xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *strdup(char *);
char *print_int(const void *addr) {
  int num = *(int *)addr;
  char str[15];
  sprintf(str, "%d", num);
  return strdup(str);
}


x86 assembly (clang, -O0):
<print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0x1b(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x1b(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int>:
push   %rbx
sub    $0x10,%rsp
mov    (%rdi),%edx
lea    0xed2(%rip),%rsi
lea    0x1(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @print_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [15 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %4, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [15 x i8], [15 x i8]* %4, i64 0, i64 0
%12 = call i8* @strdup(i8* %11)
ret i8* %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @print_int(i8* nocapture %0) {
%2 = alloca [15 x i8]
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%7 = call i8* @strdup(i8* %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int, unsigned int (*)());
char core_init(unsigned int c, unsigned int (*a)()) {
  if (c != 0x504 && c != 0x508 && c != 0x50C)
    return 1;
  put32(c, a);
  return 0;
}


x86 assembly (clang, -O0):
<core_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x504,-0x8(%rbp)
je     114f <core_init+0x3f>
cmpl   $0x508,-0x8(%rbp)
je     114f <core_init+0x3f>
cmpl   $0x50c,-0x8(%rbp)
je     114f <core_init+0x3f>
movb   $0x1,-0x1(%rbp)
jmp    115f <core_init+0x4f>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <put32@plt>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<core_init>:
mov    $0x1,%al
lea    -0x504(%rdi),%ecx
cmp    $0x8,%ecx
ja     1133 <core_init+0x23>
mov    $0x111,%edx
bt     %ecx,%edx
jae    1133 <core_init+0x23>
push   %rax
call   1030 <put32@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define signext i8 @core_init(i32 %0, i32 (...)* %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32 (...)*
store i32 %0, i32* %4
store i32 (...)* %1, i32 (...)** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 1284
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 1288
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 1292
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 1, i8* %3
br label %19
15: ; preds = %11, %8, %2
%16 = load i32, i32* %4
%17 = load i32 (...)*, i32 (...)** %5
%18 = call i32 @put32(i32 %16, i32 (...)* %17)
store i8 0, i8* %3
br label %19
19: ; preds = %15, %14
%20 = load i8, i8* %3
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @core_init(i32 %0, i32 (...)* %1) {
switch i32 %0, label %5 [
i32 1292, label %3
i32 1288, label %3
i32 1284, label %3
]
3: ; preds = %2, %2, %2
%4 = tail call i32 @put32(i32 %0, i32 (...)* %1)
br label %5
5: ; preds = %2, %3
%6 = phi i8 [ 0, %3 ], [ 1, %2 ]
ret i8 %6
}
/* Type definitions */
typedef int const uint32_t;

/* Variables and functions */
const uint32_t maj(uint32_t x, uint32_t y, uint32_t z) {
  return ((x & y) ^ (x & z) ^ (y & z));
}


x86 assembly (clang, -O0):
<maj>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maj>:
mov    %edx,%eax
xor    %esi,%eax
and    %edi,%eax
and    %esi,%edx
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @maj(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %6
%12 = and i32 %10, %11
%13 = xor i32 %9, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
%17 = xor i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @maj(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, %1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = xor i32 %5, %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ EEXIST;
scalar_t__ errno;
int mkdir(char *, int);
char verify_or_make_dir(char *path) {
  if ((mkdir(path, 0777) == -1) && (errno != EEXIST)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<verify_or_make_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    1156 <verify_or_make_dir+0x46>
mov    0x2e9e(%rip),%rax
mov    (%rax),%rax
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%rax
je     1156 <verify_or_make_dir+0x46>
movb   $0x0,-0x1(%rbp)
jmp    115a <verify_or_make_dir+0x4a>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_or_make_dir>:
push   %rax
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    1136 <verify_or_make_dir+0x26>
mov    0x2eb1(%rip),%rax
mov    (%rax),%rax
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%rax
jne    113a <verify_or_make_dir+0x2a>
mov    $0x1,%al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
@EEXIST = global i64 0
define signext i8 @verify_or_make_dir(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @mkdir(i8* %4, i32 511)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i64, i64* @errno
%9 = load i64, i64* @EEXIST
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
store i8 0, i8* %2
br label %13
12: ; preds = %7, %1
store i8 1, i8* %2
br label %13
13: ; preds = %12, %11
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
@errno = global i64 0
@EEXIST = global i64 0
define signext i8 @verify_or_make_dir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 511)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EEXIST
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i8 [ 1, %8 ], [ 0, %4 ]
ret i8 %10
}
/* Variables and functions */
int foo();
int main() {
  int i = 0;
  while (i < 5) {
    int a = foo();
    i++;
  }
  return foo();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1148 <main+0x38>
mov    $0x0,%al
call   1030 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = call i32 (...) @foo()
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = call i32 (...) @foo()
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @foo()
%6 = tail call i32 (...) @foo()
ret i32 %6
}
double pow(double x, double y) {
  return ({
    extern __typeof__(pow) module_libc_pow;
    &module_libc_pow;
  })(x, y);
}


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2ecf(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
jmp    1030 <module_libc_pow@plt>

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

LLVM IR (-O2):
define double @pow(double %0, double %1) {
%3 = tail call double @module_libc_pow(double %0, double %1)
ret double %3
}
void RTLogDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogDestroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func3(double p1) {
  if ((int)p1)
    printf("func3\n");
}


x86 assembly (clang, -O0):
<func3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1137 <func3+0x27>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func3>:
cvttsd2si %xmm0,%eax
test   %eax,%eax
je     1124 <func3+0x14>
lea    0xee1(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [7 x i8] c"func3\0A\00"
define void @func3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"func3\00"
define void @func3(double %0) {
%2 = fptosi double %0 to i32
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
DumpPlcfand() {
  printf("\n\n\n****************  ANNOTATION TABLES  ***************\n");
  printf("****************  NOT IMPLEMENTED  ***************\n\n");
}


x86 assembly (clang, -O0):
<DumpPlcfand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpPlcfand>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf14(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"\0A\0A\0A**************** ANNOTATION TABLES ***************\0A\00"
@.str.1 = [53 x i8] c"**************** NOT IMPLEMENTED ***************\0A\0A\00"
define i32 @DumpPlcfand() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@str = [56 x i8] c"\0A\0A\0A**************** ANNOTATION TABLES ***************\00"
@str.2 = [52 x i8] c"**************** NOT IMPLEMENTED ***************\0A\00"
define i32 @DumpPlcfand() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.2, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int traverse(const char *file, const struct stat *sb, int flag) {
  printf("found %s\n", file);
  return 0;
}


x86 assembly (clang, -O0):
<traverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traverse>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [10 x i8] c"found %s\0A\00"
define i32 @traverse(i8* %0, %struct.stat* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
int vm_validate_header(char *filename) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vm_validate_header(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ curve25519_donna(unsigned char *, unsigned char const *,
                                    unsigned char const *);
void curve25519_public(const unsigned char *privkey, unsigned char *pubkey) {
  static const unsigned char basepoint[32] = {9};
  curve25519_donna(pubkey, privkey, basepoint);
}


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

x86 assembly (clang, -O2):
<curve25519_public>:
mov    %rdi,%rax
lea    0xee6(%rip),%rdx
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <curve25519_donna@plt>

LLVM IR (-O0):
@curve25519_public.basepoint = internal constant <{ i8, [31 x i8] }> <{ i8 9, [31 x i8] zeroinitializer }>
define void @curve25519_public(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @curve25519_donna(i8* %5, i8* %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* bitcast (<{ i8, [31 x i8] }>* @curve25519_public.basepoint to [32 x i8]*), i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@curve25519_public.basepoint = internal constant <{ i8, [31 x i8] }> <{ i8 9, [31 x i8] zeroinitializer }>
define void @curve25519_public(i8* %0, i8* %1) {
%3 = tail call i32 @curve25519_donna(i8* %1, i8* %0, i8* getelementptr inbounds (<{ i8, [31 x i8] }>, <{ i8, [31 x i8] }>* @curve25519_public.basepoint, i64 0, i32 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vfs;

/* Variables and functions */
int /*<<< orphan*/ sqlite3_snprintf(int, char *, char *);
void wrap_DlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg) {
  sqlite3_snprintf(nByte, zErrMsg, "Loadable extensions are not supported");
  zErrMsg[nByte - 1] = '\0';
}


x86 assembly (clang, -O0):
<wrap_DlError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
lea    0xecf(%rip),%rdx
call   1030 <sqlite3_snprintf@plt>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_DlError>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
lea    0xee1(%rip),%rdx
mov    %esi,%edi
mov    %rbx,%rsi
call   1030 <sqlite3_snprintf@plt>
movslq %ebp,%rax
movb   $0x0,-0x1(%rax,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Loadable extensions are not supported\00"
define void @wrap_DlError(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %6
%9 = call i32 @sqlite3_snprintf(i32 %7, i8* %8, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %6
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Loadable extensions are not supported\00"
define void @wrap_DlError(i32* nocapture readnone %0, i32 %1, i8* %2) {
%4 = tail call i32 @sqlite3_snprintf(i32 %1, i8* %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%5 = add nsw i32 %1, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %2, i64 %6
store i8 0, i8* %7
ret void
}
void gtk_window_set_focus() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_focus() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_cmd(char *);
int main() {
  char *buff = "  !@  #$   usEr     a$@#@ /aa /   fdd";
  parse_cmd(buff);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c" !@ #$ usEr a$@#@ /aa / fdd\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @parse_cmd(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c" !@ #$ usEr a$@#@ /aa / fdd\00"
define i32 @main() {
%1 = tail call i32 @parse_cmd(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void abort() {
  raise(SIGABRT);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
jmp    1122 <abort+0x12>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
nop
jmp    1120 <abort+0x10>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @raise(i32 %1)
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @raise(i32 %1)
br label %3
3: ; preds = %0, %3
br label %3
}
int xIMUReceiverIsFramingChar(const unsigned char c) { return (c & 0x80); }


x86 assembly (clang, -O0):
<xIMUReceiverIsFramingChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xIMUReceiverIsFramingChar>:
mov    %edi,%eax
and    $0xffffff80,%eax
ret

LLVM IR (-O0):
define i32 @xIMUReceiverIsFramingChar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 128
ret i32 %5
}

LLVM IR (-O2):
define i32 @xIMUReceiverIsFramingChar(i8 zeroext %0) {
%2 = and i8 %0, -128
%3 = zext i8 %2 to i32
ret i32 %3
}
void uart1_puts(const char *s) {}


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

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

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

LLVM IR (-O2):
define void @uart1_puts(i8* nocapture %0) {
ret void
}
/* Variables and functions */
float round(float);
float _round(float s) { return round(s); }


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

x86 assembly (clang, -O2):
<_round>:
jmp    1030 <roundf@plt>

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

LLVM IR (-O2):
define float @_round(float %0) {
%2 = tail call float @llvm.round.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Clear_Config_File(void *location) {
  if (!location)
    return;
  free(location);
}


x86 assembly (clang, -O0):
<Clear_Config_File>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <Clear_Config_File+0x1c>
jmp    1135 <Clear_Config_File+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Clear_Config_File(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 %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @Clear_Config_File(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
int is_prime(int num) {
  int i;
  if (num == 2) {
    return 1;
  }
  for (i = 2; i < num / 2; i++) {
    if (num % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    111d <is_prime+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1178 <is_prime+0x78>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    1171 <is_prime+0x71>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    115e <is_prime+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    1178 <is_prime+0x78>
jmp    1163 <is_prime+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <is_prime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%r8d
cmp    $0x6,%edi
jl     1130 <is_prime+0x30>
mov    %edi,%esi
shr    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1134 <is_prime+0x34>
add    $0x1,%ecx
cmp    %ecx,%esi
jne    1120 <is_prime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 5
br i1 %2, label %3, label %12
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %7
5: ; preds = %7
%6 = icmp eq i32 %11, %4
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %7, %5, %1
%13 = phi i32 [ 1, %1 ], [ 0, %7 ], [ 1, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glutWireTetrahedron();
void drawTetra(void) {
  glColor3f(1.0, 0.5, 0.0);
  glPushMatrix();
  glScalef(6.0, 6.0, 6.0);
  glutWireTetrahedron();
  glPopMatrix();
}


x86 assembly (clang, -O0):
<drawTetra>:
push   %rbp
mov    %rsp,%rbp
movsd  0xeac(%rip),%xmm0
movsd  0xeac(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1050 <glColor3f@plt>
mov    $0x0,%al
call   1070 <glPushMatrix@plt>
movsd  0xe85(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1060 <glScalef@plt>
mov    $0x0,%al
call   1030 <glutWireTetrahedron@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawTetra>:
push   %rax
movsd  0xea7(%rip),%xmm0
movsd  0xea7(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1050 <glColor3f@plt>
xor    %eax,%eax
call   1070 <glPushMatrix@plt>
movsd  0xe98(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1060 <glScalef@plt>
xor    %eax,%eax
call   1030 <glutWireTetrahedron@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
define void @drawTetra() {
%1 = call i32 @glColor3f(double 1.000000e+00, double 5.000000e-01, double 0.000000e+00)
%2 = call i32 (...) @glPushMatrix()
%3 = call i32 @glScalef(double 6.000000e+00, double 6.000000e+00, double 6.000000e+00)
%4 = call i32 (...) @glutWireTetrahedron()
%5 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @drawTetra() {
%1 = tail call i32 @glColor3f(double 1.000000e+00, double 5.000000e-01, double 0.000000e+00)
%2 = tail call i32 (...) @glPushMatrix()
%3 = tail call i32 @glScalef(double 6.000000e+00, double 6.000000e+00, double 6.000000e+00)
%4 = tail call i32 (...) @glutWireTetrahedron()
%5 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
unsigned int htonl(unsigned int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned int *, int);
unsigned char *address_ipv4(unsigned a, unsigned char *ipv4) {
  a = htonl(a);
  memcpy(ipv4, &a, 4);
  return ipv4;
}


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

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

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

LLVM IR (-O2):
define i8* @address_ipv4(i32 %0, i8* returned %1) {
%3 = alloca i32
%4 = tail call i32 @htonl(i32 %0)
store i32 %4, i32* %3
%5 = call i32 @memcpy(i8* %1, i32* %3, i32 4)
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ z_streamp;

/* Variables and functions */
int deflateReset(int /*<<< orphan*/);
__attribute__((__visibility__("default"))) int kz_deflateReset(z_streamp strm) {
  return deflateReset(strm);
}


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

x86 assembly (clang, -O2):
<kz_deflateReset>:
jmp    1030 <deflateReset@plt>

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

LLVM IR (-O2):
define i32 @kz_deflateReset(i32 %0) {
%2 = tail call i32 @deflateReset(i32 %0)
ret i32 %2
}
float degree2radiant(float d) { return (d * 3.14159265358979323846) / 180; }


x86 assembly (clang, -O0):
<degree2radiant>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degree2radiant>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @degree2radiant(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x400921FB54442D18
%6 = fdiv double %5, 1.800000e+02
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @degree2radiant(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x400921FB54442D18
%4 = fdiv double %3, 1.800000e+02
%5 = fptrunc double %4 to float
ret float %5
}
int sgn(float z) { return ((z < 0) ? -1 : (z == 0) ? 0 : 1); }


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1123 <sgn+0x23>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <sgn+0x45>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0x1,%eax
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
xorps  %xmm1,%xmm1
movaps %xmm0,%xmm2
cmpneqss %xmm1,%xmm2
movd   %xmm2,%ecx
and    $0x1,%ecx
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sgn(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load float, float* %2
%8 = fcmp oeq float %7, 0.000000e+00
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 1
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ -1, %5 ], [ %10, %6 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @sgn(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp une float %0, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = select i1 %2, i32 -1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exiterr();
int /*<<< orphan*/ faterror(char *);
int looping;
volatile void IOerror() {
  static looping;
  if (looping)
    exiterr();
  looping = 1;
  faterror("input/output error; is the file system full?");
}


x86 assembly (clang, -O0):
<IOerror>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
je     1138 <IOerror+0x18>
mov    $0x0,%al
call   1030 <exiterr@plt>
movl   $0x1,0x2ef2(%rip)
lea    0xeb7(%rip),%rdi
call   1040 <faterror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IOerror>:
push   %rax
cmpb   $0x1,0x2f0c(%rip)
jne    1131 <IOerror+0x11>
xor    %eax,%eax
call   1030 <exiterr@plt>
movb   $0x1,0x2efc(%rip)
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1040 <faterror@plt>

LLVM IR (-O0):
@IOerror.looping = internal global i32 0
@.str = [45 x i8] c"input/output error; is the file system full?\00"
@looping = global i32 0
define void @IOerror() {
%1 = load i32, i32* @IOerror.looping
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @exiterr()
br label %5
5: ; preds = %3, %0
store i32 1, i32* @IOerror.looping
%6 = call i32 @faterror(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@IOerror.looping = internal unnamed_addr global i1 false
@.str = [45 x i8] c"input/output error; is the file system full?\00"
@looping = global i32 0
define void @IOerror() {
%1 = load i1, i1* @IOerror.looping
br i1 %1, label %2, label %4
2: ; preds = %0
%3 = tail call i32 (...) @exiterr()
br label %4
4: ; preds = %2, %0
store i1 true, i1* @IOerror.looping
%5 = tail call i32 @faterror(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
int main() {
  unsigned char c = 57;
  printf("c: %u\n", c);
  printf("~c: %u\n", (unsigned char)~c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x39,-0x5(%rbp)
lea    0xed7(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
movzbl -0x5(%rbp),%eax
xor    $0xffffffff,%eax
lea    0xebf(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee9(%rip),%rdi
mov    $0x39,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0xc6,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"c: %u\0A\00"
@.str.1 = [8 x i8] c"~c: %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 57, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = xor i32 %6, -1
%8 = trunc i32 %7 to i8
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"c: %u\0A\00"
@.str.1 = [8 x i8] c"~c: %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext 57)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext -58)
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int main() {
  int i = 0;
  char *buf[10];
  while (i < 10) {
    buf[i] = (char *)calloc(1, 1024 * 1024 * 256);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1159 <main+0x49>
mov    $0x1,%edi
mov    $0x10000000,%esi
call   1030 <calloc@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
mov    %rcx,-0x60(%rbp,%rax,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i8*]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = call i64 @calloc(i32 1, i32 268435456)
%9 = inttoptr i64 %8 to i8*
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 %11
store i8* %9, i8** %12
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @calloc(i32 1, i32 268435456)
%2 = tail call i64 @calloc(i32 1, i32 268435456)
%3 = tail call i64 @calloc(i32 1, i32 268435456)
%4 = tail call i64 @calloc(i32 1, i32 268435456)
%5 = tail call i64 @calloc(i32 1, i32 268435456)
%6 = tail call i64 @calloc(i32 1, i32 268435456)
%7 = tail call i64 @calloc(i32 1, i32 268435456)
%8 = tail call i64 @calloc(i32 1, i32 268435456)
%9 = tail call i64 @calloc(i32 1, i32 268435456)
%10 = tail call i64 @calloc(i32 1, i32 268435456)
ret i32 0
}
int *test1(int *a) { return a + 1; }


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

x86 assembly (clang, -O2):
<test1>:
lea    0x4(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @test1(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
ret i32* %2
}
/* Variables and functions */
scalar_t__ yylex();
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  while (yylex() != 0)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <yylex@plt>
cmp    $0x0,%rax
je     113c <main+0x2c>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <yylex@plt>
test   %rax,%rax
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 (...) @yylex()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ core5_swap(char *, int);
void U_EMRCLOSEFIGURE_swap(char *record, int torev) {
  core5_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRCLOSEFIGURE_swap>:
jmp    1030 <core5_swap@plt>

LLVM IR (-O0):
define void @U_EMRCLOSEFIGURE_swap(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 = call i32 @core5_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_EMRCLOSEFIGURE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_append_strv(void *m, char **l) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_append_strv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_append_strv>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_append_strv(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_append_strv(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int _sys_close(int);
int close(int fd) { return _sys_close(fd); }


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

x86 assembly (clang, -O2):
<close>:
jmp    1030 <_sys_close@plt>

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @_sys_close(i32 %0)
ret i32 %2
}
/* Type definitions */
struct in_addr {
  unsigned int s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ inet_pton(int /*<<< orphan*/, char *, struct in_addr *);
unsigned int inet_str_to_hex(char *str) {
  struct in_addr sa;
  inet_pton(AF_INET, str, &sa);
  return sa.s_addr;
}


x86 assembly (clang, -O0):
<inet_str_to_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <inet_pton@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_str_to_hex>:
push   %rax
mov    %rdi,%rsi
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
call   1030 <inet_pton@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i32 @inet_str_to_hex(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.in_addr
store i8* %0, i8** %2
%4 = load i32, i32* @AF_INET
%5 = load i8*, i8** %2
%6 = call i32 @inet_pton(i32 %4, i8* %5, %struct.in_addr* %3)
%7 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i32 @inet_str_to_hex(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = load i32, i32* @AF_INET
%5 = call i32 @inet_pton(i32 %4, i8* %0, %struct.in_addr* %2)
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
void LcdModel_Init() {}


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

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

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

LLVM IR (-O2):
define void @LcdModel_Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void stub1();
void run_test(const char *test_name, void (*test_case)(void)) {
  printf("%s -->", test_name);
  (*test_case)();
  printf("<-- finished\n");
}


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

x86 assembly (clang, -O2):
<run_test>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
call   *%rbx
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s -->\00"
@.str.1 = [14 x i8] c"<-- finished\0A\00"
define void @run_test(i8* %0, void ()* %1) {
%3 = alloca i8*
%4 = alloca void ()*
store i8* %0, i8** %3
store void ()* %1, void ()** %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load void ()*, void ()** %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s -->\00"
@str = [13 x i8] c"<-- finished\00"
define void @run_test(i8* %0, void ()* nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
tail call void %1()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t ISignf(float x) { return (0.0f < x) - (x < 0.0f); }


x86 assembly (clang, -O0):
<ISignf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISignf>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ISignf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float 0.000000e+00, %3
%5 = zext i1 %4 to i32
%6 = load float, float* %2
%7 = fcmp olt float %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ISignf(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt float %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
ret i32 %6
}
extern void outsw(unsigned short port, const void *addr, unsigned long count) {
  __asm__ __volatile__("rep ; outs"
                       "w"
                       : "=S"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
rep outsw %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsw>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsw %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "rep ; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep ; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}