xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void timer_init(struct timeval *timer) { gettimeofday(timer, NULL); }


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

x86 assembly (clang, -O2):
<timer_init>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @timer_init(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @timer_init(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
/* Type definitions */
typedef int __u16;

/* Variables and functions */
__u16 pn_port(__u16 handle) { return handle & 0x3ff; }


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

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

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

LLVM IR (-O2):
define i32 @pn_port(i32 %0) {
%2 = and i32 %0, 1023
ret i32 %2
}
void __iounmap(void *addr) {}


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

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

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

LLVM IR (-O2):
define void @__iounmap(i8* nocapture %0) {
ret void
}
int my_hash_callback_remove(void *key, void *value, void *user_data) {
  int *d = value;
  if ((*d) % 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<my_hash_callback_remove>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     113b <my_hash_callback_remove+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <my_hash_callback_remove+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_hash_callback_remove>:
mov    (%rsi),%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @my_hash_callback_remove(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %4
%6 = and i32 %5, 1
ret i32 %6
}
int fun392() { return 392; }


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

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

LLVM IR (-O0):
define i32 @fun392() {
ret i32 392
}

LLVM IR (-O2):
define i32 @fun392() {
ret i32 392
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_snanminabs(int, float *, int);
int main() {
  float x[] = {1.0,  -2.0, -3.0, 4.0,       -5.0,
               -6.0, 7.0,  -8.0, 0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  float v = stdlib_strided_snanminabs(N, x, stride);
  printf("minabs: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0x5,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1030 <stdlib_strided_snanminabs@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_snanminabs@plt>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x float] [float 1.000000e+00, float -2.000000e+00, float -3.000000e+00, float 4.000000e+00, float -5.000000e+00, float -6.000000e+00, float 7.000000e+00, float -8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [12 x i8] c"minabs: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [10 x float]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_snanminabs(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x float] [float 1.000000e+00, float -2.000000e+00, float -3.000000e+00, float 4.000000e+00, float -5.000000e+00, float -6.000000e+00, float 7.000000e+00, float -8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [12 x i8] c"minabs: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_snanminabs(i32 5, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
int halt() {
  asm("cli");
  asm("hlt");
}


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

x86 assembly (clang, -O2):
<halt>:
cli
hlt
ret

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

LLVM IR (-O2):
define i32 @halt() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret i32 undef
}
/* Variables and functions */
int ff(int);
int f(int a) {
  int b = a + a + a + ff(a);
  return b;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ff@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
lea    (%rdi,%rdi,2),%ebx
call   1030 <ff@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %2
%10 = call i32 @ff(i32 %9)
%11 = add nsw i32 %8, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = tail call i32 @ff(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
void plat_midi_init(void) {}


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

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

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

LLVM IR (-O2):
define void @plat_midi_init() {
ret void
}
/* Variables and functions */
int __ctype_isblank(int);
int isblank(int c) { return __ctype_isblank(c); }


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

x86 assembly (clang, -O2):
<isblank>:
jmp    1030 <__ctype_isblank@plt>

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

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = tail call i32 @__ctype_isblank(i32 %0)
ret i32 %2
}
/* Type definitions */
struct zfs_file {
  int dummy;
};
struct zfs_dir {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_fs_info(struct zfs_file *, struct zfs_dir *);
mount_zfs() {
  struct zfs_file *files;
  struct zfs_dir *dirs;
  get_fs_info(files, dirs);
}


x86 assembly (clang, -O0):
<mount_zfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <get_fs_info@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_zfs>:
jmp    1030 <get_fs_info@plt>

LLVM IR (-O0):
%struct.zfs_file = type { i32 }
%struct.zfs_dir = type { i32 }
define i32 @mount_zfs() {
%1 = alloca i32
%2 = alloca %struct.zfs_file*
%3 = alloca %struct.zfs_dir*
%4 = load %struct.zfs_file*, %struct.zfs_file** %2
%5 = load %struct.zfs_dir*, %struct.zfs_dir** %3
%6 = call i32 @get_fs_info(%struct.zfs_file* %4, %struct.zfs_dir* %5)
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
%struct.zfs_file = type { i32 }
%struct.zfs_dir = type { i32 }
define i32 @mount_zfs() {
%1 = tail call i32 @get_fs_info(%struct.zfs_file* undef, %struct.zfs_dir* undef)
ret i32 undef
}
__attribute__((always_)) void kick_process(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @kick_process(%struct.task_struct* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
time_t strtoepoch(char *time) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @strtoepoch(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void p_Exit(int err) {
  printf("\n");
  exit(err);
}


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

x86 assembly (clang, -O2):
<p_Exit>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @p_Exit(i32 %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ build_hdr();
int /*<<< orphan*/ fail(char *);
int /*<<< orphan*/ get_files(char *);
int /*<<< orphan*/ write_pkg(char *);
int main(int argc, char *argv[]) {
  if (argc != 3)
    fail("usage: cospkg cos.pkg dir");
  get_files(argv[2]);
  build_hdr();
  write_pkg(argv[1]);
  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)
cmpl   $0x3,-0x8(%rbp)
je     116c <main+0x2c>
lea    0xe99(%rip),%rdi
call   1030 <fail@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <get_files@plt>
mov    $0x0,%al
call   1040 <build_hdr@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <write_pkg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
je     1155 <main+0x15>
lea    0xeb0(%rip),%rdi
call   1030 <fail@plt>
mov    0x10(%rbx),%rdi
call   1050 <get_files@plt>
xor    %eax,%eax
call   1040 <build_hdr@plt>
mov    0x8(%rbx),%rdi
call   1060 <write_pkg@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"usage: cospkg cos.pkg dir\00"
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 ne i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @fail(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 2
%13 = load i8*, i8** %12
%14 = call i32 @get_files(i8* %13)
%15 = call i32 (...) @build_hdr()
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @write_pkg(i8* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"usage: cospkg cos.pkg dir\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @fail(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @get_files(i8* %8)
%10 = tail call i32 (...) @build_hdr()
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @write_pkg(i8* %12)
ret i32 0
}
void handler(int sig_num) { return; }


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int alea(int max) {
  srand(time(NULL));
  return (rand() % max);
}


x86 assembly (clang, -O0):
<alea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alea>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @alea(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = load i32, i32* %2
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @alea(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %0
ret i32 %5
}
int test_imm_8Cuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x8C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Cuint64_highword_reg>:
movabs $0x8c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Cuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 601295421440
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
void copy_bytes(char *dst, uint32_t length, uint32_t offset) {
  char *src = dst - offset;
  while (length-- > 0)
    *dst++ = *src++;
}


x86 assembly (clang, -O0):
<copy_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    115f <copy_bytes+0x5f>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111f <copy_bytes+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_bytes>:
test   %rsi,%rsi
je     111d <copy_bytes+0x1d>
mov    %rdi,%rax
sub    %rdx,%rax
xor    %ecx,%ecx
nopl   (%rax)
movzbl (%rax,%rcx,1),%edx
mov    %dl,(%rdi,%rcx,1)
add    $0x1,%rcx
jmp    1110 <copy_bytes+0x10>
ret

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

LLVM IR (-O2):
define void @copy_bytes(i8* %0, i8* readnone %1, i8* %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = ptrtoint i8* %0 to i64
%7 = ptrtoint i8* %2 to i64
%8 = sub i64 %6, %7
%9 = inttoptr i64 %8 to i8*
br label %10
10: ; preds = %10, %5
%11 = phi i8* [ %13, %10 ], [ %9, %5 ]
%12 = phi i8* [ %15, %10 ], [ %0, %5 ]
%13 = getelementptr inbounds i8, i8* %11, i64 1
%14 = load i8, i8* %11
%15 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %14, i8* %12
br label %10
16: ; preds = %3
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t Function2Int32(int32_t a, int32_t b) { return a + b; }


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

x86 assembly (clang, -O2):
<Function2Int32>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @Function2Int32(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 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @Function2Int32(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int addup_wrongly(short *);
__attribute__((no)) int do_other_stuff(void) {
  short la[100];
  return 123 + addup_wrongly(la);
}


x86 assembly (clang, -O0):
<do_other_stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
lea    -0xd0(%rbp),%rdi
call   1030 <addup_wrongly@plt>
add    $0x7b,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_other_stuff>:
sub    $0xc8,%rsp
mov    %rsp,%rdi
call   1030 <addup_wrongly@plt>
add    $0x7b,%eax
add    $0xc8,%rsp
ret

LLVM IR (-O0):
define i32 @do_other_stuff() {
%1 = alloca [100 x i16]
%2 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 0
%3 = call i32 @addup_wrongly(i16* %2)
%4 = add nsw i32 123, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @do_other_stuff() {
%1 = alloca [100 x i16]
%2 = bitcast [100 x i16]* %1 to i8*
%3 = getelementptr inbounds [100 x i16], [100 x i16]* %1, i64 0, i64 0
%4 = call i32 @addup_wrongly(i16* %3)
%5 = add nsw i32 %4, 123
ret i32 %5
}
int hfsc_parse_opt(struct qdisc_util *qu, int argc, char **argv,
                   struct nlmsghdr *n) {
  return -1;
}


x86 assembly (clang, -O0):
<hfsc_parse_opt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.qdisc_util = type opaque
%struct.nlmsghdr = type opaque
define i32 @hfsc_parse_opt(%struct.qdisc_util* %0, i32 %1, i8** %2, %struct.nlmsghdr* %3) {
%5 = alloca %struct.qdisc_util*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca %struct.nlmsghdr*
store %struct.qdisc_util* %0, %struct.qdisc_util** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store %struct.nlmsghdr* %3, %struct.nlmsghdr** %8
ret i32 -1
}

LLVM IR (-O2):
%struct.qdisc_util = type opaque
%struct.nlmsghdr = type opaque
define i32 @hfsc_parse_opt(%struct.qdisc_util* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, %struct.nlmsghdr* nocapture readnone %3) {
ret i32 -1
}
void exit(int ec) {
  *(volatile int *)((0x10500000 + 8)) = ec;
  while (1)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x10500008,%eax
mov    %ecx,(%rax)
jmp    1111 <exit+0x11>

x86 assembly (clang, -O2):
<exit>:
mov    %edi,0x10500008
nopw   0x0(%rax,%rax,1)
jmp    1110 <exit+0x10>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 273678344 to i32*)
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
define void @exit(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 273678344 to i32*)
br label %2
2: ; preds = %1, %2
br label %2
}
void sha256_help(void) { printf("%s - TBD\n", __func__); }


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

x86 assembly (clang, -O2):
<sha256_help>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s - TBD\0A\00"
@__func__.sha256_help = [12 x i8] c"sha256_help\00"
define void @sha256_help() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.sha256_help, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s - TBD\0A\00"
@__func__.sha256_help = [12 x i8] c"sha256_help\00"
define void @sha256_help() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.sha256_help, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t nibble_to_hex_char(uint8_t nibble) {
  char buf[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
                  '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
  return buf[nibble & 0xF];
}


x86 assembly (clang, -O0):
<nibble_to_hex_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
cltq
movsbl -0x20(%rbp,%rax,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_to_hex_char>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
movsbl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
@__const.nibble_to_hex_char.buf = [16 x i8] c"0123456789abcdef"
define i32 @nibble_to_hex_char(i32 %0) {
%2 = alloca i32
%3 = alloca [16 x i8]
store i32 %0, i32* %2
%4 = bitcast [16 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = and i32 %5, 15
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@__const.nibble_to_hex_char.buf = [16 x i8] c"0123456789abcdef"
define i32 @nibble_to_hex_char(i32 %0) {
%2 = and i32 %0, 15
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [16 x i8], [16 x i8]* @__const.nibble_to_hex_char.buf, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ print_message(char *);
void sorted5_setup_fixture() {
  print_message("Pqueue with 5 sorted elements\n");
  print_message("-----------------------------\n");
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Pqueue with 5 sorted elements\0A\00"
@.str.1 = [31 x i8] c"-----------------------------\0A\00"
define void @sorted5_setup_fixture() {
%1 = call i32 @print_message(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print_message(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Pqueue with 5 sorted elements\0A\00"
@.str.1 = [31 x i8] c"-----------------------------\0A\00"
define void @sorted5_setup_fixture() {
%1 = tail call i32 @print_message(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_message(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void inc_rt_prio(struct rt_rq *rt_rq, int prio) {}


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

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

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

LLVM IR (-O2):
%struct.rt_rq = type opaque
define void @inc_rt_prio(%struct.rt_rq* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_immt_op();
int /*<<< orphan*/ arm_memio_ldrbt(int /*<<< orphan*/);
void arm_ldrbt_imm() { arm_memio_ldrbt(arm_memio_immt_op()); }


x86 assembly (clang, -O0):
<arm_ldrbt_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_memio_immt_op@plt>
mov    %eax,%edi
call   1040 <arm_memio_ldrbt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_ldrbt_imm>:
push   %rax
xor    %eax,%eax
call   1030 <arm_memio_immt_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_memio_ldrbt@plt>

LLVM IR (-O0):
define void @arm_ldrbt_imm() {
%1 = call i32 (...) @arm_memio_immt_op()
%2 = call i32 @arm_memio_ldrbt(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_ldrbt_imm() {
%1 = tail call i32 (...) @arm_memio_immt_op()
%2 = tail call i32 @arm_memio_ldrbt(i32 %1)
ret void
}
/* Variables and functions */
double limit_degrees(double);
double topocentric_azimuth_angle(double azimuth_astro) {
  return limit_degrees(azimuth_astro + 180.0);
}


x86 assembly (clang, -O0):
<topocentric_azimuth_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <limit_degrees@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<topocentric_azimuth_angle>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <limit_degrees@plt>

LLVM IR (-O0):
define double @topocentric_azimuth_angle(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.800000e+02
%5 = call double @limit_degrees(double %4)
ret double %5
}

LLVM IR (-O2):
define double @topocentric_azimuth_angle(double %0) {
%2 = fadd double %0, 1.800000e+02
%3 = tail call double @limit_degrees(double %2)
ret double %3
}
void BUF_strlcpy(void) {}


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

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

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

LLVM IR (-O2):
define void @BUF_strlcpy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IsValidGencode(int const);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int NumberSenseCodonsInGenCode(const int gencode) {
  assert(IsValidGencode(gencode));
  switch (gencode) {
  case 0:
    return 61;
  case 1:
    return 60;
  }
  abort();
  return -1;
}


x86 assembly (clang, -O0):
<NumberSenseCodonsInGenCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <IsValidGencode@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     116e <NumberSenseCodonsInGenCode+0x3e>
jmp    115d <NumberSenseCodonsInGenCode+0x2d>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     117a <NumberSenseCodonsInGenCode+0x4a>
jmp    1186 <NumberSenseCodonsInGenCode+0x56>
movl   $0x3d,-0x4(%rbp)
jmp    118d <NumberSenseCodonsInGenCode+0x5d>
movl   $0x3c,-0x4(%rbp)
jmp    118d <NumberSenseCodonsInGenCode+0x5d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumberSenseCodonsInGenCode>:
push   %rbx
mov    %edi,%ebx
call   1050 <IsValidGencode@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0x3d,%eax
test   %ebx,%ebx
je     1152 <NumberSenseCodonsInGenCode+0x22>
cmp    $0x1,%ebx
jne    1154 <NumberSenseCodonsInGenCode+0x24>
mov    $0x3c,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @NumberSenseCodonsInGenCode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @IsValidGencode(i32 %4)
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %3
switch i32 %7, label %10 [
i32 0, label %8
i32 1, label %9
]
8: ; preds = %1
store i32 61, i32* %2
br label %12
9: ; preds = %1
store i32 60, i32* %2
br label %12
10: ; preds = %1
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @NumberSenseCodonsInGenCode(i32 %0) {
%2 = tail call i32 @IsValidGencode(i32 %0)
%3 = tail call i32 @assert(i32 %2)
switch i32 %0, label %5 [
i32 0, label %7
i32 1, label %4
]
4: ; preds = %1
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1, %4
%8 = phi i32 [ 60, %4 ], [ 61, %1 ]
ret i32 %8
}
/* Variables and functions */
int syscall(int, void const *, size_t);
int munlock(const void *addr, size_t len) { return syscall(151, addr, len); }


x86 assembly (clang, -O0):
<munlock>:
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    $0x97,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<munlock>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x97,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @munlock(i8* %0, i64 %1) {
%3 = tail call i32 @syscall(i32 151, i8* %0, i64 %1)
ret i32 %3
}
int g_is_equal_d(double s, double d) { return (s == d); }


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

x86 assembly (clang, -O2):
<g_is_equal_d>:
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @g_is_equal_d(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 oeq double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @g_is_equal_d(double %0, double %1) {
%3 = fcmp oeq double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgindw(void) {
  gen("mov\tbx,ax");
  gen("mov\tax,[bx]");
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"mov\09bx,ax\00"
@.str.1 = [12 x i8] c"mov\09ax,[bx]\00"
define void @cgindw() {
%1 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"mov\09bx,ax\00"
@.str.1 = [12 x i8] c"mov\09ax,[bx]\00"
define void @cgindw() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
int32_t squ3(uint16_t phase) { return (phase > (1 << 13)) ? 22938 : -22938; }


x86 assembly (clang, -O0):
<squ3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffa666,%eax
mov    $0x599a,%ecx
cmp    $0x2000,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<squ3>:
cmp    $0x2001,%edi
mov    $0x599a,%ecx
mov    $0xffffa666,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @squ3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 8192
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 22938, i32 -22938
ret i32 %6
}

LLVM IR (-O2):
define i32 @squ3(i32 %0) {
%2 = icmp sgt i32 %0, 8192
%3 = select i1 %2, i32 22938, i32 -22938
ret i32 %3
}
int test_imm_57int16_reg(short val) {
  return ((val) & (-0x57 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_57int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffa9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_57int16_reg>:
test   $0xffa9,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_57int16_reg(i16 signext %0) {
%2 = and i16 %0, -87
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double rtn_double(double *p_double, unsigned int d) { return *p_double; }


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

x86 assembly (clang, -O2):
<rtn_double>:
movsd  (%rdi),%xmm0
ret

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

LLVM IR (-O2):
define double @rtn_double(double* nocapture %0, i32 %1) {
%3 = load double, double* %0
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ XWMHints;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XWMHints(void) {
  XWMHints *_p = (XWMHints *)malloc(sizeof(XWMHints));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XWMHints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XWMHints+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XWMHints>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XWMHints+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XWMHints() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XWMHints() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
const char *dev_to_tty(int tty) {
  static char txt[64];
  sprintf(txt, "%d,%d", (tty >> 8) & 0xff, tty & 0xff);
  return txt;
}


x86 assembly (clang, -O0):
<dev_to_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
sar    $0x8,%edx
and    $0xff,%edx
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
lea    0x2f09(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_to_tty>:
push   %rbx
mov    %edi,%eax
movzbl %ah,%edx
movzbl %al,%ecx
lea    0x2f20(%rip),%rbx
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@dev_to_tty.txt = internal global [64 x i8] zeroinitializer
@.str = [6 x i8] c"%d,%d\00"
define i8* @dev_to_tty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = call i32 @sprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dev_to_tty.txt, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dev_to_tty.txt, i64 0, i64 0)
}

LLVM IR (-O2):
@dev_to_tty.txt = internal global [64 x i8] zeroinitializer
@.str = [6 x i8] c"%d,%d\00"
define i8* @dev_to_tty(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
%4 = and i32 %0, 255
%5 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @dev_to_tty.txt, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @dev_to_tty.txt, i64 0, i64 0)
}
const char *hdfLibraryVersion(void) { return ("library undefined"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"library undefined\00"
define i8* @hdfLibraryVersion() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"library undefined\00"
define i8* @hdfLibraryVersion() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int vsprintf(char *buffer, const char *format, va_list ap) {
  return vsnprintf(buffer, ~(size_t)0, format, ap);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xffffffffffffffff,%rsi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0xffffffffffffffff,%rsi
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
define i32 @vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @vsnprintf(i8* %7, i64 -1, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsnprintf(i8* %0, i64 -1, i8* %1, i32 %2)
ret i32 %4
}
void tun_standby_init(struct tuntap *tt) {}


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

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

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

LLVM IR (-O2):
%struct.tuntap = type opaque
define void @tun_standby_init(%struct.tuntap* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i = 2147483648.5f;
  printf("%d\n", i);
  i = 2147483648;
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x80000000,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 poison, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 -2147483648, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -2147483648)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int main() {
  f1(20);
  f1(20 - 1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 20)
%2 = tail call i32 @f1(i32 19)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *xrealloc(void *old, size_t bytes) {
  void *ret = realloc(old, bytes);
  if (!ret) {
    perror("xrealloc");
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<xrealloc>:
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 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <xrealloc+0x42>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"xrealloc\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
int test_imm_5Auint32_reg(unsigned int val) {
  return ((val) & (0x5A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Auint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x5a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_5Auint32_reg(i32 %0) {
%2 = and i32 %0, 90
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test2(int);
test() {
  test2(10);
  test2(20);
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0xa,%edi
call   1030 <test2@plt>
mov    $0x14,%edi
pop    %rax
jmp    1030 <test2@plt>

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = call i32 @test2(i32 10)
%3 = call i32 @test2(i32 20)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 @test2(i32 10)
%2 = tail call i32 @test2(i32 20)
ret i32 undef
}