xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_char();
unsigned get_word(void) {
  unsigned w;
  w = get_char() & 0xff;
  w |= (get_char() & 0xff) << 8;
  w |= (get_char() & 0xff) << 16;
  w |= (get_char() & 0xff) << 24;
  return w;
}


x86 assembly (clang, -O0):
<get_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_char@plt>
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_char@plt>
and    $0xff,%eax
shl    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_char@plt>
and    $0xff,%eax
shl    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_char@plt>
and    $0xff,%eax
shl    $0x18,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_word>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <get_char@plt>
movzbl %al,%ebx
xor    %eax,%eax
call   1030 <get_char@plt>
shl    $0x8,%eax
movzwl %ax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <get_char@plt>
movzbl %al,%ebx
shl    $0x10,%ebx
or     %ebp,%ebx
xor    %eax,%eax
call   1030 <get_char@plt>
shl    $0x18,%eax
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_word() {
%1 = alloca i32
%2 = call i32 (...) @get_char()
%3 = and i32 %2, 255
store i32 %3, i32* %1
%4 = call i32 (...) @get_char()
%5 = and i32 %4, 255
%6 = shl i32 %5, 8
%7 = load i32, i32* %1
%8 = or i32 %7, %6
store i32 %8, i32* %1
%9 = call i32 (...) @get_char()
%10 = and i32 %9, 255
%11 = shl i32 %10, 16
%12 = load i32, i32* %1
%13 = or i32 %12, %11
store i32 %13, i32* %1
%14 = call i32 (...) @get_char()
%15 = and i32 %14, 255
%16 = shl i32 %15, 24
%17 = load i32, i32* %1
%18 = or i32 %17, %16
store i32 %18, i32* %1
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_word() {
%1 = tail call i32 (...) @get_char()
%2 = and i32 %1, 255
%3 = tail call i32 (...) @get_char()
%4 = shl i32 %3, 8
%5 = and i32 %4, 65280
%6 = or i32 %5, %2
%7 = tail call i32 (...) @get_char()
%8 = shl i32 %7, 16
%9 = and i32 %8, 16711680
%10 = or i32 %6, %9
%11 = tail call i32 (...) @get_char()
%12 = shl i32 %11, 24
%13 = or i32 %10, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ scanf(char *, long long *);
int main(void) {
  long long valid;
  scanf("%lld", &valid);
  printf("%lld", valid);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rsi
lea    0xebd(%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
lea    0xed4(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintUsage() { printf("usage: wal2arr -w wal -a arr [ -i ident ]\n"); }


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"usage: wal2arr -w wal -a arr [ -i ident ]\0A\00"
define void @PrintUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"usage: wal2arr -w wal -a arr [ -i ident ]\00"
define void @PrintUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(unsigned char);
int isempty(const char *s) {
  while ('\0' != *s) {
    if (!isspace((unsigned char)*s))
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     115f <isempty+0x4f>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114e <isempty+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1166 <isempty+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <isempty+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isempty>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isempty+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <isempty+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isempty+0x20>
jmp    114b <isempty+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isempty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isspace(i8 zeroext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
unsigned short inw_local(int);
unsigned short(inw)(int port) {
  unsigned short tmp;
  {
    tmp = inw_local(port);
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <inw_local@plt>
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
jmp    1030 <inw_local@plt>

LLVM IR (-O0):
define zeroext i16 @inw(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call zeroext i16 @inw_local(i32 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw(i32 %0) {
%2 = tail call zeroext i16 @inw_local(i32 %0)
ret i16 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned int EOF;
int /*<<< orphan*/ error(char *);
int fgetc(int /*<<< orphan*/ *);
unsigned int read_msb_word(FILE *stream) {
  unsigned int c = (fgetc(stream) << 8) + fgetc(stream);
  if (c == EOF)
    error("premature end of file");
  return c;
}


x86 assembly (clang, -O0):
<read_msb_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%eax
jne    116c <read_msb_word+0x4c>
lea    0xe99(%rip),%rdi
call   1040 <error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_msb_word>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    0x2ea5(%rip),%rax
cmp    (%rax),%ebx
jne    1153 <read_msb_word+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <error@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [22 x i8] c"premature end of file\00"
define i32 @read_msb_word(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = call i32 @fgetc(i32* %7)
%9 = add nsw i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [22 x i8] c"premature end of file\00"
define i32 @read_msb_word(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = shl i32 %2, 8
%4 = tail call i32 @fgetc(i32* %0)
%5 = add nsw i32 %3, %4
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret i32 %5
}
/* Type definitions */
struct edo_args_info {
  int dummy;
};

/* Variables and functions */
int edo_cmdline_parser2(int, char **, struct edo_args_info *,
                        int /*<<< orphan*/, int, int);
int edo_cmdline_parser(int argc, char **argv, struct edo_args_info *args_info) {
  return edo_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<edo_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <edo_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edo_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <edo_cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.edo_args_info = type { i32 }
define i32 @edo_cmdline_parser(i32 %0, i8** %1, %struct.edo_args_info* %2) {
%4 = tail call i32 @edo_cmdline_parser2(i32 %0, i8** %1, %struct.edo_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
void EC_GROUP_get_trinomial_basis(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_get_trinomial_basis() {
ret void
}
int test_imm_EDint32_mem(int *val) {
  return ((*val) & (0xED << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EDint32_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, 237
%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_EDint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 237
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ yyerror(char *);
void unterminate_string() { yyerror("Unterminate string constant"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Unterminate string constant\00"
define void @unterminate_string() {
%1 = call i32 @yyerror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Unterminate string constant\00"
define void @unterminate_string() {
%1 = tail call i32 @yyerror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ns2ssq(int);
void ns2ssq_(int *hiq) { ns2ssq(*hiq); }


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

x86 assembly (clang, -O2):
<ns2ssq_>:
mov    (%rdi),%edi
jmp    1030 <ns2ssq@plt>

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

LLVM IR (-O2):
define void @ns2ssq_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ns2ssq(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void smp_rmb(void) { barrier(); }


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

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

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

LLVM IR (-O2):
define void @smp_rmb() {
%1 = tail call i32 (...) @barrier()
ret void
}
/* Variables and functions */
int partitionSort(int *, int, int);
void quickSort(int *arr, int low, int high) {
  if (low < high) {
    int partitionIndex = partitionSort(arr, low, high);
    quickSort(arr, low, partitionIndex - 1);
    quickSort(arr, partitionIndex + 1, high);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partitionSort@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partitionSort@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quickSort(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* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partitionSort(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partitionSort(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void RSA_size(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU0_TGIE0() {
ret void
}
/* Variables and functions */
int bindthread2core(int /*<<< orphan*/, int);
int /*<<< orphan*/ pthread_self();
int bind2core(int core_id) {
  return (bindthread2core(pthread_self(), core_id));
}


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

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

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

LLVM IR (-O2):
define i32 @bind2core(i32 %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @bindthread2core(i32 %2, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello world from QA bundle c!\n");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"Hello world from QA bundle c!\0A\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 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"Hello world from QA bundle c!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int set_value_of_continuation_parameter(int k, double *val) {
  int *b, fail;
  fail = _ada_use_c2phc4c(190, &k, b, val, 0);
  return fail;
}


x86 assembly (clang, -O0):
<set_value_of_continuation_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0xbe,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_value_of_continuation_parameter>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xbe,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @set_value_of_continuation_parameter(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%7 = load i32*, i32** %5
%8 = load double*, double** %4
%9 = call i32 @_ada_use_c2phc4c(i32 190, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %6
%10 = load i32, i32* %6
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_value_of_continuation_parameter(i32 %0, double* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 190, i32* %3, i32* undef, double* %1, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ h(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int b;
  scanf("%d", &b);
  h(b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <h@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @h(i32 %4)
ret i32 0
}
int do_939() { return 939; }


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

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

LLVM IR (-O0):
define i32 @do_939() {
ret i32 939
}

LLVM IR (-O2):
define i32 @do_939() {
ret i32 939
}
int test_imm_C8uint16_mem(unsigned short *val) {
  return ((*val) & (-0xC8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C8uint16_mem>:
movzwl (%rdi),%eax
test   $0xff38,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C8uint16_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, -200
%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_C8uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -200
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int);
void sr(int pn) { do_csi("%d A", pn); }


x86 assembly (clang, -O0):
<sr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <do_csi@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d A\00"
define void @sr(i32 %0) {
%2 = tail call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char *GetEnvVar(char const *);
int atoi(char const *);
int ReturnEnvVarIntDef(const char *name, int def) {
  const char *s = GetEnvVar(name);
  return s ? atoi(s) : def;
}


x86 assembly (clang, -O0):
<ReturnEnvVarIntDef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <GetEnvVar@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1158 <ReturnEnvVarIntDef+0x38>
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    115e <ReturnEnvVarIntDef+0x3e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReturnEnvVarIntDef>:
push   %rbx
mov    %esi,%ebx
call   1030 <GetEnvVar@plt>
test   %rax,%rax
je     1136 <ReturnEnvVarIntDef+0x16>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ReturnEnvVarIntDef(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i8* @GetEnvVar(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i32 @atoi(i8* %11)
br label %15
13: ; preds = %2
%14 = load i32, i32* %4
br label %15
15: ; preds = %13, %10
%16 = phi i32 [ %12, %10 ], [ %14, %13 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @ReturnEnvVarIntDef(i8* %0, i32 %1) {
%3 = tail call i8* @GetEnvVar(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @atoi(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %1, %2 ]
ret i32 %8
}
/* Type definitions */
struct view_contacts {
  int dummy;
};
struct view {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct view_contacts *);
void view_contacts_free(struct view *v) { free((struct view_contacts *)v); }


x86 assembly (clang, -O0):
<view_contacts_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):
<view_contacts_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.view = type { i32 }
%struct.view_contacts = type { i32 }
define void @view_contacts_free(%struct.view* %0) {
%2 = alloca %struct.view*
store %struct.view* %0, %struct.view** %2
%3 = load %struct.view*, %struct.view** %2
%4 = bitcast %struct.view* %3 to %struct.view_contacts*
%5 = call i32 @free(%struct.view_contacts* %4)
ret void
}

LLVM IR (-O2):
%struct.view = type { i32 }
%struct.view_contacts = type { i32 }
define void @view_contacts_free(%struct.view* nocapture %0) {
%2 = bitcast %struct.view* %0 to %struct.view_contacts*
%3 = tail call i32 @free(%struct.view_contacts* %2)
ret void
}
/* Variables and functions */
bool isLittleEndian() {
  union {
    int theInteger;
    char singleByte;
  } endianTest;
  endianTest.theInteger = 1;
  return endianTest.singleByte;
}


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

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @isLittleEndian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 1, i32* %2
%3 = bitcast %union.anon* %1 to i8*
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isLittleEndian() {
ret i32 1
}
int compute_char(void) {
  char x = 1;
  int i = 0;
  while (x) {
    x = x << 1;
    ++i;
  }
  return (i / 8);
}


x86 assembly (clang, -O0):
<compute_char>:
push   %rbp
mov    %rsp,%rbp
movb   $0x1,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1131 <compute_char+0x31>
movsbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110f <compute_char+0xf>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compute_char() {
ret i32 1
}
void calc_bl2_chksum(unsigned long addr) {
  int i;
  unsigned long checksum;
  unsigned long src;
  for (i = 0, checksum = 0; i < ((14 * 1024) - (4)); i++) {
    checksum += *(unsigned char *)addr++;
  }
  *(unsigned long *)addr = checksum;
}


x86 assembly (clang, -O0):
<calc_bl2_chksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x37fc,-0xc(%rbp)
jge    114c <calc_bl2_chksum+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <calc_bl2_chksum+0x17>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_bl2_chksum>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rax,1),%edx
add    %rcx,%rdx
movzbl 0x1(%rdi,%rax,1),%ecx
add    %rdx,%rcx
movzbl 0x2(%rdi,%rax,1),%edx
add    %rcx,%rdx
movzbl 0x3(%rdi,%rax,1),%ecx
add    %rdx,%rcx
add    $0x4,%rax
cmp    $0x37fc,%eax
jne    1110 <calc_bl2_chksum+0x10>
mov    %rcx,0x37fc(%rdi)
ret

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

LLVM IR (-O2):
define void @calc_bl2_chksum(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %21, %2 ]
%4 = phi i64 [ 0, %1 ], [ %25, %2 ]
%5 = phi i32 [ 0, %1 ], [ %26, %2 ]
%6 = add i64 %3, 1
%7 = inttoptr i64 %3 to i8*
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
%10 = add i64 %4, %9
%11 = add i64 %3, 2
%12 = inttoptr i64 %6 to i8*
%13 = load i8, i8* %12
%14 = zext i8 %13 to i64
%15 = add i64 %10, %14
%16 = add i64 %3, 3
%17 = inttoptr i64 %11 to i8*
%18 = load i8, i8* %17
%19 = zext i8 %18 to i64
%20 = add i64 %15, %19
%21 = add i64 %3, 4
%22 = inttoptr i64 %16 to i8*
%23 = load i8, i8* %22
%24 = zext i8 %23 to i64
%25 = add i64 %20, %24
%26 = add nuw nsw i32 %5, 4
%27 = icmp eq i32 %26, 14332
br i1 %27, label %28, label %2
28: ; preds = %2
%29 = add i64 %0, 14332
%30 = inttoptr i64 %29 to i64*
store i64 %25, i64* %30
ret void
}
int compute(int a, int b, int (*f)(int, int)) {
  int i;
  int c = 0;
  for (i = 0; i < a; i++) {
    c = (*f)(i, b);
  }
  return c;
}


x86 assembly (clang, -O0):
<compute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1149 <compute+0x49>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
call   *%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <compute+0x20>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute>:
test   %edi,%edi
jle    113a <compute+0x3a>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
mov    %r15d,%esi
call   *%r14
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <compute+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @compute(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i32 %2(i32 %6, i32 %1)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %3
%11 = phi i32 [ 0, %3 ], [ %7, %5 ]
ret i32 %11
}
sumEvenFibonacciBelowX(int x) {
  int a = 1, b = 1, s = 0;
  while (b <= x) {
    if (b % 2 == 0)
      s += b;
    b = a + b;
    a = b - a;
  }
  return s;
}


x86 assembly (clang, -O0):
<sumEvenFibonacciBelowX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     115c <sumEvenFibonacciBelowX+0x5c>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1145 <sumEvenFibonacciBelowX+0x45>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    111c <sumEvenFibonacciBelowX+0x1c>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumEvenFibonacciBelowX>:
test   %edi,%edi
jle    112b <sumEvenFibonacciBelowX+0x2b>
mov    $0x1,%edx
xor    %eax,%eax
mov    $0x1,%ecx
mov    %edx,%esi
test   $0x1,%sil
mov    $0x0,%edx
cmove  %esi,%edx
add    %edx,%eax
add    %esi,%ecx
mov    %ecx,%edx
cmp    %edi,%ecx
mov    %esi,%ecx
jle    1110 <sumEvenFibonacciBelowX+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sumEvenFibonacciBelowX(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 1, %1 ]
%6 = phi i32 [ %5, %3 ], [ 1, %1 ]
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 %5, i32 0
%10 = add nsw i32 %9, %4
%11 = add nsw i32 %5, %6
%12 = icmp sgt i32 %11, %0
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %14
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int chat_server_accept_client(int server_fd) {
  int client_fd =
      accept(server_fd, NULL, (socklen_t *)sizeof(struct sockaddr_in));
  if (client_fd < 0) {
    perror("chat_server_accept_client, accept");
    return -1;
  }
  return client_fd;
}


x86 assembly (clang, -O0):
<chat_server_accept_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x4,%edx
call   1040 <accept@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1161 <chat_server_accept_client+0x41>
lea    0xeb0(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <chat_server_accept_client+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chat_server_accept_client>:
push   %rax
mov    $0x4,%edx
xor    %esi,%esi
call   1040 <accept@plt>
test   %eax,%eax
js     1133 <chat_server_accept_client+0x13>
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"chat_server_accept_client, accept\00"
define i32 @chat_server_accept_client(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @accept(i32 %5, i32* null, i32* inttoptr (i64 4 to i32*))
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [34 x i8] c"chat_server_accept_client, accept\00"
define i32 @chat_server_accept_client(i32 %0) {
%2 = tail call i32 @accept(i32 %0, i32* null, i32* inttoptr (i64 4 to i32*))
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ %2, %1 ]
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBOTGMode(uint32_t ui32Base) {
  ;
  (*((volatile uint8_t *)(ui32Base + 0x0000041C))) = 0;
}


x86 assembly (clang, -O0):
<USBOTGMode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x41c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBOTGMode>:
movq   $0x0,0x41c(%rdi)
ret

LLVM IR (-O0):
define void @USBOTGMode(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1052
%5 = inttoptr i64 %4 to i64*
store volatile i64 0, i64* %5
ret void
}

LLVM IR (-O2):
define void @USBOTGMode(i64 %0) {
%2 = add nsw i64 %0, 1052
%3 = inttoptr i64 %2 to i64*
store volatile i64 0, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XFontProp;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XFontProp(void) {
  XFontProp *_p = (XFontProp *)malloc(sizeof(XFontProp));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XFontProp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XFontProp+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XFontProp>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XFontProp+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XFontProp() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XFontProp() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
scalar_t__ cos(double);
int /*<<< orphan*/ printf(char *, double);
int foo2() {
  printf("foo2 cos (0.0) = %g\n", (double)cos((double)0.0));
  return 0xf00;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
call   1040 <cos@plt>
cvtsi2sd %rax,%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf00,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
push   %rax
xorps  %xmm0,%xmm0
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf00,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"foo2 cos (0.0) = %g\0A\00"
define i32 @foo2() {
%1 = call i64 @cos(double 0.000000e+00)
%2 = sitofp i64 %1 to double
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 3840
}

LLVM IR (-O2):
@.str = [21 x i8] c"foo2 cos (0.0) = %g\0A\00"
define i32 @foo2() {
%1 = tail call i64 @cos(double 0.000000e+00)
%2 = sitofp i64 %1 to double
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 3840
}
/* Variables and functions */
double scalb(double, double);
double test6(double x, double exp) { return scalb(x, exp); }


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

x86 assembly (clang, -O2):
<test6>:
jmp    1030 <scalb@plt>

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

LLVM IR (-O2):
define double @test6(double %0, double %1) {
%3 = tail call double @scalb(double %0, double %1)
ret double %3
}
unsigned long hashdjb(unsigned char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++)
    hash = hash * 33 + c;
  return hash;
}


x86 assembly (clang, -O0):
<hashdjb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1143 <hashdjb+0x43>
imul   $0x21,-0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashdjb+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashdjb>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hashdjb+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashdjb+0x10>
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i64 @hashdjb(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 5381, i64* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %5
%12 = load i64, i64* %3
%13 = mul i64 %12, 33
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = add i64 %13, %15
store i64 %16, i64* %3
br label %5
17: ; preds = %5
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @hashdjb(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void writeU32LittleEndian(uint8_t *out, uint32_t in) {
  out[0] = (uint8_t)in;
  out[1] = (uint8_t)(in >> 8);
  out[2] = (uint8_t)(in >> 16);
  out[3] = (uint8_t)(in >> 24);
}


x86 assembly (clang, -O0):
<writeU32LittleEndian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeU32LittleEndian>:
movslq %esi,%rax
mov    %rax,(%rdi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rdi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rdi)
sar    $0x18,%eax
cltq
mov    %rax,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @writeU32LittleEndian(i64* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
store i64 %3, i64* %0
%4 = ashr i32 %1, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %5, i64* %6
%7 = ashr i32 %1, 16
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %8, i64* %9
%10 = ashr i32 %1, 24
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %11, i64* %12
ret void
}