{"id":12270,"date":"2022-09-30T06:49:30","date_gmt":"2022-09-30T01:19:30","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/"},"modified":"2022-09-30T06:49:30","modified_gmt":"2022-09-30T01:19:30","slug":"solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/","title":{"rendered":"[Solved] Why does it return a random value other than the value I give to the function?"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-66394904\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"66394904\" data-parentid=\"66393678\" data-score=\"1\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>First of all, C functions are call-by-value: the <code>int x<\/code> arg in the function is a <em>copy<\/em>.  Modifying it doesn&#8217;t modify the caller&#8217;s copy of whatever they passed, so your <code>swap<\/code> makes zero sense.<\/p>\n<p>Second, you&#8217;re using the return value of the function, but you don&#8217;t have a <code>return<\/code> statement.  In C (unlike C++), it&#8217;s not undefined behaviour for execution to fall off the end of a non-<code>void<\/code> function (for historical reasons, before <code>void<\/code> existed, and function returns types defaulted to int).  But it <em>is<\/em> still undefined behaviour for the caller to <em>use<\/em> a return value when the function didn&#8217;t <code>return<\/code> one.<\/p>\n<p>In this case, returning 100 was the effect of the undefined behaviour (of using the return value of a function where execution falls off the end without a <code>return<\/code> statement).  <strong>This is a coincidence of how GCC compiles in debug mode (<code>-O0<\/code>)<\/strong>:<\/p>\n<p><strong>GCC <code>-O0<\/code> likes to evaluate non-constant expressions in the return-value register<\/strong>, e.g. EAX\/RAX on x86-64.  (This is actually true for GCC across architectures, not just x86-64).  This actually gets abused on codegolf.SE answers; apparently some people would rather golf in <code>gcc -O0<\/code> as a language than ANSI C.  See <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/codegolf.stackexchange.com\/questions\/2203\/tips-for-golfing-in-c\/106067#106067\">this &#8220;C golfing tips&#8221; answer<\/a> and the comments on it, and this SO Q&amp;A about why <code>i=j<\/code> inside a function putting a value in RAX.  Note that it only works when GCC has to load a value into registers, not just do a memory-destination increment like <code>add dword ptr [rbp-4], 1<\/code> for <code>x++<\/code> or whatever.<\/p>\n<hr>\n<p>In your case (with your code compiled by GCC10.2 <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/godbolt.org\/#g:!((g:!((g:!((h:codeEditor,i:(fontScale:14,j:1,lang:___c,selection:(endColumn:58,endLineNumber:6,positionColumn:58,positionLineNumber:6,selectionStartColumn:58,selectionStartLineNumber:6,startColumn:58,startLineNumber:6),source:%27%23include+%3Cstdio.h%3E%0A%0Aint+swap+(int+x)%0A%7B%0A++++x+%3D+20%3B%0A++++\/\/x+%3D+x%2Bx%2Bx%3B++\/\/+Use+x+in+a+way+that+gets+it+into+EAX%0A%7D%0A%0Aint+main(void)%0A%7B%0A++++int+y+%3D+100%3B%0A++++int+a+%3D+swap(y)%3B%0A++++printf+(%22Value:+%25d%22,+a)%3B%0A++++return+0%3B%0A%7D%0A%0Aint+main_constarg(void)%0A%7B%0A++++int+a+%3D+swap(100)%3B+++%0A++++printf+(%22Value:+%25d%22,+a)%3B%0A++++return+0%3B%0A%7D%27),l:%275%27,n:%270%27,o:%27C+source+%231%27,t:%270%27)),k:45.99686028257457,l:%274%27,m:100,n:%270%27,o:%27%27,s:0,t:%270%27),(g:!((g:!((h:compiler,i:(compiler:cg102,filters:(b:%270%27,binary:%271%27,commentOnly:%270%27,demangle:%270%27,directives:%270%27,execute:%271%27,intel:%270%27,libraryCode:%271%27,trim:%271%27),fontScale:13,j:1,lang:___c,libs:!(),options:%27-Wall+-Wextra+-O0%27,selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1),l:%275%27,n:%270%27,o:%27x86-64+gcc+10.2+(Editor+%231,+Compiler+%231)+C%27,t:%270%27)),k:48.440833747363996,l:%274%27,m:59.83854692230071,n:%270%27,o:%27%27,s:0,t:%270%27),(g:!((h:output,i:(compiler:1,editor:1,fontScale:14,wrap:%271%27),l:%275%27,n:%270%27,o:%27%231+with+x86-64+gcc+10.2%27,t:%270%27)),header:(),l:%274%27,m:40.16145307769929,n:%270%27,o:%27%27,s:0,t:%270%27)),k:54.00313971742543,l:%273%27,n:%270%27,o:%27%27,t:%270%27)),l:%272%27,m:100,n:%270%27,o:%27%27,t:%270%27)),version:4\">on the Godbolt compiler explorer<\/a>)<\/p>\n<p><code>int y=100;<\/code> stores 100 directly to stack memory (the way GCC compiles your code).<\/p>\n<p><code>int a = swap(y);<\/code> loads <code>y<\/code> into EAX (for no apparent reason), <em>then<\/em> copies to EDI to pass as an arg to <code>swap<\/code>.  Since GCC&#8217;s asm for <code>swap<\/code> doesn&#8217;t touch EAX, after the call, EAX=y, so effectively the function returns <code>y<\/code>.<\/p>\n<p>But if you call it with <code>swap(100)<\/code>, GCC doesn&#8217;t end up putting 100 into EAX while setting up the args.<\/p>\n<p>The way GCC compiles your <code>swap<\/code>, the asm doesn&#8217;t touch EAX, so whatever <code>main<\/code> left there is treated as the return value.<\/p>\n<pre><code>main:\n...\n        mov     DWORD PTR [rbp-4], 100          # y=100\n\n        mov     eax, DWORD PTR [rbp-4]          # load y into EAX\n        mov     edi, eax                        # copy it to EDI (first arg-passing reg)\n        call    swap                            # swap(y)\n\n        mov     DWORD PTR [rbp-8], eax          # a = EAX as the retval = y\n...\n<\/code><\/pre>\n<p>But with your other main:<\/p>\n<pre><code>main:\n...                                    # nothing that touches EAX\n        mov     edi, 100\n        call    swap\n        mov     DWORD PTR [rbp-4], eax   # a = whatever garbage was there on entry to main\n...\n<\/code><\/pre>\n<p>(The later <code>...<\/code> reloads <code>a<\/code> as an arg for <code>printf<\/code>, matching the ISO C semantics because GCC <code>-O0<\/code> compiles each C statement to a separate block of asm; thus the later ones aren&#8217;t affected by the earlier UB (unlike in the general case with optimization enabled), so do just print whatever&#8217;s in <code>a<\/code>&#8216;s memory location.)<\/p>\n<p>The <code>swap<\/code> function compiles like this (again, GCC10.2 -O0):<\/p>\n<pre><code>swap:\n        push    rbp\n        mov     rbp, rsp\n        mov     DWORD PTR [rbp-4], edi\n        mov     DWORD PTR [rbp-4], 20\n        nop\n        pop     rbp\n        ret\n<\/code><\/pre>\n<hr>\n<p>Keep in mind <strong>none of this has anything to do with valid portable C<\/strong>.  This (using garbage left in memory or registers) one of the kinds of things you see in practice from C that invokes undefined behaviour, but certainly not the only thing.  See also <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/blog.llvm.org\/2011\/05\/what-every-c-programmer-should-know.html\">What Every C Programmer Should Know About Undefined Behavior<\/a> from the LLVM blog.<\/p>\n<p>This answer is just answering the literal question of what exactly happened in asm.  (I&#8217;m assuming un-optimized GCC because that easily explains the result, and x86-64 because that&#8217;s a common ISA, especially when people forget to mention any ISA.)<\/p>\n<p>Other compilers are different, and GCC will be different if you enable optimization.<\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">5<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Why does it return a random value other than the value I give to the function? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] First of all, C functions are call-by-value: the int x arg in the function is a copy. Modifying it doesn&#8217;t modify the caller&#8217;s copy of whatever they passed, so your swap makes zero sense. Second, you&#8217;re using the return value of the function, but you don&#8217;t have a return statement. In C (unlike C++), &#8230; <a title=\"[Solved] Why does it return a random value other than the value I give to the function?\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/\" aria-label=\"More on [Solved] Why does it return a random value other than the value I give to the function?\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[465,324,608,2797],"class_list":["post-12270","post","type-post","status-publish","format-standard","hentry","category-solved","tag-assembly","tag-c","tag-gcc","tag-undefined-behavior"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[Solved] Why does it return a random value other than the value I give to the function? - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Why does it return a random value other than the value I give to the function? - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] First of all, C functions are call-by-value: the int x arg in the function is a copy. Modifying it doesn&#8217;t modify the caller&#8217;s copy of whatever they passed, so your swap makes zero sense. Second, you&#8217;re using the return value of the function, but you don&#8217;t have a return statement. In C (unlike C++), ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-30T01:19:30+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\\\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Why does it return a random value other than the value I give to the function?\",\"datePublished\":\"2022-09-30T01:19:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\\\/\"},\"wordCount\":559,\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"keywords\":[\"assembly\",\"c++\",\"gcc\",\"undefined-behavior\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\\\/\",\"name\":\"[Solved] Why does it return a random value other than the value I give to the function? - JassWeb\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\"},\"datePublished\":\"2022-09-30T01:19:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Why does it return a random value other than the value I give to the function?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\\\/\\\/jassweb.com\"],\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/author\\\/jaspritsinghghumangmail-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Why does it return a random value other than the value I give to the function? - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Why does it return a random value other than the value I give to the function? - JassWeb","og_description":"[ad_1] First of all, C functions are call-by-value: the int x arg in the function is a copy. Modifying it doesn&#8217;t modify the caller&#8217;s copy of whatever they passed, so your swap makes zero sense. Second, you&#8217;re using the return value of the function, but you don&#8217;t have a return statement. In C (unlike C++), ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/","og_site_name":"JassWeb","article_published_time":"2022-09-30T01:19:30+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Why does it return a random value other than the value I give to the function?","datePublished":"2022-09-30T01:19:30+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/"},"wordCount":559,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["assembly","c++","gcc","undefined-behavior"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/","url":"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/","name":"[Solved] Why does it return a random value other than the value I give to the function? - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-09-30T01:19:30+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-why-does-it-return-a-random-value-other-than-the-value-i-give-to-the-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Why does it return a random value other than the value I give to the function?"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/12270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=12270"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/12270\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=12270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=12270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=12270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}