xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/ *);
void do_shell(void) {
  char *argz[2];
  argz[0] = "sh";
  argz[1] = NULL;
  execve("/bin/sh", argz, NULL);
}


x86 assembly (clang, -O0):
<do_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee6(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xeca(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execve@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_shell>:
sub    $0x18,%rsp
lea    0xeea(%rip),%rax
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xed1(%rip),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <execve@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"sh\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define void @do_shell() {
%1 = alloca [2 x i8*]
%2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%5 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %4, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"sh\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define void @do_shell() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %3, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, char *);
int error_handle(char *error, int error_code, int critical) {
  printf("Error %d: %s\n", error_code, error);
  if (critical)
    exit(error_code);
  return error_code;
}


x86 assembly (clang, -O0):
<error_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x10(%rbp)
je     1157 <error_handle+0x37>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_handle>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%rdx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
test   %ebp,%ebp
jne    1143 <error_handle+0x23>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"Error %d: %s\0A\00"
define i32 @error_handle(i8* %0, i32 returned %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%5 = icmp eq i32 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @exit(i32 %1)
unreachable
8: ; preds = %3
ret i32 %1
}
int ast_hashtab_hash_string_sax(const void *obj, int modulus) {
  unsigned char *str = (unsigned char *)obj;
  unsigned int total = 0, c = 0;
  while ((c = *str++))
    total ^= (total << 5) + (total >> 2) + (total << 10) + c;
  return (total % modulus);
}


x86 assembly (clang, -O0):
<ast_hashtab_hash_string_sax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
je     1163 <ast_hashtab_hash_string_sax+0x63>
mov    -0x1c(%rbp),%eax
shl    $0x5,%eax
mov    -0x1c(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
mov    -0x1c(%rbp),%ecx
shl    $0xa,%ecx
add    %ecx,%eax
add    -0x20(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1121 <ast_hashtab_hash_string_sax+0x21>
mov    -0x1c(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ast_hashtab_hash_string_sax>:
mov    (%rdi),%cl
test   %cl,%cl
je     1133 <ast_hashtab_hash_string_sax+0x33>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%r8d
mov    %eax,%edx
shr    $0x2,%edx
imul   $0x420,%eax,%ecx
add    %edx,%ecx
add    %r8d,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ast_hashtab_hash_string_sax+0x10>
jmp    1135 <ast_hashtab_hash_string_sax+0x35>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ast_hashtab_hash_string_sax(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %16, %5 ], [ %3, %2 ]
%7 = phi i32 [ %15, %5 ], [ 0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = zext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = lshr i32 %7, 2
%12 = mul i32 %7, 1056
%13 = add i32 %12, %11
%14 = add i32 %13, %9
%15 = xor i32 %14, %7
%16 = load i8, i8* %10
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %5, %2
%19 = phi i32 [ 0, %2 ], [ %15, %5 ]
%20 = urem i32 %19, %1
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f(int);
int main(void) {
  if (sizeof(short) < 2 || sizeof(short) >= sizeof(int))
    exit(0);
  if (f(-32767) != 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffff8001,%edi
call   1040 <f@plt>
cmp    $0x1,%eax
je     1159 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffff8001,%edi
call   1040 <f@plt>
cmp    $0x1,%eax
jne    1147 <main+0x17>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 -32767)
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
int binToDec(int x) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @binToDec(i32 %0) {
ret i32 -1
}
void gquad_count_layers(int i, int L, int *l, void *data, void *NA, void *NA2,
                        void *NA3) {
  *((int *)data) += L;
}


x86 assembly (clang, -O0):
<gquad_count_layers>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gquad_count_layers>:
add    %esi,(%rcx)
ret

LLVM IR (-O0):
define void @gquad_count_layers(i32 %0, i32 %1, i32* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32* %2, i32** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%15 = load i32, i32* %9
%16 = load i8*, i8** %11
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %17
%19 = add nsw i32 %18, %15
store i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @gquad_count_layers(i32 %0, i32 %1, i32* nocapture readnone %2, i8* nocapture %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8* nocapture readnone %6) {
%8 = bitcast i8* %3 to i32*
%9 = load i32, i32* %8
%10 = add nsw i32 %9, %1
store i32 %10, i32* %8
ret void
}
void TransposeUVWxH_C() {}


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

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

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

LLVM IR (-O2):
define void @TransposeUVWxH_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_openfile(int /*<<< orphan*/);
void fgmvwrite_openfile_(char *filnam) {
  gmvwrite_openfile(fortchartoc(filnam));
}


x86 assembly (clang, -O0):
<fgmvwrite_openfile_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fortchartoc@plt>
mov    %eax,%edi
call   1040 <gmvwrite_openfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_openfile_>:
push   %rax
call   1030 <fortchartoc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <gmvwrite_openfile@plt>

LLVM IR (-O0):
define void @fgmvwrite_openfile_(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fortchartoc(i8* %3)
%5 = call i32 @gmvwrite_openfile(i32 %4)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_openfile_(i8* %0) {
%2 = tail call i32 @fortchartoc(i8* %0)
%3 = tail call i32 @gmvwrite_openfile(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x23() {
  Assert_real((isbdigit(35) == 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_isbdigit.c",
              180, ("isbdigit should be 0 for #"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x23>:
push   %rax
mov    $0x23,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xb4,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for #\00"
define void @t_isbdigit_0x23() {
%1 = call i64 @isbdigit(i32 35)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for #\00"
define void @t_isbdigit_0x23() {
%1 = tail call i64 @isbdigit(i32 35)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int minimum(int a, int b, int c) {
  int min = a;
  if (b < min)
    min = b;
  if (c < min)
    min = c;
  return (min);
}


x86 assembly (clang, -O0):
<minimum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1125 <minimum+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1137 <minimum+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum>:
mov    %edi,%eax
cmp    %edi,%esi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @minimum(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ read_ensemble_from_file(char *);
void load_ensemble(char *filename) { read_ensemble_from_file(filename); }


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

x86 assembly (clang, -O2):
<load_ensemble>:
jmp    1030 <read_ensemble_from_file@plt>

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

LLVM IR (-O2):
define void @load_ensemble(i8* %0) {
%2 = tail call i32 @read_ensemble_from_file(i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
void *get_XEnterWindowEvent_display(void *_p) {
  return (void *)((XEnterWindowEvent *)_p)->display;
}


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

x86 assembly (clang, -O2):
<get_XEnterWindowEvent_display>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @get_XEnterWindowEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int const);
void decode_none(const unsigned char *ciphertext, const int ciphertext_length,
                 const unsigned char *key, const int key_length,
                 unsigned char *plaintext) {
  0;
  memcpy(plaintext, ciphertext, ciphertext_length);
}


x86 assembly (clang, -O0):
<decode_none>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_none>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    %r8,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @decode_none(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %10
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 @memcpy(i8* %11, i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @decode_none(i8* %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* %4) {
%6 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deleteHashTables();
int /*<<< orphan*/ deleteObjects();
void project_close() {
  deleteObjects();
  deleteHashTables();
}


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

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

LLVM IR (-O0):
define void @project_close() {
%1 = call i32 (...) @deleteObjects()
%2 = call i32 (...) @deleteHashTables()
ret void
}

LLVM IR (-O2):
define void @project_close() {
%1 = tail call i32 (...) @deleteObjects()
%2 = tail call i32 (...) @deleteHashTables()
ret void
}
/* Type definitions */
struct rbtree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rbtree *);
scalar_t__ get_rbt_size(struct rbtree *);
int free_rbtree(struct rbtree *rbt) {
  if (get_rbt_size(rbt) > 0)
    return -1;
  free(rbt);
  return 0;
}


x86 assembly (clang, -O0):
<free_rbtree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <get_rbt_size@plt>
cmp    $0x0,%rax
jle    114b <free_rbtree+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <free_rbtree+0x3b>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_rbtree>:
push   %rbx
mov    %rdi,%rbx
call   1040 <get_rbt_size@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jle    1138 <free_rbtree+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.rbtree = type { i32 }
define i32 @free_rbtree(%struct.rbtree* %0) {
%2 = alloca i32
%3 = alloca %struct.rbtree*
store %struct.rbtree* %0, %struct.rbtree** %3
%4 = load %struct.rbtree*, %struct.rbtree** %3
%5 = call i64 @get_rbt_size(%struct.rbtree* %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %11
8: ; preds = %1
%9 = load %struct.rbtree*, %struct.rbtree** %3
%10 = call i32 @free(%struct.rbtree* %9)
store i32 0, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.rbtree = type { i32 }
define i32 @free_rbtree(%struct.rbtree* %0) {
%2 = tail call i64 @get_rbt_size(%struct.rbtree* %0)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(%struct.rbtree* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
int getMin(int x, int y, int z) {
  if (x < y) {
    if (x < z)
      return x;
    else
      return z;
  } else {
    if (y < z)
      return y;
    else
      return z;
  }
}


x86 assembly (clang, -O0):
<getMin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <getMin+0x3b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1130 <getMin+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <getMin+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <getMin+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1152 <getMin+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <getMin+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMin>:
mov    %edx,%eax
cmp    %edx,%edi
cmovl  %edi,%eax
cmp    %esi,%eax
cmovge %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @getMin(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp slt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
/* Type definitions */
struct rlimit {
  scalar_t__ rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_CORE;
scalar_t__ getrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ setrlimit(int /*<<< orphan*/, struct rlimit *);
void test_disable_coredumps(void) {
  struct rlimit r;
  if (getrlimit(RLIMIT_CORE, &r) == 0) {
    r.rlim_cur = 0;
    setrlimit(RLIMIT_CORE, &r);
  }
}


x86 assembly (clang, -O0):
<test_disable_coredumps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1040 <getrlimit@plt>
cmp    $0x0,%rax
jne    115e <test_disable_coredumps+0x3e>
movq   $0x0,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <setrlimit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_disable_coredumps>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rbx
mov    (%rbx),%edi
lea    0x8(%rsp),%rsi
call   1040 <getrlimit@plt>
test   %rax,%rax
jne    1152 <test_disable_coredumps+0x32>
movq   $0x0,0x8(%rsp)
mov    (%rbx),%edi
lea    0x8(%rsp),%rsi
call   1030 <setrlimit@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.rlimit = type { i64 }
@RLIMIT_CORE = global i32 0
define void @test_disable_coredumps() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_CORE
%3 = call i64 @getrlimit(i32 %2, %struct.rlimit* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
store i64 0, i64* %6
%7 = load i32, i32* @RLIMIT_CORE
%8 = call i32 @setrlimit(i32 %7, %struct.rlimit* %1)
br label %9
9: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i64 }
@RLIMIT_CORE = global i32 0
define void @test_disable_coredumps() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_CORE
%4 = call i64 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
store i64 0, i64* %7
%8 = load i32, i32* @RLIMIT_CORE
%9 = call i32 @setrlimit(i32 %8, %struct.rlimit* %1)
br label %10
10: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main(void) {
  int a;
  if (a != -1) {
    int s = a + 1;
    assert(s != 0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1143 <main+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
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
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
br label %13
13: ; preds = %6, %0
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int sum_func(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<sum_func>:
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):
<sum_func>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @sum_func(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 @sum_func(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int test_imm_07int32_mem(int *val) {
  return ((*val) & (0x07 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_07int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 7
%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_07int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 7
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void expires_startup(void) {}


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

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

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

LLVM IR (-O2):
define void @expires_startup() {
ret void
}
/* Variables and functions */
size_t strcspn(char const *, char *);
const char *path_next_sep(const char *path) {
  size_t skip;
  skip = strcspn(path, "/");
  return *(path + skip) ? path + skip : NULL;
}


x86 assembly (clang, -O0):
<path_next_sep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1156 <path_next_sep+0x46>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1161 <path_next_sep+0x51>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1161 <path_next_sep+0x51>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_next_sep>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcspn@plt>
lea    (%rbx,%rax,1),%rdx
xor    %ecx,%ecx
cmpb   $0x0,(%rbx,%rax,1)
cmovne %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @path_next_sep(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strcspn(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = load i64, i64* %3
%15 = getelementptr inbounds i8, i8* %13, i64 %14
br label %17
16: ; preds = %1
br label %17
17: ; preds = %16, %12
%18 = phi i8* [ %15, %12 ], [ null, %16 ]
ret i8* %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @path_next_sep(i8* %0) {
%2 = tail call i64 @strcspn(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = select i1 %5, i8* null, i8* %3
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int write(int, int /*<<< orphan*/ *, int);
void myWrite(int fd, uint8_t *data, int size) {
  if (write(fd, data, size) < size) {
    perror("write()");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<myWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
jge    116d <myWrite+0x3d>
lea    0xe9f(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myWrite>:
push   %rbx
mov    %edx,%ebx
call   1030 <write@plt>
cmp    %ebx,%eax
jl     113e <myWrite+0xe>
pop    %rbx
ret
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"write()\00"
define void @myWrite(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 @write(i32 %7, i32* %8, i32 %9)
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 0)
unreachable
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"write()\00"
define void @myWrite(i32 %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i32* %1, i32 %2)
%5 = icmp slt i32 %4, %2
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf("Usage: tst_usleep interval[s|ms|us]\n\n");
  printf("       If no unit is specified the interval is in seconds\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: tst_usleep interval[s|ms|us]\0A\0A\00"
@.str.1 = [59 x i8] c" If no unit is specified the interval is in seconds\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Usage: tst_usleep interval[s|ms|us]\0A\00"
@str.2 = [58 x i8] c" If no unit is specified the interval is in seconds\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.2, i64 0, i64 0))
ret void
}
void respond(ack, option) int ack, option;
{
  unsigned char c[3];
  c[0] = 255;
  c[1] = ack;
  c[2] = option;
}


x86 assembly (clang, -O0):
<respond>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movb   $0xff,-0xb(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @respond(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [3 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
store i8 -1, i8* %6
%7 = load i32, i32* %3
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 %8, i8* %9
%10 = load i32, i32* %4
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 2
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @respond(i32 %0, i32 %1) {
ret void
}
int test_imm_B9int16_mem(short *val) {
  return ((*val) & (0xB9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B9int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 185
%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_B9int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 185
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_F4uint16_mem(unsigned short *val) {
  return ((*val) & (0xF4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F4uint16_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, 244
%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_F4uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 244
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int, char *);
void listenner(int cid, char *from, int from_size, int *port, char *buffer,
               unsigned int buffer_size_returned) {
  printf("<%s[%d]:%d>%s\n", from, *port, cid, buffer);
}


x86 assembly (clang, -O0):
<listenner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
mov    -0x4(%rbp),%ecx
mov    -0x28(%rbp),%r8
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listenner>:
mov    %edi,%eax
mov    (%rcx),%edx
lea    0xee5(%rip),%rdi
mov    %eax,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"<%s[%d]:%d>%s\0A\00"
define void @listenner(i32 %0, i8* %1, i32 %2, i32* %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i8*, i8** %8
%14 = load i32*, i32** %10
%15 = load i32, i32* %14
%16 = load i32, i32* %7
%17 = load i8*, i8** %11
%18 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %15, i32 %16, i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"<%s[%d]:%d>%s\0A\00"
define void @listenner(i32 %0, i8* %1, i32 %2, i32* nocapture %3, i8* %4, i32 %5) {
%7 = load i32, i32* %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %7, i32 %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f1(void) { printf("the first exit handler\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"the first exit handler\0A\00"
define void @f1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"the first exit handler\00"
define void @f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
int twist_r_on_cornerperm(cperm)
int cperm;
{
  int temp_arr[8];
  cornerperm_unpack(cperm, temp_arr);
  four_cycle(temp_arr, 4, 7, 1, 0);
  return cornerperm_pack(temp_arr);
}


x86 assembly (clang, -O0):
<twist_r_on_cornerperm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <cornerperm_unpack@plt>
lea    -0x30(%rbp),%rdi
mov    $0x4,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x0,%al
call   1030 <four_cycle@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1050 <cornerperm_pack@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twist_r_on_cornerperm>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <cornerperm_unpack@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <cornerperm_pack@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @twist_r_on_cornerperm(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @cornerperm_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 4, i32 7, i32 1, i32 0)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @cornerperm_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @twist_r_on_cornerperm(i32 %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @cornerperm_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 4, i32 7, i32 1, i32 0)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @cornerperm_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
void nseel_asm_booltofp_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_booltofp_end() {
ret void
}
long long __attribute__((no)) foo(unsigned short s) { return (short)s; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswq -0x2(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movswq %di,%rax
ret

LLVM IR (-O0):
define i64 @foo(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @foo(i16 zeroext %0) {
%2 = sext i16 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  system("chroot /workspace/vagrant/vag0/_install /bin/ash");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"chroot /workspace/vagrant/vag0/_install /bin/ash\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @system(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"chroot /workspace/vagrant/vag0/_install /bin/ash\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
reg0adr1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (r0 <= (*((int *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx),%eax
jg     1134 <reg0adr1+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <reg0adr1+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0adr1>:
xor    %eax,%eax
cmp    %edi,0xa98ac7
setge  %al
ret

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

LLVM IR (-O2):
define i32 @reg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = load i32, i32* inttoptr (i64 11111111 to i32*)
%8 = icmp sge i32 %7, %0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
struct sio_rpc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sio_rpc *);
void sio_rpc_free(struct sio_rpc *rpc) { free(rpc); }


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

x86 assembly (clang, -O2):
<sio_rpc_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.sio_rpc = type { i32 }
define void @sio_rpc_free(%struct.sio_rpc* nocapture %0) {
%2 = tail call i32 @free(%struct.sio_rpc* %0)
ret void
}
int divs100(long n) {
  return (n / 100);
  long q, r;
  n = n + (n >> 31 & 99);
  q = (n >> 1) + (n >> 3) + (n >> 6) - (n >> 10) + (n >> 12) + (n >> 13) -
      (n >> 16);
  q = q + (q >> 20);
  q = q >> 6;
  r = n - q * 100;
  return q + ((r + 28) >> 7);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
movabs $0xa3d70a3d70a3d70b,%rcx
0a d7 a3
mov    %rdi,%rax
imul   %rcx
lea    (%rdx,%rdi,1),%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x6,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @divs100(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = sdiv i64 %5, 100
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @divs100(i64 %0) {
%2 = sdiv i64 %0, 100
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int dix_main(int, char **, char **);
int main(int argc, char *argv[], char *envp[]) {
  return dix_main(argc, argv, envp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <dix_main@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <dix_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @dix_main(i32 %0, i8** %1, i8** %2)
ret i32 %4
}
int btic4b_subfold(int a, int b) {
  int c;
  c = a - b;
  c = (c << 1) ^ (c >> 31);
  return (c);
}


x86 assembly (clang, -O0):
<btic4b_subfold>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btic4b_subfold>:
sub    %esi,%edi
lea    (%rdi,%rdi,1),%eax
sar    $0x1f,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @btic4b_subfold(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = shl i32 %9, 1
%11 = load i32, i32* %5
%12 = ashr i32 %11, 31
%13 = xor i32 %10, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @btic4b_subfold(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = shl i32 %3, 1
%5 = ashr i32 %3, 31
%6 = xor i32 %4, %5
ret i32 %6
}