#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 test(int);
int main(void) {
  int a = 1, b = 0;
  int aux1 = 1, aux2 = 2;
  char name1[] = "daniel test";
  int x = (++a) > (++b) ? (++a) : (++b);
  int l = 2 + 1 * 2 + 1;
  int k = test(10);
  printf("x/l"
         " = %d\n",
         x / l);
  printf("--> result-1: %d\n", x);
  printf("--> result-2: %d\n", l);
  printf("--> result-3: %d\n", k);
  printf("--> %s\n", name1);
  int h = 1, u = 2;
  {
    int tmp;
    tmp = h;
    h = u;
    u = tmp;
  };
  printf("--> %d, %d", h, u);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeac(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    %ecx,%eax
jle    118a <main+0x6a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x3c(%rbp)
jmp    1196 <main+0x76>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x24(%rbp)
movl   $0x5,-0x28(%rbp)
mov    $0xa,%edi
call   1040 <test@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
cltd
idivl  -0x28(%rbp)
mov    %eax,%esi
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x30(%rbp)
movl   $0x2,-0x34(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x74206c65696e6164,%rax
6c 20 74
mov    %rax,(%rsp)
movl   $0x747365,0x8(%rsp)
mov    $0xa,%edi
call   1040 <test@plt>
mov    %eax,%ebx
lea    0xebe(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.name1 = [12 x i8] c"daniel test\00"
@.str = [10 x i8] c"x/l = %d\0A\00"
@.str.1 = [18 x i8] c"--> result-1: %d\0A\00"
@.str.2 = [18 x i8] c"--> result-2: %d\0A\00"
@.str.3 = [18 x i8] c"--> result-3: %d\0A\00"
@.str.4 = [8 x i8] c"--> %s\0A\00"
@.str.5 = [11 x i8] c"--> %d, %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [12 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
store i32 2, i32* %5
%13 = bitcast [12 x i8]* %6 to i8*
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
%18 = icmp sgt i32 %15, %17
br i1 %18, label %19, label %22
19: ; preds = %0
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %25
22: ; preds = %0
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %25
25: ; preds = %22, %19
%26 = phi i32 [ %21, %19 ], [ %24, %22 ]
store i32 %26, i32* %7
store i32 5, i32* %8
%27 = call i32 @test(i32 10)
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = sdiv i32 %28, %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %7
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%34 = load i32, i32* %8
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %9
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %38)
store i32 1, i32* %10
store i32 2, i32* %11
%40 = load i32, i32* %10
store i32 %40, i32* %12
%41 = load i32, i32* %11
store i32 %41, i32* %10
%42 = load i32, i32* %12
store i32 %42, i32* %11
%43 = load i32, i32* %10
%44 = load i32, i32* %11
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %43, i32 %44)
ret i32 0
}

LLVM IR (-O2):
@__const.main.name1 = [12 x i8] c"daniel test\00"
@.str = [10 x i8] c"x/l = %d\0A\00"
@.str.1 = [18 x i8] c"--> result-1: %d\0A\00"
@.str.2 = [18 x i8] c"--> result-2: %d\0A\00"
@.str.3 = [18 x i8] c"--> result-3: %d\0A\00"
@.str.4 = [8 x i8] c"--> %s\0A\00"
@.str.5 = [11 x i8] c"--> %d, %d\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @test(i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 3)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 5)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %3)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 2, i32 1)
ret i32 0
}