#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 */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  int x = 6;
  int y = 9;
  printf("nuchange x,y=%d,%d\n", x, y);
  {
    int temp;
    temp = (x);
    (x) = (y);
    (y) = temp;
  };
  printf("changed num is: %d,%d\n", x, y);
  printf("max is %d\n", (((x) > (y)) ? (x) : (y)));
  printf("min is %d\n", (((x) < (y)) ? (x) : (y)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    117e <main+0x6e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1184 <main+0x74>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ac <main+0x9c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11b2 <main+0xa2>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x6,%esi
mov    $0x9,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x9,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"nuchange x,y=%d,%d\0A\00"
@.str.1 = [23 x i8] c"changed num is: %d,%d\0A\00"
@.str.2 = [11 x i8] c"max is %d\0A\00"
@.str.3 = [11 x i8] c"min is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %2
store i32 9, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %2
store i32 %8, i32* %4
%9 = load i32, i32* %3
store i32 %9, i32* %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = load i32, i32* %2
br label %21
19: ; preds = %0
%20 = load i32, i32* %3
br label %21
21: ; preds = %19, %17
%22 = phi i32 [ %18, %17 ], [ %20, %19 ]
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = load i32, i32* %2
br label %31
29: ; preds = %21
%30 = load i32, i32* %3
br label %31
31: ; preds = %29, %27
%32 = phi i32 [ %28, %27 ], [ %30, %29 ]
%33 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"nuchange x,y=%d,%d\0A\00"
@.str.1 = [23 x i8] c"changed num is: %d,%d\0A\00"
@.str.2 = [11 x i8] c"max is %d\0A\00"
@.str.3 = [11 x i8] c"min is %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 6, i32 9)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 9, i32 6)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 9)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 6)
ret i32 0
}