xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ch8_SCLEFT() { printf("Error: ch8_SCLEFT not yet implemented\n"); }


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Error: ch8_SCLEFT not yet implemented\0A\00"
define void @ch8_SCLEFT() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"Error: ch8_SCLEFT not yet implemented\00"
define void @ch8_SCLEFT() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret void
}
double add() {
  int age;
  return 0.0;
}


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

x86 assembly (clang, -O2):
<add>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @add() {
%1 = alloca i32
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @add() {
ret double 0.000000e+00
}
int test_imm_8Auint16_reg(unsigned short val) {
  return ((val) & (-0x8A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Auint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff76,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Auint16_reg>:
test   $0xff76,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Auint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -138
%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_8Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -138
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int /*<<< orphan*/);
int /*<<< orphan*/ IntRegister(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ _TimerIntNumberGet(int /*<<< orphan*/, int /*<<< orphan*/);
void TimerIntRegister(uint32_t ui32Base, uint32_t ui32Timer,
                      void (*pfnHandler)(void)) {
  uint32_t ui32Int;
  ;

  ;
  ui32Int = _TimerIntNumberGet(ui32Base, ui32Timer);
  ;
  IntRegister(ui32Int, pfnHandler);
  IntEnable(ui32Int);
}


x86 assembly (clang, -O0):
<TimerIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_TimerIntNumberGet@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <IntRegister@plt>
mov    -0x14(%rbp),%edi
call   1040 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIntRegister>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1030 <_TimerIntNumberGet@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <IntRegister@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <IntEnable@plt>

LLVM IR (-O0):
define void @TimerIntRegister(i32 %0, i32 %1, void ()* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca void ()*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store void ()* %2, void ()** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @_TimerIntNumberGet(i32 %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load void ()*, void ()** %6
%13 = bitcast void ()* %12 to void (...)*
%14 = call i32 @IntRegister(i32 %11, void (...)* %13)
%15 = load i32, i32* %7
%16 = call i32 @IntEnable(i32 %15)
ret void
}

LLVM IR (-O2):
define void @TimerIntRegister(i32 %0, i32 %1, void ()* %2) {
%4 = tail call i32 @_TimerIntNumberGet(i32 %0, i32 %1)
%5 = bitcast void ()* %2 to void (...)*
%6 = tail call i32 @IntRegister(i32 %4, void (...)* %5)
%7 = tail call i32 @IntEnable(i32 %4)
ret void
}
/* Variables and functions */
char const *_glp_lib_version();
const char *glp_version(void) { return _glp_lib_version(); }


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

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

LLVM IR (-O0):
define i8* @glp_version() {
%1 = call i8* (...) @_glp_lib_version()
ret i8* %1
}

LLVM IR (-O2):
define i8* @glp_version() {
%1 = tail call i8* (...) @_glp_lib_version()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_list(int *l, int len) {
  int c;
  for (c = 0; c < len; c++) {
    printf("%d ", l[c]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_list+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_list+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_list>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_list+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_list+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_list(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_list(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test2() { printf("call lib test2\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"call lib test2\00"
define void @test2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i[5];
  int j;
  i[0] = 65536 + 2;
  i[1] = 65536 * 3 + 4;
  j = *((int *)((char *)i + 2));
  printf("sizeof int is %d  j=%d \n", sizeof(int), j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x10002,-0x20(%rbp)
movl   $0x30004,-0x1c(%rbp)
mov    -0x1e(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edx
lea    0xec3(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x3000400010002,%rax
mov    %rax,(%rsp)
mov    0x2(%rsp),%edx
lea    0xed6(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"sizeof int is %d j=%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
store i32 65538, i32* %4
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
store i32 196612, i32* %5
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = bitcast i32* %6 to i8*
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 4, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"sizeof int is %d j=%d \0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = bitcast i64* %1 to i32*
store i32 65538, i32* %3
%4 = getelementptr inbounds i8, i8* %2, i64 4
%5 = bitcast i8* %4 to i32*
store i32 196612, i32* %5
%6 = getelementptr inbounds i8, i8* %2, i64 2
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 4, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: blocksig [-s 'signum ..'] command [args ..]\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: blocksig [-s 'signum ..'] command [args ..]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: blocksig [-s 'signum ..'] command [args ..]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void st_Setup(void) {}


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

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

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

LLVM IR (-O2):
define void @st_Setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dl_sl_save(void *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void dl_sl_print(void *s, int nproc) { dl_sl_save(s, nproc, stdout); }


x86 assembly (clang, -O0):
<dl_sl_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
call   1030 <dl_sl_save@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dl_sl_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <dl_sl_save@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @dl_sl_print(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @stdout
%8 = call i32 @dl_sl_save(i8* %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @dl_sl_print(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @dl_sl_save(i8* %0, i32 %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void err(char *s) {
  perror(s);
  exit(errno);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @errno
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
define void @err(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @errno
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int tun_open() {
  int fd;
  fd = open("/dev/tun", O_RDWR);
  if (fd < 0) {
    fd = open("/dev/net/tun", O_RDWR);
  }
  return fd;
}


x86 assembly (clang, -O0):
<tun_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xed8(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1152 <tun_open+0x42>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tun_open>:
push   %rbx
mov    0x2ed0(%rip),%rbx
mov    (%rbx),%esi
lea    0xedf(%rip),%rdi
call   1030 <open@plt>
test   %eax,%eax
js     112c <tun_open+0x1c>
pop    %rbx
ret
mov    (%rbx),%esi
lea    0xed4(%rip),%rdi
pop    %rbx
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/tun\00"
@O_RDWR = global i32 0
@.str.1 = [13 x i8] c"/dev/net/tun\00"
define i32 @tun_open() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @O_RDWR
%8 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %7)
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/tun\00"
@O_RDWR = global i32 0
@.str.1 = [13 x i8] c"/dev/net/tun\00"
define i32 @tun_open() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @O_RDWR
%6 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %0
%8 = phi i32 [ %6, %4 ], [ %2, %0 ]
ret i32 %8
}
/* Variables and functions */
int mul(int, int);
int ten(int x) { return mul(x, 10); }


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

x86 assembly (clang, -O2):
<ten>:
mov    $0xa,%esi
jmp    1030 <mul@plt>

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

LLVM IR (-O2):
define i32 @ten(i32 %0) {
%2 = tail call i32 @mul(i32 %0, i32 10)
ret i32 %2
}
__attribute__((always_)) const char *
module_address_lookup(unsigned long addr, unsigned long *symbolsize,
                      unsigned long *offset, char **modname, char *namebuf) {
  return ((void *)0);
}


x86 assembly (clang, -O0):
<module_address_lookup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @module_address_lookup(i64 %0, i64* %1, i64* %2, i8** %3, i8* %4) {
%6 = alloca i64
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i8**
%10 = alloca i8*
store i64 %0, i64* %6
store i64* %1, i64** %7
store i64* %2, i64** %8
store i8** %3, i8*** %9
store i8* %4, i8** %10
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @module_address_lookup(i64 %0, i64* nocapture readnone %1, i64* nocapture readnone %2, i8** nocapture readnone %3, i8* nocapture readnone %4) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int answer = 7 - 4 + 3 * 4 / 2;
  printf("The answer is %d", answer);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"The answer is %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
__attribute__((__no__)) void do_nothing_user(struct test_user *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_user>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_user+0x1b>
jmp    1120 <do_nothing_user+0x20>
jmp    1120 <do_nothing_user+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_user = type opaque
define void @do_nothing_user(%struct.test_user* %0) {
%2 = alloca %struct.test_user*
store %struct.test_user* %0, %struct.test_user** %2
%3 = load %struct.test_user*, %struct.test_user** %2
%4 = ptrtoint %struct.test_user* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_user = type opaque
define void @do_nothing_user(%struct.test_user* nocapture %0) {
ret void
}
int nvram_unset(const char *name) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @nvram_unset(i8* nocapture readnone %0) {
ret i32 -1
}
void workload(char *SEQA, char *SEQB, char *alignedA, char *alignedB,
              int num_jobs) {
#pragma HLS INTERFACE m_axi port = SEQA offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = SEQB offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = alignedA offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = alignedB offset = slave bundle = gmem
#pragma HLS INTERFACE s_axilite port = SEQA bundle = control
#pragma HLS INTERFACE s_axilite port = SEQB bundle = control
#pragma HLS INTERFACE s_axilite port = alignedA bundle = control
#pragma HLS INTERFACE s_axilite port = alignedB bundle = control
#pragma HLS INTERFACE s_axilite port = num_jobs bundle = control
#pragma HLS INTERFACE s_axilite port = return bundle = control
  int M[(128 + 1) * (128 + 1)];
  char ptr[(128 + 1) * (128 + 1)];
  int i;
  return;
}


x86 assembly (clang, -O0):
<workload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x144d0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
add    $0x144d0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @workload(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [16641 x i32]
%12 = alloca [16641 x i8]
%13 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @workload(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i32 %4) {
ret void
}
/* Variables and functions */
scalar_t__ net_getparam(int);
int /*<<< orphan*/ net_setnetvars();
int /*<<< orphan*/ net_uninit();
int /*<<< orphan*/ xprintf(char *, char *);
int ui_ifdown(void) {
  char *devname;
  devname = (char *)net_getparam(10);
  if (devname) {
    xprintf("Device %s has been deactivated.\n", devname);
    net_uninit();
    net_setnetvars();
  }
  return 0;
}


x86 assembly (clang, -O0):
<ui_ifdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1060 <net_getparam@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117f <ui_ifdown+0x3f>
mov    -0x8(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <xprintf@plt>
mov    $0x0,%al
call   1050 <net_uninit@plt>
mov    $0x0,%al
call   1040 <net_setnetvars@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui_ifdown>:
push   %rax
mov    $0xa,%edi
call   1060 <net_getparam@plt>
test   %rax,%rax
je     116d <ui_ifdown+0x2d>
lea    0xea9(%rip),%rdi
mov    %rax,%rsi
call   1030 <xprintf@plt>
xor    %eax,%eax
call   1050 <net_uninit@plt>
xor    %eax,%eax
call   1040 <net_setnetvars@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Device %s has been deactivated.\0A\00"
define i32 @ui_ifdown() {
%1 = alloca i8*
%2 = call i64 @net_getparam(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i8*, i8** %1
%8 = call i32 @xprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 (...) @net_uninit()
%10 = call i32 (...) @net_setnetvars()
br label %11
11: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Device %s has been deactivated.\0A\00"
define i32 @ui_ifdown() {
%1 = tail call i64 @net_getparam(i32 10)
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = inttoptr i64 %1 to i8*
%5 = tail call i32 @xprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 (...) @net_uninit()
%7 = tail call i32 (...) @net_setnetvars()
br label %8
8: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
char *A7_command_readport();
scalar_t__ A7board_available();
char *A7HTTP_A7read() {
  char *reply = "";
  if (A7board_available()) {
    reply = A7_command_readport();
  }
  return reply;
}


x86 assembly (clang, -O0):
<A7HTTP_A7read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <A7board_available@plt>
cmp    $0x0,%rax
je     114f <A7HTTP_A7read+0x2f>
mov    $0x0,%al
call   1040 <A7_command_readport@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<A7HTTP_A7read>:
push   %rax
xor    %eax,%eax
call   1030 <A7board_available@plt>
test   %rax,%rax
je     1135 <A7HTTP_A7read+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <A7_command_readport@plt>
lea    0xec4(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @A7HTTP_A7read() {
%1 = alloca i8*
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i64 (...) @A7board_available()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i8* (...) @A7_command_readport()
store i8* %5, i8** %1
br label %6
6: ; preds = %4, %0
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @A7HTTP_A7read() {
%1 = tail call i64 (...) @A7board_available()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i8* (...) @A7_command_readport()
br label %5
5: ; preds = %3, %0
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %0 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void function_child(void) {
  static int number;
  printf("%d", ++number);
}


x86 assembly (clang, -O0):
<function_child>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f09(%rip)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_child>:
mov    0x2f16(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f0d(%rip)
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@function_child.number = internal global i32 0
@.str = [3 x i8] c"%d\00"
define void @function_child() {
%1 = load i32, i32* @function_child.number
%2 = add nsw i32 %1, 1
store i32 %2, i32* @function_child.number
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@function_child.number = internal unnamed_addr global i32 0
@.str = [3 x i8] c"%d\00"
define void @function_child() {
%1 = load i32, i32* @function_child.number
%2 = add nsw i32 %1, 1
store i32 %2, i32* @function_child.number
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_wait();
void atapio_io_delay() {
  unsigned int i;
  for (i = 0; i < 10000; i++)
    io_wait();
}


x86 assembly (clang, -O0):
<atapio_io_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jae    1141 <atapio_io_delay+0x31>
mov    $0x0,%al
call   1030 <io_wait@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <atapio_io_delay+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atapio_io_delay>:
push   %rbx
mov    $0x2710,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <io_wait@plt>
add    $0xffffffff,%ebx
jne    1120 <atapio_io_delay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @atapio_io_delay() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp ult i32 %3, 10000
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @io_wait()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @atapio_io_delay() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @io_wait()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 10000
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __tiger__main();
int atoi(char *);
char *getenv(char *);
int /*<<< orphan*/ llvm_gc_initialize(int);
int main(void) {
  char *initial_heap_size = getenv("TIGERHEAPSIZE");
  if (initial_heap_size != NULL) {
    llvm_gc_initialize(atoi(initial_heap_size));
  } else {
    llvm_gc_initialize(10000);
  };
  __tiger__main();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117f <main+0x3f>
mov    -0x10(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1040 <llvm_gc_initialize@plt>
jmp    1189 <main+0x49>
mov    $0x2710,%edi
call   1040 <llvm_gc_initialize@plt>
mov    $0x0,%al
call   1050 <__tiger__main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     115e <main+0x1e>
mov    %rax,%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
jmp    1163 <main+0x23>
mov    $0x2710,%edi
call   1040 <llvm_gc_initialize@plt>
xor    %eax,%eax
call   1050 <__tiger__main@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"TIGERHEAPSIZE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i32 @atoi(i8* %7)
%9 = call i32 @llvm_gc_initialize(i32 %8)
br label %12
10: ; preds = %0
%11 = call i32 @llvm_gc_initialize(i32 10000)
br label %12
12: ; preds = %10, %6
%13 = call i32 (...) @__tiger__main()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"TIGERHEAPSIZE\00"
define i32 @main() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @atoi(i8* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 10000, %0 ]
%7 = tail call i32 @llvm_gc_initialize(i32 %6)
%8 = tail call i32 (...) @__tiger__main()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
void xsetenv(char *name, char *value) { setenv(name, value, 1); }


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

x86 assembly (clang, -O2):
<xsetenv>:
mov    $0x1,%edx
jmp    1030 <setenv@plt>

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

LLVM IR (-O2):
define void @xsetenv(i8* %0, i8* %1) {
%3 = tail call i32 @setenv(i8* %0, i8* %1, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ CMAC_CTX;

/* Variables and functions */
int /*<<< orphan*/ CMAC_CTX_cleanup(int /*<<< orphan*/ *);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void CMAC_CTX_free(CMAC_CTX *ctx) {
  CMAC_CTX_cleanup(ctx);
  free(ctx);
}


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

x86 assembly (clang, -O2):
<CMAC_CTX_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <CMAC_CTX_cleanup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @CMAC_CTX_free(i32* %0) {
%2 = tail call i32 @CMAC_CTX_cleanup(i32* %0)
%3 = tail call i32 @free(i32* %0)
ret void
}
int Xopenpl(char *s) {
  (void)s;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Xopenpl(i8* nocapture readnone %0) {
ret i32 0
}
long NET_sendData(void *pData, int Size, int Mode) { return 0; }


x86 assembly (clang, -O0):
<NET_sendData>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @NET_sendData(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i64 0
}

LLVM IR (-O2):
define i64 @NET_sendData(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ logger_tests();
int /*<<< orphan*/ queue_tests();
int /*<<< orphan*/ string_utils_tests();
int main(void) {
  queue_tests();
  logger_tests();
  string_utils_tests();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <queue_tests@plt>
mov    $0x0,%al
call   1040 <logger_tests@plt>
mov    $0x0,%al
call   1050 <string_utils_tests@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <queue_tests@plt>
xor    %eax,%eax
call   1040 <logger_tests@plt>
xor    %eax,%eax
call   1050 <string_utils_tests@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @queue_tests()
%3 = call i32 (...) @logger_tests()
%4 = call i32 (...) @string_utils_tests()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @queue_tests()
%2 = tail call i32 (...) @logger_tests()
%3 = tail call i32 (...) @string_utils_tests()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __const_udelay(unsigned long);
void __ndelay(unsigned long nsecs) { __const_udelay(nsecs * 5); }


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

x86 assembly (clang, -O2):
<__ndelay>:
lea    (%rdi,%rdi,4),%rdi
jmp    1030 <__const_udelay@plt>

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

LLVM IR (-O2):
define void @__ndelay(i64 %0) {
%2 = mul i64 %0, 5
%3 = tail call i32 @__const_udelay(i64 %2)
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRDRAWTEXT_set(void) { return U_WMRCORENONE_set("U_WMRDRAWTEXT"); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"U_WMRDRAWTEXT\00"
define i8* @U_WMRDRAWTEXT_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ wDateTimePush(char, int /*<<< orphan*/);
int /*<<< orphan*/ wStackPopDateTime();
void wBuiltinHour() { wDateTimePush('h', wStackPopDateTime()); }


x86 assembly (clang, -O0):
<wBuiltinHour>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <wStackPopDateTime@plt>
mov    %eax,%esi
mov    $0x68,%edi
call   1030 <wDateTimePush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinHour>:
push   %rax
xor    %eax,%eax
call   1040 <wStackPopDateTime@plt>
mov    $0x68,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <wDateTimePush@plt>

LLVM IR (-O0):
define void @wBuiltinHour() {
%1 = call i32 (...) @wStackPopDateTime()
%2 = call i32 @wDateTimePush(i8 signext 104, i32 %1)
ret void
}

LLVM IR (-O2):
define void @wBuiltinHour() {
%1 = tail call i32 (...) @wStackPopDateTime()
%2 = tail call i32 @wDateTimePush(i8 signext 104, i32 %1)
ret void
}
/* Variables and functions */
char *OC_mkBuildTabFunc(char *, char *);
char *OC_mkBuildCTabFunc(char *entries) {
  return OC_mkBuildTabFunc("buildPervasiveConstants", entries);
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"buildPervasiveConstants\00"
define i8* @OC_mkBuildCTabFunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @OC_mkBuildTabFunc(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [24 x i8] c"buildPervasiveConstants\00"
define i8* @OC_mkBuildCTabFunc(i8* %0) {
%2 = tail call i8* @OC_mkBuildTabFunc(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ kernel_reschedule();
void kernel_launch() {
  while (1) {
    kernel_reschedule();
  }
}


x86 assembly (clang, -O0):
<kernel_launch>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <kernel_launch+0x9>
mov    $0x0,%al
call   1030 <kernel_reschedule@plt>
jmp    1119 <kernel_launch+0x9>

x86 assembly (clang, -O2):
<kernel_launch>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <kernel_reschedule@plt>
jmp    1120 <kernel_launch+0x10>

LLVM IR (-O0):
define void @kernel_launch() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @kernel_reschedule()
br label %1
}

LLVM IR (-O2):
define void @kernel_launch() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @kernel_reschedule()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int);
void decrqlp(int mode) { do_csi("%d'|", mode); }


x86 assembly (clang, -O0):
<decrqlp>:
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):
<decrqlp>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d'|\00"
define void @decrqlp(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'|\00"
define void @decrqlp(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 */
int /*<<< orphan*/ get_grid_great_circle_area(int const *, int const *,
                                              double const *, double const *,
                                              double *);
void get_grid_great_circle_area_(const int *nlon, const int *nlat,
                                 const double *lon, const double *lat,
                                 double *area) {
  get_grid_great_circle_area(nlon, nlat, lon, lat, area);
}


x86 assembly (clang, -O0):
<get_grid_great_circle_area_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <get_grid_great_circle_area@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_grid_great_circle_area_>:
jmp    1030 <get_grid_great_circle_area@plt>

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

LLVM IR (-O2):
define void @get_grid_great_circle_area_(i32* %0, i32* %1, double* %2, double* %3, double* %4) {
%6 = tail call i32 @get_grid_great_circle_area(i32* %0, i32* %1, double* %2, double* %3, double* %4)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ChildProcess();
int /*<<< orphan*/ ParentProcess();
scalar_t__ fork();
void main() {
  pid_t pid;
  pid = fork();
  if (pid == 0)
    ChildProcess();
  else
    ParentProcess();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115a <main+0x2a>
mov    $0x0,%al
call   1040 <ChildProcess@plt>
jmp    1161 <main+0x31>
mov    $0x0,%al
call   1030 <ParentProcess@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
je     1145 <main+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ParentProcess@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ChildProcess@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i64
%2 = call i64 (...) @fork()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @ChildProcess()
br label %9
7: ; preds = %0
%8 = call i32 (...) @ParentProcess()
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @ChildProcess()
br label %7
5: ; preds = %0
%6 = tail call i32 (...) @ParentProcess()
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int first_two_digits(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int mw = first_two_digits(5678);
  printf("%d", mw);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x162e,%edi
call   1040 <first_two_digits@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@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 @first_two_digits(i32 5678)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @first_two_digits(i32 5678)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fwrite(char const *, size_t, int, int /*<<< orphan*/ *);
size_t strlen(char const *);
int fputs(const char *str, FILE *fp) {
  size_t l = strlen(str);
  return (l) ? (int)fwrite(str, l, 1, fp) - 1 : 0;
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1169 <fputs+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1173 <fputs+0x53>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1173 <fputs+0x53>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     114c <fputs+0x2c>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fwrite@plt>
add    $0xffffffff,%eax
jmp    114e <fputs+0x2e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fputs(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i64
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = load i32*, i32** %4
%14 = call i64 @fwrite(i8* %11, i64 %12, i32 1, i32* %13)
%15 = trunc i64 %14 to i32
%16 = sub nsw i32 %15, 1
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %10
%19 = phi i32 [ %16, %10 ], [ 0, %17 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @fputs(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @fwrite(i8* %0, i64 %3, i32 1, i32* %1)
%7 = trunc i64 %6 to i32
%8 = add nsw i32 %7, -1
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
void *REALLOC_PTR(void *, size_t);
void *lrtr_realloc(void *ptr, size_t size) { return REALLOC_PTR(ptr, size); }


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

x86 assembly (clang, -O2):
<lrtr_realloc>:
jmp    1030 <REALLOC_PTR@plt>

LLVM IR (-O0):
define i8* @lrtr_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @REALLOC_PTR(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @lrtr_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @REALLOC_PTR(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ nav_Close();
int navClose() {
  nav_Close();
  return 0;
}


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

x86 assembly (clang, -O2):
<navClose>:
push   %rax
xor    %eax,%eax
call   1030 <nav_Close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @navClose() {
%1 = call i32 (...) @nav_Close()
ret i32 0
}

LLVM IR (-O2):
define i32 @navClose() {
%1 = tail call i32 (...) @nav_Close()
ret i32 0
}