xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sqrt_v(double);
int main(void) {
  printf("sqrt (2.0) = %.5f\n", sqrt_v(2.0));
  printf("sqrt (100.0) = %.5f\n", sqrt_v(144.0));
  printf("sqrt (17.5) = %.5f\n", sqrt_v(17.5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
call   1040 <sqrt_v@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb8(%rip),%xmm0
call   1040 <sqrt_v@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe97(%rip),%xmm0
call   1040 <sqrt_v@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <sqrt_v@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xec6(%rip),%xmm0
call   1040 <sqrt_v@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb5(%rip),%xmm0
call   1040 <sqrt_v@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"sqrt (2.0) = %.5f\0A\00"
@.str.1 = [21 x i8] c"sqrt (100.0) = %.5f\0A\00"
@.str.2 = [20 x i8] c"sqrt (17.5) = %.5f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @sqrt_v(double 2.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @sqrt_v(double 1.440000e+02)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call double @sqrt_v(double 1.750000e+01)
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"sqrt (2.0) = %.5f\0A\00"
@.str.1 = [21 x i8] c"sqrt (100.0) = %.5f\0A\00"
@.str.2 = [20 x i8] c"sqrt (17.5) = %.5f\0A\00"
define i32 @main() {
%1 = tail call double @sqrt_v(double 2.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @sqrt_v(double 1.440000e+02)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @sqrt_v(double 1.750000e+01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}
/* Type definitions */
struct int_cont_t {
  int dummy;
};

/* Variables and functions */
scalar_t__ init_cont(int);
struct int_cont_t *init_int_cont() {
  return (struct int_cont_t *)init_cont(sizeof(int));
}


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

x86 assembly (clang, -O2):
<init_int_cont>:
mov    $0x4,%edi
jmp    1030 <init_cont@plt>

LLVM IR (-O0):
%struct.int_cont_t = type { i32 }
define %struct.int_cont_t* @init_int_cont() {
%1 = call i64 @init_cont(i32 4)
%2 = inttoptr i64 %1 to %struct.int_cont_t*
ret %struct.int_cont_t* %2
}

LLVM IR (-O2):
%struct.int_cont_t = type { i32 }
define %struct.int_cont_t* @init_int_cont() {
%1 = tail call i64 @init_cont(i32 4)
%2 = inttoptr i64 %1 to %struct.int_cont_t*
ret %struct.int_cont_t* %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_socket(int sock) {
  close(sock);
  return;
}


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

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

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

LLVM IR (-O2):
define void @close_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
char *mandoc_malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *mandoc_strndup(const char *ptr, size_t sz) {
  char *p;
  p = mandoc_malloc(sz + 1);
  memcpy(p, ptr, sz);
  p[(int)sz] = '\0';
  return (p);
}


x86 assembly (clang, -O0):
<mandoc_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <mandoc_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mandoc_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <mandoc_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mandoc_strndup(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 i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @mandoc_malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @mandoc_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @mandoc_malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%6 = shl i64 %1, 32
%7 = ashr exact i64 %6, 32
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8 0, i8* %8
ret i8* %4
}
void system_sound_silence(void) { return; }


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

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

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

LLVM IR (-O2):
define void @system_sound_silence() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_char(int /*<<< orphan*/);
void display_string(char *s) {
  while (*s)
    display_char(*s++);
}


x86 assembly (clang, -O0):
<display_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <display_string+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <display_char@plt>
jmp    111c <display_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <display_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <display_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <display_string+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @display_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @display_char(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @display_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @display_char(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void cutils_carg_zero(char empty) {}


x86 assembly (clang, -O0):
<cutils_carg_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cutils_carg_zero(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ devinit_usage(char *, char *, int /*<<< orphan*/);
void usage() { devinit_usage("mem", "<size>", 0); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
xor    %edx,%edx
call   1030 <devinit_usage@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %edx,%edx
jmp    1030 <devinit_usage@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"mem\00"
@.str.1 = [7 x i8] c"<size>\00"
define void @usage() {
%1 = call i32 @devinit_usage(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"mem\00"
@.str.1 = [7 x i8] c"<size>\00"
define void @usage() {
%1 = tail call i32 @devinit_usage(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
void ff_hevc_put_hevc_bi_w_epel_hv6_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_hv6_12_sse4() {
ret void
}
/* Variables and functions */
double sqrt(double);
double calculate_first_root(double a, double b, double discriminant) {
  return (-b + sqrt(discriminant)) / (2 * a);
}


x86 assembly (clang, -O0):
<calculate_first_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe9a(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_first_root>:
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1127 <calculate_first_root+0x17>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1150 <calculate_first_root+0x40>
sub    $0x18,%rsp
movapd %xmm2,%xmm0
movsd  %xmm3,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm3
add    $0x18,%rsp
subsd  %xmm1,%xmm0
addsd  %xmm3,%xmm3
divsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @calculate_first_root(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = fneg double %7
%9 = load double, double* %6
%10 = call double @sqrt(double %9)
%11 = fadd double %8, %10
%12 = load double, double* %4
%13 = fmul double 2.000000e+00, %12
%14 = fdiv double %11, %13
ret double %14
}

LLVM IR (-O2):
define double @calculate_first_root(double %0, double %1, double %2) {
%4 = tail call double @sqrt(double %2)
%5 = fsub double %4, %1
%6 = fmul double %0, 2.000000e+00
%7 = fdiv double %5, %6
ret double %7
}
/* Type definitions */
struct sigaction {
  void (*sa_handler)(int);
  scalar_t__ sa_flags;
  int /*<<< orphan*/ sa_mask;
};

/* Variables and functions */
int sigaction(int, struct sigaction *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int set_signal(int signum, void (*handler)(int)) {
  struct sigaction new_action;
  new_action.sa_handler = handler;
  sigemptyset(&new_action.sa_mask);
  new_action.sa_flags = 0;
  return sigaction(signum, &new_action, 0);
}


x86 assembly (clang, -O0):
<set_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
add    $0x10,%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_signal>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
mov    %rsi,0x8(%rsp)
lea    0x18(%rsp),%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { void (i32)*, i64, i32 }
define i32 @set_signal(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
%5 = alloca %struct.sigaction
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%6 = load void (i32)*, void (i32)** %4
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 0
store void (i32)* %6, void (i32)** %7
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 2
%9 = call i32 @sigemptyset(i32* %8)
%10 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 1
store i64 0, i64* %10
%11 = load i32, i32* %3
%12 = call i32 @sigaction(i32 %11, %struct.sigaction* %5, i32 0)
ret i32 %12
}

LLVM IR (-O2):
%struct.sigaction = type { void (i32)*, i64, i32 }
define i32 @set_signal(i32 %0, void (i32)* %1) {
%3 = alloca %struct.sigaction
%4 = bitcast %struct.sigaction* %3 to i8*
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store void (i32)* %1, void (i32)** %5
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 2
%7 = call i32 @sigemptyset(i32* %6)
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 1
store i64 0, i64* %8
%9 = call i32 @sigaction(i32 %0, %struct.sigaction* %3, i32 0)
ret i32 %9
}
unsigned int c2i(char c) {
  return (((c) <= '9') ? ((c) - '0') : (((c) - 'a') + 10));
}


x86 assembly (clang, -O0):
<c2i>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1126 <c2i+0x26>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <c2i+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2i>:
lea    -0x57(%rdi),%ecx
lea    -0x30(%rdi),%eax
cmp    $0x3a,%dil
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @c2i(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 %4, 57
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %15
10: ; preds = %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 97
%14 = add nsw i32 %13, 10
br label %15
15: ; preds = %10, %6
%16 = phi i32 [ %9, %6 ], [ %14, %10 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @c2i(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp slt i8 %0, 58
%4 = select i1 %3, i32 -48, i32 -87
%5 = add nsw i32 %4, %2
ret i32 %5
}
int adsf_make_link(int *t, int n, int a, int b) {
  if (a < b) {
    t[b] = a;
    return a;
  } else {
    t[a] = b;
    return b;
  }
}


x86 assembly (clang, -O0):
<adsf_make_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1136 <adsf_make_link+0x36>
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <adsf_make_link+0x4a>
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adsf_make_link>:
mov    %ecx,%eax
cmp    %ecx,%edx
mov    %edx,%ecx
cmovl  %eax,%ecx
cmovl  %edx,%eax
movslq %ecx,%rcx
mov    %eax,(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define i32 @adsf_make_link(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, %3
%6 = select i1 %5, i32 %3, i32 %2
%7 = select i1 %5, i32 %2, i32 %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %7, i32* %9
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ oscInit();
int /*<<< orphan*/ oscStartLoop();
int /*<<< orphan*/ oscWait();
int main() {
  oscInit();
  oscStartLoop();
  oscWait();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <oscInit@plt>
mov    $0x0,%al
call   1040 <oscStartLoop@plt>
mov    $0x0,%al
call   1030 <oscWait@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @oscInit()
%2 = call i32 (...) @oscStartLoop()
%3 = call i32 (...) @oscWait()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @oscInit()
%2 = tail call i32 (...) @oscStartLoop()
%3 = tail call i32 (...) @oscWait()
ret i32 0
}
int lm_support_dlm(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lm_support_dlm() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wprintf(char *);
void printc() { wprintf(L"This is  testing.\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i32] [i32 84, i32 104, i32 105, i32 115, i32 32, i32 105, i32 115, i32 32, i32 32, i32 116, i32 101, i32 115, i32 116, i32 105, i32 110, i32 103, i32 46, i32 10, i32 0]
define void @printc() {
%1 = call i32 @wprintf(i8* bitcast ([19 x i32]* @.str to i8*))
ret void
}

LLVM IR (-O2):
@.str = [19 x i32] [i32 84, i32 104, i32 105, i32 115, i32 32, i32 105, i32 115, i32 32, i32 32, i32 116, i32 101, i32 115, i32 116, i32 105, i32 110, i32 103, i32 46, i32 10, i32 0]
define void @printc() {
%1 = tail call i32 @wprintf(i8* bitcast ([19 x i32]* @.str to i8*))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf2(char *, int);
int truncInt(int);
void GenIntData(int Size, int Val) {
  Val = truncInt(Val);
  if (Size == 1)
    printf2("\tdb\t%d\n", Val);
  else if (Size == 2)
    printf2("\tdw\t%d\n", Val);
}


x86 assembly (clang, -O0):
<GenIntData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <truncInt@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1157 <GenIntData+0x37>
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf2@plt>
jmp    1175 <GenIntData+0x55>
cmpl   $0x2,-0x4(%rbp)
jne    1170 <GenIntData+0x50>
mov    -0x8(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf2@plt>
jmp    1175 <GenIntData+0x55>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenIntData>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <truncInt@plt>
cmp    $0x1,%ebx
je     113d <GenIntData+0x1d>
cmp    $0x2,%ebx
jne    114c <GenIntData+0x2c>
lea    0xecd(%rip),%rdi
jmp    1144 <GenIntData+0x24>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <printf2@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"\09db\09%d\0A\00"
@.str.1 = [8 x i8] c"\09dw\09%d\0A\00"
define void @GenIntData(i32 %0, i32 %1) {
%3 = tail call i32 @truncInt(i32 %1)
switch i32 %0, label %8 [
i32 1, label %5
i32 2, label %4
]
4: ; preds = %2
br label %5
5: ; preds = %2, %4
%6 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %2 ]
%7 = tail call i32 @printf2(i8* %6, i32 %3)
br label %8
8: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint_least64_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_uint_least64_t(uint_least64_t const k1,
                                           uint_least64_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_uint_least64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_uint_least64_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_uint_least64_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ e_shxri(int, int, int);
void e_shlri(int r, int i) { e_shxri(r, i, 4); }


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

x86 assembly (clang, -O2):
<e_shlri>:
mov    $0x4,%edx
jmp    1030 <e_shxri@plt>

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

LLVM IR (-O2):
define void @e_shlri(i32 %0, i32 %1) {
%3 = tail call i32 @e_shxri(i32 %0, i32 %1, i32 4)
ret void
}
void __attribute__((no)) called_by_test_4() {}


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

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

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

LLVM IR (-O2):
define void @called_by_test_4() {
ret void
}
void g_hash_table_foreach_remove() {}


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

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

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

LLVM IR (-O2):
define void @g_hash_table_foreach_remove() {
ret void
}
float calcFov(int width, int height) { return (float)width / (float)height; }


x86 assembly (clang, -O0):
<calcFov>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcFov>:
cvtsi2ss %edi,%xmm0
cvtsi2ss %esi,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @calcFov(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to float
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to float
%9 = fdiv float %6, %8
ret float %9
}

LLVM IR (-O2):
define float @calcFov(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to float
%4 = sitofp i32 %1 to float
%5 = fdiv float %3, %4
ret float %5
}
/* Type definitions */
struct fsm {
  int dummy;
};

/* Variables and functions */
struct fsm *fsm_subset(struct fsm *, int);
struct fsm *fsm_determinize(struct fsm *net) {
  return (fsm_subset(net, 2));
}


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

x86 assembly (clang, -O2):
<fsm_determinize>:
mov    $0x2,%esi
jmp    1030 <fsm_subset@plt>

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

LLVM IR (-O2):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_determinize(%struct.fsm* %0) {
%2 = tail call %struct.fsm* @fsm_subset(%struct.fsm* %0, i32 2)
ret %struct.fsm* %2
}
/* Variables and functions */
int ERR_isError(size_t);
unsigned ZSTDv05_isError(size_t code) { return ERR_isError(code); }


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

x86 assembly (clang, -O2):
<ZSTDv05_isError>:
jmp    1030 <ERR_isError@plt>

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

LLVM IR (-O2):
define i32 @ZSTDv05_isError(i64 %0) {
%2 = tail call i32 @ERR_isError(i64 %0)
ret i32 %2
}
int get_length(char *string) {
  int k = 0;
  while (string[k] != 0)
    k++;
  return k;
}


x86 assembly (clang, -O0):
<get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <get_length+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <get_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <get_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void INT_Excep_DMACA_DMAC3I(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_DMACA_DMAC3I() {
ret void
}
/* Variables and functions */
unsigned long GetDraw77();
unsigned long getdraw() { return GetDraw77(); }


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

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

LLVM IR (-O0):
define i64 @getdraw() {
%1 = call i64 (...) @GetDraw77()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getdraw() {
%1 = tail call i64 (...) @GetDraw77()
ret i64 %1
}
int redisApi_on_listen(void *inst) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @redisApi_on_listen(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int ap_get_single_string_command(int, int, char *, int);
int ap_get_album(int session, char *str) {
  return (ap_get_single_string_command(session, 0xcc11, str, 256));
}


x86 assembly (clang, -O0):
<ap_get_album>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc11,%esi
mov    $0x100,%ecx
call   1030 <ap_get_single_string_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_get_album>:
mov    %rsi,%rdx
mov    $0xcc11,%esi
mov    $0x100,%ecx
jmp    1030 <ap_get_single_string_command@plt>

LLVM IR (-O0):
define i32 @ap_get_album(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @ap_get_single_string_command(i32 %5, i32 52241, i8* %6, i32 256)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ap_get_album(i32 %0, i8* %1) {
%3 = tail call i32 @ap_get_single_string_command(i32 %0, i32 52241, i8* %1, i32 256)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  short __flags;
};
typedef TYPE_1__ posix_spawnattr_t;

/* Variables and functions */
int posix_spawnattr_getflags(const posix_spawnattr_t *restrict attr,
                             short *restrict flags) {
  *flags = attr->__flags;
  return 0;
}


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

x86 assembly (clang, -O2):
<posix_spawnattr_getflags>:
movzwl (%rdi),%eax
mov    %ax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i16 }
define i32 @posix_spawnattr_getflags(%struct.TYPE_3__* noalias %0, i16* noalias %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i16*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i16* %1, i16** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i16, i16* %6
%8 = load i16*, i16** %4
store i16 %7, i16* %8
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i16 }
define i32 @posix_spawnattr_getflags(%struct.TYPE_3__* noalias nocapture %0, i16* noalias nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%4 = load i16, i16* %3
store i16 %4, i16* %1
ret i32 0
}
/* Variables and functions */
int __sys_close(int);
int close(int file) { return __sys_close(file); }


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

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

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @__sys_close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: cp.minix <input file> <source file> <dest file>\n");
  exit(EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"usage: cp.minix <input file> <source file> <dest file>\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [55 x i8] c"usage: cp.minix <input file> <source file> <dest file>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int recv(int, char *, int, int /*<<< orphan*/);
int DgramReceiveConnected(int fd, char *buf, int size) {
  return (recv(fd, buf, size, 0));
}


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

x86 assembly (clang, -O2):
<DgramReceiveConnected>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @DgramReceiveConnected(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
void print_timeval_m(FILE *o, const struct timeval *t) {
  fprintf(o, "%g", (double)t->tv_sec + (double)t->tv_usec / (1000.0 * 1000.0));
}


x86 assembly (clang, -O0):
<print_timeval_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xec1(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_timeval_m>:
cvtsi2sdq 0x8(%rsi),%xmm1
cvtsi2sdq (%rsi),%xmm0
divsd  0xedd(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [3 x i8] c"%g\00"
define void @print_timeval_m(i32* %0, %struct.timeval* %1) {
%3 = alloca i32*
%4 = alloca %struct.timeval*
store i32* %0, i32** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i32*, i32** %3
%6 = load %struct.timeval*, %struct.timeval** %4
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = load %struct.timeval*, %struct.timeval** %4
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fdiv double %13, 1.000000e+06
%15 = fadd double %9, %14
%16 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %15)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [3 x i8] c"%g\00"
define void @print_timeval_m(i32* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %9, %5
%11 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %10)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_utimes;
int syscall(int /*<<< orphan*/, char const *, struct timeval const *);
int utimes(const char *filename, const struct timeval times[2]) {
  return syscall(SYS_utimes, filename, times);
}


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

x86 assembly (clang, -O2):
<utimes>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@SYS_utimes = global i32 0
define i32 @utimes(i8* %0, %struct.timeval* %1) {
%3 = alloca i8*
%4 = alloca %struct.timeval*
store i8* %0, i8** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i32, i32* @SYS_utimes
%6 = load i8*, i8** %3
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = call i32 @syscall(i32 %5, i8* %6, %struct.timeval* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@SYS_utimes = global i32 0
define i32 @utimes(i8* %0, %struct.timeval* %1) {
%3 = load i32, i32* @SYS_utimes
%4 = tail call i32 @syscall(i32 %3, i8* %0, %struct.timeval* %1)
ret i32 %4
}
XRemoveHosts() {}


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

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

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

LLVM IR (-O2):
define i32 @XRemoveHosts() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ getcwd(char *, int);
int /*<<< orphan*/ info_msg(char *, char *);
void cmd_pwd(char *arg) {
  char buf[4096];
  if (getcwd(buf, sizeof buf)) {
    info_msg("%s", buf);
  }
}


x86 assembly (clang, -O0):
<cmd_pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x1010(%rbp),%rdi
mov    $0x1000,%esi
call   1030 <getcwd@plt>
cmp    $0x0,%rax
je     115d <cmd_pwd+0x3d>
lea    -0x1010(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1040 <info_msg@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_pwd>:
sub    $0x1008,%rsp
mov    %rsp,%rdi
mov    $0x1000,%esi
call   1030 <getcwd@plt>
test   %rax,%rax
je     1148 <cmd_pwd+0x28>
lea    0xec0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <info_msg@plt>
add    $0x1008,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @cmd_pwd(i8* %0) {
%2 = alloca i8*
%3 = alloca [4096 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = call i64 @getcwd(i8* %4, i32 4096)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%9 = call i32 @info_msg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @cmd_pwd(i8* nocapture readnone %0) {
%2 = alloca [4096 x i8]
%3 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%4 = call i64 @getcwd(i8* %3, i32 4096)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @info_msg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %8
8: ; preds = %6, %1
ret void
}
__typeof__(strndup(1, (void *)1)) test_strndup_163(void) {
  return strndup(1, (void *)1);
}


x86 assembly (clang, -O0):
<test_strndup_163>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %rsi,%rdi
call   1030 <strndup@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @test_strndup_163() {
%1 = call i8* @strndup(i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @test_strndup_163() {
%1 = tail call i8* @strndup(i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ spiral();
void dizzyFace() { spiral(); }


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

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

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

LLVM IR (-O2):
define void @dizzyFace() {
%1 = tail call i32 (...) @spiral()
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;
typedef scalar_t__ ui32Base;

/* Variables and functions */
void PWMGenIntTrigDisable(uint32_t ui32Base, uint32_t ui32Gen,
                          uint32_t ui32IntTrig) {
  ;
  ;

  ;
  (*((volatile unsigned long *)(((ui32Base) + (ui32Gen)) + 0x00000004))) &=
      ~(ui32IntTrig);
}


x86 assembly (clang, -O0):
<PWMGenIntTrigDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    %rcx,%rax
mov    0x4(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenIntTrigDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    %rdx,-0x18(%rsp)
mov    -0x18(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
mov    -0x10(%rsp),%rdx
and    %rax,0x4(%rcx,%rdx,1)
ret

LLVM IR (-O0):
define void @PWMGenIntTrigDisable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
store volatile i64 %2, i64* %6
%7 = load volatile i64, i64* %6
%8 = xor i64 %7, -1
%9 = load volatile i64, i64* %4
%10 = load volatile i64, i64* %5
%11 = add i64 %9, %10
%12 = add i64 %11, 4
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = and i64 %14, %8
store volatile i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @PWMGenIntTrigDisable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
store volatile i64 %2, i64* %6
%7 = load volatile i64, i64* %6
%8 = xor i64 %7, -1
%9 = load volatile i64, i64* %4
%10 = load volatile i64, i64* %5
%11 = add i64 %9, 4
%12 = add i64 %11, %10
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = and i64 %14, %8
store volatile i64 %15, i64* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int foo(int);
int int_nd();
int main() {
  int x1 = int_nd();
  int y1 = foo(x1);
  __CRAB_assert(y1 == x1);
  int x2 = 1000;
  int y2 = foo(x2);
  __CRAB_assert(y2 == 1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <int_nd@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
movl   $0x3e8,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <foo@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <int_nd@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <foo@plt>
xor    %edi,%edi
cmp    %ebx,%eax
sete   %dil
call   1030 <__CRAB_assert@plt>
mov    $0x3e8,%edi
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x3e8,%eax
sete   %dil
call   1030 <__CRAB_assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @int_nd()
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @foo(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @__CRAB_assert(i32 %12)
store i32 1000, i32* %4
%14 = load i32, i32* %4
%15 = call i32 @foo(i32 %14)
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 1000
%18 = zext i1 %17 to i32
%19 = call i32 @__CRAB_assert(i32 %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @int_nd()
%2 = tail call i32 @foo(i32 %1)
%3 = icmp eq i32 %2, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @__CRAB_assert(i32 %4)
%6 = tail call i32 @foo(i32 1000)
%7 = icmp eq i32 %6, 1000
%8 = zext i1 %7 to i32
%9 = tail call i32 @__CRAB_assert(i32 %8)
ret i32 0
}
/* Variables and functions */
int func1();
int main(void) {
  int i;
  int i___0;
  int a;
  {
    i = 0;
    {
      while (1) {
      while_continue:;
        if (i) {
        } else {
          goto while_break;
        }
        i___0 = 5;
      }
    while_break:;
    }
    a = func1();
    return (0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    112b <main+0x1b>
cmpl   $0x0,-0x8(%rbp)
je     113a <main+0x2a>
jmp    113f <main+0x2f>
jmp    114b <main+0x3b>
movl   $0x5,-0xc(%rbp)
jmp    1126 <main+0x16>
mov    $0x0,%al
call   1030 <func1@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func1()
ret i32 0
}