xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
void remove_newline_ch(char *line) {
  int new_line = strlen(line) - 1;
  if (line[new_line] == '\n')
    line[new_line] = '\0';
}


x86 assembly (clang, -O0):
<remove_newline_ch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    114c <remove_newline_ch+0x3c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_newline_ch>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <remove_newline_ch+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @remove_newline_ch(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %19
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
br label %19
19: ; preds = %14, %1
ret void
}

LLVM IR (-O2):
define void @remove_newline_ch(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
int exact_square(int n) {
  int a;
  for (a = 0; a <= n / 2; a++) {
    if (n == a * a) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     115d <exact_square+0x5d>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <exact_square+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1164 <exact_square+0x64>
jmp    114f <exact_square+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <exact_square+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
jl     1138 <exact_square+0x38>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
add    $0x1,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
je     1133 <exact_square+0x33>
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1120 <exact_square+0x20>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @exact_square(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 = %18, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sdiv i32 %7, 2
%9 = icmp sle i32 %6, %8
br i1 %9, label %10, label %21
10: ; preds = %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = icmp eq i32 %11, %14
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %2
br label %22
17: ; preds = %10
br label %18
18: ; preds = %17
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %5
21: ; preds = %5
store i32 0, i32* %2
br label %22
22: ; preds = %21, %16
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp slt i32 %0, -1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = sdiv i32 %0, 2
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 0, %3 ]
%10 = mul nsw i32 %9, %9
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 0, %1 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ close(int const);
int errno;
void sock_close(const int *const fd) {
  assert(fd != NULL);
  int _errno = errno;
  if (*fd > -1)
    (void)close(*fd);
  errno = _errno;
}


x86 assembly (clang, -O0):
<sock_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jle    1162 <sock_close+0x42>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0xc(%rbp),%ecx
mov    0x2e74(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_close>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    0x2ea4(%rip),%r14
mov    (%r14),%ebp
mov    (%rbx),%edi
test   %edi,%edi
js     114a <sock_close+0x2a>
call   1030 <close@plt>
mov    %ebp,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define void @sock_close(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* @errno
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = icmp sgt i32 %10, -1
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i32*, i32** %2
%14 = load i32, i32* %13
%15 = call i32 @close(i32 %14)
br label %16
16: ; preds = %12, %1
%17 = load i32, i32* %3
store i32 %17, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @sock_close(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* @errno
%6 = load i32, i32* %0
%7 = icmp sgt i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @close(i32 %6)
br label %10
10: ; preds = %8, %1
store i32 %5, i32* @errno
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void timeConv(int time) {
  int a, b, c;
  a = time / 3600;
  b = (time % 3600) / 60;
  c = (time % 3600) % 60;
  printf("%dH %dM %dS", a, b, c);
}


x86 assembly (clang, -O0):
<timeConv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeConv>:
movslq %edi,%rax
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0xb,%esi
add    %ecx,%esi
imul   $0xe10,%esi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edi
shr    $0xf,%ecx
sar    $0x5,%edi
add    %ecx,%edi
movswl %di,%edx
imul   $0x3c,%edi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
lea    0xea0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%dH %dM %dS\00"
define void @timeConv(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 3600
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = srem i32 %8, 3600
%10 = sdiv i32 %9, 60
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = srem i32 %11, 3600
%13 = srem i32 %12, 60
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%dH %dM %dS\00"
define void @timeConv(i32 %0) {
%2 = sdiv i32 %0, 3600
%3 = srem i32 %0, 3600
%4 = trunc i32 %3 to i16
%5 = sdiv i16 %4, 60
%6 = sext i16 %5 to i32
%7 = srem i16 %4, 60
%8 = sext i16 %7 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %6, i32 %8)
ret void
}
/* Variables and functions */
scalar_t__ CC3RandomDoubleBetween(float, float);
float CC3RandomFloatBetween(float min, float max) {
  return (float)CC3RandomDoubleBetween(min, max);
}


x86 assembly (clang, -O0):
<CC3RandomFloatBetween>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <CC3RandomDoubleBetween@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CC3RandomFloatBetween>:
push   %rax
call   1030 <CC3RandomDoubleBetween@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @CC3RandomFloatBetween(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i64 @CC3RandomDoubleBetween(float %5, float %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @CC3RandomFloatBetween(float %0, float %1) {
%3 = tail call i64 @CC3RandomDoubleBetween(float %0, float %1)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ seatest_test_fixture_end();
int /*<<< orphan*/ seatest_test_fixture_start(char *);
void chmod_tests(void) {
  do {
    seatest_test_fixture_start(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/sshilovsky/vifm/refs/heads/master/tests/iop/"
        "chmod.c");
  } while (0);
  do {
    seatest_test_fixture_end();
  } while (0);
}


x86 assembly (clang, -O0):
<chmod_tests>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <chmod_tests+0x9>
lea    0xed0(%rip),%rdi
call   1040 <seatest_test_fixture_start@plt>
jmp    113a <chmod_tests+0x1a>
mov    $0x0,%al
call   1030 <seatest_test_fixture_end@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmod_tests>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <seatest_test_fixture_start@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <seatest_test_fixture_end@plt>

LLVM IR (-O0):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sshilovsky/vifm/refs/heads/master/tests/iop/chmod.c\00"
define void @chmod_tests() {
br label %1
1: ; preds = %0
%2 = call i32 @seatest_test_fixture_start(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = call i32 (...) @seatest_test_fixture_end()
br label %6
6: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sshilovsky/vifm/refs/heads/master/tests/iop/chmod.c\00"
define void @chmod_tests() {
%1 = tail call i32 @seatest_test_fixture_start(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @seatest_test_fixture_end()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M665_f(char *s) {
  debug("M665_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M665_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M665_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M665_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M665_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M665_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M665_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ configureBlePatch();
int /*<<< orphan*/ enterBleCpePatch();
void refreshBlePatch(void) {
  enterBleCpePatch();
  configureBlePatch();
}


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

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

LLVM IR (-O0):
define void @refreshBlePatch() {
%1 = call i32 (...) @enterBleCpePatch()
%2 = call i32 (...) @configureBlePatch()
ret void
}

LLVM IR (-O2):
define void @refreshBlePatch() {
%1 = tail call i32 (...) @enterBleCpePatch()
%2 = tail call i32 (...) @configureBlePatch()
ret void
}
/* Variables and functions */
scalar_t__ ISBLANK(int);
int inchar();
int in_nonblank(void) {
  int ch;
  do
    ch = inchar();
  while (ISBLANK(ch));
  return ch;
}


x86 assembly (clang, -O0):
<in_nonblank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <inchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ISBLANK@plt>
cmp    $0x0,%rax
jne    1128 <in_nonblank+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_nonblank>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <inchar@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <ISBLANK@plt>
test   %rax,%rax
jne    1130 <in_nonblank+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @in_nonblank() {
%1 = alloca i32
br label %2
2: ; preds = %4, %0
%3 = call i32 (...) @inchar()
store i32 %3, i32* %1
br label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = call i64 @ISBLANK(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %2, label %8
8: ; preds = %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @in_nonblank() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @inchar()
%3 = tail call i64 @ISBLANK(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int countDigitOne(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 0;
  for (i = 100; i < 200; i++) {
    printf("\r\n i[%d]=%d", i, countDigitOne(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x64,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jge    1177 <main+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <countDigitOne@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x64,%ebx
lea    0xed0(%rip),%r14
mov    %ebx,%edi
call   1040 <countDigitOne@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xc8,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"\0D\0A i[%d]=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 100, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 200
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @countDigitOne(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0D\0A i[%d]=%d\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 100, %0 ], [ %5, %1 ]
%3 = tail call i32 @countDigitOne(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 200
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f();
int pair(int, int /*<<< orphan*/);
int list1(int a) { return pair(a, f()); }


x86 assembly (clang, -O0):
<list1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <pair@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list1>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <f@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <pair@plt>

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

LLVM IR (-O2):
define i32 @list1(i32 %0) {
%2 = tail call i32 (...) @f()
%3 = tail call i32 @pair(i32 %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/
avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2_ssse3(
    int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
extern void
avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2_ssse3_sse41(
    __m128i *in_3_v16i_current_r_g_b_vectors,
    __m128i *out_3_previous_r_g_b_vectors,
    __m128i *out_3_v16i_avg_422_r_g_b_vectors) {
  avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2_ssse3(
      in_3_v16i_current_r_g_b_vectors, out_3_previous_r_g_b_vectors,
      out_3_v16i_avg_422_r_g_b_vectors);
}


x86 assembly (clang, -O0):
<avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2_ssse3_sse41>:
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
call   1030 <avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2_ssse3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2_ssse3_sse41>:
jmp    1030 <avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2_ssse3@plt>

LLVM IR (-O0):
define void @avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2_ssse3_sse41(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2_ssse3(i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2_ssse3_sse41(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @avg_422_downsample_first_r_g_b_vectors_n_save_previous_sse2_ssse3(i32* %0, i32* %1, i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlockattr_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
int pthread_rwlockattr_init(int /*<<< orphan*/ *);
int my_pthread_rwlockattr_init(pthread_rwlockattr_t *__attr) {
  pthread_rwlockattr_t *realattr;
  realattr = malloc(sizeof(pthread_rwlockattr_t));
  *((int *)__attr) = (int)realattr;
  return pthread_rwlockattr_init(realattr);
}


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

x86 assembly (clang, -O2):
<my_pthread_rwlockattr_init>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %eax,(%rbx)
mov    %rax,%rdi
pop    %rbx
jmp    1030 <pthread_rwlockattr_init@plt>

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

LLVM IR (-O2):
define i32 @my_pthread_rwlockattr_init(i32* nocapture writeonly %0) {
%2 = tail call i32* @malloc(i32 4)
%3 = ptrtoint i32* %2 to i64
%4 = trunc i64 %3 to i32
store i32 %4, i32* %0
%5 = tail call i32 @pthread_rwlockattr_init(i32* %2)
ret i32 %5
}
void ff_hevc_h_loop_filter_luma_8_avx() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_h_loop_filter_luma_8_avx() {
ret void
}
int main() { return ((3)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 3
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test1(int a) {
  if ((a >> 3) & 1)
    foo();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <test1+0x24>
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
test   $0x8,%dil
jne    1117 <test1+0x7>
ret
xor    %eax,%eax
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 3
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @foo()
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @test1(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @foo()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main() { foo(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
ret i32 0
}
int Operand_frt_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~0xf) != 0;
  return error;
}


x86 assembly (clang, -O0):
<Operand_frt_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffff0,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_frt_encode>:
xor    %eax,%eax
cmpl   $0x10,(%rdi)
setae  %al
ret

LLVM IR (-O0):
define i32 @Operand_frt_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -16
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @Operand_frt_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 15
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int *turns_init(int length) {
  int *turns;
  turns = (int *)malloc(sizeof(int) * length);
  for (int i = 0; i < length; i++)
    *(turns + i) = 0;
  return turns;
}


x86 assembly (clang, -O0):
<turns_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115e <turns_init+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <turns_init+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turns_init>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <turns_init+0x29>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @turns_init(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = inttoptr i64 %3 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 2
br label %9
9: ; preds = %5, %1
%10 = inttoptr i64 %3 to i32*
ret i32* %10
}
int idx_find_entry() { return (1); }


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

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

LLVM IR (-O0):
define i32 @idx_find_entry() {
ret i32 1
}

LLVM IR (-O2):
define i32 @idx_find_entry() {
ret i32 1
}
/* Variables and functions */
scalar_t__ __cmpdf2(float, float);
int __ledf2(double a1, double a2) { return __cmpdf2((float)a1, (float)a2) > 0; }


x86 assembly (clang, -O0):
<__ledf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  -0x10(%rbp),%xmm1
cvtsd2ss %xmm1,%xmm1
call   1030 <__cmpdf2@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ledf2>:
push   %rax
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
call   1030 <__cmpdf2@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__ledf2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fptrunc double %5 to float
%7 = load double, double* %4
%8 = fptrunc double %7 to float
%9 = call i64 @__cmpdf2(float %6, float %8)
%10 = icmp sgt i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @__ledf2(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = tail call i64 @__cmpdf2(float %3, float %4)
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t kernel___Byte_ffi_ascii___impl(unsigned char self) {
  return (uint32_t)self;
}


x86 assembly (clang, -O0):
<kernel___Byte_ffi_ascii___impl>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel___Byte_ffi_ascii___impl>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @kernel___Byte_ffi_ascii___impl(i8 zeroext %0) {
%2 = zext i8 %0 to i32
ret i32 %2
}
int test_div(int x) {
  int j;
  j = x / 2;
  return j;
}


x86 assembly (clang, -O0):
<test_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_div>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @test_div(i32 %0) {
%2 = sdiv i32 %0, 2
ret i32 %2
}
void THInit() {}


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

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

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

LLVM IR (-O2):
define void @THInit() {
ret void
}
/* Variables and functions */
unsigned long _crc32(unsigned char *, long);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
unsigned long mon_crc32(char *buf, long nbytes) {
  unsigned long ret;
  monLock();
  ret = _crc32((unsigned char *)buf, nbytes);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <_crc32@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_crc32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <_crc32@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @mon_crc32(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 (...) @monLock()
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i64 @_crc32(i8* %7, i64 %8)
store i64 %9, i64* %5
%10 = call i32 (...) @monUnlock()
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
define i64 @mon_crc32(i8* %0, i64 %1) {
%3 = tail call i32 (...) @monLock()
%4 = tail call i64 @_crc32(i8* %0, i64 %1)
%5 = tail call i32 (...) @monUnlock()
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ Elf32_auxv_t;

/* Variables and functions */
int /*<<< orphan*/ _dl_aux_init(int /*<<< orphan*/ *);
void _dl_aux_init_from_envp(char **envp) {
  if (envp == NULL)
    return;
  while (*envp)
    ++envp;
  _dl_aux_init((Elf32_auxv_t *)(envp + 1));
}


x86 assembly (clang, -O0):
<_dl_aux_init_from_envp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <_dl_aux_init_from_envp+0x1c>
jmp    115d <_dl_aux_init_from_envp+0x4d>
jmp    1131 <_dl_aux_init_from_envp+0x21>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1150 <_dl_aux_init_from_envp+0x40>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1131 <_dl_aux_init_from_envp+0x21>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1030 <_dl_aux_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dl_aux_init_from_envp>:
test   %rdi,%rdi
je     112f <_dl_aux_init_from_envp+0x1f>
cs nopw 0x0(%rax,%rax,1)
nop
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1120 <_dl_aux_init_from_envp+0x10>
jmp    1030 <_dl_aux_init@plt>
ret

LLVM IR (-O0):
define void @_dl_aux_init_from_envp(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp eq i8** %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %19
6: ; preds = %1
br label %7
7: ; preds = %11, %6
%8 = load i8**, i8*** %2
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8**, i8*** %2
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %2
br label %7
14: ; preds = %7
%15 = load i8**, i8*** %2
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = bitcast i8** %16 to i32*
%18 = call i32 @_dl_aux_init(i32* %17)
br label %19
19: ; preds = %14, %5
ret void
}

LLVM IR (-O2):
define void @_dl_aux_init_from_envp(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i8** [ %7, %3 ], [ %0, %1 ]
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = getelementptr inbounds i8*, i8** %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = bitcast i8** %7 to i32*
%10 = tail call i32 @_dl_aux_init(i32* %9)
br label %11
11: ; preds = %1, %8
ret void
}
/* Variables and functions */
int strcspn(char const, char const);
int unmatched(char const *str, char const *group) {
  return (strcspn(*str, *group));
}


x86 assembly (clang, -O0):
<unmatched>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
movsbl %cl,%edi
movsbl (%rax),%esi
call   1030 <strcspn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmatched>:
movsbl (%rdi),%edi
movsbl (%rsi),%esi
jmp    1030 <strcspn@plt>

LLVM IR (-O0):
define i32 @unmatched(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = call i32 @strcspn(i8 signext %6, i8 signext %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @unmatched(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = tail call i32 @strcspn(i8 signext %3, i8 signext %4)
ret i32 %5
}
/* Variables and functions */
int firstuse();
int foo();
int main() { return foo() + firstuse(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <firstuse@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <foo@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <firstuse@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 (...) @firstuse()
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @firstuse()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int vhangup(void) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<vhangup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vhangup>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @vhangup() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @vhangup() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ nguraConsoleCleanup();
void nguraCleanup() { nguraConsoleCleanup(); }


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

x86 assembly (clang, -O2):
<nguraCleanup>:
xor    %eax,%eax
jmp    1030 <nguraConsoleCleanup@plt>

LLVM IR (-O0):
define void @nguraCleanup() {
%1 = call i32 (...) @nguraConsoleCleanup()
ret void
}

LLVM IR (-O2):
define void @nguraCleanup() {
%1 = tail call i32 (...) @nguraConsoleCleanup()
ret void
}
int ft_any(char **tab, int (*f)(char *)) {
  int i;
  i = 0;
  while (tab[i] != 0) {
    if (f(tab[i]) == 1)
      return (1);
    i++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     115f <ft_any+0x5f>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rdi
call   *%rax
cmp    $0x1,%eax
jne    1151 <ft_any+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1166 <ft_any+0x66>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <ft_any+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_any>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbp
mov    (%rdi),%rdi
xor    %r14d,%r14d
test   %rdi,%rdi
je     113c <ft_any+0x3c>
mov    %rsi,%rbx
add    $0x8,%rbp
nopl   0x0(%rax)
call   *%rbx
cmp    $0x1,%eax
je     1136 <ft_any+0x36>
mov    0x0(%rbp),%rdi
add    $0x8,%rbp
test   %rdi,%rdi
jne    1120 <ft_any+0x20>
jmp    113c <ft_any+0x3c>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ft_any(i8** nocapture %0, i32 (i8*)* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %15, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8*, i8** %0, i64 %14
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %15, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %14, %5 ], [ 0, %2 ]
%11 = phi i8* [ %7, %5 ], [ %3, %2 ]
%12 = tail call i32 %1(i8* %11)
%13 = icmp eq i32 %12, 1
%14 = add nuw i64 %10, 1
br i1 %13, label %15, label %5
15: ; preds = %9, %5, %2
%16 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void grid_check_horz(float x, float y, int y_direction) {
  int check_x = (int)x;
  int check_y = (y_direction == 1) ? (int)y : (int)y - 1;
  printf("grid check %d, %d\n", check_x, check_y);
}


x86 assembly (clang, -O0):
<grid_check_horz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1144 <grid_check_horz+0x34>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114f <grid_check_horz+0x3f>
cvttss2si -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_check_horz>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
cvttss2si %xmm1,%edx
sub    %eax,%edx
cvttss2si %xmm0,%esi
lea    0xed7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"grid check %d, %d\0A\00"
define void @grid_check_horz(float %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store float %0, float* %4
store float %1, float* %5
store i32 %2, i32* %6
%9 = load float, float* %4
%10 = fptosi float %9 to i32
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load float, float* %5
%15 = fptosi float %14 to i32
br label %20
16: ; preds = %3
%17 = load float, float* %5
%18 = fptosi float %17 to i32
%19 = sub nsw i32 %18, 1
br label %20
20: ; preds = %16, %13
%21 = phi i32 [ %15, %13 ], [ %19, %16 ]
store i32 %21, i32* %8
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"grid check %d, %d\0A\00"
define void @grid_check_horz(float %0, float %1, i32 %2) {
%4 = icmp ne i32 %2, 1
%5 = fptosi float %1 to i32
%6 = sext i1 %4 to i32
%7 = add nsw i32 %6, %5
%8 = fptosi float %0 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %7)
ret void
}
/* Variables and functions */
int fnmatch(char const *, char const *, int);
int octave_fnmatch_wrapper(const char *pattern, const char *name, int flags) {
  return fnmatch(pattern, name, flags);
}


x86 assembly (clang, -O0):
<octave_fnmatch_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <fnmatch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_fnmatch_wrapper>:
jmp    1030 <fnmatch@plt>

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

LLVM IR (-O2):
define i32 @octave_fnmatch_wrapper(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @fnmatch(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
void finn_vec2_zero(float *result) { memset(result, 0, sizeof(float) * 2); }


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

x86 assembly (clang, -O2):
<finn_vec2_zero>:
xor    %esi,%esi
mov    $0x8,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @finn_vec2_zero(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @memset(float* %3, i32 0, i32 8)
ret void
}

LLVM IR (-O2):
define void @finn_vec2_zero(float* %0) {
%2 = tail call i32 @memset(float* %0, i32 0, i32 8)
ret void
}
void menu(void) {}


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

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

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

LLVM IR (-O2):
define void @menu() {
ret void
}
int test_imm_2Cuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x2C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Cuint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x2c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Cuint64_lowword_reg>:
test   $0x2c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Cuint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 44
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_2Cuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 44
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char get_r_rd(int inst) { return ((inst & 0x0000F800) >> 11); }


x86 assembly (clang, -O0):
<get_r_rd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf800,%eax
sar    $0xb,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_r_rd>:
mov    %edi,%eax
shr    $0xb,%eax
and    $0x1f,%al
ret

LLVM IR (-O0):
define signext i8 @get_r_rd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 63488
%5 = ashr i32 %4, 11
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @get_r_rd(i32 %0) {
%2 = lshr i32 %0, 11
%3 = trunc i32 %2 to i8
%4 = and i8 %3, 31
ret i8 %4
}