xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("Hello, World v%s!\n", ("1"
                                 "."
                                 "0"
                                 "."
                                 "0"));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Hello, World v%s!\0A\00"
@.str.1 = [6 x i8] c"1.0.0\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Hello, World v%s!\0A\00"
@.str.1 = [6 x i8] c"1.0.0\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int register_reboot_notifier(struct notifier_block *x) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.notifier_block = type opaque
define i32 @register_reboot_notifier(%struct.notifier_block* %0) {
%2 = alloca %struct.notifier_block*
%3 = alloca i32
store %struct.notifier_block* %0, %struct.notifier_block** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @register_reboot_notifier(%struct.notifier_block* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SMBWriteWord(int, int, int);
int /*<<< orphan*/ sleep(int);
void eraseEepromFlash() {
  SMBWriteWord(0x16, 0x12, 0x83DE);
  sleep(1);
}


x86 assembly (clang, -O0):
<eraseEepromFlash>:
push   %rbp
mov    %rsp,%rbp
mov    $0x16,%edi
mov    $0x12,%esi
mov    $0x83de,%edx
call   1030 <SMBWriteWord@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eraseEepromFlash>:
push   %rax
mov    $0x16,%edi
mov    $0x12,%esi
mov    $0x83de,%edx
call   1030 <SMBWriteWord@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
define void @eraseEepromFlash() {
%1 = call i32 @SMBWriteWord(i32 22, i32 18, i32 33758)
%2 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @eraseEepromFlash() {
%1 = tail call i32 @SMBWriteWord(i32 22, i32 18, i32 33758)
%2 = tail call i32 @sleep(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int __infer_nondet_int();
int pthread_mutexattr_init(pthread_mutexattr_t *attr) {
  if (attr == 0)
    while (1)
      ;
  return __infer_nondet_int();
}


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

x86 assembly (clang, -O2):
<pthread_mutexattr_init>:
test   %rdi,%rdi
je     1120 <pthread_mutexattr_init+0x10>
xor    %eax,%eax
jmp    1030 <__infer_nondet_int@plt>
nopl   0x0(%rax)
jmp    1120 <pthread_mutexattr_init+0x10>

LLVM IR (-O0):
define i32 @pthread_mutexattr_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
br label %6
6: ; preds = %5, %6
br label %6
7: ; preds = %1
%8 = call i32 (...) @__infer_nondet_int()
ret i32 %8
}

LLVM IR (-O2):
define i32 @pthread_mutexattr_init(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
%5 = tail call i32 (...) @__infer_nondet_int()
ret i32 %5
}
void __attribute__((visibility("default"))) _mcleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @_mcleanup() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t w2rev(uint16_t const x) {
  return ((0xff & (x >> (0 * 8))) << (1 * 8)) |
         ((0xff & (x >> (1 * 8))) << (0 * 8));
}


x86 assembly (clang, -O0):
<w2rev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<w2rev>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @w2rev(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 0
%5 = and i32 255, %4
%6 = shl i32 %5, 8
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = and i32 255, %8
%10 = shl i32 %9, 0
%11 = or i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @w2rev(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void retire(void) {
  printf("So long for now.\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<retire>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<retire>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"So long for now.\0A\00"
@EXIT_SUCCESS = global i32 0
define void @retire() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [17 x i8] c"So long for now.\00"
define void @retire() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void internal_function_is_not_visible() {
  printf("You can't call me directly.\n");
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"You can't call me directly.\0A\00"
define void @internal_function_is_not_visible() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"You can't call me directly.\00"
define void @internal_function_is_not_visible() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x;
  int r = rand();
  if (r > 0) {
    x = 42;
  } else {
    x = 7;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1146 <main+0x36>
movl   $0x2a,-0x14(%rbp)
jmp    114d <main+0x3d>
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
test   %eax,%eax
mov    $0x2a,%ecx
mov    $0x7,%eax
cmovg  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 42, i32 7
ret i32 %5
}
long long susz() { return 0xffff7fffffff0000LL; }


x86 assembly (clang, -O0):
<susz>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff7fffffff0000,%rax
7f ff ff
pop    %rbp
ret

x86 assembly (clang, -O2):
<susz>:
movabs $0xffff7fffffff0000,%rax
7f ff ff
ret

LLVM IR (-O0):
define i64 @susz() {
ret i64 -140737488420864
}

LLVM IR (-O2):
define i64 @susz() {
ret i64 -140737488420864
}
int test_imm_12uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x12 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_12uint64_lowword_reg>:
test   $0x12,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_12uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 18
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_12uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 18
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *full_tmp_name(const char *filename) {
  char *full_name;
  const char *tmp_dir;
  tmp_dir = get_asf_tmp_dir();
  full_name =
      (char *)malloc(sizeof(char) * (strlen(filename) + strlen(tmp_dir) + 10));
  sprintf(full_name, "%s%c%s", tmp_dir, '/', filename);
  return full_name;
}


x86 assembly (clang, -O0):
<full_tmp_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_asf_tmp_dir@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0xa,%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%r8
lea    0xe66(%rip),%rsi
mov    $0x2f,%ecx
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<full_tmp_name>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <get_asf_tmp_dir@plt>
movslq %eax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0xa,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xe84(%rip),%rsi
mov    %rax,%rdi
mov    %r15,%rdx
mov    $0x2f,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s%c%s\00"
define i8* @full_tmp_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i32 (...) @get_asf_tmp_dir()
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %2
%9 = call i64 @strlen(i8* %8)
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
%12 = add i64 %9, %11
%13 = add i64 %12, 10
%14 = mul i64 1, %13
%15 = call i8* @malloc(i64 %14)
store i8* %15, i8** %3
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = load i8*, i8** %2
%19 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %17, i32 47, i8* %18)
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%c%s\00"
define noalias i8* @full_tmp_name(i8* %0) {
%2 = tail call i32 (...) @get_asf_tmp_dir()
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %4)
%7 = add i64 %5, 10
%8 = add i64 %7, %6
%9 = tail call i8* @malloc(i64 %8)
%10 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %9, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i32 47, i8* %0)
ret i8* %9
}
void _Z12_Jv_init_cifP13_Jv_Utf8ConstibP7ffi_cifPP9_ffi_typeS5_(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z12_Jv_init_cifP13_Jv_Utf8ConstibP7ffi_cifPP9_ffi_typeS5_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void delete_type(char *type) { free(type); }


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

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

LLVM IR (-O2):
define void @delete_type(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct user_desc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_modify_ldt;
int errno;
int syscall(int /*<<< orphan*/, int, struct user_desc *, unsigned long);
int safe_modify_ldt(int func, struct user_desc *ptr, unsigned long bytecount) {
  int ret = syscall(SYS_modify_ldt, 0x11, ptr, bytecount);
  if (ret < -1) {
    errno = -ret;
  }
  return ret;
}


x86 assembly (clang, -O0):
<safe_modify_ldt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x11,%esi
call   1030 <syscall@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jge    1159 <safe_modify_ldt+0x49>
xor    %ecx,%ecx
sub    -0x1c(%rbp),%ecx
mov    0x2e89(%rip),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_modify_ldt>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    $0x11,%esi
call   1030 <syscall@plt>
cmp    $0xfffffffe,%eax
jg     113c <safe_modify_ldt+0x2c>
mov    %eax,%ecx
neg    %ecx
mov    0x2ea6(%rip),%rdx
mov    %ecx,(%rdx)
pop    %rcx
ret

LLVM IR (-O0):
%struct.user_desc = type { i32 }
@SYS_modify_ldt = global i32 0
@errno = global i32 0
define i32 @safe_modify_ldt(i32 %0, %struct.user_desc* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.user_desc*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store %struct.user_desc* %1, %struct.user_desc** %5
store i64 %2, i64* %6
%8 = load i32, i32* @SYS_modify_ldt
%9 = load %struct.user_desc*, %struct.user_desc** %5
%10 = load i64, i64* %6
%11 = call i32 @syscall(i32 %8, i32 17, %struct.user_desc* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* %7
%16 = sub nsw i32 0, %15
store i32 %16, i32* @errno
br label %17
17: ; preds = %14, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
%struct.user_desc = type { i32 }
@SYS_modify_ldt = global i32 0
@errno = global i32 0
define i32 @safe_modify_ldt(i32 %0, %struct.user_desc* %1, i64 %2) {
%4 = load i32, i32* @SYS_modify_ldt
%5 = tail call i32 @syscall(i32 %4, i32 17, %struct.user_desc* %1, i64 %2)
%6 = icmp slt i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = sub nsw i32 0, %5
store i32 %8, i32* @errno
br label %9
9: ; preds = %7, %3
ret i32 %5
}
void abcde6fghijklmn9opqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcde6fghijklmn9opqrstuvwxzy() {
ret void
}
unsigned long long unsignedlonglong_ignoring_signedchar(unsigned long long x,
                                                        signed char y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlonglong_ignoring_signedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_signedchar(i64 returned %0, i8 signext %1) {
ret i64 %0
}
int is_data_packet(int opcode) { return opcode == 3; }


x86 assembly (clang, -O0):
<is_data_packet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_data_packet>:
xor    %eax,%eax
cmp    $0x3,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_data_packet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_data_packet(i32 %0) {
%2 = icmp eq i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ geoXyz2Rae(double *, double *);
double geoXyz2R(double x, double y, double z) {
  double rae[3], xyz[3];
  xyz[0] = x;
  xyz[1] = y;
  xyz[2] = z;
  geoXyz2Rae(xyz, rae);
  return (rae[0]);
}


x86 assembly (clang, -O0):
<geoXyz2R>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <geoXyz2Rae@plt>
movsd  -0x30(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geoXyz2R>:
sub    $0x38,%rsp
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
call   1030 <geoXyz2Rae@plt>
movsd  0x20(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @geoXyz2R(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca [3 x double]
%8 = alloca [3 x double]
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
store double %9, double* %10
%11 = load double, double* %5
%12 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 1
store double %11, double* %12
%13 = load double, double* %6
%14 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 2
store double %13, double* %14
%15 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%16 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%17 = call i32 @geoXyz2Rae(double* %15, double* %16)
%18 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%19 = load double, double* %18
ret double %19
}

LLVM IR (-O2):
define double @geoXyz2R(double %0, double %1, double %2) {
%4 = alloca [3 x double]
%5 = alloca [3 x double]
%6 = bitcast [3 x double]* %4 to i8*
%7 = bitcast [3 x double]* %5 to i8*
%8 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
store double %0, double* %8
%9 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
store double %1, double* %9
%10 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
store double %2, double* %10
%11 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%12 = call i32 @geoXyz2Rae(double* %8, double* %11)
%13 = load double, double* %11
ret double %13
}
/* Variables and functions */
size_t sce_bitstobytes(size_t n_bits) {
  return n_bits / 8 + (n_bits % 8 ? 1 : 0);
}


x86 assembly (clang, -O0):
<sce_bitstobytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
mov    -0x8(%rbp),%rsi
and    $0x7,%rsi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%rsi
cmovne %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sce_bitstobytes>:
mov    %rdi,%rax
shr    $0x3,%rax
and    $0x7,%edi
cmp    $0x1,%rdi
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @sce_bitstobytes(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 8
%5 = load i64, i64* %2
%6 = urem i64 %5, 8
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
%10 = sext i32 %9 to i64
%11 = add i64 %4, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @sce_bitstobytes(i64 %0) {
%2 = lshr i64 %0, 3
%3 = and i64 %0, 7
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i64
%6 = add nuw nsw i64 %2, %5
ret i64 %6
}
/* Type definitions */
struct CRYPTO_dynlock_value {
  int dummy;
};

/* Variables and functions */
scalar_t__ d0_createmutex();
struct CRYPTO_dynlock_value *dyn_create_function(const char *file, int line) {
  return (struct CRYPTO_dynlock_value *)d0_createmutex();
}


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

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

LLVM IR (-O0):
%struct.CRYPTO_dynlock_value = type { i32 }
define %struct.CRYPTO_dynlock_value* @dyn_create_function(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i64 (...) @d0_createmutex()
%6 = inttoptr i64 %5 to %struct.CRYPTO_dynlock_value*
ret %struct.CRYPTO_dynlock_value* %6
}

LLVM IR (-O2):
%struct.CRYPTO_dynlock_value = type { i32 }
define %struct.CRYPTO_dynlock_value* @dyn_create_function(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i64 (...) @d0_createmutex()
%4 = inttoptr i64 %3 to %struct.CRYPTO_dynlock_value*
ret %struct.CRYPTO_dynlock_value* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, product;
#pragma omp parallel for reduction(* : product)
  for (i = 1; i <= 30; i++)
    product *= i;
  printf("Result = %d\n", product);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jg     1148 <main+0x38>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Result = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
unsigned isprint(char c) { return (c >= 0x20 && c <= 0x7e); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isprint+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xe0,%dil
xor    %eax,%eax
cmp    $0x5f,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 126
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isprint(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write_port(unsigned short, int);
void configure_serial_modem(unsigned short com) { write_port((com + 4), 0x03); }


x86 assembly (clang, -O0):
<configure_serial_modem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x4,%eax
mov    $0x3,%esi
movzwl %ax,%edi
call   1030 <write_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure_serial_modem>:
add    $0x4,%edi
movzwl %di,%edi
mov    $0x3,%esi
jmp    1030 <write_port@plt>

LLVM IR (-O0):
define void @configure_serial_modem(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = add nsw i32 %4, 4
%6 = trunc i32 %5 to i16
%7 = call i32 @write_port(i16 zeroext %6, i32 3)
ret void
}

LLVM IR (-O2):
define void @configure_serial_modem(i16 zeroext %0) {
%2 = add i16 %0, 4
%3 = tail call i32 @write_port(i16 zeroext %2, i32 3)
ret void
}
void sound_play(int sound, float *noisepos, float *playerpos, float *playeror) {
  return;
}


x86 assembly (clang, -O0):
<sound_play>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sound_play(i32 %0, float* %1, float* %2, float* %3) {
%5 = alloca i32
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
store i32 %0, i32* %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
ret void
}

LLVM IR (-O2):
define void @sound_play(i32 %0, float* nocapture %1, float* nocapture %2, float* nocapture %3) {
ret void
}
void mdio_ready() {
  int i;
  for (;;) {
    if ((*(volatile unsigned int *)(0x2000003C) & 0x2) == 0x0)
      break;
    i++;
    if (i == 10000000) {
      i = 0;
    }
  }
}


x86 assembly (clang, -O0):
<mdio_ready>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2000003c,%eax
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    111c <mdio_ready+0x1c>
jmp    113e <mdio_ready+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x989680,-0x4(%rbp)
jne    1139 <mdio_ready+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1104 <mdio_ready+0x4>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdio_ready>:
testl  $0x2,0x2000003c
jne    1100 <mdio_ready>
ret

LLVM IR (-O0):
define void @mdio_ready() {
%1 = alloca i32
br label %2
2: ; preds = %13, %0
%3 = load volatile i32, i32* inttoptr (i64 536870972 to i32*)
%4 = and i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %14
7: ; preds = %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 10000000
br i1 %11, label %12, label %13
12: ; preds = %7
store i32 0, i32* %1
br label %13
13: ; preds = %12, %7
br label %2
14: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @mdio_ready() {
%1 = load volatile i32, i32* inttoptr (i64 536870972 to i32*)
%2 = and i32 %1, 2
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0, %4
%5 = load volatile i32, i32* inttoptr (i64 536870972 to i32*)
%6 = and i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_chdir(int /*<<< orphan*/);
int /*<<< orphan*/ op_chdirup();
int /*<<< orphan*/ op_mkdir(int);
int /*<<< orphan*/ op_renamexd(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ op_sync();
void wl_renamexddir(void) {
  op_mkdir(0);
  op_mkdir(1);
  op_chdir(0);
  op_mkdir(2);
  op_chdirup();
  op_sync();
  op_renamexd(0, 2, 1, 3);
}


x86 assembly (clang, -O0):
<wl_renamexddir>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <op_mkdir@plt>
mov    $0x1,%edi
call   1040 <op_mkdir@plt>
xor    %edi,%edi
call   1070 <op_chdir@plt>
mov    $0x2,%edi
call   1040 <op_mkdir@plt>
mov    $0x0,%al
call   1050 <op_chdirup@plt>
mov    $0x0,%al
call   1060 <op_sync@plt>
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1030 <op_renamexd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_renamexddir>:
push   %rax
xor    %edi,%edi
call   1040 <op_mkdir@plt>
mov    $0x1,%edi
call   1040 <op_mkdir@plt>
xor    %edi,%edi
call   1070 <op_chdir@plt>
mov    $0x2,%edi
call   1040 <op_mkdir@plt>
xor    %eax,%eax
call   1050 <op_chdirup@plt>
xor    %eax,%eax
call   1060 <op_sync@plt>
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
pop    %rax
jmp    1030 <op_renamexd@plt>

LLVM IR (-O0):
define void @wl_renamexddir() {
%1 = call i32 @op_mkdir(i32 0)
%2 = call i32 @op_mkdir(i32 1)
%3 = call i32 @op_chdir(i32 0)
%4 = call i32 @op_mkdir(i32 2)
%5 = call i32 (...) @op_chdirup()
%6 = call i32 (...) @op_sync()
%7 = call i32 @op_renamexd(i32 0, i32 2, i32 1, i32 3)
ret void
}

LLVM IR (-O2):
define void @wl_renamexddir() {
%1 = tail call i32 @op_mkdir(i32 0)
%2 = tail call i32 @op_mkdir(i32 1)
%3 = tail call i32 @op_chdir(i32 0)
%4 = tail call i32 @op_mkdir(i32 2)
%5 = tail call i32 (...) @op_chdirup()
%6 = tail call i32 (...) @op_sync()
%7 = tail call i32 @op_renamexd(i32 0, i32 2, i32 1, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Working late.\n");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Working late.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test5() {
  int x, y;
  x = y;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @test5() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ add_contact(char *, int);
int check_name(char *);
int /*<<< orphan*/ display_user_list();
int add_user(char *name, int socket) {
  int error = check_name(name);
  if (error != 0)
    return error;
  add_contact(name, socket);
  display_user_list();
  return 0;
}


x86 assembly (clang, -O0):
<add_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <check_name@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1160 <add_user+0x30>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <add_user+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <add_contact@plt>
mov    $0x0,%al
call   1030 <display_user_list@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_user>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbp
call   1040 <check_name@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1157 <add_user+0x27>
mov    %rbp,%rdi
mov    %r14d,%esi
call   1050 <add_contact@plt>
xor    %eax,%eax
call   1030 <display_user_list@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @add_user(i8* %0, i32 %1) {
%3 = tail call i32 @check_name(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @add_contact(i8* %0, i32 %1)
%7 = tail call i32 (...) @display_user_list()
br label %8
8: ; preds = %2, %5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *acomalloc(size_t len) {
  void *ptr = malloc(len);
  if (ptr == NULL) {
    fprintf(stderr, "Out of memory!\n");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<acomalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <acomalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acomalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <acomalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory!\0A\00"
define noalias i8* @acomalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
struct sk_buff {
  int dummy;
};

/* Variables and functions */
struct sk_buff *__dev_alloc_skb(unsigned int, int);
struct sk_buff *dev_alloc_skb(unsigned int length) {
  return __dev_alloc_skb(length, (0x20));
}


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

x86 assembly (clang, -O2):
<dev_alloc_skb>:
mov    $0x20,%esi
jmp    1030 <__dev_alloc_skb@plt>

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

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
define %struct.sk_buff* @dev_alloc_skb(i32 %0) {
%2 = tail call %struct.sk_buff* @__dev_alloc_skb(i32 %0, i32 32)
ret %struct.sk_buff* %2
}
void destroy_image_data(char **src, int y) {
  while (y--)
    free(src[y]);
  free(src);
}


x86 assembly (clang, -O0):
<destroy_image_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1149 <destroy_image_data+0x39>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    111f <destroy_image_data+0xf>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_image_data>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
je     1152 <destroy_image_data+0x42>
mov    %esi,%r12d
movslq %esi,%rax
lea    (%r14,%rax,8),%r15
add    $0xfffffffffffffff8,%r15
neg    %r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r12d
jne    1140 <destroy_image_data+0x30>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy_image_data(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = trunc i64 %8 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fault_init();
int test_main(int, char **);
int main(int argc, char *argv[]) {
  fault_init();
  return test_main(argc, argv);
}


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   1040 <fault_init@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <fault_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <test_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @fault_init()
%4 = tail call i32 @test_main(i32 %0, i8** %1)
ret i32 %4
}
void websils_tls_api_0() {}


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

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

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

LLVM IR (-O2):
define void @websils_tls_api_0() {
ret void
}
int estimatedLengthOfwith(int deltaX, int deltaY) {
  int absDy;
  int absDx;
  if (deltaX >= 0) {
    absDx = deltaX;
  } else {
    absDx = 0 - deltaX;
  }
  if (deltaY >= 0) {
    absDy = deltaY;
  } else {
    absDy = 0 - deltaY;
  }
  if (absDx > absDy) {
    return absDx + (((int)absDy >> 1));
  } else {
    return absDy + (((int)absDx >> 1));
  }
}


x86 assembly (clang, -O0):
<estimatedLengthOfwith>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111f <estimatedLengthOfwith+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <estimatedLengthOfwith+0x27>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     113c <estimatedLengthOfwith+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <estimatedLengthOfwith+0x44>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1163 <estimatedLengthOfwith+0x63>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <estimatedLengthOfwith+0x71>
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimatedLengthOfwith>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    %esi,%edx
neg    %edx
cmovs  %esi,%edx
mov    %edx,%esi
shr    %esi
add    %ecx,%esi
mov    %ecx,%eax
shr    %eax
add    %edx,%eax
cmp    %edx,%ecx
cmova  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @estimatedLengthOfwith(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%5 = icmp ugt i32 %3, %4
%6 = lshr i32 %4, 1
%7 = add nuw nsw i32 %6, %3
%8 = lshr i32 %3, 1
%9 = add nuw nsw i32 %4, %8
%10 = select i1 %5, i32 %7, i32 %9
ret i32 %10
}
int fun768() { return 768; }


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

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

LLVM IR (-O0):
define i32 @fun768() {
ret i32 768
}

LLVM IR (-O2):
define i32 @fun768() {
ret i32 768
}
/* Variables and functions */
size_t returnsChar();
void t5() {
  int *array = 0;
  int val = array[returnsChar()];
}


x86 assembly (clang, -O0):
<t5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <returnsChar@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @t5() {
%1 = alloca i32*
%2 = alloca i32
store i32* null, i32** %1
%3 = load i32*, i32** %1
%4 = call i64 (...) @returnsChar()
%5 = getelementptr inbounds i32, i32* %3, i64 %4
%6 = load i32, i32* %5
store i32 %6, i32* %2
ret void
}

LLVM IR (-O2):
define void @t5() {
%1 = tail call i64 (...) @returnsChar()
ret void
}
float num_abs(float a) { return a < 0 ? -a : a; }


x86 assembly (clang, -O0):
<num_abs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <num_abs+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <num_abs+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_abs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @num_abs(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 %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}

LLVM IR (-O2):
define float @num_abs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void my_clearscrn(void) { system("clear"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
define void @my_clearscrn() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @my_clearscrn() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
signed long long signedlonglong_id(signed long long x) { return x; }


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

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

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

LLVM IR (-O2):
define i64 @signedlonglong_id(i64 returned %0) {
ret i64 %0
}