#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 /*<<< orphan*/ swap(int *, int *);
int /*<<< orphan*/ swap1(int *, int *);
int change() {
  int x = 6;
  int y = 9;
  printf("nuchange x,y=%d,%d\n", x, y);
  swap(&x, &y);
  printf("swap changed num is: %d,%d\n", x, y);
  swap1(&x, &y);
  printf("swap1 changed num is: %d,%d\n", x, y);
  {
    int temp;
    temp = (x);
    (x) = (y);
    (y) = temp;
  };
  printf("SWAP 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):
<change>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x6,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <swap@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <swap1@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11d9 <change+0xa9>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11df <change+0xaf>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1207 <change+0xd7>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    120d <change+0xdd>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change>:
push   %r14
push   %rbx
push   %rax
movl   $0x6,0x4(%rsp)
movl   $0x9,(%rsp)
lea    0xeb6(%rip),%rdi
mov    $0x6,%esi
mov    $0x9,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <swap1@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%esi
mov    %esi,0x4(%rsp)
mov    %edx,(%rsp)
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%esi
cmp    %esi,%eax
cmovg  %eax,%esi
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%esi
cmp    %esi,%eax
cmovl  %eax,%esi
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"nuchange x,y=%d,%d\0A\00"
@.str.1 = [28 x i8] c"swap changed num is: %d,%d\0A\00"
@.str.2 = [29 x i8] c"swap1 changed num is: %d,%d\0A\00"
@.str.3 = [28 x i8] c"SWAP changed num is: %d,%d\0A\00"
@.str.4 = [11 x i8] c"max is %d\0A\00"
@.str.5 = [11 x i8] c"min is %d\0A\00"
define i32 @change() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 6, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 9, i32* %2
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 6, i32 9)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
%10 = call i32 @swap1(i32* %1, i32* %2)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i32, i32* %1
%15 = load i32, i32* %2
store i32 %15, i32* %1
store i32 %14, i32* %2
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %14)
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = icmp sgt i32 %17, %18
%20 = select i1 %19, i32 %17, i32 %18
%21 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = icmp slt i32 %22, %23
%25 = select i1 %24, i32 %22, i32 %23
%26 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %25)
ret i32 0
}