xunge/DecIR huggingface dataset:
int checkSum(float x, float y) {
  float sum;
  sum = x + y;
  if (sum - (int)sum)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<checkSum>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvttss2si -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1146 <checkSum+0x46>
jp     1146 <checkSum+0x46>
jmp    1152 <checkSum+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1159 <checkSum+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkSum>:
addss  %xmm1,%xmm0
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cmpneqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @checkSum(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fadd float %7, %8
store float %9, float* %6
%10 = load float, float* %6
%11 = load float, float* %6
%12 = fptosi float %11 to i32
%13 = sitofp i32 %12 to float
%14 = fsub float %10, %13
%15 = fcmp une float %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %18
17: ; preds = %2
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @checkSum(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fptosi float %3 to i32
%5 = sitofp i32 %4 to float
%6 = fsub float %3, %5
%7 = fcmp une float %6, 0.000000e+00
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct ibv_pd {
  int dummy;
};

/* Variables and functions */
int ibv_dealloc_pd(struct ibv_pd *);
int mlx4_glue_dealloc_pd(struct ibv_pd *pd) { return ibv_dealloc_pd(pd); }


x86 assembly (clang, -O0):
<mlx4_glue_dealloc_pd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ibv_dealloc_pd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlx4_glue_dealloc_pd>:
jmp    1030 <ibv_dealloc_pd@plt>

LLVM IR (-O0):
%struct.ibv_pd = type { i32 }
define i32 @mlx4_glue_dealloc_pd(%struct.ibv_pd* %0) {
%2 = alloca %struct.ibv_pd*
store %struct.ibv_pd* %0, %struct.ibv_pd** %2
%3 = load %struct.ibv_pd*, %struct.ibv_pd** %2
%4 = call i32 @ibv_dealloc_pd(%struct.ibv_pd* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.ibv_pd = type { i32 }
define i32 @mlx4_glue_dealloc_pd(%struct.ibv_pd* %0) {
%2 = tail call i32 @ibv_dealloc_pd(%struct.ibv_pd* %0)
ret i32 %2
}
/* Variables and functions */
long gregorianDateToJulianDay(int, int, int);
long getJuldayOrigin() {
  static long juldayOrigin;
  if (juldayOrigin == 0)
    juldayOrigin = gregorianDateToJulianDay(2001, 1, 1);
  return juldayOrigin;
}


x86 assembly (clang, -O0):
<getJuldayOrigin>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x0,0x2f14(%rip)
jne    113a <getJuldayOrigin+0x2a>
mov    $0x7d1,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <gregorianDateToJulianDay@plt>
mov    %rax,0x2ef6(%rip)
mov    0x2eef(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getJuldayOrigin>:
push   %rax
mov    0x2f18(%rip),%rax
test   %rax,%rax
je     111f <getJuldayOrigin+0xf>
pop    %rcx
ret
mov    $0x7d1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <gregorianDateToJulianDay@plt>
mov    %rax,0x2ef6(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@getJuldayOrigin.juldayOrigin = internal global i64 0
define i64 @getJuldayOrigin() {
%1 = load i64, i64* @getJuldayOrigin.juldayOrigin
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i64 @gregorianDateToJulianDay(i32 2001, i32 1, i32 1)
store i64 %4, i64* @getJuldayOrigin.juldayOrigin
br label %5
5: ; preds = %3, %0
%6 = load i64, i64* @getJuldayOrigin.juldayOrigin
ret i64 %6
}

LLVM IR (-O2):
@getJuldayOrigin.juldayOrigin = internal unnamed_addr global i64 0
define i64 @getJuldayOrigin() {
%1 = load i64, i64* @getJuldayOrigin.juldayOrigin
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i64 @gregorianDateToJulianDay(i32 2001, i32 1, i32 1)
store i64 %4, i64* @getJuldayOrigin.juldayOrigin
br label %5
5: ; preds = %3, %0
%6 = phi i64 [ %4, %3 ], [ %1, %0 ]
ret i64 %6
}
void pcp_def_cpu_metrics(struct activity *a) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_def_cpu_metrics(%struct.activity* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = -2 - 1;
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffd,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -3, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int, int /*<<< orphan*/,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ *open(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main() {
  char name[] = "Hello World";
  FILE *fout = open("xyz.txt", "w+");
  fwrite(name, sizeof(char), strlen(name), fout);
  fclose(fout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xeb1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xeaf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    0xea9(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1050 <open@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1060 <fwrite@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,0x8(%rsp)
movl   $0x646c72,0x10(%rsp)
lea    0xea7(%rip),%rdi
lea    0xea8(%rip),%rsi
call   1050 <open@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.name = [12 x i8] c"Hello World\00"
@.str = [8 x i8] c"xyz.txt\00"
@.str.1 = [3 x i8] c"w+\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca i32*
%3 = bitcast [12 x i8]* %1 to i8*
%4 = call i32* @open(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %2
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = load i32*, i32** %2
%9 = call i32 @fwrite(i8* %5, i32 1, i32 %7, i32* %8)
%10 = load i32*, i32** %2
%11 = call i32 @fclose(i32* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.name = [12 x i8] c"Hello World\00"
@.str = [8 x i8] c"xyz.txt\00"
@.str.1 = [3 x i8] c"w+\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* @open(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @fwrite(i8* %2, i32 1, i32 %4, i32* %3)
%6 = call i32 @fclose(i32* %3)
ret i32 0
}
/* Variables and functions */
int regmatchInsensitive(char *, char *);
int iscomment(char *line) {
  if (line == (char *)NULL)
    return (1);
  return regmatchInsensitive(line,
                             "^[\x20\x09\x0A\x0C]*$|^[\x20\x09\x0A\x0C]*#.*$");
}


x86 assembly (clang, -O0):
<iscomment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <iscomment+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1146 <iscomment+0x36>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <regmatchInsensitive@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscomment>:
test   %rdi,%rdi
je     1121 <iscomment+0x11>
lea    0xee4(%rip),%rsi
jmp    1030 <regmatchInsensitive@plt>
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"^[ \09\0A\0C]*$|^[ \09\0A\0C]*#.*$\00"
define i32 @iscomment(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @regmatchInsensitive(i8* %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [23 x i8] c"^[ \09\0A\0C]*$|^[ \09\0A\0C]*#.*$\00"
define i32 @iscomment(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @regmatchInsensitive(i8* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
long double sinl(long double);
__attribute__((__weak__, __always___)) long double
softboundcets_sinl(long double x) {
  return sinl(x);
}


x86 assembly (clang, -O0):
<softboundcets_sinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_sinl>:
jmp    1030 <sinl@plt>

LLVM IR (-O0):
define weak x86_fp80 @softboundcets_sinl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @sinl(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define weak x86_fp80 @softboundcets_sinl(x86_fp80 %0) {
%2 = tail call x86_fp80 @sinl(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int strlen(char *);
void buf_cat(char *s, int c) {
  int i;
  i = strlen(s);
  s[i] = c;
  s[i + 1] = 0;
}


x86 assembly (clang, -O0):
<buf_cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_cat>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @buf_cat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 %9, i8* %13
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
store i8 0, i8* %18
ret void
}

LLVM IR (-O2):
define void @buf_cat(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = trunc i32 %1 to i8
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %4, i8* %6
%7 = add nsw i32 %3, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
ret void
}
int countDigits(int num) {
  int dig = 1;
  while ((num /= 10) != 0)
    dig++;
  return dig;
}


x86 assembly (clang, -O0):
<countDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1133 <countDigits+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <countDigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigits>:
lea    0x9(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x13,%ecx
jb     1145 <countDigits+0x45>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    $0x1,%eax
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1120 <countDigits+0x20>
ret

LLVM IR (-O0):
define i32 @countDigits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 10
store i32 %6, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @countDigits(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = sdiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = add nsw i32 %7, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
int findOddSum(int a, int b) {
  int isOdd = a % 2;
  int lowerBound = a + !isOdd;
  int sum = 0;
  while (lowerBound <= b) {
    sum += lowerBound;
    lowerBound += 2;
  }
  return sum;
}


x86 assembly (clang, -O0):
<findOddSum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmpl   $0x0,-0xc(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115a <findOddSum+0x5a>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <findOddSum+0x37>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findOddSum>:
mov    %edi,%ecx
not    %ecx
mov    %ecx,%r8d
and    $0x1,%r8d
lea    (%r8,%rdi,1),%edx
xor    %eax,%eax
cmp    %esi,%edx
jg     113a <findOddSum+0x3a>
add    $0x2,%edx
add    $0x1,%esi
cmp    %esi,%edx
cmovg  %edx,%esi
add    %ecx,%esi
sub    %r8d,%esi
shr    %esi
imul   %esi,%edx
add    %edi,%edx
lea    -0x1(%rsi),%eax
imul   %esi,%eax
and    $0xfffffffe,%eax
add    %edx,%eax
add    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @findOddSum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = srem i32 %8, 2
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = add nsw i32 %10, %14
store i32 %15, i32* %6
store i32 0, i32* %7
br label %16
16: ; preds = %20, %2
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = add nsw i32 %22, %21
store i32 %23, i32* %7
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 2
store i32 %25, i32* %6
br label %16
26: ; preds = %16
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @findOddSum(i32 %0, i32 %1) {
%3 = and i32 %0, 1
%4 = xor i32 %3, 1
%5 = add i32 %4, %0
%6 = icmp sgt i32 %5, %1
br i1 %6, label %23, label %7
7: ; preds = %2
%8 = add i32 %5, 2
%9 = add nsw i32 %1, 1
%10 = call i32 @llvm.smax.i32(i32 %8, i32 %9)
%11 = xor i32 %0, -1
%12 = add i32 %10, %11
%13 = sub i32 %12, %4
%14 = lshr i32 %13, 1
%15 = mul i32 %14, %8
%16 = add i32 %15, %0
%17 = lshr i32 %13, 1
%18 = add nsw i32 %14, -1
%19 = mul i32 %17, %18
%20 = and i32 %19, -2
%21 = add i32 %16, %20
%22 = add i32 %21, %4
br label %23
23: ; preds = %7, %2
%24 = phi i32 [ 0, %2 ], [ %22, %7 ]
ret i32 %24
}
void cdrrvt(in, iout) int *in, *iout;
{ *in = *iout; }


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

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

LLVM IR (-O0):
define void @cdrrvt(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = load i32*, i32** %3
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @cdrrvt(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
store i32 %3, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *txt_open_for_append(char *path) { return fopen(path, "a"); }


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

x86 assembly (clang, -O2):
<txt_open_for_append>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i32* @txt_open_for_append(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define noalias i32* @txt_open_for_append(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
int ret_val() { return 123; }


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

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

LLVM IR (-O0):
define i32 @ret_val() {
ret i32 123
}

LLVM IR (-O2):
define i32 @ret_val() {
ret i32 123
}
unsigned npot(unsigned n) {
  unsigned i = 0;
  while (1) {
    if ((1 << i) >= n)
      return 1 << i;
    ++i;
  }
}


x86 assembly (clang, -O0):
<npot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x4(%rbp),%eax
jb     112d <npot+0x2d>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <npot+0xe>

x86 assembly (clang, -O2):
<npot>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%eax
shl    %cl,%eax
add    $0x1,%ecx
cmp    %edi,%eax
jb     1110 <npot+0x10>
ret

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

LLVM IR (-O2):
define i32 @npot(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = shl nuw i32 1, %3
%5 = icmp ult i32 %4, %0
%6 = add i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world!\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_data_source {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_data_source_get_user_data(struct wl_data_source *wl_data_source) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_data_source);
}


x86 assembly (clang, -O0):
<wl_data_source_get_user_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wl_proxy_get_user_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_data_source_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_data_source = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_data_source_get_user_data(%struct.wl_data_source* %0) {
%2 = alloca %struct.wl_data_source*
store %struct.wl_data_source* %0, %struct.wl_data_source** %2
%3 = load %struct.wl_data_source*, %struct.wl_data_source** %2
%4 = bitcast %struct.wl_data_source* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_data_source = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_data_source_get_user_data(%struct.wl_data_source* %0) {
%2 = bitcast %struct.wl_data_source* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ write(int, char *, int);
void tyan_lcdm_switch_mode(int fd) {
  char lcdcmd1[4] = {0xF1, 0x73, 0x01, 0xF2};
  char lcdcmd2[3] = {0xF1, 0x6c, 0xF2};
  write(fd, lcdcmd1, 4);
  sleep(1);
  write(fd, lcdcmd2, 3);
  sleep(1);
}


x86 assembly (clang, -O0):
<tyan_lcdm_switch_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xec1(%rip),%al
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x4(%rbp),%edi
lea    -0xb(%rbp),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tyan_lcdm_switch_mode>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0xf20173f1,0xc(%rsp)
f2
movb   $0xf2,0xa(%rsp)
movw   $0x6cf1,0x8(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
mov    $0x3,%edx
call   1030 <write@plt>
mov    $0x1,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@__const.tyan_lcdm_switch_mode.lcdcmd1 = [4 x i8] c"\F1s\01\F2"
@__const.tyan_lcdm_switch_mode.lcdcmd2 = [3 x i8] c"\F1l\F2"
define void @tyan_lcdm_switch_mode(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
%4 = alloca [3 x i8]
store i32 %0, i32* %2
%5 = bitcast [4 x i8]* %3 to i8*
%6 = bitcast [3 x i8]* %4 to i8*
%7 = load i32, i32* %2
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%9 = call i32 @write(i32 %7, i8* %8, i32 4)
%10 = call i32 @sleep(i32 1)
%11 = load i32, i32* %2
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%13 = call i32 @write(i32 %11, i8* %12, i32 3)
%14 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
@__const.tyan_lcdm_switch_mode.lcdcmd2 = [3 x i8] c"\F1l\F2"
define void @tyan_lcdm_switch_mode(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8]
%4 = bitcast i32* %2 to i8*
store i32 -234785807, i32* %2
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%6 = call i32 @write(i32 %0, i8* %4, i32 4)
%7 = tail call i32 @sleep(i32 1)
%8 = call i32 @write(i32 %0, i8* %5, i32 3)
%9 = tail call i32 @sleep(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int v(int y) {
  if (y >= 0 && y <= 63)
    return y;
  fprintf(stderr, "Got %d in v\n", y);
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     114a <v+0x2a>
cmpl   $0x3f,-0x8(%rbp)
jg     114a <v+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <v+0x50>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v>:
push   %rbx
mov    %edi,%ebx
cmp    $0x40,%edi
jb     1148 <v+0x28>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"Got %d in v\0A\00"
define i32 @v(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 63
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %16
11: ; preds = %6, %1
%12 = load i32, i32* @stderr
%13 = load i32, i32* %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 @assert(i32 0)
store i32 0, i32* %2
br label %16
16: ; preds = %11, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"Got %d in v\0A\00"
define i32 @v(i32 %0) {
%2 = icmp ult i32 %0, 64
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @assert(i32 0)
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ 0, %3 ], [ %0, %1 ]
ret i32 %8
}
/* Type definitions */
struct t_gui_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_buffer_close(struct t_gui_buffer *);
scalar_t__ string_strcasecmp(char const *, char *);
int gui_buffer_user_input_cb(const void *pointer, void *data,
                             struct t_gui_buffer *buffer,
                             const char *input_data) {
  (void)pointer;
  (void)data;
  if (string_strcasecmp(input_data, "q") == 0) {
    gui_buffer_close(buffer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<gui_buffer_user_input_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    115b <gui_buffer_user_input_cb+0x3b>
mov    -0x18(%rbp),%rdi
call   1040 <gui_buffer_close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_buffer_user_input_cb>:
push   %rbx
mov    %rdx,%rbx
lea    0xed5(%rip),%rsi
mov    %rcx,%rdi
call   1030 <string_strcasecmp@plt>
test   %rax,%rax
jne    1140 <gui_buffer_user_input_cb+0x20>
mov    %rbx,%rdi
call   1040 <gui_buffer_close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.t_gui_buffer = type { i32 }
@.str = [2 x i8] c"q\00"
define i32 @gui_buffer_user_input_cb(i8* %0, i8* %1, %struct.t_gui_buffer* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.t_gui_buffer*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.t_gui_buffer* %2, %struct.t_gui_buffer** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %8
%12 = call i64 @string_strcasecmp(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %4
%15 = load %struct.t_gui_buffer*, %struct.t_gui_buffer** %7
%16 = call i32 @gui_buffer_close(%struct.t_gui_buffer* %15)
br label %17
17: ; preds = %14, %4
ret i32 0
}

LLVM IR (-O2):
%struct.t_gui_buffer = type { i32 }
@.str = [2 x i8] c"q\00"
define i32 @gui_buffer_user_input_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_gui_buffer* %2, i8* %3) {
%5 = tail call i64 @string_strcasecmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @gui_buffer_close(%struct.t_gui_buffer* %2)
br label %9
9: ; preds = %7, %4
ret i32 0
}
/* Variables and functions */
double divide(double, int);
int /*<<< orphan*/ puts(int);
void test() {
  puts(divide(6, 4) == 1.5);
  puts(divide(4.5, -3) == -1.5);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movsd  0xeec(%rip),%xmm0
mov    $0x4,%edi
call   1040 <divide@plt>
movsd  0xed2(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <puts@plt>
movsd  0xeac(%rip),%xmm0
mov    $0xfffffffd,%edi
call   1040 <divide@plt>
movsd  0xe92(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x4,%edi
call   1040 <divide@plt>
cmpeqsd 0xecc(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <puts@plt>
movsd  0xebf(%rip),%xmm0
mov    $0xfffffffd,%edi
call   1040 <divide@plt>
cmpeqsd 0xeb4(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
define void @test() {
%1 = call double @divide(double 6.000000e+00, i32 4)
%2 = fcmp oeq double %1, 1.500000e+00
%3 = zext i1 %2 to i32
%4 = call i32 @puts(i32 %3)
%5 = call double @divide(double 4.500000e+00, i32 -3)
%6 = fcmp oeq double %5, -1.500000e+00
%7 = zext i1 %6 to i32
%8 = call i32 @puts(i32 %7)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call double @divide(double 6.000000e+00, i32 4)
%2 = fcmp oeq double %1, 1.500000e+00
%3 = zext i1 %2 to i32
%4 = tail call i32 @puts(i32 %3)
%5 = tail call double @divide(double 4.500000e+00, i32 -3)
%6 = fcmp oeq double %5, -1.500000e+00
%7 = zext i1 %6 to i32
%8 = tail call i32 @puts(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_char(char const);
void print_string(const char *s) {
  for (; (*s) != '\0'; s++)
    print_char((*s));
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <print_string+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <print_char@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <print_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <print_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <print_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print_string+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @print_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %12, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @print_char(i8 signext %10)
br label %12
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @print_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @print_char(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int Kit_WordFindFirstBit(unsigned uWord) {
  int i;
  for (i = 0; i < 32; i++)
    if (uWord & (1 << i))
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<Kit_WordFindFirstBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1150 <Kit_WordFindFirstBit+0x50>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     113d <Kit_WordFindFirstBit+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <Kit_WordFindFirstBit+0x57>
jmp    1142 <Kit_WordFindFirstBit+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <Kit_WordFindFirstBit+0xe>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_WordFindFirstBit>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
bt     %eax,%edi
jb     114b <Kit_WordFindFirstBit+0x4b>
lea    0x1(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jb     1144 <Kit_WordFindFirstBit+0x44>
lea    0x2(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jb     1148 <Kit_WordFindFirstBit+0x48>
lea    0x3(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jb     114c <Kit_WordFindFirstBit+0x4c>
add    $0x4,%eax
cmp    $0x20,%eax
jne    1110 <Kit_WordFindFirstBit+0x10>
mov    $0xffffffff,%eax
ret
add    $0x1,%eax
ret
add    $0x2,%eax
ret
add    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @Kit_WordFindFirstBit(i32 %0) {
br label %2
2: ; preds = %22, %1
%3 = phi i32 [ 0, %1 ], [ %23, %22 ]
%4 = shl nuw i32 1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %2
%8 = or i32 %3, 1
%9 = shl nuw i32 1, %8
%10 = and i32 %9, %0
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %7
%13 = or i32 %3, 2
%14 = shl nuw i32 1, %13
%15 = and i32 %14, %0
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %25
17: ; preds = %12
%18 = or i32 %3, 3
%19 = shl nuw i32 1, %18
%20 = and i32 %19, %0
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = add nuw nsw i32 %3, 4
%24 = icmp eq i32 %23, 32
br i1 %24, label %25, label %2
25: ; preds = %22, %17, %12, %7, %2
%26 = phi i32 [ %3, %2 ], [ %8, %7 ], [ %13, %12 ], [ %18, %17 ], [ -1, %22 ]
ret i32 %26
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *);
size_t util_file_length(FILE *fd) {
  size_t off, filesize;
  off = ftell(fd);
  fseek(fd, 0, SEEK_END);
  filesize = ftell(fd);
  fseek(fd, (long)off, SEEK_SET);
  return filesize;
}


x86 assembly (clang, -O0):
<util_file_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_file_length>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @util_file_length(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i32*, i32** %2
%13 = load i64, i64* %3
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i64 %13, i32 %14)
%16 = load i64, i64* %4
ret i64 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @util_file_length(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i64 %2, i32 %6)
ret i64 %5
}
void TC1_IRQHandler(void) {
  while (1)
    ;
}


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

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

LLVM IR (-O0):
define void @TC1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @TC1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void d2i_PKCS8_PRIV_KEY_INFO_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_PKCS8_PRIV_KEY_INFO_bio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ circlemod2_undefined();
int circlemod3();
int circlemod2(void) {
  circlemod2_undefined();
  return circlemod3();
}


x86 assembly (clang, -O0):
<circlemod2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <circlemod2_undefined@plt>
mov    $0x0,%al
call   1030 <circlemod3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<circlemod2>:
push   %rax
xor    %eax,%eax
call   1040 <circlemod2_undefined@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <circlemod3@plt>

LLVM IR (-O0):
define i32 @circlemod2() {
%1 = call i32 (...) @circlemod2_undefined()
%2 = call i32 (...) @circlemod3()
ret i32 %2
}

LLVM IR (-O2):
define i32 @circlemod2() {
%1 = tail call i32 (...) @circlemod2_undefined()
%2 = tail call i32 (...) @circlemod3()
ret i32 %2
}
/* Variables and functions */
int abs_value(int, int);
int change_in_temp(int **T, int x1, int y1, int x2, int y2) {
  return (abs_value(T[x1][y1], T[x2][y2]));
}


x86 assembly (clang, -O0):
<change_in_temp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <abs_value@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_in_temp>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
movslq %edx,%rdx
mov    (%rax,%rdx,4),%eax
movslq %ecx,%rcx
mov    (%rdi,%rcx,8),%rcx
movslq %r8d,%rdx
mov    (%rcx,%rdx,4),%esi
mov    %eax,%edi
jmp    1030 <abs_value@plt>

LLVM IR (-O0):
define i32 @change_in_temp(i32** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32** %0, i32*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32**, i32*** %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32*, i32** %11, i64 %13
%15 = load i32*, i32** %14
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32**, i32*** %6
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32*, i32** %20, i64 %22
%24 = load i32*, i32** %23
%25 = load i32, i32* %10
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
%29 = call i32 @abs_value(i32 %19, i32 %28)
ret i32 %29
}

LLVM IR (-O2):
define i32 @change_in_temp(i32** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32*, i32** %0, i64 %6
%8 = load i32*, i32** %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = load i32, i32* %10
%12 = sext i32 %3 to i64
%13 = getelementptr inbounds i32*, i32** %0, i64 %12
%14 = load i32*, i32** %13
%15 = sext i32 %4 to i64
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i32, i32* %16
%18 = tail call i32 @abs_value(i32 %11, i32 %17)
ret i32 %18
}
void ff_hevc_put_hevc_uni_w_pel_pixels64_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_pel_pixels64_10_sse4() {
ret void
}
/* Variables and functions */
double LibC1Func();
int /*<<< orphan*/ printf(char *);
int main() {
  if (LibC1Func() != 2.0) {
    printf("Problem with libc1\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <LibC1Func@plt>
movsd  0xec2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1153 <main+0x33>
jp     1153 <main+0x33>
jmp    116b <main+0x4b>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1172 <main+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <LibC1Func@plt>
ucomisd 0xece(%rip),%xmm0
jne    1136 <main+0x16>
jnp    1147 <main+0x27>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Problem with libc1\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double (...) @LibC1Func()
%3 = fcmp une double %2, 2.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@str = [19 x i8] c"Problem with libc1\00"
define i32 @main() {
%1 = tail call double (...) @LibC1Func()
%2 = fcmp une double %1, 2.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void goodbye(void) { printf("Goodbye, World\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Goodbye, World\0A\00"
define void @goodbye() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"Goodbye, World\00"
define void @goodbye() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int effect_wait_key_event(struct razer_fx_render_node *render, int keycode,
                          int pressed) {
  if (pressed)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<effect_wait_key_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1124 <effect_wait_key_event+0x24>
movl   $0x0,-0x4(%rbp)
jmp    112b <effect_wait_key_event+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<effect_wait_key_event>:
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret

LLVM IR (-O0):
%struct.razer_fx_render_node = type opaque
define i32 @effect_wait_key_event(%struct.razer_fx_render_node* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.razer_fx_render_node*
%6 = alloca i32
%7 = alloca i32
store %struct.razer_fx_render_node* %0, %struct.razer_fx_render_node** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 0, i32* %4
br label %12
11: ; preds = %3
store i32 1, i32* %4
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
%struct.razer_fx_render_node = type opaque
define i32 @effect_wait_key_event(%struct.razer_fx_render_node* nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void apply_Ey_tfsf(int j) {}


x86 assembly (clang, -O0):
<apply_Ey_tfsf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @apply_Ey_tfsf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @apply_Ey_tfsf(i32 %0) {
ret void
}
void ff_hevc_put_hevc_uni_qpel_h48_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h48_10_avx2() {
ret void
}