xunge/DecIR huggingface dataset:
void cvt2bittable(const unsigned char *tl, char bt[256]) {
  int i;
  int cnt = 1;
  for (i = 0; !(((tl[i]) & 0377) == ((((unsigned char)(0))) & 0377)); i++) {
    bt[((tl[i]) & 0377)] = cnt++;
  }
}


x86 assembly (clang, -O0):
<cvt2bittable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0xff,%eax
cmp    $0x0,%eax
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    1140 <cvt2bittable+0x40>
jmp    1177 <cvt2bittable+0x77>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rsi
movzbl (%rcx,%rsi,1),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <cvt2bittable+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt2bittable>:
mov    (%rdi),%al
test   %al,%al
je     1122 <cvt2bittable+0x22>
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
movzbl %al,%eax
mov    %cl,(%rsi,%rax,1)
movzbl (%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <cvt2bittable+0x10>
ret

LLVM IR (-O0):
define void @cvt2bittable(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 1, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %31, %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 255
%15 = icmp eq i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %34
17: ; preds = %7
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
%20 = trunc i32 %18 to i8
%21 = load i8*, i8** %4
%22 = load i8*, i8** %3
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = and i32 %27, 255
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %21, i64 %29
store i8 %20, i8* %30
br label %31
31: ; preds = %17
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %7
34: ; preds = %7
ret void
}

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


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

x86 assembly (clang, -O2):
<INSTR>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <STORE_S_IMM_I32@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <NEXT_INSTR@plt>

LLVM IR (-O0):
define i32 @INSTR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @STORE_S_IMM_I32 to i32 (i32, ...)*)(i32 1)
%5 = call i32 (...) @NEXT_INSTR()
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @INSTR(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @STORE_S_IMM_I32 to i32 (i32, ...)*)(i32 1)
%3 = tail call i32 (...) @NEXT_INSTR()
ret i32 undef
}
int is_number(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_number+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_number(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_number(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_inotify_map_get_path();
int /*<<< orphan*/ test_inotify_map_get_wd();
int /*<<< orphan*/ test_inotify_unmap_all();
int /*<<< orphan*/ test_inotify_unmap_path();
int /*<<< orphan*/ test_inotify_unmap_wd();
int main() {
  test_inotify_unmap_path();
  test_inotify_unmap_wd();
  test_inotify_unmap_all();
  test_inotify_map_get_wd();
  test_inotify_map_get_path();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_inotify_unmap_path@plt>
mov    $0x0,%al
call   1030 <test_inotify_unmap_wd@plt>
mov    $0x0,%al
call   1070 <test_inotify_unmap_all@plt>
mov    $0x0,%al
call   1050 <test_inotify_map_get_wd@plt>
mov    $0x0,%al
call   1040 <test_inotify_map_get_path@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_inotify_unmap_path@plt>
xor    %eax,%eax
call   1030 <test_inotify_unmap_wd@plt>
xor    %eax,%eax
call   1070 <test_inotify_unmap_all@plt>
xor    %eax,%eax
call   1050 <test_inotify_map_get_wd@plt>
xor    %eax,%eax
call   1040 <test_inotify_map_get_path@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_inotify_unmap_path()
%3 = call i32 (...) @test_inotify_unmap_wd()
%4 = call i32 (...) @test_inotify_unmap_all()
%5 = call i32 (...) @test_inotify_map_get_wd()
%6 = call i32 (...) @test_inotify_map_get_path()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_inotify_unmap_path()
%2 = tail call i32 (...) @test_inotify_unmap_wd()
%3 = tail call i32 (...) @test_inotify_unmap_all()
%4 = tail call i32 (...) @test_inotify_map_get_wd()
%5 = tail call i32 (...) @test_inotify_map_get_path()
ret i32 0
}
/* Variables and functions */
int num_perfeito(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int vlr;
  printf("Informe um valor: ");
  scanf("%d", &vlr);
  printf("Numero %d eh perfeito: %d\n", vlr, num_perfeito(vlr));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <num_perfeito@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1030 <num_perfeito@plt>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Informe um valor: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Numero %d eh perfeito: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @num_perfeito(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Informe um valor: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Numero %d eh perfeito: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @num_perfeito(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
int sign(int r) {
  int s;
  s = (r > 0) - (r < 0);
  return (s);
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x4(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
sar    $0x1f,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @sign(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
%9 = zext i1 %8 to i32
%10 = sub nsw i32 %6, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = ashr i32 %0, 31
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xad() {
  Assert_real((isprint(173) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              870, ("isprint should be 0 for 0xad"));
}


x86 assembly (clang, -O0):
<t_isprint_0xad>:
push   %rbp
mov    %rsp,%rbp
mov    $0xad,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x366,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xad>:
push   %rax
mov    $0xad,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x366,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xad\00"
define void @t_isprint_0xad() {
%1 = call i64 @isprint(i32 173)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 870, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xad\00"
define void @t_isprint_0xad() {
%1 = tail call i64 @isprint(i32 173)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 870, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void drop_linux_vm_cache(void) {
  FILE *fp = fopen("/proc/sys/vm/drop_caches", "w");
  if (fp) {
    fputs("1\n", fp);
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<drop_linux_vm_cache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1173 <drop_linux_vm_cache+0x43>
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_linux_vm_cache>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     116e <drop_linux_vm_cache+0x3e>
mov    %rax,%rbx
lea    0xec8(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"/proc/sys/vm/drop_caches\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"1\0A\00"
define void @drop_linux_vm_cache() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%8 = load i32*, i32** %1
%9 = call i32 @fclose(i32* %8)
br label %10
10: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"/proc/sys/vm/drop_caches\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"1\0A\00"
define void @drop_linux_vm_cache() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 2, i64 1, i32* %1)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_iochannel_is_writable() {
  printf("NOT IMPLEMENTED:"
         "pa_iochannel_is_writable"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_iochannel_is_writable\00"
define i32 @pa_iochannel_is_writable() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_F6uint8_reg(unsigned char val) {
  return ((val) & (0xF6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F6uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xf6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_F6uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -10
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_clear_quaddobl_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(567, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_clear_quaddobl_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x237,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_clear_quaddobl_Laurent_system>:
mov    $0x237,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_clear_quaddobl_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 567, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_clear_quaddobl_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 567, i32* undef, i32* undef, double* undef)
ret i32 %1
}
int sun(int s1, int s2) { return s1 + s2; }


x86 assembly (clang, -O0):
<sun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sun>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @sun(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XMapRequestEvent;

/* Variables and functions */
void set_XMapRequestEvent_send_event(void *_p, int _v) {
  ((XMapRequestEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XMapRequestEvent_send_event>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XMapRequestEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ POP();
int /*<<< orphan*/ PUSH(int /*<<< orphan*/);
scalar_t__ cell2pointer(int /*<<< orphan*/);
int /*<<< orphan*/ unaligned_read_long(unsigned char const *);
void unalignedlongread(void) {
  const unsigned char *addr = (const unsigned char *)cell2pointer(POP());
  PUSH(unaligned_read_long(addr));
}


x86 assembly (clang, -O0):
<unalignedlongread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <POP@plt>
mov    %eax,%edi
call   1030 <cell2pointer@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <unaligned_read_long@plt>
mov    %eax,%edi
call   1060 <PUSH@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unalignedlongread>:
push   %rax
xor    %eax,%eax
call   1050 <POP@plt>
mov    %eax,%edi
call   1030 <cell2pointer@plt>
mov    %rax,%rdi
call   1040 <unaligned_read_long@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <PUSH@plt>

LLVM IR (-O0):
define void @unalignedlongread() {
%1 = alloca i8*
%2 = call i32 (...) @POP()
%3 = call i64 @cell2pointer(i32 %2)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = call i32 @unaligned_read_long(i8* %5)
%7 = call i32 @PUSH(i32 %6)
ret void
}

LLVM IR (-O2):
define void @unalignedlongread() {
%1 = tail call i32 (...) @POP()
%2 = tail call i64 @cell2pointer(i32 %1)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @unaligned_read_long(i8* %3)
%5 = tail call i32 @PUSH(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcscmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninitvar_wcscmp(wchar_t *s1, wchar_t *s2) {
  wchar_t *str1;
  wchar_t *str2;
  (void)wcscmp(str1, s2);
  (void)wcscmp(s1, str2);
  (void)wcscmp(str1, str2);
  (void)wcscmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<uninitvar_wcscmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <wcscmp@plt>
mov    %rbx,%rdi
call   1030 <wcscmp@plt>
call   1030 <wcscmp@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <wcscmp@plt>

LLVM IR (-O0):
define void @uninitvar_wcscmp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %5
%8 = load i32*, i32** %4
%9 = call i32 @wcscmp(i32* %7, i32* %8)
%10 = load i32*, i32** %3
%11 = load i32*, i32** %6
%12 = call i32 @wcscmp(i32* %10, i32* %11)
%13 = load i32*, i32** %5
%14 = load i32*, i32** %6
%15 = call i32 @wcscmp(i32* %13, i32* %14)
%16 = load i32*, i32** %3
%17 = load i32*, i32** %4
%18 = call i32 @wcscmp(i32* %16, i32* %17)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wcscmp(i32* %0, i32* %1) {
%3 = tail call i32 @wcscmp(i32* undef, i32* %1)
%4 = tail call i32 @wcscmp(i32* %0, i32* undef)
%5 = tail call i32 @wcscmp(i32* undef, i32* undef)
%6 = tail call i32 @wcscmp(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ big_frame();
int /*<<< orphan*/ medium_frame();
int /*<<< orphan*/ small_frame();
void main() {
  small_frame();
  medium_frame();
  big_frame();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <small_frame@plt>
mov    $0x0,%al
call   1040 <medium_frame@plt>
mov    $0x0,%al
call   1050 <big_frame@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <small_frame@plt>
xor    %eax,%eax
call   1040 <medium_frame@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <big_frame@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @small_frame()
%2 = call i32 (...) @medium_frame()
%3 = call i32 (...) @big_frame()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @small_frame()
%2 = tail call i32 (...) @medium_frame()
%3 = tail call i32 (...) @big_frame()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int assert(int x) {
  if (!x) {
    abort();
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112c <assert+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1115 <assert+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int *);
void exit_thread() {
  int a;
  pthread_exit(&a);
}


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

x86 assembly (clang, -O2):
<exit_thread>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <pthread_exit@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @exit_thread() {
%1 = alloca i32
%2 = call i32 @pthread_exit(i32* %1)
ret void
}

LLVM IR (-O2):
define void @exit_thread() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_exit(i32* %1)
ret void
}
int test_imm_F5uint16_mem(unsigned short *val) {
  return ((*val) & (0xF5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F5uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xf5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F5uint16_mem>:
testb  $0xf5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F5uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 245
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int syscall(int, char const *, int, char const *);
int symlinkat(const char *existing, int fd, const char *new) {
  return syscall(331, existing, fd, new);
}


x86 assembly (clang, -O0):
<symlinkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x14b,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symlinkat>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x14b,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @symlinkat(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @syscall(i32 331, i8* %0, i32 %1, i8* %2)
ret i32 %4
}
void clean_up(double *E2, double *Wcopy, double *work, int *iwork) {
  free(E2);
  free(Wcopy);
  free(work);
  free(iwork);
}


x86 assembly (clang, -O0):
<clean_up>:
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    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_up>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @clean_up(double* nocapture %0, double* nocapture %1, double* nocapture %2, i32* nocapture %3) {
%5 = bitcast double* %0 to i8*
tail call void @free(i8* %5)
%6 = bitcast double* %1 to i8*
tail call void @free(i8* %6)
%7 = bitcast double* %2 to i8*
tail call void @free(i8* %7)
%8 = bitcast i32* %3 to i8*
tail call void @free(i8* %8)
ret void
}
/* Variables and functions */
int f_shutdown(int, int);
int /*<<< orphan*/ printf(char *, char *, int);
int shutdown(int fd, int how) {
  (void)(3 >= 4 ? printf("%sshutdown(fd=%d)", "\n:: [CALL]\t", fd) : 0);
  if (0) {
    return f_shutdown(fd, how);
  }
  return f_shutdown(fd, how);
}


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

x86 assembly (clang, -O2):
<shutdown>:
jmp    1030 <f_shutdown@plt>

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

LLVM IR (-O2):
define i32 @shutdown(i32 %0, i32 %1) {
%3 = tail call i32 @f_shutdown(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct icmphdr {
  int dummy;
};

/* Variables and functions */
scalar_t__ skb_transport_header(struct sk_buff const *);
struct icmphdr *icmp_hdr(const struct sk_buff *skb) {
  return (struct icmphdr *)skb_transport_header(skb);
}


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

x86 assembly (clang, -O2):
<icmp_hdr>:
jmp    1030 <skb_transport_header@plt>

LLVM IR (-O0):
%struct.icmphdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.icmphdr* @icmp_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_transport_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.icmphdr*
ret %struct.icmphdr* %5
}

LLVM IR (-O2):
%struct.icmphdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.icmphdr* @icmp_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_transport_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.icmphdr*
ret %struct.icmphdr* %3
}
extern void do_irq_end(void) {}


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

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

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

LLVM IR (-O2):
define void @do_irq_end() {
ret void
}
int not3(int n) { return n != 3; }


x86 assembly (clang, -O0):
<not3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<not3>:
xor    %eax,%eax
cmp    $0x3,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @not3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @not3(i32 %0) {
%2 = icmp ne i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__2__IO__set();
void LedsP__Led0__set(void) { HplAtm128GeneralIOPinP__2__IO__set(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led0__set() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__2__IO__set()
ret void
}
int bar(int x) {
  switch (x) {
  case -1 >> 200:
  case 1 << 200:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x80000000,%eax
je     112e <bar+0x2e>
jmp    111d <bar+0x1d>
mov    -0xc(%rbp),%eax
sub    $0xffffffff,%eax
jne    113a <bar+0x3a>
jmp    112e <bar+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1141 <bar+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0xffffffff,%edi
sete   %al
cmp    $0x80000000,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 -1, label %5
i32 -2147483648, label %5
]
5: ; preds = %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = icmp eq i32 %0, -2147483648
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
m_sdiv() {
  ol("XCHG AX,BX");
  ol("CWD");
  ol("IDIV BX");
  ol("MOV  BX,DX");
}


x86 assembly (clang, -O0):
<m_sdiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
lea    0xee0(%rip),%rdi
call   1030 <ol@plt>
lea    0xed8(%rip),%rdi
call   1030 <ol@plt>
lea    0xed4(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_sdiv>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ol@plt>
lea    0xee7(%rip),%rdi
call   1030 <ol@plt>
lea    0xedf(%rip),%rdi
call   1030 <ol@plt>
lea    0xedb(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"XCHG AX,BX\00"
@.str.1 = [4 x i8] c"CWD\00"
@.str.2 = [8 x i8] c"IDIV BX\00"
@.str.3 = [11 x i8] c"MOV BX,DX\00"
define i32 @m_sdiv() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"XCHG AX,BX\00"
@.str.1 = [4 x i8] c"CWD\00"
@.str.2 = [8 x i8] c"IDIV BX\00"
@.str.3 = [11 x i8] c"MOV BX,DX\00"
define i32 @m_sdiv() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
ret i32 undef
}
void thFreeTls(int idx) {}


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

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

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

LLVM IR (-O2):
define void @thFreeTls(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char);
void printf(char *text) {
  int i = 0;
  while (((*text) != 0)) {
    print((*text));
  }
}


x86 assembly (clang, -O0):
<printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1144 <printf+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <print@plt>
jmp    1123 <printf+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     112f <printf+0x1f>
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <print@plt>
movzbl (%rbx),%eax
test   %al,%al
jne    1120 <printf+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printf(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @print(i8 signext %5)
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_ret(char *, char *, int);
int epoll_create(int);
int epoller_create() {
  int epoll_fd;
  epoll_fd = epoll_create(32000);
  if (epoll_fd == -1) {
    debug_ret("file: %s, line: %d",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/oyld/tinyframe/refs/heads/master/src/"
              "epoll.c",
              104);
    return -1;
  }
  return epoll_fd;
}


x86 assembly (clang, -O0):
<epoller_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7d00,%edi
call   1040 <epoll_create@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1163 <epoller_create+0x43>
lea    0xeba(%rip),%rdi
lea    0xec6(%rip),%rsi
mov    $0x68,%edx
call   1030 <debug_ret@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <epoller_create+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoller_create>:
push   %rbx
mov    $0x7d00,%edi
call   1040 <epoll_create@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    114a <epoller_create+0x2a>
lea    0xec7(%rip),%rdi
lea    0xed3(%rip),%rsi
mov    $0x68,%edx
call   1030 <debug_ret@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"file: %s, line: %d\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/oyld/tinyframe/refs/heads/master/src/epoll.c\00"
define i32 @epoller_create() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @epoll_create(i32 32000)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @debug_ret(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 104)
store i32 -1, i32* %1
br label %10
8: ; preds = %0
%9 = load i32, i32* %2
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [19 x i8] c"file: %s, line: %d\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/oyld/tinyframe/refs/heads/master/src/epoll.c\00"
define i32 @epoller_create() {
%1 = tail call i32 @epoll_create(i32 32000)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @debug_ret(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 104)
br label %5
5: ; preds = %0, %3
ret i32 %1
}
/* Variables and functions */
double pow(double, double);
double stdpow_(double *x, double *y) { return pow(*x, *y); }


x86 assembly (clang, -O0):
<stdpow_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdpow_>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @stdpow_(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 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = call double @pow(double %6, double %8)
ret double %9
}

LLVM IR (-O2):
define double @stdpow_(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call double @pow(double %3, double %4)
ret double %5
}
int test_imm_FBuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xFB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FBuint64_highword_mem>:
testb  $0xfb,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FBuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1078036791296
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main() {
  int a, b, c, d;
  d = 10;
  if (c > d) {
    a = 3;
    b = 2;
  } else {
    a = 2;
    b = 3;
  }
  c = a + b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1131 <main+0x31>
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
jmp    113f <main+0x3f>
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
signed long v_signed_long_func() { return (0); }


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

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

LLVM IR (-O0):
define i64 @v_signed_long_func() {
ret i64 0
}

LLVM IR (-O2):
define i64 @v_signed_long_func() {
ret i64 0
}
/* Variables and functions */
char *scan_keys();
long strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
long scan_long(void) {
  char *text;
  register long result;
  text = scan_keys();
  result = strtol(text, NULL, 0);
  return (result);
}


x86 assembly (clang, -O0):
<scan_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <scan_keys@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_long>:
push   %rax
xor    %eax,%eax
call   1030 <scan_keys@plt>
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <strtol@plt>

LLVM IR (-O0):
define i64 @scan_long() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i8* (...) @scan_keys()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @strtol(i8* %4, i32* null, i32 0)
store i64 %5, i64* %2
%6 = load i64, i64* %2
ret i64 %6
}

LLVM IR (-O2):
define i64 @scan_long() {
%1 = tail call i8* (...) @scan_keys()
%2 = tail call i64 @strtol(i8* nocapture %1, i32* null, i32 0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This is a program with a ");
  printf("problem");
  return 0;
}


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>
lea    0xee8(%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
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"This is a program with a \00"
@.str.1 = [8 x i8] c"problem\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"This is a program with a \00"
@.str.1 = [8 x i8] c"problem\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *itoca(int);
int /*<<< orphan*/ terminal_writestring(char *);
void kpi(int n) {
  char *p = itoca(n);
  terminal_writestring(p);
}


x86 assembly (clang, -O0):
<kpi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <itoca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <terminal_writestring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kpi>:
push   %rax
call   1040 <itoca@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <terminal_writestring@plt>

LLVM IR (-O0):
define void @kpi(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @itoca(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @terminal_writestring(i8* %6)
ret void
}

LLVM IR (-O2):
define void @kpi(i32 %0) {
%2 = tail call i8* @itoca(i32 %0)
%3 = tail call i32 @terminal_writestring(i8* %2)
ret void
}
int semiCoveredFunction(int i) {
  if (i == 123456)
    i -= 1;
  return i;
}


x86 assembly (clang, -O0):
<semiCoveredFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1e240,-0x4(%rbp)
jne    111d <semiCoveredFunction+0x1d>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<semiCoveredFunction>:
cmp    $0x1e240,%edi
mov    $0x1e23f,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @semiCoveredFunction(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 123456
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @semiCoveredFunction(i32 %0) {
%2 = icmp eq i32 %0, 123456
%3 = select i1 %2, i32 123455, i32 %0
ret i32 %3
}