#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double pow(int, int);
int /*<<< orphan*/ printf(char *, int, ...);
int main(int argc, char *argv[]) {
  int power = pow(3, 2);
  printf("3 to the 2nd power is %d\n", power);
  printf("2e9 to the 10th power is %.0f\n", pow(2000000000, 10));
  int x = 1;
  int y = 100;
  printf("X is %d and Y is %d\nPerforming swap now.\n", x, y);
  int temp;
  temp = x;
  x = y;
  y = temp;
  printf("After the swap X is %d and Y is %d!\n\n", x, y);
  printf("Problem #19 -- X is %d and Y is %d\nPerforming swap now.\n", x, y);
  x = x ^ y;
  y = x ^ y;
  x = x ^ y;
  printf("After the swap X is %d and Y is %d!\n\n", x, y);
  x = 2000000000;
  y = 2100000000;
  printf(
      "Problem #19 continued\n -- X is %d and Y is %d\nPerforming swap now.\n",
      x, y);
  x = x ^ y;
  y = x ^ y;
  x = x ^ y;
  printf("After the swap X is %d and Y is %d!\n\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x77359400,%edi
mov    $0xa,%esi
call   1040 <pow@plt>
cvttsd2si %xmm0,%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
movl   $0x64,-0x1c(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x77359400,-0x18(%rbp)
movl   $0x7d2b7500,-0x1c(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
cvttsd2si %xmm0,%esi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x77359400,%edi
mov    $0xa,%esi
call   1040 <pow@plt>
cvttsd2si %xmm0,%esi
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf48(%rip),%rdi
mov    $0x1,%esi
mov    $0x64,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb7(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x64,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x64,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x77359400,%esi
mov    $0x7d2b7500,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7d2b7500,%esi
mov    $0x77359400,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"3 to the 2nd power is %d\0A\00"
@.str.1 = [31 x i8] c"2e9 to the 10th power is %.0f\0A\00"
@.str.2 = [42 x i8] c"X is %d and Y is %d\0APerforming swap now.\0A\00"
@.str.3 = [38 x i8] c"After the swap X is %d and Y is %d!\0A\0A\00"
@.str.4 = [57 x i8] c"Problem -- X is %d and Y is %d\0APerforming swap now.\0A\00"
@.str.5 = [68 x i8] c"Problem continued\0A -- X is %d and Y is %d\0APerforming swap now.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = call double @pow(i32 3, i32 2)
%10 = fptosi double %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call double @pow(i32 2000000000, i32 10)
%14 = fptosi double %13 to i32
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %14)
store i32 1, i32* %6
store i32 100, i32* %7
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %16, i32 %17)
%19 = load i32, i32* %6
store i32 %19, i32* %8
%20 = load i32, i32* %7
store i32 %20, i32* %6
%21 = load i32, i32* %8
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %22, i32 %23)
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0), i32 %25, i32 %26)
%28 = load i32, i32* %6
%29 = load i32, i32* %7
%30 = xor i32 %28, %29
store i32 %30, i32* %6
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = xor i32 %31, %32
store i32 %33, i32* %7
%34 = load i32, i32* %6
%35 = load i32, i32* %7
%36 = xor i32 %34, %35
store i32 %36, i32* %6
%37 = load i32, i32* %6
%38 = load i32, i32* %7
%39 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %37, i32 %38)
store i32 2000000000, i32* %6
store i32 2100000000, i32* %7
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.5, i64 0, i64 0), i32 %40, i32 %41)
%43 = load i32, i32* %6
%44 = load i32, i32* %7
%45 = xor i32 %43, %44
store i32 %45, i32* %6
%46 = load i32, i32* %6
%47 = load i32, i32* %7
%48 = xor i32 %46, %47
store i32 %48, i32* %7
%49 = load i32, i32* %6
%50 = load i32, i32* %7
%51 = xor i32 %49, %50
store i32 %51, i32* %6
%52 = load i32, i32* %6
%53 = load i32, i32* %7
%54 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %52, i32 %53)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"3 to the 2nd power is %d\0A\00"
@.str.1 = [31 x i8] c"2e9 to the 10th power is %.0f\0A\00"
@.str.2 = [42 x i8] c"X is %d and Y is %d\0APerforming swap now.\0A\00"
@.str.3 = [38 x i8] c"After the swap X is %d and Y is %d!\0A\0A\00"
@.str.4 = [57 x i8] c"Problem -- X is %d and Y is %d\0APerforming swap now.\0A\00"
@.str.5 = [68 x i8] c"Problem continued\0A -- X is %d and Y is %d\0APerforming swap now.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @pow(i32 3, i32 2)
%4 = fptosi double %3 to i32
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call double @pow(i32 2000000000, i32 10)
%7 = fptosi double %6 to i32
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 100)
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 100, i32 1)
%11 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0), i32 100, i32 1)
%12 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 100)
%13 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.5, i64 0, i64 0), i32 2000000000, i32 2100000000)
%14 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 2100000000, i32 2000000000)
ret i32 0
}