xunge/DecIR huggingface dataset:
void test_41_2(int *mem) { __atomic_fetch_xor(mem, -1, 4); }


x86 assembly (clang, -O0):
<test_41_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
xor    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test_41_2+0x4b>
jmp    1122 <test_41_2+0x22>
mov    -0x24(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_41_2>:
lock xorl $0xffffffff,(%rdi)
ret

LLVM IR (-O0):
define void @test_41_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 -1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw xor i32* %5, i32 %6 acq_rel
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test_41_2(i32* nocapture %0) {
%2 = atomicrmw xor i32* %0, i32 -1 acq_rel
ret void
}
int TrioFollowedBySeparator(int position) { return (1 == 0); }


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

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

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

LLVM IR (-O2):
define i32 @TrioFollowedBySeparator(i32 %0) {
ret i32 0
}
void posix_extensions() {
  printf("%'d\n", 123456789);
  printf("%'i\n", 123456789);
  printf("%'f\n", (float)1.0);
  printf("%'p\n", (void *)0);
}


x86 assembly (clang, -O0):
<posix_extensions>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
mov    $0x75bcd15,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x75bcd15,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
movsd  0xeb7(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_extensions>:
push   %rax
lea    0xef0(%rip),%rdi
mov    $0x75bcd15,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x75bcd15,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
movsd  0xeba(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%'d\0A\00"
@.str.1 = [5 x i8] c"%'i\0A\00"
@.str.2 = [5 x i8] c"%'f\0A\00"
@.str.3 = [5 x i8] c"%'p\0A\00"
define void @posix_extensions() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 123456789)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 123456789)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double 1.000000e+00)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* null)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%'d\0A\00"
@.str.1 = [5 x i8] c"%'i\0A\00"
@.str.2 = [5 x i8] c"%'f\0A\00"
@.str.3 = [5 x i8] c"%'p\0A\00"
define void @posix_extensions() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 123456789)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 123456789)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double 1.000000e+00)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* null)
ret void
}
unsigned int hash(char *str) {
  unsigned int hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash % 94007;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x16f37,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1148 <hash+0x48>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x64ef7a75,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x10,%edx
imul   $0x16f37,%edx,%ecx
sub    %ecx,%eax
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %11, 94007
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 5381, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  unsigned long ss_size;
  void *ss_sp;
};
typedef TYPE_1__ stack_t;
typedef int /*<<< orphan*/ ss;

/* Variables and functions */
int /*<<< orphan*/ memset(TYPE_1__ *, int /*<<< orphan*/, int);
int sigaltstack(TYPE_1__ *, int /*<<< orphan*/ *);
int setup_altstack(void *start, unsigned long size) {
  stack_t ss;
  memset(&ss, 0, sizeof(ss));
  ss.ss_size = size;
  ss.ss_sp = start;
  return sigaltstack(&ss, NULL);
}


x86 assembly (clang, -O0):
<setup_altstack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <sigaltstack@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_altstack>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    %rbx,(%rsp)
mov    %r14,0x8(%rsp)
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <sigaltstack@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i64, i8* }
define i32 @setup_altstack(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca %struct.TYPE_4__
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 @memset(%struct.TYPE_4__* %5, i32 0, i32 16)
%7 = load i64, i64* %4
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %5, i32 0, i32 0
store i64 %7, i64* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %5, i32 0, i32 1
store i8* %9, i8** %10
%11 = call i32 @sigaltstack(%struct.TYPE_4__* %5, i32* null)
ret i32 %11
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i64, i8* }
define i32 @setup_altstack(i8* %0, i64 %1) {
%3 = alloca %struct.TYPE_4__
%4 = bitcast %struct.TYPE_4__* %3 to i8*
%5 = call i32 @memset(%struct.TYPE_4__* %3, i32 0, i32 16)
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 1
store i8* %0, i8** %7
%8 = call i32 @sigaltstack(%struct.TYPE_4__* %3, i32* null)
ret i32 %8
}
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
struct hash *lib_hash_create_size(int, unsigned int (*)(char *),
                                  int (*)(void *, void *));
struct hash *lib_hash_create(unsigned int (*hash_key)(char *),
                             int (*hash_cmp)(void *, void *)) {
  return lib_hash_create_size(10240, hash_key, hash_cmp);
}


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

x86 assembly (clang, -O2):
<lib_hash_create>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2800,%edi
jmp    1030 <lib_hash_create_size@plt>

LLVM IR (-O0):
%struct.hash = type { i32 }
define %struct.hash* @lib_hash_create(i32 (i8*)* %0, i32 (i8*, i8*)* %1) {
%3 = alloca i32 (i8*)*
%4 = alloca i32 (i8*, i8*)*
store i32 (i8*)* %0, i32 (i8*)** %3
store i32 (i8*, i8*)* %1, i32 (i8*, i8*)** %4
%5 = load i32 (i8*)*, i32 (i8*)** %3
%6 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %4
%7 = call %struct.hash* @lib_hash_create_size(i32 10240, i32 (i8*)* %5, i32 (i8*, i8*)* %6)
ret %struct.hash* %7
}

LLVM IR (-O2):
%struct.hash = type { i32 }
define %struct.hash* @lib_hash_create(i32 (i8*)* %0, i32 (i8*, i8*)* %1) {
%3 = tail call %struct.hash* @lib_hash_create_size(i32 10240, i32 (i8*)* %0, i32 (i8*, i8*)* %1)
ret %struct.hash* %3
}
long double testassign(_Atomic long double *addr) {
  *addr = 115;
  return *addr;
}


x86 assembly (clang, -O0):
<testassign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,-0x20(%rbp)
flds   0xec3(%rip)
fstpt  -0x20(%rbp)
mov    $0x10,%edi
mov    %rdi,-0x40(%rbp)
lea    -0x20(%rbp),%rdx
mov    $0x5,%ecx
mov    %ecx,-0x34(%rbp)
call   1040 <__atomic_store@plt>
mov    -0x40(%rbp),%rdi
mov    -0x34(%rbp),%ecx
mov    -0x8(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <__atomic_load@plt>
fldt   -0x30(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testassign>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
flds   0xecb(%rip)
fstpt  (%rsp)
mov    %rsp,%rdx
mov    $0x10,%edi
mov    %rbx,%rsi
mov    $0x5,%ecx
call   1040 <__atomic_store@plt>
lea    0x10(%rsp),%rdx
mov    $0x10,%edi
mov    %rbx,%rsi
mov    $0x5,%ecx
call   1030 <__atomic_load@plt>
fldt   0x10(%rsp)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define x86_fp80 @testassign(x86_fp80* %0) {
%2 = alloca x86_fp80*
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %2
%5 = load x86_fp80*, x86_fp80** %2
%6 = bitcast x86_fp80* %3 to i8*
store x86_fp80 0xK4005E600000000000000, x86_fp80* %3
%7 = bitcast x86_fp80* %5 to i8*
%8 = bitcast x86_fp80* %3 to i8*
%9 = load x86_fp80*, x86_fp80** %2
%10 = bitcast x86_fp80* %9 to i8*
%11 = bitcast x86_fp80* %4 to i8*
%12 = load x86_fp80, x86_fp80* %4
ret x86_fp80 %12
}

LLVM IR (-O2):
define x86_fp80 @testassign(x86_fp80* %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = bitcast x86_fp80* %2 to i8*
store x86_fp80 0xK4005E600000000000000, x86_fp80* %2
%5 = bitcast x86_fp80* %0 to i8*
%6 = bitcast x86_fp80* %3 to i8*
%7 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %7
}
/* Variables and functions */
int /*<<< orphan*/ ctrl_t_day_common();
int /*<<< orphan*/ goto_check();
void ctrl_t_day_original() {
  ctrl_t_day_common();
  goto_check();
}


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

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

LLVM IR (-O0):
define void @ctrl_t_day_original() {
%1 = call i32 (...) @ctrl_t_day_common()
%2 = call i32 (...) @goto_check()
ret void
}

LLVM IR (-O2):
define void @ctrl_t_day_original() {
%1 = tail call i32 (...) @ctrl_t_day_common()
%2 = tail call i32 (...) @goto_check()
ret void
}
int proc_comm_batt_is_charging(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @proc_comm_batt_is_charging() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pauseresumeserver();
void pauseresumegame() { pauseresumeserver(); }


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

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

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

LLVM IR (-O2):
define void @pauseresumegame() {
%1 = tail call i32 (...) @pauseresumeserver()
ret void
}
int fun744() { return 744; }


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

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

LLVM IR (-O0):
define i32 @fun744() {
ret i32 744
}

LLVM IR (-O2):
define i32 @fun744() {
ret i32 744
}
/* Variables and functions */
unsigned long long rand();
unsigned long long rand64(void) {
  return rand() ^ ((unsigned long long)rand() << 15) ^
         ((unsigned long long)rand() << 30) ^
         ((unsigned long long)rand() << 45) ^
         ((unsigned long long)rand() << 60);
}


x86 assembly (clang, -O0):
<rand64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
shl    $0xf,%rcx
xor    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
shl    $0x1e,%rcx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
shl    $0x2d,%rcx
xor    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
shl    $0x3c,%rcx
xor    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand64>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%r15
shl    $0xf,%r15
xor    %r14,%r15
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%r14
shl    $0x1e,%r14
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rbx
shl    $0x2d,%rbx
xor    %r14,%rbx
xor    %r15,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x3c,%rax
xor    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @rand64() {
%1 = call i64 (...) @rand()
%2 = call i64 (...) @rand()
%3 = shl i64 %2, 15
%4 = xor i64 %1, %3
%5 = call i64 (...) @rand()
%6 = shl i64 %5, 30
%7 = xor i64 %4, %6
%8 = call i64 (...) @rand()
%9 = shl i64 %8, 45
%10 = xor i64 %7, %9
%11 = call i64 (...) @rand()
%12 = shl i64 %11, 60
%13 = xor i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @rand64() {
%1 = tail call i64 (...) @rand()
%2 = tail call i64 (...) @rand()
%3 = shl i64 %2, 15
%4 = xor i64 %3, %1
%5 = tail call i64 (...) @rand()
%6 = shl i64 %5, 30
%7 = xor i64 %4, %6
%8 = tail call i64 (...) @rand()
%9 = shl i64 %8, 45
%10 = xor i64 %7, %9
%11 = tail call i64 (...) @rand()
%12 = shl i64 %11, 60
%13 = xor i64 %10, %12
ret i64 %13
}
int dns_v_abi(void) { return 0x20150612; }


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

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

LLVM IR (-O0):
define i32 @dns_v_abi() {
ret i32 538248722
}

LLVM IR (-O2):
define i32 @dns_v_abi() {
ret i32 538248722
}
void iapp_deinit(struct iapp_data *iapp) {}


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

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

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

LLVM IR (-O2):
%struct.iapp_data = type opaque
define void @iapp_deinit(%struct.iapp_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alloc_fail();
void *malloc(size_t);
void *sdb_malloc(size_t size) {
  void *p;
  p = malloc(size);
  if (p == NULL)
    alloc_fail();
  return p;
}


x86 assembly (clang, -O0):
<sdb_malloc>:
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    114b <sdb_malloc+0x2b>
mov    $0x0,%al
call   1030 <alloc_fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @sdb_malloc(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 %10
8: ; preds = %1
%9 = call i32 (...) @alloc_fail()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @sdb_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @alloc_fail()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int atoi(char const *);
scalar_t__ sqlite3FitsIn32Bits(char const *);
int sqlite3GetInt32(const char *zNum, int *pValue) {
  if (sqlite3FitsIn32Bits(zNum)) {
    *pValue = atoi(zNum);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sqlite3GetInt32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sqlite3FitsIn32Bits@plt>
cmp    $0x0,%rax
je     1160 <sqlite3GetInt32+0x40>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1167 <sqlite3GetInt32+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3GetInt32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <sqlite3FitsIn32Bits@plt>
test   %rax,%rax
je     1146 <sqlite3GetInt32+0x26>
mov    %rbx,%rdi
call   1040 <atoi@plt>
mov    %eax,(%r14)
mov    $0x1,%eax
jmp    1148 <sqlite3GetInt32+0x28>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @sqlite3GetInt32(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i64 @sqlite3FitsIn32Bits(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @atoi(i8* %0)
store i32 %6, i32* %1
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
void av_buffer_pool_init() {}


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

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

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

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

/* Variables and functions */
uint32_t HashKey(int key) {
  uint32_t index;
  index = key % 100;
  return index;
}


x86 assembly (clang, -O0):
<HashKey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashKey>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @HashKey(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 100
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @HashKey(i32 %0) {
%2 = srem i32 %0, 100
ret i32 %2
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_event_source_get_enabled(void *s,
                                                                       int *m) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_source_get_enabled>:
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_event_source_get_enabled>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_source_get_enabled(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %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_event_source_get_enabled(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
unsigned short sn_readw_fast(void *addr) {
  return *(volatile unsigned short *)addr;
}


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

x86 assembly (clang, -O2):
<sn_readw_fast>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @sn_readw_fast(i8* %0) {
%2 = bitcast i8* %0 to i16*
%3 = load volatile i16, i16* %2
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void Usage(void) {
  {
    printf("Usage: BLZ command filename [filename [...]]\n"
           "\n"
           "command:\n"
           "  -d .... decode 'filename'\n"
           "  -en ... encode 'filename', normal mode\n"
           "  -eo ... encode 'filename', optimal mode (LZ-CUE)\n"
           "\n"
           "* multiple filenames and wildcards are permitted\n"
           "* the original file is overwritten with the new file\n"
           "* this codification is used in the DS overlay files\n");
    exit(-1);
  };
}


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

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

LLVM IR (-O0):
@.str = [331 x i8] c"Usage: BLZ command filename [filename [...]]\0A\0Acommand:\0A -d .... decode 'filename'\0A -en ... encode 'filename', normal mode\0A -eo ... encode 'filename', optimal mode (LZ-CUE)\0A\0A* multiple filenames and wildcards are permitted\0A* the original file is overwritten with the new file\0A* this codification is used in the DS overlay files\0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([331 x i8], [331 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [330 x i8] c"Usage: BLZ command filename [filename [...]]\0A\0Acommand:\0A -d .... decode 'filename'\0A -en ... encode 'filename', normal mode\0A -eo ... encode 'filename', optimal mode (LZ-CUE)\0A\0A* multiple filenames and wildcards are permitted\0A* the original file is overwritten with the new file\0A* this codification is used in the DS overlay files\00"
define void @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([330 x i8], [330 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *w_calloc(size_t count, size_t size) { return calloc(count, size); }


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

x86 assembly (clang, -O2):
<w_calloc>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @w_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ grupo;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char **, int);
int identify2(char *name, int size) {
  char grupo[] = "Ana Mativi\nAthos Lagemann\nRicardo Sabedra\n";
  int tamanho = sizeof(grupo);
  if (size <= tamanho) {
    return -1;
  }
  memcpy(name, &grupo, tamanho);
  return 0;
}


x86 assembly (clang, -O0):
<identify2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x2b,%edx
call   1030 <memcpy@plt>
movl   $0x2b,-0x44(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x44(%rbp),%eax
jg     1153 <identify2+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <identify2+0x5a>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x44(%rbp),%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<identify2>:
sub    $0x38,%rsp
movups 0xf00(%rip),%xmm0
movups %xmm0,0x1b(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0xffffffff,%eax
cmp    $0x2c,%esi
jl     1150 <identify2+0x40>
mov    %rsp,%rsi
mov    $0x2b,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.identify2.grupo = [43 x i8] c"Ana Mativi\0AAthos Lagemann\0ARicardo Sabedra\0A\00"
define i32 @identify2(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [43 x i8]
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = bitcast [43 x i8]* %6 to i8*
store i32 43, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %18
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = bitcast [43 x i8]* %6 to i8**
%16 = load i32, i32* %7
%17 = call i32 @memcpy(i8* %14, i8** %15, i32 %16)
store i32 0, i32* %3
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@__const.identify2.grupo = [43 x i8] c"Ana Mativi\0AAthos Lagemann\0ARicardo Sabedra\0A\00"
define i32 @identify2(i8* %0, i32 %1) {
%3 = alloca [43 x i8]
%4 = getelementptr inbounds [43 x i8], [43 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %1, 44
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = bitcast [43 x i8]* %3 to i8**
%8 = call i32 @memcpy(i8* %0, i8** %7, i32 43)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ 0, %6 ], [ -1, %2 ]
ret i32 %10
}
void RTSemFastMutexCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemFastMutexCreate() {
ret void
}
int coq_flt(double x, double y) { return x < y; }


x86 assembly (clang, -O0):
<coq_flt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<coq_flt>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @coq_flt(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @coq_flt(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_error_2() {
  printf("a strange error occur, certainly due to the memory allocation in the "
         "spectrum initialisation --> exit\n");
  exit(102);
}


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

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

LLVM IR (-O0):
@.str = [103 x i8] c"a strange error occur, certainly due to the memory allocation in the spectrum initialisation --> exit\0A\00"
define void @print_error_2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 102)
unreachable
}

LLVM IR (-O2):
@str = [102 x i8] c"a strange error occur, certainly due to the memory allocation in the spectrum initialisation --> exit\00"
define void @print_error_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 102)
unreachable
}
void init_fm_bishop(int fm[][2]) {
  int i;
  for (i = 0; i < 14; i++) {
    fm[i][0] = -1;
    fm[i][1] = -1;
  }
}


x86 assembly (clang, -O0):
<init_fm_bishop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xe,-0xc(%rbp)
jge    1146 <init_fm_bishop+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,0x4(%rax,%rcx,8)
ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_fm_bishop+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_fm_bishop>:
pcmpeqd %xmm0,%xmm0
movdqu %xmm0,0x60(%rdi)
movdqu %xmm0,0x50(%rdi)
movdqu %xmm0,0x40(%rdi)
movdqu %xmm0,0x30(%rdi)
movdqu %xmm0,0x20(%rdi)
movdqu %xmm0,0x10(%rdi)
movdqu %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @init_fm_bishop([2 x i32]* nocapture writeonly %0) {
%2 = bitcast [2 x i32]* %0 to i8*
ret void
}
/* Variables and functions */
int ENXIO;
int nc_pm8921_gpio_get_state(int gpio, int *state) { return -ENXIO; }


x86 assembly (clang, -O0):
<nc_pm8921_gpio_get_state>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @nc_pm8921_gpio_get_state(i32 %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @ENXIO
%4 = sub nsw i32 0, %3
ret i32 %4
}
long arith2(long x, long y, long z) {
  long t1 = x | y;
  long t2 = t1 >> 3;
  long t3 = ~t2;
  long t4 = z - t3;
  return t4;
}


x86 assembly (clang, -O0):
<arith2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sar    $0x3,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith2>:
or     %rsi,%rdi
sar    $0x3,%rdi
lea    (%rdx,%rdi,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @arith2(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = or i64 %11, %12
store i64 %13, i64* %7
%14 = load i64, i64* %7
%15 = ashr i64 %14, 3
store i64 %15, i64* %8
%16 = load i64, i64* %8
%17 = xor i64 %16, -1
store i64 %17, i64* %9
%18 = load i64, i64* %6
%19 = load i64, i64* %9
%20 = sub nsw i64 %18, %19
store i64 %20, i64* %10
%21 = load i64, i64* %10
ret i64 %21
}

LLVM IR (-O2):
define i64 @arith2(i64 %0, i64 %1, i64 %2) {
%4 = or i64 %1, %0
%5 = ashr i64 %4, 3
%6 = add i64 %2, 1
%7 = add i64 %6, %5
ret i64 %7
}
int trans_6_y(int x, int y) { return -x; }


x86 assembly (clang, -O0):
<trans_6_y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @trans_6_y(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_destroy(void *data) { free(data); }


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

LLVM IR (-O0):
define void @my_destroy(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 @my_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
short ishortor(short x, short y) {
  x |= 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<ishortor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
or     $0x18,%eax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
jne    1145 <ishortor+0x35>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishortor>:
mov    %edi,%eax
or     $0x18,%eax
ret

LLVM IR (-O0):
define signext i16 @ishortor(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = or i32 %6, 24
%8 = trunc i32 %7 to i16
store i16 %8, i16* %3
%9 = load i16, i16* %3
%10 = icmp ne i16 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @foo(i8* null)
br label %13
13: ; preds = %11, %2
%14 = load i16, i16* %3
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @ishortor(i16 signext %0, i16 signext %1) {
%3 = or i16 %0, 24
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xdd() {
  Assert_real((isbdigit(221) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1110, ("isbdigit should be 0 for 0xdd"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xdd>:
push   %rax
mov    $0xdd,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x456,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xdd\00"
define void @t_isbdigit_0xdd() {
%1 = tail call i64 @isbdigit(i32 221)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1110, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_text_iter_forward_visible_word_end() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_forward_visible_word_end() {
ret void
}
/* Variables and functions */
char *malloc(int);
char *f() { return malloc(1); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0x1,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @f() {
%1 = call i8* @malloc(i32 1)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @f() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
ret i8* %1
}
/* Type definitions */
struct bufferevent {
  int dummy;
};

/* Variables and functions */
scalar_t__ EVBUFFER_LENGTH(int /*<<< orphan*/);
int /*<<< orphan*/ EVBUFFER_OUTPUT(struct bufferevent *);
int /*<<< orphan*/ EV_READ;
int /*<<< orphan*/ bufferevent_enable(struct bufferevent *, int /*<<< orphan*/);
void stream_request_writecb(struct bufferevent *bev, void *arg) {
  do {
    ;
  } while (0);
  if (EVBUFFER_LENGTH(EVBUFFER_OUTPUT(bev)) == 0) {
    bufferevent_enable(bev, EV_READ);
  }
}


x86 assembly (clang, -O0):
<stream_request_writecb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1145 <stream_request_writecb+0x15>
mov    -0x8(%rbp),%rdi
call   1050 <EVBUFFER_OUTPUT@plt>
mov    %eax,%edi
call   1030 <EVBUFFER_LENGTH@plt>
cmp    $0x0,%rax
jne    1171 <stream_request_writecb+0x41>
mov    -0x8(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1040 <bufferevent_enable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stream_request_writecb>:
push   %rbx
mov    %rdi,%rbx
call   1050 <EVBUFFER_OUTPUT@plt>
mov    %eax,%edi
call   1030 <EVBUFFER_LENGTH@plt>
test   %rax,%rax
je     1147 <stream_request_writecb+0x17>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <bufferevent_enable@plt>

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
@EV_READ = global i32 0
define void @stream_request_writecb(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load %struct.bufferevent*, %struct.bufferevent** %3
%8 = call i32 @EVBUFFER_OUTPUT(%struct.bufferevent* %7)
%9 = call i64 @EVBUFFER_LENGTH(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load %struct.bufferevent*, %struct.bufferevent** %3
%13 = load i32, i32* @EV_READ
%14 = call i32 @bufferevent_enable(%struct.bufferevent* %12, i32 %13)
br label %15
15: ; preds = %11, %6
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
@EV_READ = global i32 0
define void @stream_request_writecb(%struct.bufferevent* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @EVBUFFER_OUTPUT(%struct.bufferevent* %0)
%4 = tail call i64 @EVBUFFER_LENGTH(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @EV_READ
%8 = tail call i32 @bufferevent_enable(%struct.bufferevent* %0, i32 %7)
br label %9
9: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("no way\n");
  } else {
    char *flag = "FLAG_{chuck_norris_way}";
    printf("no way\n");
  }
}


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)
cmpl   $0x2,-0x8(%rbp)
je     1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <main+0x48>
lea    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%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 = [8 x i8] c"no way\0A\00"
@.str.1 = [24 x i8] c"FLAG_{chuck_norris_way}\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %2
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@str.2 = [7 x i8] c"no way\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 2
%4 = select i1 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isupper(int);
void t_isupper_0x50() {
  Assert_real((isupper(80)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              405, ("isupper should be 1 for P"));
}


x86 assembly (clang, -O0):
<t_isupper_0x50>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50,%edi
call   1030 <isupper@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x195,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x50>:
push   %rax
mov    $0x50,%edi
call   1030 <isupper@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x195,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for P\00"
define void @t_isupper_0x50() {
%1 = call i32 @isupper(i32 80)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for P\00"
define void @t_isupper_0x50() {
%1 = tail call i32 @isupper(i32 80)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t get_time(void) { return time(NULL); }


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i32 @get_time() {
%1 = call i32 @time(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_time() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ root;
};
typedef TYPE_1__ XKeyReleasedEvent;

/* Variables and functions */
unsigned long get_XKeyReleasedEvent_root(void *_p) {
  return (unsigned long)((XKeyReleasedEvent *)_p)->root;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XKeyReleasedEvent_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XKeyReleasedEvent_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}