xunge/DecIR huggingface dataset:
void rop3_49_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D & stk3;
  stk1 = S | stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_49_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_49_0_0>:
not    %dl
and    (%rdi),%dl
or     %sil,%dl
not    %dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_49_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = load i8*, i8** %4
store i8 %31, i8* %32
ret void
}

LLVM IR (-O2):
define void @rop3_49_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = or i8 %6, %1
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cache_print(void) { printf("Library cache disabled\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Library cache disabled\0A\00"
define void @cache_print() {
%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"Library cache disabled\00"
define void @cache_print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void timer_function(void *data) { printf("timer %p\n", data); }


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

x86 assembly (clang, -O2):
<timer_function>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"timer %p\0A\00"
define void @timer_function(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct tgdb_command {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tgdb_command *);
void tgdb_command_destroy(void *item) {
  struct tgdb_command *tc = (struct tgdb_command *)item;
  free(tc);
  tc = NULL;
}


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

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

LLVM IR (-O0):
%struct.tgdb_command = type { i32 }
define void @tgdb_command_destroy(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.tgdb_command*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.tgdb_command*
store %struct.tgdb_command* %5, %struct.tgdb_command** %3
%6 = load %struct.tgdb_command*, %struct.tgdb_command** %3
%7 = call i32 @free(%struct.tgdb_command* %6)
store %struct.tgdb_command* null, %struct.tgdb_command** %3
ret void
}

LLVM IR (-O2):
%struct.tgdb_command = type { i32 }
define void @tgdb_command_destroy(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.tgdb_command*
%3 = tail call i32 @free(%struct.tgdb_command* %2)
ret void
}
int maggie_error(const char *format, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @maggie_error(i8* nocapture readnone %0, ...) {
ret i32 0
}
void set(int *p, int value) { *p = value; }


x86 assembly (clang, -O0):
<set>:
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>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
/* Variables and functions */
unsigned int rand();
unsigned int genOddNum(unsigned int limit) {
  unsigned int output = (rand() % (limit >= 3 ? limit : 500));
  if (output < 3)
    output += 3;
  return output % 2 ? output : ++output;
}


x86 assembly (clang, -O0):
<genOddNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x3,-0x4(%rbp)
jb     113a <genOddNum+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <genOddNum+0x37>
mov    $0x1f4,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <genOddNum+0x37>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jae    1167 <genOddNum+0x57>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1181 <genOddNum+0x71>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    118d <genOddNum+0x7d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genOddNum>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cmp    $0x3,%ebx
mov    $0x1f4,%ecx
cmovae %ebx,%ecx
xor    %edx,%edx
div    %ecx
lea    0x3(%rdx),%ecx
cmp    $0x3,%edx
cmovae %edx,%ecx
mov    %ecx,%eax
not    %eax
and    $0x1,%eax
add    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @genOddNum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @rand()
%5 = load i32, i32* %2
%6 = icmp uge i32 %5, 3
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %7
%11 = phi i32 [ %8, %7 ], [ 500, %9 ]
%12 = urem i32 %4, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = icmp ult i32 %13, 3
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* %3
%17 = add i32 %16, 3
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %10
%19 = load i32, i32* %3
%20 = urem i32 %19, 2
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = load i32, i32* %3
br label %27
24: ; preds = %18
%25 = load i32, i32* %3
%26 = add i32 %25, 1
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %22
%28 = phi i32 [ %23, %22 ], [ %26, %24 ]
ret i32 %28
}

LLVM IR (-O2):
define i32 @genOddNum(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = icmp ugt i32 %0, 2
%4 = select i1 %3, i32 %0, i32 500
%5 = urem i32 %2, %4
%6 = icmp ult i32 %5, 3
%7 = add i32 %5, 3
%8 = select i1 %6, i32 %7, i32 %5
%9 = and i32 %8, 1
%10 = xor i32 %9, 1
%11 = add nuw i32 %10, %8
ret i32 %11
}
dtterm(argc, argv) int argc;
char *argv[];
{ main(argc, argv); }


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

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

LLVM IR (-O0):
define i32 @dtterm(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @main to i32 (i32, i8**, ...)*)(i32 %6, i8** %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @dtterm(i32 %0, i8** %1) {
%3 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @main to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xc5() {
  Assert_real((isxdigit(197) == 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_isxdigit.c",
              990, ("isxdigit should be 0 for 0xc5"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xc5>:
push   %rax
mov    $0xc5,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3de,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xc5\00"
define void @t_isxdigit_0xc5() {
%1 = call i64 @isxdigit(i32 197)
%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 990, i8* getelementptr inbounds ([30 x i8], [30 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xc5\00"
define void @t_isxdigit_0xc5() {
%1 = tail call i64 @isxdigit(i32 197)
%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 990, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int nl();
int wrap_nl(void) { return nl(); }


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

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

LLVM IR (-O0):
define i32 @wrap_nl() {
%1 = call i32 (...) @nl()
ret i32 %1
}

LLVM IR (-O2):
define i32 @wrap_nl() {
%1 = tail call i32 (...) @nl()
ret i32 %1
}
int verificaJogadaValida(int tab[3][3], int pos) {
  int x = pos / 3, y = pos % 3;
  if (tab[x][y] == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<verificaJogadaValida>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1150 <verificaJogadaValida+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1157 <verificaJogadaValida+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verificaJogadaValida>:
movslq %esi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
sub    %edx,%eax
movslq %ecx,%rcx
movslq %eax,%rdx
lea    (%rcx,%rcx,2),%rax
lea    (%rdi,%rax,4),%rcx
xor    %eax,%eax
cmpl   $0x0,(%rcx,%rdx,4)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @verificaJogadaValida([3 x i32]* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 3
%4 = srem i32 %1, 3
%5 = sext i32 %3 to i64
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 %5, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
void I444ToARGBRow_C() {}


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

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

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

LLVM IR (-O2):
define void @I444ToARGBRow_C() {
ret void
}
/* Variables and functions */
int stub1();
int testClosureVrI(int (*closure)(void)) {
  return closure != NULL ? (*closure)() : (int)0;
}


x86 assembly (clang, -O0):
<testClosureVrI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <testClosureVrI+0x22>
call   *-0x8(%rbp)
mov    %eax,-0xc(%rbp)
jmp    112c <testClosureVrI+0x2c>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <testClosureVrI+0x2c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrI>:
test   %rdi,%rdi
je     1107 <testClosureVrI+0x7>
jmp    *%rdi
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @testClosureVrI(i32 ()* %0) {
%2 = alloca i32 ()*
store i32 ()* %0, i32 ()** %2
%3 = load i32 ()*, i32 ()** %2
%4 = icmp ne i32 ()* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32 ()*, i32 ()** %2
%7 = call i32 %6()
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @testClosureVrI(i32 ()* %0) {
%2 = icmp eq i32 ()* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 %0()
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ enprintf(int, char *);
void *encalloc(int status, size_t nmemb, size_t size) {
  void *p;
  p = calloc(nmemb, size);
  if (!p)
    enprintf(status, "calloc: out of memory\n");
  return p;
}


x86 assembly (clang, -O0):
<encalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115e <encalloc+0x3e>
mov    -0x4(%rbp),%edi
lea    0xea7(%rip),%rsi
call   1040 <enprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <encalloc+0x26>
lea    0xec1(%rip),%rsi
mov    %ebp,%edi
call   1040 <enprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"calloc: out of memory\0A\00"
define noalias i8* @encalloc(i32 %0, i64 %1, i64 %2) {
%4 = tail call i8* @calloc(i64 %1, i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @enprintf(i32 %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i8* %4
}
int Degree(unsigned a[]) {
  int i = 500 - 1;
  while (i > 0 && a[i] == 0)
    i--;
  return i;
}


x86 assembly (clang, -O0):
<Degree>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1f3,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    1130 <Degree+0x30>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <Degree+0x40>
jmp    114e <Degree+0x4e>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <Degree+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Degree>:
mov    $0x1f0,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x3(%rcx),%eax
cmpl   $0x0,(%rdi,%rax,4)
jne    113f <Degree+0x3f>
lea    0x2(%rcx),%eax
cmpl   $0x0,(%rdi,%rax,4)
jne    113f <Degree+0x3f>
lea    0x1(%rcx),%eax
cmpl   $0x0,(%rdi,%rax,4)
jne    113f <Degree+0x3f>
cmp    $0x2,%eax
jb     113d <Degree+0x3d>
mov    %ecx,%eax
cmpl   $0x0,(%rdi,%rax,4)
jne    1140 <Degree+0x40>
add    $0xfffffffc,%ecx
jmp    1110 <Degree+0x10>
xor    %eax,%eax
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Degree(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 499, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %7, %4
%15 = phi i1 [ false, %4 ], [ %13, %7 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
br label %4
19: ; preds = %14
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @Degree(i32* nocapture %0) {
br label %2
2: ; preds = %28, %1
%3 = phi i32 [ 499, %1 ], [ %29, %28 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %30
8: ; preds = %2
%9 = add nsw i32 %3, -1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %30
14: ; preds = %8
%15 = add nsw i32 %3, -2
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %14
%21 = add nsw i32 %3, -3
%22 = icmp ugt i32 %15, 1
br i1 %22, label %23, label %30
23: ; preds = %20
%24 = zext i32 %21 to i64
%25 = getelementptr inbounds i32, i32* %0, i64 %24
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = add nsw i32 %3, -4
br label %2
30: ; preds = %23, %20, %14, %8, %2
%31 = phi i32 [ %3, %2 ], [ %9, %8 ], [ %15, %14 ], [ 0, %20 ], [ %21, %23 ]
ret i32 %31
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void soundSetEffect(uint32_t effect) {}


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

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

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

LLVM IR (-O2):
define void @soundSetEffect(i32 %0) {
ret void
}
void write_int(unsigned char *data, int offset, int value) {
  data[offset] = value >> 24;
  data[offset + 1] = value >> 16;
  data[offset + 2] = value >> 8;
  data[offset + 3] = value;
}


x86 assembly (clang, -O0):
<write_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x18,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int>:
movslq %esi,%rax
bswap  %edx
mov    %edx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @write_int(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* %6
%8 = ashr i32 %7, 24
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 %9, i8* %13
%14 = load i32, i32* %6
%15 = ashr i32 %14, 16
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %17, i64 %20
store i8 %16, i8* %21
%22 = load i32, i32* %6
%23 = ashr i32 %22, 8
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %4
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 2
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %25, i64 %28
store i8 %24, i8* %29
%30 = load i32, i32* %6
%31 = trunc i32 %30 to i8
%32 = load i8*, i8** %4
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %32, i64 %35
store i8 %31, i8* %36
ret void
}

LLVM IR (-O2):
define void @write_int(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = lshr i32 %2, 24
%5 = trunc i32 %4 to i8
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %5, i8* %7
%8 = lshr i32 %2, 16
%9 = trunc i32 %8 to i8
%10 = add nsw i32 %1, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 %9, i8* %12
%13 = lshr i32 %2, 8
%14 = trunc i32 %13 to i8
%15 = add nsw i32 %1, 2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 %14, i8* %17
%18 = trunc i32 %2 to i8
%19 = add nsw i32 %1, 3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %0, i64 %20
store i8 %18, i8* %21
ret void
}
/* Variables and functions */
scalar_t__ sqrt(float const);
float vlength(const float *v) {
  return (float)sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}


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

x86 assembly (clang, -O2):
<vlength>:
push   %rax
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @vlength(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
%24 = call i64 @sqrt(float %23)
%25 = sitofp i64 %24 to float
ret float %25
}

LLVM IR (-O2):
define float @vlength(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call i64 @sqrt(float %9)
%11 = sitofp i64 %10 to float
ret float %11
}
int ILibGetLocalIPv6List(struct sockaddr_in6 **list) {}


x86 assembly (clang, -O0):
<ILibGetLocalIPv6List>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr_in6 = type opaque
define i32 @ILibGetLocalIPv6List(%struct.sockaddr_in6** %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_in6**
store %struct.sockaddr_in6** %0, %struct.sockaddr_in6*** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type opaque
define i32 @ILibGetLocalIPv6List(%struct.sockaddr_in6** nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ lb_fatal(char *, size_t);
void *malloc(size_t);
void *lb_malloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL)
    lb_fatal("failed to allocate %d bytes of memory\n", size);
  return ptr;
}


x86 assembly (clang, -O0):
<lb_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <lb_malloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <lb_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lb_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <lb_malloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <lb_fatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [39 x i8] c"failed to allocate %d bytes of memory\0A\00"
define i8* @lb_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @lb_fatal(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [39 x i8] c"failed to allocate %d bytes of memory\0A\00"
define noalias i8* @lb_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lb_fatal(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRF5_set(void) { return U_WMRCORENONE_set("U_WMRF5"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRF5\00"
define i8* @U_WMRF5_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRF5\00"
define i8* @U_WMRF5_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
scalar_t__ tcgetattr(int, struct termios *);
int isatty(int fd) {
  struct termios term;
  return tcgetattr(fd, &term) == 0;
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <tcgetattr@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
push   %rax
mov    %rsp,%rsi
call   1030 <tcgetattr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.termios
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @tcgetattr(i32 %4, %struct.termios* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @isatty(i32 %0) {
%2 = alloca %struct.termios
%3 = bitcast %struct.termios* %2 to i8*
%4 = call i64 @tcgetattr(i32 %0, %struct.termios* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned grecs_hash_string(const char *name, unsigned long hashsize) {
  unsigned i;
  for (i = 0; *name; name++) {
    i <<= 1;
    i ^= *(unsigned char *)name;
  }
  return i % hashsize;
}


x86 assembly (clang, -O0):
<grecs_hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <grecs_hash_string+0x47>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <grecs_hash_string+0x13>
mov    -0x14(%rbp),%eax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grecs_hash_string>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1126 <grecs_hash_string+0x26>
add    $0x1,%rdi
nopl   0x0(%rax)
mov    %eax,%edx
add    %eax,%edx
movzbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <grecs_hash_string+0x10>
mov    %eax,%eax
cmp    %rsi,%rax
jb     1131 <grecs_hash_string+0x31>
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @grecs_hash_string(i8* nocapture %0, i64 %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 i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = shl i32 %7, 1
%10 = zext i8 %6 to i32
%11 = xor i32 %9, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = zext i32 %11 to i64
br label %17
17: ; preds = %15, %2
%18 = phi i64 [ 0, %2 ], [ %16, %15 ]
%19 = urem i64 %18, %1
%20 = trunc i64 %19 to i32
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_movx_atDPTR(char *str) {
  sprintf(str, "MOVX  A, @DPTR                  ");
}


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

x86 assembly (clang, -O2):
<sprint_movx_atDPTR>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

LLVM IR (-O0):
@.str = [33 x i8] c"MOVX A, @DPTR \00"
define void @sprint_movx_atDPTR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"MOVX A, @DPTR \00"
define void @sprint_movx_atDPTR(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, void *, int);
void mff_send_time(int fd, float x) { write(fd, (void *)&x, sizeof(float)); }


x86 assembly (clang, -O0):
<mff_send_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mff_send_time>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @mff_send_time(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = bitcast float* %4 to i8*
%7 = call i32 @write(i32 %5, i8* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @mff_send_time(i32 %0, float %1) {
%3 = alloca float
store float %1, float* %3
%4 = bitcast float* %3 to i8*
%5 = call i32 @write(i32 %0, i8* %4, i32 4)
ret void
}
/* Variables and functions */
long long rintf(float);
long long llrintf(float x) { return rintf(x); }


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

x86 assembly (clang, -O2):
<llrintf>:
jmp    1030 <rintf@plt>

LLVM IR (-O0):
define i64 @llrintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @rintf(float %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @llrintf(float %0) {
%2 = tail call i64 @rintf(float %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
void sys_abort(void) {
  printf("Abort called.\n");
  abort();
}


x86 assembly (clang, -O0):
<sys_abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<sys_abort>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Abort called.\0A\00"
define void @sys_abort() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@str = [14 x i8] c"Abort called.\00"
define void @sys_abort() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
char *eembed_ignore_const_s(const char *str) { return (char *)(str); }


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

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

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

LLVM IR (-O2):
define i8* @eembed_ignore_const_s(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(const char *cmdname) {
  printf("Usage: %s [-m] addr value\n", cmdname);
  printf("\t -m : use MMIO instead of port IO\n");
  printf("\t addr,value : in 0xXXXX format\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: %s [-m] addr value\0A\00"
@.str.1 = [36 x i8] c"\09 -m : use MMIO instead of port IO\0A\00"
@.str.2 = [33 x i8] c"\09 addr,value : in 0xXXXX format\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: %s [-m] addr value\0A\00"
@str = [35 x i8] c"\09 -m : use MMIO instead of port IO\00"
@str.3 = [32 x i8] c"\09 addr,value : in 0xXXXX format\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int (*)());
onintr() {
  signal(SIGINT, onintr);
  printf("interrupt\n");
}


x86 assembly (clang, -O0):
<onintr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rsi
call   1040 <signal@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onintr>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rsi
call   1040 <signal@plt>
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [11 x i8] c"interrupt\0A\00"
define i32 @onintr() {
%1 = alloca i32
%2 = load i32, i32* @SIGINT
%3 = call i32 @signal(i32 %2, i32 (...)* bitcast (i32 ()* @onintr to i32 (...)*))
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [10 x i8] c"interrupt\00"
define i32 @onintr() {
%1 = load i32, i32* @SIGINT
%2 = tail call i32 @signal(i32 %1, i32 (...)* bitcast (i32 ()* @onintr to i32 (...)*))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char *generatePasscode(int);
int /*<<< orphan*/ phase(int);
void phase_3() {
  char *pass = generatePasscode(3);
  phase(3);
}


x86 assembly (clang, -O0):
<phase_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <generatePasscode@plt>
mov    %rax,-0x8(%rbp)
mov    $0x3,%edi
call   1040 <phase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phase_3>:
push   %rax
mov    $0x3,%edi
call   1030 <generatePasscode@plt>
mov    $0x3,%edi
pop    %rax
jmp    1040 <phase@plt>

LLVM IR (-O0):
define void @phase_3() {
%1 = alloca i8*
%2 = call i8* @generatePasscode(i32 3)
store i8* %2, i8** %1
%3 = call i32 @phase(i32 3)
ret void
}

LLVM IR (-O2):
define void @phase_3() {
%1 = tail call i8* @generatePasscode(i32 3)
%2 = tail call i32 @phase(i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
char *write_uint32(char *buf, uint32_t val) {
  uint32_t tmp = htonl(val);
  memcpy(buf, &tmp, 4);
  return buf + 4;
}


x86 assembly (clang, -O0):
<write_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_uint32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @write_uint32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @htonl(i32 %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = call i32 @memcpy(i8* %8, i32* %5, i32 4)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 4
ret i8* %11
}

LLVM IR (-O2):
define i8* @write_uint32(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htonl(i32 %1)
store i32 %5, i32* %3
%6 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
%7 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ plus_ten1(int);
int /*<<< orphan*/ plus_ten2(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  a = 5;
  plus_ten1(a);
  printf("a = %d\n", a);
  plus_ten2(&a);
  printf("a = %d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <plus_ten1@plt>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1050 <plus_ten2@plt>
mov    -0x8(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x5,0xc(%rsp)
mov    $0x5,%edi
call   1040 <plus_ten1@plt>
lea    0xeb2(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
call   1050 <plus_ten2@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"a = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = tail call i32 @plus_ten1(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = call i32 @plus_ten2(i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
int constraint_shutdown(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @constraint_shutdown() {
ret i32 0
}

LLVM IR (-O2):
define i32 @constraint_shutdown() {
ret i32 0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ perror(char *);
pid_t fk() {
  pid_t pid = fork();
  if (pid == -1) {
    perror("fork failed");
    exit(1);
  }
  return pid;
}


x86 assembly (clang, -O0):
<fk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1162 <fk+0x32>
lea    0xead(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fk>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
cmp    $0xffffffff,%eax
je     113f <fk+0xf>
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"fork failed\00"
define i32 @fk() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ jdns_free(void *);
void jdns_object_free(void *a) { jdns_free(a); }


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

x86 assembly (clang, -O2):
<jdns_object_free>:
jmp    1030 <jdns_free@plt>

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

LLVM IR (-O2):
define void @jdns_object_free(i8* %0) {
%2 = tail call i32 @jdns_free(i8* %0)
ret void
}