xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(int exit_value) {
  printf("Usage: pcalc [<option>...]\n"
         "       pcalc [<option>...] <expression>\n"
         "\n"
         "       -i  infix notation (default)\n"
         "       -r  postfix notation (rpn)\n"
         "       -p  prefix notation\n"
         "       -c  print config path and exit\n"
         "       -w  print settings and exit\n"
         "       -h  show this help\n");
  exit(exit_value);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [265 x i8] c"Usage: pcalc [<option>...]\0A pcalc [<option>...] <expression>\0A\0A -i infix notation (default)\0A -r postfix notation (rpn)\0A -p prefix notation\0A -c print config path and exit\0A -w print settings and exit\0A -h show this help\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [264 x i8] c"Usage: pcalc [<option>...]\0A pcalc [<option>...] <expression>\0A\0A -i infix notation (default)\0A -r postfix notation (rpn)\0A -p prefix notation\0A -c print config path and exit\0A -w print settings and exit\0A -h show this help\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([264 x i8], [264 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int BIGS1(int);
int CH(int, int, int);
int /*<<< orphan*/ printf(char *, int);
void test() {
  uint32_t d = 0x87912990;
  uint32_t e = 0x07590dcd;
  uint32_t f = 0xb092f20c;
  uint32_t g = 0x745a48de;
  uint32_t h = 0x1e578218;
  uint32_t answ = h + BIGS1(e) + CH(e, f, g) + 0xe49b69c1 + 0x6362a380;
  printf("test: %02x", d + answ);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x87912990,-0x4(%rbp)
movl   $0x7590dcd,-0x8(%rbp)
movl   $0xb092f20c,-0xc(%rbp)
movl   $0x745a48de,-0x10(%rbp)
movl   $0x1e578218,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <BIGS1@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <CH@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0xe49b69c1,%eax
add    $0x6362a380,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
add    -0x18(%rbp),%esi
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    $0x7590dcd,%edi
call   1050 <BIGS1@plt>
mov    %eax,%ebx
mov    $0x7590dcd,%edi
mov    $0xb092f20c,%esi
mov    $0x745a48de,%edx
call   1030 <CH@plt>
lea    (%rbx,%rax,1),%esi
add    $0xede6b8e9,%esi
lea    0xe9f(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"test: %02x\00"
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 -2020529776, i32* %1
store i32 123276749, i32* %2
store i32 -1332547060, i32* %3
store i32 1952073950, i32* %4
store i32 509051416, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %2
%9 = call i32 @BIGS1(i32 %8)
%10 = add nsw i32 %7, %9
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @CH(i32 %11, i32 %12, i32 %13)
%15 = add nsw i32 %10, %14
%16 = add i32 %15, -459576895
%17 = add i32 %16, 1667408768
store i32 %17, i32* %6
%18 = load i32, i32* %1
%19 = load i32, i32* %6
%20 = add nsw i32 %18, %19
%21 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"test: %02x\00"
define void @test() {
%1 = tail call i32 @BIGS1(i32 123276749)
%2 = tail call i32 @CH(i32 123276749, i32 -1332547060, i32 1952073950)
%3 = add i32 %1, -303646487
%4 = add i32 %3, %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
unsigned long unsignedlong_ignoring_signedlonglongint(unsigned long x,
                                                      signed long long int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @unsignedlong_ignoring_signedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int is_file_exist(char *file) {
  if (file == NULL) {
    return -1;
  }
  return (access(file, F_OK) ? (-1) : 0);
}


x86 assembly (clang, -O0):
<is_file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <is_file_exist+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <is_file_exist+0x49>
mov    -0x10(%rbp),%rdi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file_exist>:
test   %rdi,%rdi
je     112e <is_file_exist+0x1e>
push   %rax
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
neg    %rax
sbb    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @is_file_exist(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %14
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i32, i32* @F_OK
%10 = call i64 @access(i8* %8, i32 %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 0
store i32 %13, i32* %2
br label %14
14: ; preds = %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @is_file_exist(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32, i32* @F_OK
%5 = tail call i64 @access(i8* %0, i32 %4)
%6 = icmp ne i64 %5, 0
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ tree_start(char *);
int main() {
  tree_start("Robot1");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Robot1\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @tree_start(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Robot1\00"
define i32 @main() {
%1 = tail call i32 @tree_start(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void Free(vpPtr) void *vpPtr;
{ free(vpPtr); }


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

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

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

LLVM IR (-O2):
define void @Free(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ memory_exhausted();
void *jv_mem_calloc(size_t nemb, size_t sz) {
  void *p = calloc(nemb, sz);
  if (!p) {
    memory_exhausted();
  }
  return p;
}


x86 assembly (clang, -O0):
<jv_mem_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <jv_mem_calloc+0x33>
mov    $0x0,%al
call   1040 <memory_exhausted@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jv_mem_calloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <jv_mem_calloc+0x15>
xor    %eax,%eax
call   1040 <memory_exhausted@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @jv_mem_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @memory_exhausted()
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @jv_mem_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @memory_exhausted()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ ioperm(int, int, int);
int /*<<< orphan*/ perror(char *);
void parport_init() {
  if (ioperm(0x378, 0x379 - 0x378 + 1, 1)) {
    perror("Can't get I/O privileges for parallel port");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<parport_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x378,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <ioperm@plt>
cmp    $0x0,%rax
je     1168 <parport_init+0x38>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<parport_init>:
push   %rax
mov    $0x378,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <ioperm@plt>
test   %rax,%rax
jne    114c <parport_init+0x1c>
pop    %rax
ret
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Can't get I/O privileges for parallel port\00"
define void @parport_init() {
%1 = call i64 @ioperm(i32 888, i32 2, i32 1)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @perror(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Can't get I/O privileges for parallel port\00"
define void @parport_init() {
%1 = tail call i64 @ioperm(i32 888, i32 2, i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ crash();
int /*<<< orphan*/ printf(char *);
__attribute__((visibility("default"))) __attribute__((no)) void func1() {
  printf("func1\n");
  crash();
}


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

x86 assembly (clang, -O2):
<func1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <crash@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"func1\00"
define void @func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @crash()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ const *);
struct tm *localtime(const time_t *time) {
  return gmtime(time);
}


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

x86 assembly (clang, -O2):
<localtime>:
jmp    1030 <gmtime@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime(i32* %0) {
%2 = tail call %struct.tm* @gmtime(i32* %0)
ret %struct.tm* %2
}
int simple(int a, int n) {
  for (int i = 1; i <= n; i++) {
    a = a + i;
  }
  return a;
}


x86 assembly (clang, -O0):
<simple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1134 <simple+0x34>
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <simple+0x11>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple>:
mov    %edi,%eax
test   %esi,%esi
jle    111b <simple+0x1b>
lea    (%rax,%rsi,2),%eax
lea    -0x1(%rsi),%ecx
add    $0xfffffffe,%esi
imul   %rcx,%rsi
shr    %rsi
add    %esi,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @simple(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 1, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %10
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @simple(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = shl nuw i32 %1, 1
%6 = add i32 %5, %0
%7 = add nsw i32 %1, -1
%8 = zext i32 %7 to i33
%9 = add nsw i32 %1, -2
%10 = zext i32 %9 to i33
%11 = mul i33 %8, %10
%12 = lshr i33 %11, 1
%13 = trunc i33 %12 to i32
%14 = add i32 %6, %13
%15 = add i32 %14, -1
br label %16
16: ; preds = %4, %2
%17 = phi i32 [ %0, %2 ], [ %15, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *allocassert(void *x) {
  if (!x) {
    fprintf(stderr, "out of memory!\n");
    exit(1);
  }
  return x;
}


x86 assembly (clang, -O0):
<allocassert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <allocassert+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocassert>:
test   %rdi,%rdi
je     1129 <allocassert+0x9>
mov    %rdi,%rax
ret
push   %rax
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"out of memory!\0A\00"
define i8* @allocassert(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"out of memory!\0A\00"
define i8* @allocassert(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCKS_PER_SEC;
__attribute__((always_)) uint32_t
bbb_get_clocks_per_second_profiling_timer(void) {
  return CLOCKS_PER_SEC;
}


x86 assembly (clang, -O0):
<bbb_get_clocks_per_second_profiling_timer>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbb_get_clocks_per_second_profiling_timer>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define i32 @bbb_get_clocks_per_second_profiling_timer() {
%1 = load i32, i32* @CLOCKS_PER_SEC
ret i32 %1
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define i32 @bbb_get_clocks_per_second_profiling_timer() {
%1 = load i32, i32* @CLOCKS_PER_SEC
ret i32 %1
}
void __down_failed_interruptible(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__down_failed_interruptible>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__down_failed_interruptible>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__down_failed_interruptible = [28 x i8] c"__down_failed_interruptible\00"
define void @__down_failed_interruptible() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__func__.__down_failed_interruptible, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__down_failed_interruptible = [28 x i8] c"__down_failed_interruptible\00"
define void @__down_failed_interruptible() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__func__.__down_failed_interruptible, i64 0, i64 0))
ret void
}
int lt(unsigned long a, unsigned long b) { return a < b; }


x86 assembly (clang, -O0):
<lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt>:
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @lt(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lt(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printdiff(void *p1, void *p2) {
  printf(" %d", (int)((unsigned long)p1 - (unsigned long)p2));
}


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

x86 assembly (clang, -O2):
<printdiff>:
mov    %rdi,%rax
sub    %esi,%eax
lea    0xee4(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
define void @printdiff(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 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = sub i64 %6, %8
%10 = trunc i64 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @printdiff(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return (islower(c) ? c - 32 : c); }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
double GetRange(double *sln, int yardage) {
  double size = sln[50001 * 10 + 1];
  if (yardage < size) {
    return sln[10 * yardage];
  } else
    return 0;
}


x86 assembly (clang, -O0):
<GetRange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x3d0958(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114a <GetRange+0x4a>
mov    -0x10(%rbp),%rax
imul   $0xa,-0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1152 <GetRange+0x52>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRange>:
cvtsi2sd %esi,%xmm1
movsd  0x3d0958(%rdi),%xmm2
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm2
jbe    1121 <GetRange+0x21>
add    %esi,%esi
lea    (%rsi,%rsi,4),%eax
cltq
movsd  (%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @GetRange(double* %0, i32 %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
store double* %0, double** %4
store i32 %1, i32* %5
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 500011
%9 = load double, double* %8
store double %9, double* %6
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = load double, double* %6
%13 = fcmp olt double %11, %12
br i1 %13, label %14, label %21
14: ; preds = %2
%15 = load double*, double** %4
%16 = load i32, i32* %5
%17 = mul nsw i32 10, %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %15, i64 %18
%20 = load double, double* %19
store double %20, double* %3
br label %22
21: ; preds = %2
store double 0.000000e+00, double* %3
br label %22
22: ; preds = %21, %14
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @GetRange(double* nocapture %0, i32 %1) {
%3 = getelementptr inbounds double, double* %0, i64 500011
%4 = load double, double* %3
%5 = sitofp i32 %1 to double
%6 = fcmp ogt double %4, %5
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = mul nsw i32 %1, 10
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = load double, double* %10
br label %12
12: ; preds = %2, %7
%13 = phi double [ %11, %7 ], [ 0.000000e+00, %2 ]
ret double %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ia_setbit8(int /*<<< orphan*/, int);
void ia_setbitv(uint8_t *bytes, int i) {
  bytes[i / 8] = ia_setbit8(bytes[i / 8], i % 8);
}


x86 assembly (clang, -O0):
<ia_setbitv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
call   1030 <ia_setbit8@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ia_setbitv>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
sar    $0x3,%ecx
movslq %ecx,%rbx
mov    (%rdi,%rbx,4),%edi
and    $0xfffffff8,%eax
sub    %eax,%esi
call   1030 <ia_setbit8@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ia_setbitv(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = srem i32 %11, 8
%13 = call i32 @ia_setbit8(i32 %10, i32 %12)
%14 = load i32*, i32** %3
%15 = load i32, i32* %4
%16 = sdiv i32 %15, 8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %14, i64 %17
store i32 %13, i32* %18
ret void
}

LLVM IR (-O2):
define void @ia_setbitv(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = srem i32 %1, 8
%8 = tail call i32 @ia_setbit8(i32 %6, i32 %7)
store i32 %8, i32* %5
ret void
}
/* Type definitions */
struct Enemy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy(struct Enemy *);
void enemy_destroy(struct Enemy *enemy) {
  if (enemy) {
    destroy(enemy);
  }
}


x86 assembly (clang, -O0):
<enemy_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <enemy_destroy+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enemy_destroy>:
test   %rdi,%rdi
je     111a <enemy_destroy+0xa>
jmp    1030 <destroy@plt>
ret

LLVM IR (-O0):
%struct.Enemy = type { i32 }
define void @enemy_destroy(%struct.Enemy* %0) {
%2 = alloca %struct.Enemy*
store %struct.Enemy* %0, %struct.Enemy** %2
%3 = load %struct.Enemy*, %struct.Enemy** %2
%4 = icmp ne %struct.Enemy* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.Enemy*, %struct.Enemy** %2
%7 = call i32 @destroy(%struct.Enemy* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.Enemy = type { i32 }
define void @enemy_destroy(%struct.Enemy* %0) {
%2 = icmp eq %struct.Enemy* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @destroy(%struct.Enemy* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int main() {
  int a = 0;
  int i;
  for (i = 0; i < 5; i++) {
    a++;
  }
  while (i > 0) {
    a--;
    i--;
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
jmp    113f <main+0x3f>
cmpl   $0x0,-0xc(%rbp)
jle    1160 <main+0x60>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <main+0x3f>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
int print_uint64(int /*<<< orphan*/, char *);
int print_int64(int64_t n, char *p) {
  int sign;
  if ((sign = n < 0)) {
    *p++ = '-';
    n = -n;
  }
  return print_uint64(n, p) + sign;
}


x86 assembly (clang, -O0):
<print_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    113e <print_int64+0x2e>
jmp    1158 <print_int64+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <print_uint64@plt>
add    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int64>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
js     111b <print_int64+0xb>
mov    %ebx,%edi
jmp    1126 <print_int64+0x16>
movb   $0x2d,(%rsi)
add    $0x1,%rsi
mov    %ebx,%edi
neg    %edi
shr    $0x1f,%ebx
call   1030 <print_uint64@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @print_int64(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %5
br i1 %7, label %9, label %14
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
store i8 45, i8* %10
%12 = load i32, i32* %3
%13 = sub nsw i32 0, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %2
%15 = load i32, i32* %3
%16 = load i8*, i8** %4
%17 = call i32 @print_uint64(i32 %15, i8* %16)
%18 = load i32, i32* %5
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @print_int64(i32 %0, i8* %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%6 = sub nsw i32 0, %0
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %5, %4 ], [ %1, %2 ]
%9 = phi i32 [ %6, %4 ], [ %0, %2 ]
%10 = lshr i32 %0, 31
%11 = tail call i32 @print_uint64(i32 %9, i8* %8)
%12 = add nsw i32 %11, %10
ret i32 %12
}
unsigned char f39(unsigned char x, unsigned int y) {
  return (x >> y) | (x << (8 - y));
}


x86 assembly (clang, -O0):
<f39>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f39>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @f39(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sub i32 8, %11
%13 = shl i32 %10, %12
%14 = or i32 %8, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @f39(i8 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ GLCD_SetWindow(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                  int);
void GLCD_WindowMax(void) { GLCD_SetWindow(0, 0, 320, 240); }


x86 assembly (clang, -O0):
<GLCD_WindowMax>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    $0x140,%edx
mov    $0xf0,%ecx
mov    %esi,%edi
call   1030 <GLCD_SetWindow@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLCD_WindowMax>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0x140,%edx
mov    $0xf0,%ecx
jmp    1030 <GLCD_SetWindow@plt>

LLVM IR (-O0):
define void @GLCD_WindowMax() {
%1 = call i32 @GLCD_SetWindow(i32 0, i32 0, i32 320, i32 240)
ret void
}

LLVM IR (-O2):
define void @GLCD_WindowMax() {
%1 = tail call i32 @GLCD_SetWindow(i32 0, i32 0, i32 320, i32 240)
ret void
}
/* Type definitions */
struct em8051 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int disasm_rl_a(struct em8051 *aCPU, int aPosition, char *aBuffer) {
  sprintf(aBuffer, "RL    A");
  return 1;
}


x86 assembly (clang, -O0):
<disasm_rl_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_rl_a>:
movabs $0x41202020204c52,%rax
mov    %rax,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.em8051 = type { i32 }
@.str = [8 x i8] c"RL A\00"
define i32 @disasm_rl_a(%struct.em8051* %0, i32 %1, i8* %2) {
%4 = alloca %struct.em8051*
%5 = alloca i32
%6 = alloca i8*
store %struct.em8051* %0, %struct.em8051** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.em8051 = type { i32 }
define i32 @disasm_rl_a(%struct.em8051* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %2 to i64*
store i64 18331195836222546, i64* %4
ret i32 1
}
/* Variables and functions */
int count_els(void **tab) {
  char **tmp;
  int i;
  i = -1;
  if ((tmp = (char **)tab) != NULL)
    while (tmp[++i] != NULL)
      ;
  return (i);
}


x86 assembly (clang, -O0):
<count_els>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     114b <count_els+0x4b>
jmp    1126 <count_els+0x26>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1146 <count_els+0x46>
jmp    1126 <count_els+0x26>
jmp    114b <count_els+0x4b>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_els>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111d <count_els+0x1d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <count_els+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_els(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ -1, %1 ]
%5 = add nsw i64 %4, 1
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %5 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ -1, %1 ], [ %10, %9 ]
ret i32 %12
}
int main() {
  int a = 4;
  int b = 3;
  int c = 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double cos_integ2(const double x, const double sinx, const double cosx) {
  return (x * x - 2.0) * sinx + 2.0 * x * cosx;
}


x86 assembly (clang, -O0):
<cos_integ2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xedf(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xec6(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_integ2>:
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  0xef0(%rip),%xmm3
addsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm3
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @cos_integ2(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = call double @llvm.fmuladd.f64(double %7, double %8, double -2.000000e+00)
%10 = load double, double* %5
%11 = load double, double* %4
%12 = fmul double 2.000000e+00, %11
%13 = load double, double* %6
%14 = fmul double %12, %13
%15 = call double @llvm.fmuladd.f64(double %9, double %10, double %14)
ret double %15
}

LLVM IR (-O2):
define double @cos_integ2(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -2.000000e+00)
%5 = fmul double %0, 2.000000e+00
%6 = fmul double %5, %2
%7 = tail call double @llvm.fmuladd.f64(double %4, double %1, double %6)
ret double %7
}
float __attribute__((no)) f(float a, int b) {
  return a - (((float)b / 0x7fffffff) * 100);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
cvtsi2ssl -0x8(%rbp),%xmm0
movss  0xee6(%rip),%xmm2
divss  %xmm2,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xec9(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cvtsi2ss %edi,%xmm1
mulss  0xef4(%rip),%xmm1
mulss  0xef0(%rip),%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = fdiv float %7, 0x41E0000000000000
%9 = fneg float %8
%10 = call float @llvm.fmuladd.f32(float %9, float 1.000000e+02, float %5)
ret float %10
}

LLVM IR (-O2):
define float @f(float %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = fmul float %3, 0xBE00000000000000
%5 = tail call float @llvm.fmuladd.f32(float %4, float 1.000000e+02, float %0)
ret float %5
}
void gtk_entry_get_visibility() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_get_visibility() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ NETSCAPE_SPKI;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ NETSCAPE_SPKI_it;
NETSCAPE_SPKI *d2i_NETSCAPE_SPKI(NETSCAPE_SPKI **a, const unsigned char **in,
                                 long len) {
  return (NETSCAPE_SPKI *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                        &NETSCAPE_SPKI_it);
}


x86 assembly (clang, -O0):
<d2i_NETSCAPE_SPKI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_NETSCAPE_SPKI>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@NETSCAPE_SPKI_it = global i32 0
define i32* @d2i_NETSCAPE_SPKI(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @NETSCAPE_SPKI_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@NETSCAPE_SPKI_it = global i32 0
define i32* @d2i_NETSCAPE_SPKI(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @NETSCAPE_SPKI_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ flockfile(int /*<<< orphan*/ *);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/ *);
int ungetc_unlocked(int, int /*<<< orphan*/ *);
int ungetc(int c, FILE *file) {
  flockfile(file);
  int result = ungetc_unlocked(c, file);
  funlockfile(file);
  return result;
}


x86 assembly (clang, -O0):
<ungetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <flockfile@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <ungetc_unlocked@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <funlockfile@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungetc>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <flockfile@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <ungetc_unlocked@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <funlockfile@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ungetc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = call i32 @flockfile(i32* %6)
%8 = load i32, i32* %3
%9 = load i32*, i32** %4
%10 = call i32 @ungetc_unlocked(i32 %8, i32* %9)
store i32 %10, i32* %5
%11 = load i32*, i32** %4
%12 = call i32 @funlockfile(i32* %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @ungetc(i32 %0, i32* %1) {
%3 = tail call i32 @flockfile(i32* %1)
%4 = tail call i32 @ungetc_unlocked(i32 %0, i32* %1)
%5 = tail call i32 @funlockfile(i32* %1)
ret i32 %4
}
int char_valid(unsigned char c) {
  if (c < 32 || c == '/' || c == '\\')
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<char_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jl     1131 <char_valid+0x31>
movzbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     1131 <char_valid+0x31>
movzbl -0x5(%rbp),%eax
cmp    $0x5c,%eax
jne    113d <char_valid+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <char_valid+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_valid>:
cmp    $0x20,%dil
setae  %al
cmp    $0x5c,%dil
setne  %cl
cmp    $0x2f,%dil
setne  %dl
and    %cl,%dl
and    %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @char_valid(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 32
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 47
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 92
br i1 %14, label %15, label %16
15: ; preds = %11, %7, %1
store i32 0, i32* %2
br label %17
16: ; preds = %11
store i32 1, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @char_valid(i8 zeroext %0) {
%2 = icmp ugt i8 %0, 31
%3 = icmp ne i8 %0, 92
%4 = icmp ne i8 %0, 47
%5 = and i1 %3, %4
%6 = and i1 %2, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void errorDump(const char errorMessage[]) {
  fprintf(stderr, "%s\n", errorMessage);
  exit(1);
}


x86 assembly (clang, -O0):
<errorDump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errorDump>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @errorDump(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @errorDump(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int irq_of_parse_and_map(struct device_node *dev, int index) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.device_node = type opaque
define i32 @irq_of_parse_and_map(%struct.device_node* %0, i32 %1) {
%3 = alloca %struct.device_node*
%4 = alloca i32
store %struct.device_node* %0, %struct.device_node** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.device_node = type opaque
define i32 @irq_of_parse_and_map(%struct.device_node* nocapture readnone %0, i32 %1) {
ret i32 0
}
int execute_afs_syscall() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_afs_syscall() {
ret i32 0
}