xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fesetenv(void *);
void set_fpu_state(void *state) { fesetenv(state); }


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

x86 assembly (clang, -O2):
<set_fpu_state>:
jmp    1030 <fesetenv@plt>

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

LLVM IR (-O2):
define void @set_fpu_state(i8* %0) {
%2 = tail call i32 @fesetenv(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_();
void do0x38() { _I8080_(); }


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

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

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

LLVM IR (-O2):
define void @do0x38() {
%1 = tail call i32 (...) @_I8080_()
ret void
}
int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
                       struct btrfs_ref *generic_ref) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.btrfs_fs_info = type opaque
%struct.btrfs_ref = type opaque
define i32 @btrfs_ref_tree_mod(%struct.btrfs_fs_info* nocapture readnone %0, %struct.btrfs_ref* nocapture readnone %1) {
ret i32 0
}
void gtk_combo_box_get_add_tearoffs() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ WriteWord(int /*<<< orphan*/ *, unsigned long);
void WriteDWord(FILE *fp, unsigned long w) {
  WriteWord(fp, w & 0xffff);
  WriteWord(fp, (w & 0xffff0000) >> 16);
}


x86 assembly (clang, -O0):
<WriteDWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
and    $0xffff,%rsi
call   1030 <WriteWord@plt>
mov    -0x8(%rbp),%rdi
movabs $0xffff0000,%rsi
and    -0x10(%rbp),%rsi
shr    $0x10,%rsi
call   1030 <WriteWord@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteDWord>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movzwl %bx,%esi
call   1030 <WriteWord@plt>
shr    $0x10,%ebx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <WriteWord@plt>

LLVM IR (-O0):
define void @WriteDWord(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = and i64 %6, 65535
%8 = call i32 @WriteWord(i32* %5, i64 %7)
%9 = load i32*, i32** %3
%10 = load i64, i64* %4
%11 = and i64 %10, 4294901760
%12 = lshr i64 %11, 16
%13 = call i32 @WriteWord(i32* %9, i64 %12)
ret void
}

LLVM IR (-O2):
define void @WriteDWord(i32* %0, i64 %1) {
%3 = and i64 %1, 65535
%4 = tail call i32 @WriteWord(i32* %0, i64 %3)
%5 = lshr i64 %1, 16
%6 = and i64 %5, 65535
%7 = tail call i32 @WriteWord(i32* %0, i64 %6)
ret void
}
int fun1222() { return 1222; }


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

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

LLVM IR (-O0):
define i32 @fun1222() {
ret i32 1222
}

LLVM IR (-O2):
define i32 @fun1222() {
ret i32 1222
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int RSA_padding_add_PKCS1_PSS_mgf1(int /*<<< orphan*/ *, unsigned char *,
                                   unsigned char const *,
                                   int /*<<< orphan*/ const *,
                                   int /*<<< orphan*/ *, int);
int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
                              const unsigned char *mHash, const EVP_MD *Hash,
                              int sLen) {
  return RSA_padding_add_PKCS1_PSS_mgf1(rsa, EM, mHash, Hash, NULL, sLen);
}


x86 assembly (clang, -O0):
<RSA_padding_add_PKCS1_PSS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <RSA_padding_add_PKCS1_PSS_mgf1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA_padding_add_PKCS1_PSS>:
mov    %r8d,%r9d
xor    %r8d,%r8d
jmp    1030 <RSA_padding_add_PKCS1_PSS_mgf1@plt>

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

LLVM IR (-O2):
define i32 @RSA_padding_add_PKCS1_PSS(i32* %0, i8* %1, i8* %2, i32* %3, i32 %4) {
%6 = tail call i32 @RSA_padding_add_PKCS1_PSS_mgf1(i32* %0, i8* %1, i8* %2, i32* %3, i32* null, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void KERN_panic(char *string) {
  printf("kernel panic: %s\n", string);
  exit(1);
}


x86 assembly (clang, -O0):
<KERN_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<KERN_panic>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"kernel panic: %s\0A\00"
define void @KERN_panic(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, char const *, unsigned int);
int shim_fsopen(const char *fsname, unsigned int flags) {
  return (int)shim_enosys(0, fsname, flags);
}


x86 assembly (clang, -O0):
<shim_fsopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_fsopen>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_fsopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @shim_enosys(i32 0, i8* %5, i32 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @shim_fsopen(i8* %0, i32 %1) {
%3 = tail call i64 @shim_enosys(i32 0, i8* %0, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int map_int_hash(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @map_int_hash(i32 returned %0) {
ret i32 %0
}
int id(int x) {
  if (x == 0)
    return 0;
  int ret = id(x - 1) + 1;
  if (ret > 5)
    return 5;
  return ret;
}


x86 assembly (clang, -O0):
<id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <id+0x21>
movl   $0x0,-0x4(%rbp)
jmp    115e <id+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <id@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jle    1158 <id+0x48>
movl   $0x5,-0x4(%rbp)
jmp    115e <id+0x4e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<id>:
test   %edi,%edi
je     1130 <id+0x20>
push   %rax
add    $0xffffffff,%edi
call   1030 <id@plt>
lea    0x1(%rax),%ecx
cmp    $0x5,%eax
mov    $0x5,%eax
cmovl  %ecx,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @id(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %10, %5 ], [ 0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @id(i32 %6)
%8 = add nsw i32 %7, 1
%9 = icmp slt i32 %7, 5
%10 = select i1 %9, i32 %8, i32 5
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ nsc_assert(int);
void device_get_nameunit(void) {
  nsc_assert(0 && "This function is unimplemented.");
  ;
}


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

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

LLVM IR (-O0):
define void @device_get_nameunit() {
%1 = call i32 @nsc_assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @device_get_nameunit() {
%1 = tail call i32 @nsc_assert(i32 0)
ret void
}
void SPIM_EnableRxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SPIM_EnableRxInt() {
ret void
}
int go(char *cpu) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @go(i8* nocapture readnone %0) {
ret i32 2
}
char *name(void) {
  static char n[] = "test ctme: pass";
  return n;
}


x86 assembly (clang, -O0):
<name>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<name>:
lea    0x2f29(%rip),%rax
ret

LLVM IR (-O0):
@name.n = internal global [16 x i8] c"test ctme: pass\00"
define i8* @name() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @name.n, i64 0, i64 0)
}

LLVM IR (-O2):
@name.n = internal global [16 x i8] c"test ctme: pass\00"
define i8* @name() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @name.n, i64 0, i64 0)
}
float Sleef_fmodf(float x, float y) { return __builtin_fmodf(x, y); }


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

x86 assembly (clang, -O2):
<Sleef_fmodf>:
jmp    1030 <fmodf@plt>

LLVM IR (-O0):
define float @Sleef_fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @fmodf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @Sleef_fmodf(float %0, float %1) {
%3 = tail call float @fmodf(float %0, float %1)
ret float %3
}
void delay(int j) {
  int i;
  while (j != 0) {
    for (i = 0; i < 100; i++)
      ;
    j--;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <delay+0x43>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1135 <delay+0x35>
jmp    1127 <delay+0x27>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <delay+0x18>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <delay+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int send_event;
};
struct TYPE_4__ {
  TYPE_1__ xproperty;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xproperty_send_event(void *_p, int _v) {
  ((XEvent *)_p)->xproperty.send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xproperty_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xproperty_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xproperty_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int enabled(unsigned int *heat_core) { return heat_core[0]; }


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

x86 assembly (clang, -O2):
<enabled>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @enabled(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void rational_sub(long double *x, long double *y, long double *z) {
  (*z) = (*x) - (*y);
}


x86 assembly (clang, -O0):
<rational_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fsubrp %st,%st(1)
mov    -0x18(%rbp),%rax
fstpt  (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rational_sub>:
fldt   (%rdi)
fldt   (%rsi)
fsubrp %st,%st(1)
fstpt  (%rdx)
ret

LLVM IR (-O0):
define void @rational_sub(x86_fp80* %0, x86_fp80* %1, x86_fp80* %2) {
%4 = alloca x86_fp80*
%5 = alloca x86_fp80*
%6 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %4
store x86_fp80* %1, x86_fp80** %5
store x86_fp80* %2, x86_fp80** %6
%7 = load x86_fp80*, x86_fp80** %4
%8 = load x86_fp80, x86_fp80* %7
%9 = load x86_fp80*, x86_fp80** %5
%10 = load x86_fp80, x86_fp80* %9
%11 = fsub x86_fp80 %8, %10
%12 = load x86_fp80*, x86_fp80** %6
store x86_fp80 %11, x86_fp80* %12
ret void
}

LLVM IR (-O2):
define void @rational_sub(x86_fp80* nocapture %0, x86_fp80* nocapture %1, x86_fp80* nocapture writeonly %2) {
%4 = load x86_fp80, x86_fp80* %0
%5 = load x86_fp80, x86_fp80* %1
%6 = fsub x86_fp80 %4, %5
store x86_fp80 %6, x86_fp80* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ swap_registers_test();
int main(int argc, const char *argv[]) {
  swap_registers_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <swap_registers_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @swap_registers_test()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t get_timezone(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_timezone() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_memory_funcs(void *(*)(size_t), void (*)(void *));
void ft_set_memory_funcs(void *(*f_malloc)(size_t size),
                         void (*f_free)(void *ptr)) {
  set_memory_funcs(f_malloc, f_free);
}


x86 assembly (clang, -O0):
<ft_set_memory_funcs>:
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 <set_memory_funcs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_set_memory_funcs>:
jmp    1030 <set_memory_funcs@plt>

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

LLVM IR (-O2):
define void @ft_set_memory_funcs(i8* (i64)* %0, void (i8*)* %1) {
%3 = tail call i32 @set_memory_funcs(i8* (i64)* %0, void (i8*)* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ netd_sendmsg(int, char *, int);
int handlemsg_worker(int from, char *msg, int len, void **result) {
  netd_sendmsg(from, msg, len);
  return 0;
}


x86 assembly (clang, -O0):
<handlemsg_worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <netd_sendmsg@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @handlemsg_worker(i32 %0, i8* %1, i32 %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 @netd_sendmsg(i32 %9, i8* %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @handlemsg_worker(i32 %0, i8* %1, i32 %2, i8** nocapture readnone %3) {
%5 = tail call i32 @netd_sendmsg(i32 %0, i8* %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fontcache_free();
void fontrender_close(void) { fontcache_free(); }


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

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

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

LLVM IR (-O2):
define void @fontrender_close() {
%1 = tail call i32 (...) @fontcache_free()
ret void
}
void sd_get_seats(void) {}


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

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

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

LLVM IR (-O2):
define void @sd_get_seats() {
ret void
}
int posInBlock(int bit_num) { return (bit_num / 8); }


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

x86 assembly (clang, -O2):
<posInBlock>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @posInBlock(i32 %0) {
%2 = sdiv i32 %0, 8
ret i32 %2
}
void byte_swap2(void *ptr_) {
  unsigned char *ptr = (unsigned char *)ptr_;
  char tmp0 = ptr[0];
  ptr[0] = ptr[1];
  ptr[1] = tmp0;
}


x86 assembly (clang, -O0):
<byte_swap2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_swap2>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @byte_swap2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i8, i8* %4
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @byte_swap2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
ret void
}
void ft_striter(char *s, void (*f)(char *)) {
  if (s && f)
    while (*s)
      f(s++);
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <ft_striter+0x57>
cmpq   $0x0,-0x10(%rbp)
je     1157 <ft_striter+0x57>
jmp    112b <ft_striter+0x2b>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <ft_striter+0x52>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    %rdi,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
call   *%rax
jmp    112b <ft_striter+0x2b>
jmp    1157 <ft_striter+0x57>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1133 <ft_striter+0x33>
mov    %rsi,%r14
test   %rsi,%rsi
je     1133 <ft_striter+0x33>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1133 <ft_striter+0x33>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
mov    %r15,%rbx
jne    1120 <ft_striter+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %11, %9 ], [ %0, %6 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
tail call void %1(i8* %10)
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showhelp(void) {
  printf("\nCanFestival kernel test example console\n\n");
  printf("start - start example\n");
  printf("stop  - stop example\n");
  printf("quit  - quit console\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<showhelp>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xef6(%rip),%rdi
call   1040 <puts@plt>
lea    0xf00(%rip),%rdi
call   1040 <puts@plt>
lea    0xf09(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"\0ACanFestival kernel test example console\0A\0A\00"
@.str.1 = [23 x i8] c"start - start example\0A\00"
@.str.2 = [22 x i8] c"stop - stop example\0A\00"
@.str.3 = [22 x i8] c"quit - quit console\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @showhelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"\0ACanFestival kernel test example console\0A\00"
@str.5 = [22 x i8] c"start - start example\00"
@str.6 = [21 x i8] c"stop - stop example\00"
@str.7 = [21 x i8] c"quit - quit console\00"
define void @showhelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret void
}
struct lv_segment *last_seg(const struct logical_volume *lv) {
  return ((struct lv_segment **)lv)[0];
}


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

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

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

LLVM IR (-O2):
%struct.lv_segment = type opaque
%struct.logical_volume = type opaque
define %struct.lv_segment* @last_seg(%struct.logical_volume* nocapture %0) {
%2 = bitcast %struct.logical_volume* %0 to %struct.lv_segment**
%3 = load %struct.lv_segment*, %struct.lv_segment** %2
ret %struct.lv_segment* %3
}
/* Variables and functions */
int atoi(char const *);
int main(int argc, char const *argv[]) {
  if (argc == 2) {
    return atoi(argv[1]);
  }
  return 1;
}


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)
cmpl   $0x2,-0x8(%rbp)
jne    1145 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    114c <main+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    111e <main+0xe>
mov    0x8(%rsi),%rdi
jmp    1030 <atoi@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 1, %2 ]
ret i32 %9
}
void U_WMRRESTOREDC_print(const char *contents) { (void)(contents); }


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

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

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

LLVM IR (-O2):
define void @U_WMRRESTOREDC_print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strnlen(char const *, size_t);
char *strndup(const char *s1, size_t n) {
  char *dup;
  size_t len = strnlen(s1, n);
  if ((dup = malloc(len + 1))) {
    memcpy(dup, s1, len);
    dup[len] = '\0';
  }
  return dup;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strnlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1189 <strndup+0x59>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <strndup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
%9 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %9
br label %10
10: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteData(int);
void createDisruption_Six() {
  LCD_WriteData(0x0);
  LCD_WriteData(0x8);
  LCD_WriteData(0xc);
  LCD_WriteData(0xe);
  LCD_WriteData(0xe);
  LCD_WriteData(0xc);
  LCD_WriteData(0x8);
  LCD_WriteData(0x0);
}


x86 assembly (clang, -O0):
<createDisruption_Six>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x8,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x8,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<createDisruption_Six>:
push   %rax
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x8,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xe,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x8,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <LCD_WriteData@plt>

LLVM IR (-O0):
define void @createDisruption_Six() {
%1 = call i32 @LCD_WriteData(i32 0)
%2 = call i32 @LCD_WriteData(i32 8)
%3 = call i32 @LCD_WriteData(i32 12)
%4 = call i32 @LCD_WriteData(i32 14)
%5 = call i32 @LCD_WriteData(i32 14)
%6 = call i32 @LCD_WriteData(i32 12)
%7 = call i32 @LCD_WriteData(i32 8)
%8 = call i32 @LCD_WriteData(i32 0)
ret void
}

LLVM IR (-O2):
define void @createDisruption_Six() {
%1 = tail call i32 @LCD_WriteData(i32 0)
%2 = tail call i32 @LCD_WriteData(i32 8)
%3 = tail call i32 @LCD_WriteData(i32 12)
%4 = tail call i32 @LCD_WriteData(i32 14)
%5 = tail call i32 @LCD_WriteData(i32 14)
%6 = tail call i32 @LCD_WriteData(i32 12)
%7 = tail call i32 @LCD_WriteData(i32 8)
%8 = tail call i32 @LCD_WriteData(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int number, i = 1;
  scanf("%d", &number);
  while (i <= number) {
    printf("%d ", i);
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     116f <main+0x4f>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1163 <main+0x43>
xor    %ebx,%ebx
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    0x4(%rsp),%ebx
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ 1, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = load i32, i32* %1
%11 = icmp slt i32 %7, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int strncmp(char *, char *, int /*<<< orphan*/);
int darray_strcmp(char **a, char **b) { return strncmp(*a, *b, strlen(*a)); }


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

x86 assembly (clang, -O2):
<darray_strcmp>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rbx
mov    (%rsi),%r14
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @darray_strcmp(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @strncmp(i8* %6, i8* %8, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @darray_strcmp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strlen(i8* %3)
%6 = tail call i32 @strncmp(i8* %3, i8* %4, i32 %5)
ret i32 %6
}
/* Type definitions */
struct vmbuf {
  int dummy;
};

/* Variables and functions */
size_t vmbuf_size(struct vmbuf *);
size_t vmbuf_num_elements(struct vmbuf *vmbuf, size_t size_of_element) {
  return vmbuf_size(vmbuf) / size_of_element;
}


x86 assembly (clang, -O0):
<vmbuf_num_elements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vmbuf_size@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmbuf_num_elements>:
push   %rbx
mov    %rsi,%rbx
call   1030 <vmbuf_size@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     112c <vmbuf_num_elements+0x1c>
xor    %edx,%edx
div    %rbx
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
pop    %rbx
ret

LLVM IR (-O0):
%struct.vmbuf = type { i32 }
define i64 @vmbuf_num_elements(%struct.vmbuf* %0, i64 %1) {
%3 = alloca %struct.vmbuf*
%4 = alloca i64
store %struct.vmbuf* %0, %struct.vmbuf** %3
store i64 %1, i64* %4
%5 = load %struct.vmbuf*, %struct.vmbuf** %3
%6 = call i64 @vmbuf_size(%struct.vmbuf* %5)
%7 = load i64, i64* %4
%8 = udiv i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.vmbuf = type { i32 }
define i64 @vmbuf_num_elements(%struct.vmbuf* %0, i64 %1) {
%3 = tail call i64 @vmbuf_size(%struct.vmbuf* %0)
%4 = udiv i64 %3, %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int a[]) {
  int i = 0;
  while (a[i] != '\0') {
    printf("%d ", a[i++]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     115d <print_array+0x4d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1123 <print_array+0x13>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%esi
test   %esi,%esi
je     1154 <print_array+0x34>
mov    %rdi,%rbx
add    $0x4,%rbx
lea    0xec8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%esi
add    $0x4,%rbx
test   %esi,%esi
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

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


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"!!! Exit !!!\0A\00"
define i32 @cmd_exit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"!!! Exit !!!\00"
define i32 @cmd_exit(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
char *strcpy(char *dest, const char *src) {
  for (int i = 0; src[i] != '\0'; i++)
    dest[i] = src[i];
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1120 <strcpy+0x20>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %2
ret i8* %0
6: ; preds = %2, %6
%7 = phi i64 [ %10, %6 ], [ 0, %2 ]
%8 = phi i8 [ %12, %6 ], [ %3, %2 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %8, i8* %9
%10 = add nuw nsw i64 %7, 1
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %5, label %6
}
int main(int argc, char *argv[]) {
  int retval = 0;
  int zbSoc_fd;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}