xunge/DecIR huggingface dataset:
int test5(int a, int b, int c) {
  int x = 0;
  x = a;
  if (c > 0) {
    x = b;
  } else {
    x = a;
  }
  return (x + b - c);
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    112f <test5+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <test5+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
test   %edx,%edx
cmovg  %esi,%edi
sub    %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @test5(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
store i32 %8, i32* %7
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %5
store i32 %12, i32* %7
br label %15
13: ; preds = %3
%14 = load i32, i32* %4
store i32 %14, i32* %7
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %7
%17 = load i32, i32* %5
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %6
%20 = sub nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @test5(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
%5 = select i1 %4, i32 %1, i32 %0
%6 = sub i32 %1, %2
%7 = add i32 %6, %5
ret i32 %7
}
void conditional_operator() {
  int i = 100;
  int j = i < 50 ? i : 1;
  int k = i ?: 0;
}


x86 assembly (clang, -O0):
<conditional_operator>:
push   %rbp
mov    %rsp,%rbp
movl   $0x64,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1120 <conditional_operator+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112d <conditional_operator+0x2d>
mov    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <conditional_operator+0x2d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114d <conditional_operator+0x4d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1157 <conditional_operator+0x57>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    1157 <conditional_operator+0x57>
mov    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<conditional_operator>:
ret

LLVM IR (-O0):
define void @conditional_operator() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 100, i32* %1
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 50
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* %1
br label %9
8: ; preds = %0
br label %9
9: ; preds = %8, %6
%10 = phi i32 [ %7, %6 ], [ 1, %8 ]
store i32 %10, i32* %2
%11 = load i32, i32* %1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
br label %15
14: ; preds = %9
br label %15
15: ; preds = %14, %13
%16 = phi i32 [ %11, %13 ], [ 0, %14 ]
store i32 %16, i32* %3
ret void
}

LLVM IR (-O2):
define void @conditional_operator() {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void calculate_coverage_onscreen(int32_t *ret_coverage, double percent_coverage,
                                 int32_t maxWidth, int32_t maxHeight) {
  *ret_coverage = (int32_t)(percent_coverage * (double)(maxWidth * maxHeight));
}


x86 assembly (clang, -O0):
<calculate_coverage_onscreen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_coverage_onscreen>:
imul   %edx,%esi
cvtsi2sd %esi,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @calculate_coverage_onscreen(i32* %0, double %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store double %1, double* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double, double* %6
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = mul nsw i32 %10, %11
%13 = sitofp i32 %12 to double
%14 = fmul double %9, %13
%15 = fptosi double %14 to i32
%16 = load i32*, i32** %5
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @calculate_coverage_onscreen(i32* nocapture writeonly %0, double %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %2
%6 = sitofp i32 %5 to double
%7 = fmul double %6, %1
%8 = fptosi double %7 to i32
store i32 %8, i32* %0
ret void
}
int f(const int *p) { return *p; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @f(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
void *a1(int);
void *a0(int x) { return (((x >> 0) & 1) ? a1(x) : a1(x)); }


x86 assembly (clang, -O0):
<a0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <a0+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <a1@plt>
mov    %rax,-0x10(%rbp)
jmp    114a <a0+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <a1@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a0>:
jmp    1030 <a1@plt>

LLVM IR (-O0):
define i8* @a0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 0
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i8* @a1(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i8* @a1(i32 %11)
br label %13
13: ; preds = %10, %7
%14 = phi i8* [ %9, %7 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @a0(i32 %0) {
%2 = tail call i8* @a1(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glGetConvolutionParameteriv_size(int /*<<< orphan*/);
GLint __glGetConvolutionParameterfv_size(GLenum pname) {
  return __glGetConvolutionParameteriv_size(pname);
}


x86 assembly (clang, -O0):
<__glGetConvolutionParameterfv_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__glGetConvolutionParameteriv_size@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glGetConvolutionParameterfv_size>:
jmp    1030 <__glGetConvolutionParameteriv_size@plt>

LLVM IR (-O0):
define i32 @__glGetConvolutionParameterfv_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__glGetConvolutionParameteriv_size(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @__glGetConvolutionParameterfv_size(i32 %0) {
%2 = tail call i32 @__glGetConvolutionParameteriv_size(i32 %0)
ret i32 %2
}
/* Type definitions */
struct cnfnode {
  int dummy;
};
struct cnfmodule {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _unparse_cyconf(int /*<<< orphan*/ *, struct cnfnode *,
                                   int /*<<< orphan*/);
int unparse_cyconf(struct cnfmodule *cm, FILE *fptr, struct cnfnode *cn_root) {
  _unparse_cyconf(fptr, cn_root, 0);
  return 0;
}


x86 assembly (clang, -O0):
<unparse_cyconf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <_unparse_cyconf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unparse_cyconf>:
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
xor    %edx,%edx
call   1030 <_unparse_cyconf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cnfmodule = type { i32 }
%struct.cnfnode = type { i32 }
define i32 @unparse_cyconf(%struct.cnfmodule* %0, i32* %1, %struct.cnfnode* %2) {
%4 = alloca %struct.cnfmodule*
%5 = alloca i32*
%6 = alloca %struct.cnfnode*
store %struct.cnfmodule* %0, %struct.cnfmodule** %4
store i32* %1, i32** %5
store %struct.cnfnode* %2, %struct.cnfnode** %6
%7 = load i32*, i32** %5
%8 = load %struct.cnfnode*, %struct.cnfnode** %6
%9 = call i32 @_unparse_cyconf(i32* %7, %struct.cnfnode* %8, i32 0)
ret i32 0
}

LLVM IR (-O2):
%struct.cnfmodule = type { i32 }
%struct.cnfnode = type { i32 }
define i32 @unparse_cyconf(%struct.cnfmodule* nocapture readnone %0, i32* %1, %struct.cnfnode* %2) {
%4 = tail call i32 @_unparse_cyconf(i32* %1, %struct.cnfnode* %2, i32 0)
ret i32 0
}
void SteamAPI_ISteamHTMLSurface_Reload(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamHTMLSurface_Reload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamHTMLSurface_Reload>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_Reload = [34 x i8] c"SteamAPI_ISteamHTMLSurface_Reload\00"
define void @SteamAPI_ISteamHTMLSurface_Reload(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_Reload, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_Reload = [34 x i8] c"SteamAPI_ISteamHTMLSurface_Reload\00"
define void @SteamAPI_ISteamHTMLSurface_Reload(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_Reload, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct MHD_Daemon {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void run_mhd_poll_loop(struct MHD_Daemon *daemon) { abort(); }


x86 assembly (clang, -O0):
<run_mhd_poll_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<run_mhd_poll_loop>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.MHD_Daemon = type { i32 }
define void @run_mhd_poll_loop(%struct.MHD_Daemon* %0) {
%2 = alloca %struct.MHD_Daemon*
store %struct.MHD_Daemon* %0, %struct.MHD_Daemon** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.MHD_Daemon = type { i32 }
define void @run_mhd_poll_loop(%struct.MHD_Daemon* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
int t_illuminate(const int light, const float distance) {
  return light / distance > 255.0f ? 255 : light / distance;
}


x86 assembly (clang, -O0):
<t_illuminate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1139 <t_illuminate+0x39>
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1148 <t_illuminate+0x48>
cvtsi2ssl -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_illuminate>:
cvtsi2ss %edi,%xmm1
divss  %xmm0,%xmm1
movss  0xef0(%rip),%xmm0
minss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @t_illuminate(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to float
%7 = load float, float* %4
%8 = fdiv float %6, %7
%9 = fcmp ogt float %8, 2.550000e+02
br i1 %9, label %10, label %11
10: ; preds = %2
br label %16
11: ; preds = %2
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to float
%14 = load float, float* %4
%15 = fdiv float %13, %14
br label %16
16: ; preds = %11, %10
%17 = phi float [ 2.550000e+02, %10 ], [ %15, %11 ]
%18 = fptosi float %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @t_illuminate(i32 %0, float %1) {
%3 = sitofp i32 %0 to float
%4 = fdiv float %3, %1
%5 = fcmp oge float %4, 2.550000e+02
%6 = select i1 %5, float 2.550000e+02, float %4
%7 = fptosi float %6 to i32
ret i32 %7
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ opt_err_alloc(size_t);
void *opt_malloc(size_t n) {
  void *p = malloc(n);
  if (p == NULL) {
    opt_err_alloc(n);
  }
  return p;
}


x86 assembly (clang, -O0):
<opt_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <opt_malloc+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <opt_err_alloc@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <opt_malloc+0x1c>
mov    %r14,%rdi
call   1030 <opt_err_alloc@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @opt_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @opt_err_alloc(i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @opt_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @opt_err_alloc(i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ __NR_setns;
int syscall(int /*<<< orphan*/, int, int);
int setns(int fd, int nstype) { return syscall(__NR_setns, fd, nstype); }


x86 assembly (clang, -O0):
<setns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setns>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_setns = global i32 0
define i32 @setns(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @__NR_setns
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @syscall(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@__NR_setns = global i32 0
define i32 @setns(i32 %0, i32 %1) {
%3 = load i32, i32* @__NR_setns
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t bytes) {
  void *ret = malloc(bytes);
  if (!ret) {
    perror("xmalloc");
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <xmalloc+0x3a>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"xmalloc\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"xmalloc\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ mode;
};
typedef TYPE_1__ XFocusOutEvent;

/* Variables and functions */
int get_XFocusOutEvent_mode(void *_p) {
  return (int)((XFocusOutEvent *)_p)->mode;
}


x86 assembly (clang, -O0):
<get_XFocusOutEvent_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_XFocusOutEvent_mode>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XFocusOutEvent_mode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XFocusOutEvent_mode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void cleanup_module(void) { printk("<0>*** Good Bye from Module ***\n"); }


x86 assembly (clang, -O0):
<cleanup_module>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_module>:
lea    0xee9(%rip),%rdi
jmp    1030 <printk@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"<0>*** Good Bye from Module ***\0A\00"
define void @cleanup_module() {
%1 = call i32 @printk(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"<0>*** Good Bye from Module ***\0A\00"
define void @cleanup_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
void gdk_keyval_is_upper() {}


x86 assembly (clang, -O0):
<gdk_keyval_is_upper>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdk_keyval_is_upper>:
ret

LLVM IR (-O0):
define void @gdk_keyval_is_upper() {
ret void
}

LLVM IR (-O2):
define void @gdk_keyval_is_upper() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t mbar_to_inhg_hundreds(uint32_t mbar) {
  return (((mbar * 882353) + ((298799) / 2)) / (298799));
}


x86 assembly (clang, -O0):
<mbar_to_inhg_hundreds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xd76b1,-0x4(%rbp),%eax
add    $0x24797,%eax
mov    $0x48f2f,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbar_to_inhg_hundreds>:
imul   $0xd76b1,%edi,%eax
mov    %eax,%ecx
add    $0x24797,%ecx
movslq %ecx,%rcx
imul   $0xffffffffe098686d,%rcx,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
add    $0x24797,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x12,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mbar_to_inhg_hundreds(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 882353
%5 = add nsw i32 %4, 149399
%6 = sdiv i32 %5, 298799
ret i32 %6
}

LLVM IR (-O2):
define i32 @mbar_to_inhg_hundreds(i32 %0) {
%2 = mul nsw i32 %0, 882353
%3 = add nsw i32 %2, 149399
%4 = sdiv i32 %3, 298799
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ led_init(int);
int /*<<< orphan*/ led_on();
int /*<<< orphan*/ rcc_init();
int /*<<< orphan*/ serial_init();
int /*<<< orphan*/ serial_putc(char);
int /*<<< orphan*/ serial_puts(char *);
int /*<<< orphan*/ systick_init_int(int);
int /*<<< orphan*/ timer_init();
void startup(void) {
  int count = 0;
  int t;
  rcc_init();
  serial_init();
  serial_putc('\r');
  serial_putc('\n');
  led_init(13);
  led_on();
  systick_init_int(72);
  timer_init();
  serial_puts("Spinning\n");
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<startup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rcc_init@plt>
mov    $0x0,%al
call   10a0 <serial_init@plt>
mov    $0xd,%edi
call   1050 <serial_putc@plt>
mov    $0xa,%edi
call   1050 <serial_putc@plt>
mov    $0xd,%edi
call   1060 <led_init@plt>
mov    $0x0,%al
call   1070 <led_on@plt>
mov    $0x48,%edi
call   1030 <systick_init_int@plt>
mov    $0x0,%al
call   1090 <timer_init@plt>
lea    0xe26(%rip),%rdi
call   1080 <serial_puts@plt>
jmp    11df <startup+0x5f>

x86 assembly (clang, -O2):
<startup>:
push   %rax
xor    %eax,%eax
call   1040 <rcc_init@plt>
xor    %eax,%eax
call   10a0 <serial_init@plt>
mov    $0xd,%edi
call   1050 <serial_putc@plt>
mov    $0xa,%edi
call   1050 <serial_putc@plt>
mov    $0xd,%edi
call   1060 <led_init@plt>
xor    %eax,%eax
call   1070 <led_on@plt>
mov    $0x48,%edi
call   1030 <systick_init_int@plt>
xor    %eax,%eax
call   1090 <timer_init@plt>
lea    0xe34(%rip),%rdi
call   1080 <serial_puts@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jmp    11e0 <startup+0x60>

LLVM IR (-O0):
@.str = [10 x i8] c"Spinning\0A\00"
define void @startup() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @rcc_init()
%4 = call i32 (...) @serial_init()
%5 = call i32 @serial_putc(i8 signext 13)
%6 = call i32 @serial_putc(i8 signext 10)
%7 = call i32 @led_init(i32 13)
%8 = call i32 (...) @led_on()
%9 = call i32 @systick_init_int(i32 72)
%10 = call i32 (...) @timer_init()
%11 = call i32 @serial_puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %12, %0
br label %12
}

LLVM IR (-O2):
@.str = [10 x i8] c"Spinning\0A\00"
define void @startup() {
%1 = tail call i32 (...) @rcc_init()
%2 = tail call i32 (...) @serial_init()
%3 = tail call i32 @serial_putc(i8 signext 13)
%4 = tail call i32 @serial_putc(i8 signext 10)
%5 = tail call i32 @led_init(i32 13)
%6 = tail call i32 (...) @led_on()
%7 = tail call i32 @systick_init_int(i32 72)
%8 = tail call i32 (...) @timer_init()
%9 = tail call i32 @serial_puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %10, %0
br label %10
}
long s8q(long a, long b) { return a * 8 + b; }


x86 assembly (clang, -O0):
<s8q>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s8q>:
lea    (%rsi,%rdi,8),%rax
ret

LLVM IR (-O0):
define i64 @s8q(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = mul nsw i64 %5, 8
%7 = load i64, i64* %4
%8 = add nsw i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @s8q(i64 %0, i64 %1) {
%3 = shl nsw i64 %0, 3
%4 = add nsw i64 %3, %1
ret i64 %4
}
int compute() { return 2 + 3 + 4 + 5 + 6; }


x86 assembly (clang, -O0):
<compute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute>:
mov    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @compute() {
ret i32 20
}

LLVM IR (-O2):
define i32 @compute() {
ret i32 20
}
int cdz_sto_cfg(struct cdz_cfg_struct *ccs) { return 0; }


x86 assembly (clang, -O0):
<cdz_sto_cfg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdz_sto_cfg>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.cdz_cfg_struct = type opaque
define i32 @cdz_sto_cfg(%struct.cdz_cfg_struct* %0) {
%2 = alloca %struct.cdz_cfg_struct*
store %struct.cdz_cfg_struct* %0, %struct.cdz_cfg_struct** %2
ret i32 0
}

LLVM IR (-O2):
%struct.cdz_cfg_struct = type opaque
define i32 @cdz_sto_cfg(%struct.cdz_cfg_struct* nocapture readnone %0) {
ret i32 0
}
void asc_socket_core_destroy(void) { ; }


x86 assembly (clang, -O0):
<asc_socket_core_destroy>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asc_socket_core_destroy>:
ret

LLVM IR (-O0):
define void @asc_socket_core_destroy() {
ret void
}

LLVM IR (-O2):
define void @asc_socket_core_destroy() {
ret void
}
int str2int(char *str) {
  int num, i;
  for (i = 0, num = 0; str[i] != '\0'; i++) {
    num = num * 10 + (str[i] - '0');
  }
  return num;
}


x86 assembly (clang, -O0):
<str2int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <str2int+0x51>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <str2int+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2int>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <str2int+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str2int+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @str2int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %24, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %27
13: ; preds = %5
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, 10
%16 = load i8*, i8** %2
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 48
%23 = add nsw i32 %15, %22
store i32 %23, i32* %3
br label %24
24: ; preds = %13
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %5
27: ; preds = %5
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @str2int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = mul nsw i32 %7, 10
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
void gdk_gc_copy() {}


x86 assembly (clang, -O0):
<gdk_gc_copy>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdk_gc_copy>:
ret

LLVM IR (-O0):
define void @gdk_gc_copy() {
ret void
}

LLVM IR (-O2):
define void @gdk_gc_copy() {
ret void
}
/* Type definitions */
struct _tsarray_pub {
  int dummy;
};

/* Variables and functions */
void *minmax_scan(struct _tsarray_pub const *,
                  int (*)(void const *, void const *, void *), void *, int);
void *tsarray_min(const struct _tsarray_pub *tsarray,
                  int (*cmp)(const void *a, const void *b, void *arg),
                  void *arg) {
  return minmax_scan(tsarray, cmp, arg, -1);
}


x86 assembly (clang, -O0):
<tsarray_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xffffffff,%ecx
call   1030 <minmax_scan@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsarray_min>:
mov    $0xffffffff,%ecx
jmp    1030 <minmax_scan@plt>

LLVM IR (-O0):
%struct._tsarray_pub = type { i32 }
define i8* @tsarray_min(%struct._tsarray_pub* %0, i32 (i8*, i8*, i8*)* %1, i8* %2) {
%4 = alloca %struct._tsarray_pub*
%5 = alloca i32 (i8*, i8*, i8*)*
%6 = alloca i8*
store %struct._tsarray_pub* %0, %struct._tsarray_pub** %4
store i32 (i8*, i8*, i8*)* %1, i32 (i8*, i8*, i8*)** %5
store i8* %2, i8** %6
%7 = load %struct._tsarray_pub*, %struct._tsarray_pub** %4
%8 = load i32 (i8*, i8*, i8*)*, i32 (i8*, i8*, i8*)** %5
%9 = load i8*, i8** %6
%10 = call i8* @minmax_scan(%struct._tsarray_pub* %7, i32 (i8*, i8*, i8*)* %8, i8* %9, i32 -1)
ret i8* %10
}

LLVM IR (-O2):
%struct._tsarray_pub = type { i32 }
define i8* @tsarray_min(%struct._tsarray_pub* %0, i32 (i8*, i8*, i8*)* %1, i8* %2) {
%4 = tail call i8* @minmax_scan(%struct._tsarray_pub* %0, i32 (i8*, i8*, i8*)* %1, i8* %2, i32 -1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ help();
int /*<<< orphan*/ longNum_start();
int main(void) {
  help();
  while (1)
    longNum_start();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <help@plt>
mov    $0x0,%al
call   1030 <longNum_start@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <help@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <longNum_start@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @help()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @longNum_start()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @help()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @longNum_start()
br label %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int *int2Number(int num) {
  int *r = (int *)malloc((1) * sizeof(int));
  *r = num;
  return r;
}


x86 assembly (clang, -O0):
<int2Number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2Number>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @int2Number(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32, i32* %2
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = load i32*, i32** %3
ret i32* %8
}

LLVM IR (-O2):
define i32* @int2Number(i32 %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32 %0, i32* %3
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ atof(char const *);
int /*<<< orphan*/ c_plsdidev(int, int, int, int /*<<< orphan*/);
int opt_jy(const char *opt, const char *myoptarg, void *client_data) {
  (void)opt;
  (void)client_data;
  c_plsdidev((-42), (-42), (-42), atof(myoptarg));
  return 0;
}


x86 assembly (clang, -O0):
<opt_jy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
mov    %eax,%ecx
mov    $0xffffffd6,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <c_plsdidev@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_jy>:
push   %rax
mov    %rsi,%rdi
call   1030 <atof@plt>
mov    $0xffffffd6,%edi
mov    $0xffffffd6,%esi
mov    $0xffffffd6,%edx
mov    %eax,%ecx
call   1040 <c_plsdidev@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @opt_jy(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = load i8*, i8** %5
%10 = call i32 @atof(i8* %9)
%11 = call i32 @c_plsdidev(i32 -42, i32 -42, i32 -42, i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @opt_jy(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = tail call i32 @atof(i8* %1)
%5 = tail call i32 @c_plsdidev(i32 -42, i32 -42, i32 -42, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ test2(int);
void test(int val) {
  printf("test called-");
  int val2 = val;
  char buf[100];
  sprintf(buf, "%d", val);
  printf(buf);
  printf("\n");
  test2(val2);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb2(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <test2@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %edi,%ebx
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1060 <sprintf@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
add    $0x68,%rsp
pop    %rbx
pop    %r14
jmp    1050 <test2@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"test called-\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i8]
store i32 %0, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
store i32 %6, i32* %3
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%11 = call i32 @printf(i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* %3
%14 = call i32 @test2(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"test called-\00"
@.str.1 = [3 x i8] c"%d\00"
define void @test(i32 %0) {
%2 = alloca [100 x i8]
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%6 = call i32 @printf(i8* %4)
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @test2(i32 %0)
ret void
}
/* Variables and functions */
char *strrchr(const char *s, int c) {
  char *addr = NULL;
  if (s) {
    while (*s) {
      if (*s == c)
        addr = (char *)s;
      s++;
    }
  }
  return addr;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115e <strrchr+0x5e>
jmp    1123 <strrchr+0x23>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <strrchr+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1148 <strrchr+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <strrchr+0x23>
jmp    115e <strrchr+0x5e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
test   %rdi,%rdi
je     1126 <strrchr+0x26>
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1125 <strrchr+0x25>
nopl   (%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8* null, i8** %5
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %25
8: ; preds = %2
br label %9
9: ; preds = %21, %8
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i32, i32* %4
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = load i8*, i8** %3
store i8* %20, i8** %5
br label %21
21: ; preds = %19, %13
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
br label %9
24: ; preds = %9
br label %25
25: ; preds = %24, %2
%26 = load i8*, i8** %5
ret i8* %26
}

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %15, %7 ], [ %5, %4 ]
%9 = phi i8* [ %13, %7 ], [ null, %4 ]
%10 = phi i8* [ %14, %7 ], [ %0, %4 ]
%11 = sext i8 %8 to i32
%12 = icmp eq i32 %11, %1
%13 = select i1 %12, i8* %10, i8* %9
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %4, %2
%18 = phi i8* [ null, %2 ], [ null, %4 ], [ %13, %7 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_with_tab(char *);
int /*<<< orphan*/ print_label(int);
void gen_jump(int label) {
  output_with_tab("jp ");
  print_label(label);
  newline();
}


x86 assembly (clang, -O0):
<gen_jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_label@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_jump>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    %ebx,%edi
call   1040 <print_label@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"jp \00"
define void @gen_jump(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @output_with_tab(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @print_label(i32 %4)
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"jp \00"
define void @gen_jump(i32 %0) {
%2 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_label(i32 %0)
%4 = tail call i32 (...) @newline()
ret void
}
void g_thread_set_priority() {}


x86 assembly (clang, -O0):
<g_thread_set_priority>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_thread_set_priority>:
ret

LLVM IR (-O0):
define void @g_thread_set_priority() {
ret void
}

LLVM IR (-O2):
define void @g_thread_set_priority() {
ret void
}
int test_fun(int x, int y) {
  int c = 0;
  while (x > y) {
    x = x + 1;
    y = y + 2;
    c = c + 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113d <test_fun+0x3d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_fun+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
xor    %eax,%eax
cmp    %esi,%edi
jle    111d <test_fun+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
lea    (%rdi,%rax,1),%ecx
add    $0x2,%esi
add    $0x1,%eax
cmp    %esi,%ecx
jge    1110 <test_fun+0x10>
ret

LLVM IR (-O0):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 2
store i32 %14, i32* %4
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %9, %4 ], [ %1, %2 ]
%7 = phi i32 [ %8, %4 ], [ %0, %2 ]
%8 = add nsw i32 %7, 1
%9 = add nsw i32 %6, 2
%10 = add nuw nsw i32 %5, 1
%11 = icmp slt i32 %7, %9
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %13
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ checkInput(double *, double *);
int /*<<< orphan*/ isInCircle(double, double, short const);
int /*<<< orphan*/ printf(char *);
int main() {
  double pointX, pointY;
  const short R = 2;
  printf("Enter point coordinates: ");
  checkInput(&pointX, &pointY);
  isInCircle(pointX, pointY, R);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x2,-0x1a(%rbp)
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <checkInput@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    $0x2,%edi
call   1050 <isInCircle@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <checkInput@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x2,%edi
call   1050 <isInCircle@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Enter point coordinates: \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i16
store i32 0, i32* %1
store i16 2, i16* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @checkInput(double* %2, double* %3)
%7 = load double, double* %2
%8 = load double, double* %3
%9 = call i32 @isInCircle(double %7, double %8, i16 signext 2)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@.str = [26 x i8] c"Enter point coordinates: \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @checkInput(double* %1, double* %2)
%7 = load double, double* %1
%8 = load double, double* %2
%9 = call i32 @isInCircle(double %7, double %8, i16 signext 2)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
int do_013() { return 13; }


x86 assembly (clang, -O0):
<do_013>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_013>:
mov    $0xd,%eax
ret

LLVM IR (-O0):
define i32 @do_013() {
ret i32 13
}

LLVM IR (-O2):
define i32 @do_013() {
ret i32 13
}
void cyg_dl_force(void) { return; }


x86 assembly (clang, -O0):
<cyg_dl_force>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cyg_dl_force>:
ret

LLVM IR (-O0):
define void @cyg_dl_force() {
ret void
}

LLVM IR (-O2):
define void @cyg_dl_force() {
ret void
}
__attribute__((weak, section(".after_vectors"))) void SVC_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<SVC_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SVC_Handler+0x9>
jmp    1109 <SVC_Handler+0x9>

x86 assembly (clang, -O2):
<SVC_Handler>:
jmp    1100 <SVC_Handler>

LLVM IR (-O0):
define weak void @SVC_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @SVC_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
void _httpTLSInitialize(void) {}


x86 assembly (clang, -O0):
<_httpTLSInitialize>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_httpTLSInitialize>:
ret

LLVM IR (-O0):
define void @_httpTLSInitialize() {
ret void
}

LLVM IR (-O2):
define void @_httpTLSInitialize() {
ret void
}
/* Variables and functions */
void *malloc(int);
int main(void) {
  volatile void *p = malloc(512);
  return p != 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x200,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 512)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
int max(int arr[]) {
  int max = 0;
  int size = sizeof(arr) / sizeof(arr[0]);
  for (int i = 0; i < size; i++) {
    if (arr[i] > max)
      max = arr[i];
  }
  return max;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115e <max+0x5e>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
jle    114b <max+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <max+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111d <max+0x1d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    (%rdi),%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
mov    0x4(%rdi),%ecx
cmp    %eax,%ecx
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @max(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
store i32 2, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %25, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %28
10: ; preds = %6
%11 = load i32*, i32** %2
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = load i32, i32* %3
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %24
18: ; preds = %10
%19 = load i32*, i32** %2
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
store i32 %23, i32* %3
br label %24
24: ; preds = %18, %10
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %6
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @max(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp sgt i32 %6, %4
%8 = select i1 %7, i32 %6, i32 %4
ret i32 %8
}