xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ MultMatrix(float **, float **, float **);
int /*<<< orphan*/ memcpy(float **, float **, int);
void MultMatrix2(float m0[4][4], float m1[4][4]) {
  float dst[4][4];
  MultMatrix(m0, m1, dst);
  memcpy(m0, dst, sizeof(float) * 16);
}


x86 assembly (clang, -O0):
<MultMatrix2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <MultMatrix@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MultMatrix2>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdx
call   1040 <MultMatrix@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @MultMatrix2([4 x float]* %0, [4 x float]* %1) {
%3 = alloca [4 x float]*
%4 = alloca [4 x float]*
%5 = alloca [4 x [4 x float]]
store [4 x float]* %0, [4 x float]** %3
store [4 x float]* %1, [4 x float]** %4
%6 = load [4 x float]*, [4 x float]** %3
%7 = bitcast [4 x float]* %6 to float**
%8 = load [4 x float]*, [4 x float]** %4
%9 = bitcast [4 x float]* %8 to float**
%10 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 0
%11 = bitcast [4 x float]* %10 to float**
%12 = call i32 @MultMatrix(float** %7, float** %9, float** %11)
%13 = load [4 x float]*, [4 x float]** %3
%14 = bitcast [4 x float]* %13 to float**
%15 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %5, i64 0, i64 0
%16 = bitcast [4 x float]* %15 to float**
%17 = call i32 @memcpy(float** %14, float** %16, i32 64)
ret void
}

LLVM IR (-O2):
define void @MultMatrix2([4 x float]* %0, [4 x float]* %1) {
%3 = alloca [4 x [4 x float]]
%4 = bitcast [4 x [4 x float]]* %3 to i8*
%5 = bitcast [4 x float]* %0 to float**
%6 = bitcast [4 x float]* %1 to float**
%7 = bitcast [4 x [4 x float]]* %3 to float**
%8 = call i32 @MultMatrix(float** %5, float** %6, float** %7)
%9 = call i32 @memcpy(float** %5, float** %7, i32 64)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getegid();
int /*<<< orphan*/ print_num(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  print_num(getegid());
  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)
mov    $0x0,%al
call   1030 <getegid@plt>
mov    %eax,%edi
call   1040 <print_num@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @getegid()
%7 = call i32 @print_num(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getegid()
%4 = tail call i32 @print_num(i32 %3)
ret i32 0
}
marker1() {}


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

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

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

LLVM IR (-O2):
define i32 @marker1() {
ret i32 undef
}
int((carrier_identification_receive))(struct ss7 *ss7, struct isup_call *c,
                                      int messagetype, unsigned char *parm,
                                      int len) {
  return len;
}


x86 assembly (clang, -O0):
<carrier_identification_receive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<carrier_identification_receive>:
mov    %r8d,%eax
ret

LLVM IR (-O0):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @carrier_identification_receive(%struct.ss7* %0, %struct.isup_call* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.ss7*
%7 = alloca %struct.isup_call*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.ss7* %0, %struct.ss7** %6
store %struct.isup_call* %1, %struct.isup_call** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @carrier_identification_receive(%struct.ss7* nocapture readnone %0, %struct.isup_call* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 returned %4) {
ret i32 %4
}
int GetInt(const unsigned char *foo) { return *(const int *)foo; }


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

x86 assembly (clang, -O2):
<GetInt>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @GetInt(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
struct msghdr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recvmsg(int, struct msghdr *, int);
ssize_t txc_libc_recvmsg(int s, struct msghdr *msg, int flags) {
  return recvmsg(s, msg, flags);
}


x86 assembly (clang, -O0):
<txc_libc_recvmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <recvmsg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txc_libc_recvmsg>:
jmp    1030 <recvmsg@plt>

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

LLVM IR (-O2):
%struct.msghdr = type { i32 }
define i32 @txc_libc_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = tail call i32 @recvmsg(i32 %0, %struct.msghdr* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int l;
  int n;
  int i;
  i = l;
  assume(l > 0);
  while (i < n) {
    i++;
  }
  assert(l >= 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <main+0x40>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <main+0x26>
cmpl   $0x1,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void smt_free_buffer(void *buf) { free(buf); }


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

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

LLVM IR (-O2):
define void @smt_free_buffer(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int tst__b(register int c, char tab[]) {
  return (tab[(c >> 3) & 037] & (1 << (c & 07)));
}


x86 assembly (clang, -O0):
<tst__b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x3,%ecx
and    $0x1f,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst__b>:
mov    %edi,%ecx
mov    %edi,%eax
shr    $0x3,%eax
and    $0x1f,%eax
movzbl (%rsi,%rax,1),%edx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @tst__b(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = ashr i32 %6, 3
%8 = and i32 %7, 31
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i32, i32* %3
%14 = and i32 %13, 7
%15 = shl i32 1, %14
%16 = and i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @tst__b(i32 %0, i8* nocapture %1) {
%3 = lshr i32 %0, 3
%4 = and i32 %3, 31
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = and i32 %0, 7
%10 = shl nuw nsw i32 1, %9
%11 = and i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x2c() {
  Assert_real((isalnum(44) == 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_isalnum.c",
              225, ("isalnum should be 0 for ,"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for ,\00"
define void @t_isalnum_0x2c() {
%1 = tail call i64 @isalnum(i32 44)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 225, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int putchar(int c) { return fputc(c, stdout); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputc(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputc(i32 %0, i32 %2)
ret i32 %3
}
int dbg_remove_files(struct device *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @dbg_remove_files(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @dbg_remove_files(%struct.device* nocapture readnone %0) {
ret i32 0
}
int x_end_of_text(c)
int c;
{ return 1; }


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

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

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

LLVM IR (-O2):
define i32 @x_end_of_text(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void magenta() { printf("\033[0;35m"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;35m\00"
define void @magenta() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;35m\00"
define void @magenta() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void multidim_arr3_Good() {
  int a[3][2] = {
      {0, 1},
      {0, 2},
      {0, 3},
  };
}


x86 assembly (clang, -O0):
<multidim_arr3_Good>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.multidim_arr3_Good.a = [3 x [2 x i32]] [[2 x i32] [i32 0, i32 1], [2 x i32] [i32 0, i32 2], [2 x i32] [i32 0, i32 3]]
define void @multidim_arr3_Good() {
%1 = alloca [3 x [2 x i32]]
%2 = bitcast [3 x [2 x i32]]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @multidim_arr3_Good() {
ret void
}
/* Variables and functions */
void *bst_alloc(int (*)(void const *, void const *));
void *_bst_alloc(int (*compar)(const void *, const void *),
                 unsigned int (*getval)(const void *)) {
  return bst_alloc(compar);
}


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

x86 assembly (clang, -O2):
<_bst_alloc>:
jmp    1030 <bst_alloc@plt>

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

LLVM IR (-O2):
define i8* @_bst_alloc(i32 (i8*, i8*)* %0, i32 (i8*)* nocapture readnone %1) {
%3 = tail call i8* @bst_alloc(i32 (i8*, i8*)* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ add_option(int, char *, char *);
int /*<<< orphan*/ print_header(char *);
int /*<<< orphan*/ set_callback(char *);
void prompt_gender() {
  print_header("What are ya?");
  set_callback("pick_gender");
  add_option(1, "Male", "");
  add_option(0, "Female", "");
}


x86 assembly (clang, -O0):
<prompt_gender>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <print_header@plt>
lea    0xec6(%rip),%rdi
call   1030 <set_callback@plt>
mov    $0x1,%edi
lea    0xec1(%rip),%rsi
lea    0xead(%rip),%rdx
call   1040 <add_option@plt>
xor    %edi,%edi
lea    0xeb1(%rip),%rsi
lea    0xe98(%rip),%rdx
call   1040 <add_option@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_gender>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <print_header@plt>
lea    0xec9(%rip),%rdi
call   1030 <set_callback@plt>
lea    0xec9(%rip),%rsi
lea    0xeb5(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rdx
call   1040 <add_option@plt>
lea    0xeb3(%rip),%rsi
xor    %edi,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <add_option@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"What are ya?\00"
@.str.1 = [12 x i8] c"pick_gender\00"
@.str.2 = [5 x i8] c"Male\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [7 x i8] c"Female\00"
define void @prompt_gender() {
%1 = call i32 @print_header(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @set_callback(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @add_option(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @add_option(i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"What are ya?\00"
@.str.1 = [12 x i8] c"pick_gender\00"
@.str.2 = [5 x i8] c"Male\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [7 x i8] c"Female\00"
define void @prompt_gender() {
%1 = tail call i32 @print_header(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @set_callback(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @add_option(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @add_option(i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int foo(int *, int *);
int main(int argc, char *argv[]) {
  int i = 0;
  int j = 0;
  return foo(&i, &j);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <foo@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = call i32 @foo(i32* %3, i32* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double const *, int const);
void vecNd_copy(double result[], const double a[], const int n) {
  memcpy(result, a, n * sizeof(double));
}


x86 assembly (clang, -O0):
<vecNd_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecNd_copy>:
shl    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @vecNd_copy(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(double* %7, double* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @vecNd_copy(double* %0, double* %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = tail call i32 @memcpy(double* %0, double* %1, i32 %4)
ret void
}
int main() {
  int d, i, c;
  c = 2;
  d = 20 + c * 10 + (c >> 2) - 123;
  if (d < 10) {
    while (d < 20) {
      d = d + c * 4;
    }
  }
  if (d > 20) {
    do {
      d += c;
    } while (d < 100);
  } else {
    for (i = 0; i < 10; i++) {
    }
  }
  return d;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x10(%rbp)
imul   $0xa,-0x10(%rbp),%eax
add    $0x14,%eax
mov    -0x10(%rbp),%ecx
sar    $0x2,%ecx
add    %ecx,%eax
sub    $0x7b,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1158 <main+0x58>
jmp    1136 <main+0x36>
cmpl   $0x14,-0x8(%rbp)
jge    1153 <main+0x53>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x36>
jmp    1158 <main+0x58>
cmpl   $0x14,-0x8(%rbp)
jle    117f <main+0x7f>
jmp    1167 <main+0x67>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jl     1167 <main+0x67>
jmp    11a8 <main+0xa8>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11a3 <main+0xa3>
jmp    1195 <main+0x95>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1186 <main+0x86>
jmp    11a8 <main+0xa8>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %4
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 10
%7 = add nsw i32 20, %6
%8 = load i32, i32* %4
%9 = ashr i32 %8, 2
%10 = add nsw i32 %7, %9
%11 = sub nsw i32 %10, 123
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 10
br i1 %13, label %14, label %24
14: ; preds = %0
br label %15
15: ; preds = %18, %14
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 20
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32, i32* %2
%20 = load i32, i32* %4
%21 = mul nsw i32 %20, 4
%22 = add nsw i32 %19, %21
store i32 %22, i32* %2
br label %15
23: ; preds = %15
br label %24
24: ; preds = %23, %0
%25 = load i32, i32* %2
%26 = icmp sgt i32 %25, 20
br i1 %26, label %27, label %36
27: ; preds = %24
br label %28
28: ; preds = %32, %27
%29 = load i32, i32* %4
%30 = load i32, i32* %2
%31 = add nsw i32 %30, %29
store i32 %31, i32* %2
br label %32
32: ; preds = %28
%33 = load i32, i32* %2
%34 = icmp slt i32 %33, 100
br i1 %34, label %28, label %35
35: ; preds = %32
br label %45
36: ; preds = %24
store i32 0, i32* %3
br label %37
37: ; preds = %41, %36
%38 = load i32, i32* %3
%39 = icmp slt i32 %38, 10
br i1 %39, label %40, label %44
40: ; preds = %37
br label %41
41: ; preds = %40
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
store i32 %43, i32* %3
br label %37
44: ; preds = %37
br label %45
45: ; preds = %44, %35
%46 = load i32, i32* %2
ret i32 %46
}

LLVM IR (-O2):
define i32 @main() {
ret i32 101
}
double sizefix(double value, int type) {
  if (type == 2)
    return value * 8;
  return value;
}


x86 assembly (clang, -O0):
<sizefix>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jne    112d <sizefix+0x2d>
movsd  0xee2(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <sizefix+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizefix>:
cmp    $0x2,%edi
jne    110d <sizefix+0xd>
mulsd  0xef3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sizefix(double %0, i32 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load double, double* %4
%10 = fmul double %9, 8.000000e+00
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %8
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @sizefix(double %0, i32 %1) {
%3 = icmp eq i32 %1, 2
%4 = fmul double %0, 8.000000e+00
%5 = select i1 %3, double %4, double %0
ret double %5
}
void test_builtin() {}


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

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

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

LLVM IR (-O2):
define void @test_builtin() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cipher_correct_test();
int /*<<< orphan*/ cipher_speed_test();
void main(void) {
  cipher_correct_test();
  cipher_speed_test();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @cipher_correct_test()
%2 = call i32 (...) @cipher_speed_test()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @cipher_correct_test()
%2 = tail call i32 (...) @cipher_speed_test()
ret void
}
/* Variables and functions */
int hidden_function();
int main(int argc, char **argv) { return hidden_function(); }


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)
mov    $0x0,%al
call   1030 <hidden_function@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @hidden_function()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @hidden_function()
ret i32 %3
}
char const *pubnub_uagent(void) {
  return "Windows"
         "-PubNub-C-core/"
         "3.1.0";
}


x86 assembly (clang, -O0):
<pubnub_uagent>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pubnub_uagent>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Windows-PubNub-C-core/3.1.0\00"
define i8* @pubnub_uagent() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [28 x i8] c"Windows-PubNub-C-core/3.1.0\00"
define i8* @pubnub_uagent() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ clearCoders();
void initCoders(void) { clearCoders(); }


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

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

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

LLVM IR (-O2):
define void @initCoders() {
%1 = tail call i32 (...) @clearCoders()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void B_BUF32(void *const buf, uint32_t const x) {
  *(uint32_t *)buf = x;
}


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

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

LLVM IR (-O2):
define void @B_BUF32(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
struct dns_socket {
  int dummy;
};
struct dns_options {
  int dummy;
};

/* Variables and functions */
struct dns_socket *levee_dns_so_open(int, struct sockaddr const *, int,
                                     struct dns_options const *, int *);
struct dns_socket *dns_so_open(const struct sockaddr *local, int type,
                               const struct dns_options *opts, int *error) {
  return levee_dns_so_open(-1, local, type, opts, error);
}


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

x86 assembly (clang, -O2):
<dns_so_open>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xffffffff,%edi
jmp    1030 <levee_dns_so_open@plt>

LLVM IR (-O0):
%struct.dns_socket = type { i32 }
%struct.sockaddr = type { i32 }
%struct.dns_options = type { i32 }
define %struct.dns_socket* @dns_so_open(%struct.sockaddr* %0, i32 %1, %struct.dns_options* %2, i32* %3) {
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca %struct.dns_options*
%8 = alloca i32*
store %struct.sockaddr* %0, %struct.sockaddr** %5
store i32 %1, i32* %6
store %struct.dns_options* %2, %struct.dns_options** %7
store i32* %3, i32** %8
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32, i32* %6
%11 = load %struct.dns_options*, %struct.dns_options** %7
%12 = load i32*, i32** %8
%13 = call %struct.dns_socket* @levee_dns_so_open(i32 -1, %struct.sockaddr* %9, i32 %10, %struct.dns_options* %11, i32* %12)
ret %struct.dns_socket* %13
}

LLVM IR (-O2):
%struct.dns_socket = type { i32 }
%struct.sockaddr = type { i32 }
%struct.dns_options = type { i32 }
define %struct.dns_socket* @dns_so_open(%struct.sockaddr* %0, i32 %1, %struct.dns_options* %2, i32* %3) {
%5 = tail call %struct.dns_socket* @levee_dns_so_open(i32 -1, %struct.sockaddr* %0, i32 %1, %struct.dns_options* %2, i32* %3)
ret %struct.dns_socket* %5
}
/* Variables and functions */
int /*<<< orphan*/ BuildWord(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  char *test = "foo";
  test++;
  test--;
  BuildWord(test);
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <BuildWord@plt>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <BuildWord@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @BuildWord(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ refresh();
int clearbuf() {
  char buf[128];
  refresh();
  read(0, buf, 100);
}


x86 assembly (clang, -O0):
<clearbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    $0x0,%al
call   1040 <refresh@plt>
lea    -0x90(%rbp),%rsi
xor    %edi,%edi
mov    $0x64,%edx
call   1030 <read@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearbuf>:
sub    $0x88,%rsp
xor    %eax,%eax
call   1040 <refresh@plt>
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x64,%edx
call   1030 <read@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define i32 @clearbuf() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = call i32 (...) @refresh()
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = call i32 @read(i32 0, i8* %4, i32 100)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @clearbuf() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @refresh()
%4 = call i32 @read(i32 0, i8* %2, i32 100)
ret i32 undef
}
int get_user_accessible_timers_base(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_user_accessible_timers_base() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t f_scalar_3(int32_t x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @f_scalar_3(i32 returned %0) {
ret i32 %0
}
void UYVYToI420() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToI420() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_fio_close(int);
void close_xtc(int fp) { gmx_fio_close(fp); }


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

x86 assembly (clang, -O2):
<close_xtc>:
jmp    1030 <gmx_fio_close@plt>

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

LLVM IR (-O2):
define void @close_xtc(i32 %0) {
%2 = tail call i32 @gmx_fio_close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
scalar_t__ sched_yield();
int process(void *arg) {
  int i;
  for (i = 0; i < 50; i++)
    if (sched_yield())
      abort();
  printf("pass\n");
  return 0;
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1178 <process+0x48>
mov    $0x0,%al
call   1050 <sched_yield@plt>
cmp    $0x0,%rax
je     1165 <process+0x35>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    116a <process+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <process+0x13>
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %rbx
mov    $0x32,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <sched_yield@plt>
test   %rax,%rax
jne    1161 <process+0x31>
add    $0xffffffff,%ebx
jne    1140 <process+0x10>
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@str = [5 x i8] c"pass\00"
define i32 @process(i8* nocapture readnone %0) {
br label %5
2: ; preds = %5
%3 = add nuw nsw i32 %6, 1
%4 = icmp eq i32 %3, 50
br i1 %4, label %11, label %5
5: ; preds = %1, %2
%6 = phi i32 [ 0, %1 ], [ %3, %2 ]
%7 = tail call i64 (...) @sched_yield()
%8 = icmp eq i64 %7, 0
br i1 %8, label %2, label %9
9: ; preds = %5
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int disc_get_bitcell_period(int rate) {
  int bit_rate = 0;
  switch (rate) {
  case 0:
    bit_rate = 500;
    break;
  case 1:
    bit_rate = 300;
    break;
  case 2:
    bit_rate = 250;
    break;
  case 3:
    bit_rate = 1000;
    break;
  }
  return 1000000 / bit_rate * 2;
}


x86 assembly (clang, -O0):
<disc_get_bitcell_period>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     115e <disc_get_bitcell_period+0x5e>
mov    -0x10(%rbp),%rax
lea    0xed6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1f4,-0x8(%rbp)
jmp    115e <disc_get_bitcell_period+0x5e>
movl   $0x12c,-0x8(%rbp)
jmp    115e <disc_get_bitcell_period+0x5e>
movl   $0xfa,-0x8(%rbp)
jmp    115e <disc_get_bitcell_period+0x5e>
movl   $0x3e8,-0x8(%rbp)
mov    $0xf4240,%eax
cltd
idivl  -0x8(%rbp)
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<disc_get_bitcell_period>:
xor    %ecx,%ecx
cmp    $0x3,%edi
ja     1114 <disc_get_bitcell_period+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%ecx
mov    $0xf4240,%eax
xor    %edx,%edx
div    %ecx
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @disc_get_bitcell_period(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i32 500, i32* %3
br label %9
6: ; preds = %1
store i32 300, i32* %3
br label %9
7: ; preds = %1
store i32 250, i32* %3
br label %9
8: ; preds = %1
store i32 1000, i32* %3
br label %9
9: ; preds = %1, %8, %7, %6, %5
%10 = load i32, i32* %3
%11 = sdiv i32 1000000, %10
%12 = mul nsw i32 %11, 2
ret i32 %12
}

LLVM IR (-O2):
@switch.table.disc_get_bitcell_period = [4 x i32] [i32 500, i32 300, i32 250, i32 1000]
define i32 @disc_get_bitcell_period(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.disc_get_bitcell_period, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
%9 = udiv i32 1000000, %8
%10 = shl nuw nsw i32 %9, 1
ret i32 %10
}
/* Type definitions */
struct ibv_device {
  int dummy;
};
struct ibv_context {
  int dummy;
};

/* Variables and functions */
struct ibv_context *_open_device(struct ibv_device *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
struct ibv_context *ibv_open_device(struct ibv_device *dev) {
  dmtcp_plugin_disable_ckpt();
  struct ibv_context *user_copy = _open_device(dev);
  dmtcp_plugin_enable_ckpt();
  return user_copy;
}


x86 assembly (clang, -O0):
<ibv_open_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
call   1030 <_open_device@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_open_device>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
call   1030 <_open_device@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ibv_context = type { i32 }
%struct.ibv_device = type { i32 }
define %struct.ibv_context* @ibv_open_device(%struct.ibv_device* %0) {
%2 = alloca %struct.ibv_device*
%3 = alloca %struct.ibv_context*
store %struct.ibv_device* %0, %struct.ibv_device** %2
%4 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%5 = load %struct.ibv_device*, %struct.ibv_device** %2
%6 = call %struct.ibv_context* @_open_device(%struct.ibv_device* %5)
store %struct.ibv_context* %6, %struct.ibv_context** %3
%7 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%8 = load %struct.ibv_context*, %struct.ibv_context** %3
ret %struct.ibv_context* %8
}

LLVM IR (-O2):
%struct.ibv_context = type { i32 }
%struct.ibv_device = type { i32 }
define %struct.ibv_context* @ibv_open_device(%struct.ibv_device* %0) {
%2 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%3 = tail call %struct.ibv_context* @_open_device(%struct.ibv_device* %0)
%4 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret %struct.ibv_context* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void i2sStartPlay(void) {
  printf("IIS start playing...\n");
  *((volatile unsigned int *)((0xB0020000 + 0x24))) = 0x1;
  *((volatile unsigned int *)((0xB0020000 + 0x04))) =
      (*((volatile unsigned int *)((0xB0020000 + 0x04)))) | (1 << 5);
}


x86 assembly (clang, -O0):
<i2sStartPlay>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xb0020024,%eax
movl   $0x1,(%rax)
mov    $0xb0020004,%eax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    $0xb0020004,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2sStartPlay>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xb0020004,%eax
movl   $0x1,0x20(%rax)
orl    $0x20,(%rax)
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"IIS start playing...\0A\00"
define void @i2sStartPlay() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store volatile i32 1, i32* inttoptr (i64 2952921124 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 2952921092 to i32*)
%3 = or i32 %2, 32
store volatile i32 %3, i32* inttoptr (i64 2952921092 to i32*)
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"IIS start playing...\00"
define void @i2sStartPlay() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
store volatile i32 1, i32* inttoptr (i64 2952921124 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 2952921092 to i32*)
%3 = or i32 %2, 32
store volatile i32 %3, i32* inttoptr (i64 2952921092 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vga_putch(char);
void vga_puts(char *str) {
  int i = 0;
  while (*(str + i) != '\0') {
    vga_putch(*(str + i++));
  }
}


x86 assembly (clang, -O0):
<vga_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <vga_puts+0x48>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <vga_putch@plt>
jmp    1123 <vga_puts+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <vga_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <vga_putch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <vga_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @vga_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @vga_putch(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void ASN1_TYPE_set_int_octetstring(void) {}


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

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

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

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