xunge/DecIR huggingface dataset:
double Atan(double x) {
  if ((x >= 1) || (x <= 1))
    return (x / (1 + 0.28 * x * x));
  else
    return (3.14159265358979323846264338327 / 2 - Atan(1 / x));
}


x86 assembly (clang, -O0):
<Atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    1147 <Atan+0x37>
movsd  0xec4(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     117c <Atan+0x6c>
movsd  -0x10(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe96(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a2 <Atan+0x92>
movsd  0xe7c(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <Atan@plt>
movaps %xmm0,%xmm1
movsd  0xe6f(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Atan>:
push   %rax
ucomisd %xmm0,%xmm0
jp     1135 <Atan+0x25>
movsd  0xef1(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret
movsd  0xec3(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <Atan@plt>
movapd %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Atan(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 1.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp ole double %7, 1.000000e+00
br i1 %8, label %9, label %16
9: ; preds = %6, %1
%10 = load double, double* %3
%11 = load double, double* %3
%12 = fmul double 2.800000e-01, %11
%13 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double %12, double %13, double 1.000000e+00)
%15 = fdiv double %10, %14
store double %15, double* %2
br label %21
16: ; preds = %6
%17 = load double, double* %3
%18 = fdiv double 1.000000e+00, %17
%19 = call double @Atan(double %18)
%20 = fsub double 0x3FF921FB54442D18, %19
store double %20, double* %2
br label %21
21: ; preds = %16, %9
%22 = load double, double* %2
ret double %22
}

LLVM IR (-O2):
define double @Atan(double %0) {
%2 = fcmp ord double %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fmul double %0, 2.800000e-01
%5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double 1.000000e+00)
%6 = fdiv double %0, %5
br label %7
7: ; preds = %3, %9
%8 = phi double [ %12, %9 ], [ %6, %3 ]
ret double %8
9: ; preds = %1
%10 = fdiv double 1.000000e+00, %0
%11 = tail call double @Atan(double %10)
%12 = fsub double 0x3FF921FB54442D18, %11
br label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ bar;

/* Variables and functions */
size_t foo(int bar[]) { return sizeof(bar); }


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

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

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

LLVM IR (-O2):
define i64 @foo(i32* nocapture readnone %0) {
ret i64 8
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int);
void wl_shell_surface_send_popup_done(struct wl_resource *resource_) {
  wl_resource_post_event(resource_, 2);
}


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

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

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

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_shell_surface_send_popup_done(%struct.wl_resource* %0) {
%2 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 2)
ret void
}
void SeErrorF(fmt, a, b, c) char *fmt, *a, *b, *c;
{
  char buf[256];
  sprintf(buf, fmt, a, b, c);
  SeError(buf);
}


x86 assembly (clang, -O0):
<SeErrorF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x120(%rbp),%rdi
mov    $0x0,%al
call   1030 <SeError@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SeErrorF>:
push   %rbx
sub    $0x100,%rsp
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <SeError@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @SeErrorF(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [256 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* %11, i8* %12, i8* %13, i8* %14)
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @SeError to i32 (i8*, ...)*)(i8* %16)
ret void
}

LLVM IR (-O2):
define void @SeErrorF(i8* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) %0, i8* %1, i8* %2, i8* %3)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @SeError to i32 (i8*, ...)*)(i8* %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
void read_short(u_int16_t *s, FILE *f) { fread(s, 2, 1, f); }


x86 assembly (clang, -O0):
<read_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_short>:
mov    %rsi,%rcx
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <fread@plt>

LLVM IR (-O0):
define void @read_short(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 @fread(i32* %5, i32 2, i32 1, i32* %6)
ret void
}

LLVM IR (-O2):
define void @read_short(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fread(i32* %0, i32 2, i32 1, i32* %1)
ret void
}
/* Type definitions */
struct i8x_object {
  int dummy;
};
struct i8x_chunk {
  int dummy;
};

/* Variables and functions */
void *i8x_ob_get_userdata(struct i8x_object *);
void *__attribute__((always_)) i8x_chunk_get_userdata(struct i8x_chunk *x) {
  return i8x_ob_get_userdata((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_chunk_get_userdata>:
jmp    1030 <i8x_ob_get_userdata@plt>

LLVM IR (-O0):
%struct.i8x_chunk = type { i32 }
%struct.i8x_object = type { i32 }
define i8* @i8x_chunk_get_userdata(%struct.i8x_chunk* %0) {
%2 = alloca %struct.i8x_chunk*
store %struct.i8x_chunk* %0, %struct.i8x_chunk** %2
%3 = load %struct.i8x_chunk*, %struct.i8x_chunk** %2
%4 = bitcast %struct.i8x_chunk* %3 to %struct.i8x_object*
%5 = call i8* @i8x_ob_get_userdata(%struct.i8x_object* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.i8x_chunk = type { i32 }
%struct.i8x_object = type { i32 }
define i8* @i8x_chunk_get_userdata(%struct.i8x_chunk* %0) {
%2 = bitcast %struct.i8x_chunk* %0 to %struct.i8x_object*
%3 = tail call i8* @i8x_ob_get_userdata(%struct.i8x_object* %2)
ret i8* %3
}
void kvm_coalesced_mmio_free(struct kvm *kvm) {}


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

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

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

LLVM IR (-O2):
%struct.kvm = type opaque
define void @kvm_coalesced_mmio_free(%struct.kvm* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
int var_size_u64(int);
int var_size_s64(int64_t v) {
  return var_size_u64(((uint64_t)v << 1) ^ (v >> 63));
}


x86 assembly (clang, -O0):
<var_size_s64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
mov    -0x4(%rbp),%eax
mov    $0x3f,%ecx
sar    %cl,%eax
xor    %eax,%edi
call   1030 <var_size_u64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_size_s64>:
jmp    1030 <var_size_u64@plt>

LLVM IR (-O0):
define i32 @var_size_s64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 63
%7 = xor i32 %4, %6
%8 = call i32 @var_size_u64(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @var_size_s64(i32 %0) {
%2 = tail call i32 @var_size_u64(i32 poison)
ret i32 %2
}
int round_sin(int x) {
  return x >= 0 ? (x + (1 << 14)) >> 15 : -((-x + (1 << 14)) >> 15);
}


x86 assembly (clang, -O0):
<round_sin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1124 <round_sin+0x24>
mov    -0x4(%rbp),%eax
add    $0x4000,%eax
sar    $0xf,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <round_sin+0x39>
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
add    $0x4000,%ecx
sar    $0xf,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_sin>:
mov    %edi,%eax
test   %edi,%edi
js     110f <round_sin+0xf>
add    $0x4000,%eax
shr    $0xf,%eax
ret
mov    $0x4000,%ecx
sub    %eax,%ecx
sar    $0xf,%ecx
neg    %ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @round_sin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 16384
%8 = ashr i32 %7, 15
br label %15
9: ; preds = %1
%10 = load i32, i32* %2
%11 = sub nsw i32 0, %10
%12 = add nsw i32 %11, 16384
%13 = ashr i32 %12, 15
%14 = sub nsw i32 0, %13
br label %15
15: ; preds = %9, %5
%16 = phi i32 [ %8, %5 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @round_sin(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = add nuw nsw i32 %0, 16384
%5 = lshr i32 %4, 15
br label %10
6: ; preds = %1
%7 = sub i32 16384, %0
%8 = ashr i32 %7, 15
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ %5, %3 ], [ %9, %6 ]
ret i32 %11
}
int proc_comm_batt_get_power_on_status(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @proc_comm_batt_get_power_on_status() {
ret i32 0
}
int Cyc_Position_segment_equals(unsigned s1, unsigned s2) {
  int _T0;
  _T0 = s1 == s2;
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Position_segment_equals>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Position_segment_equals>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @Cyc_Position_segment_equals(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @Cyc_Position_segment_equals(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int ft_needle(char c, char *str) {
  int i;
  i = -1;
  while (str[++i])
    if (c == str[i])
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_needle>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1158 <ft_needle+0x58>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1153 <ft_needle+0x53>
movl   $0x1,-0x4(%rbp)
jmp    115f <ft_needle+0x5f>
jmp    1115 <ft_needle+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_needle>:
movzbl (%rsi),%eax
test   %al,%al
je     1116 <ft_needle+0x16>
add    $0x1,%rsi
cmp    %dil,%al
jne    1100 <ft_needle>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_needle(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i64 [ %5, %9 ], [ -1, %2 ]
%5 = add nsw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = icmp eq i8 %7, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %9
%12 = phi i32 [ 1, %9 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int ejtag_switch(int, char);
int mips_ejtag_instr(char instr) { return ejtag_switch(0x1001, instr); }


x86 assembly (clang, -O0):
<mips_ejtag_instr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1001,%edi
movsbl -0x1(%rbp),%esi
call   1030 <ejtag_switch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mips_ejtag_instr>:
mov    %edi,%esi
mov    $0x1001,%edi
jmp    1030 <ejtag_switch@plt>

LLVM IR (-O0):
define i32 @mips_ejtag_instr(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @ejtag_switch(i32 4097, i8 signext %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @mips_ejtag_instr(i8 signext %0) {
%2 = tail call i32 @ejtag_switch(i32 4097, i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ WriteStringToBuffer(char *);
void RecordPanicMessage(char *message) {
  WriteStringToBuffer("info.err-:E:");
  WriteStringToBuffer(message);
}


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

x86 assembly (clang, -O2):
<RecordPanicMessage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <WriteStringToBuffer@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <WriteStringToBuffer@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"info.err-:E:\00"
define void @RecordPanicMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @WriteStringToBuffer(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @WriteStringToBuffer(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"info.err-:E:\00"
define void @RecordPanicMessage(i8* %0) {
%2 = tail call i32 @WriteStringToBuffer(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @WriteStringToBuffer(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(int, unsigned char);
void print_debug_char(unsigned char byte) { __console_tx_char(7, byte); }


x86 assembly (clang, -O0):
<print_debug_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7,%edi
movzbl -0x1(%rbp),%esi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_debug_char>:
mov    %edi,%esi
mov    $0x7,%edi
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_debug_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i32 7, i8 zeroext %0)
ret void
}
/* Type definitions */
struct interface {
  int dummy;
};
struct dhcpcd_ctx {
  int dummy;
};

/* Variables and functions */
struct interface *if_findindexname(struct dhcpcd_ctx *, unsigned int,
                                   int /*<<< orphan*/ *);
struct interface *if_findindex(struct dhcpcd_ctx *ctx, unsigned int idx) {
  return if_findindexname(ctx, idx, NULL);
}


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

x86 assembly (clang, -O2):
<if_findindex>:
xor    %edx,%edx
jmp    1030 <if_findindexname@plt>

LLVM IR (-O0):
%struct.interface = type { i32 }
%struct.dhcpcd_ctx = type { i32 }
define %struct.interface* @if_findindex(%struct.dhcpcd_ctx* %0, i32 %1) {
%3 = alloca %struct.dhcpcd_ctx*
%4 = alloca i32
store %struct.dhcpcd_ctx* %0, %struct.dhcpcd_ctx** %3
store i32 %1, i32* %4
%5 = load %struct.dhcpcd_ctx*, %struct.dhcpcd_ctx** %3
%6 = load i32, i32* %4
%7 = call %struct.interface* @if_findindexname(%struct.dhcpcd_ctx* %5, i32 %6, i32* null)
ret %struct.interface* %7
}

LLVM IR (-O2):
%struct.interface = type { i32 }
%struct.dhcpcd_ctx = type { i32 }
define %struct.interface* @if_findindex(%struct.dhcpcd_ctx* %0, i32 %1) {
%3 = tail call %struct.interface* @if_findindexname(%struct.dhcpcd_ctx* %0, i32 %1, i32* null)
ret %struct.interface* %3
}
void av_hash_init() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t
sdp_event_query_service_record_handle_get_record_index(const uint8_t *event) {
  return little_endian_read_16(event, 4);
}


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

x86 assembly (clang, -O2):
<sdp_event_query_service_record_handle_get_record_index>:
mov    $0x4,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @sdp_event_query_service_record_handle_get_record_index(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 4)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a, b, c;
  for (a = 1;; a++) {
    b = ((a * 8 + 7) * 8 + 1) * 8 + 1;
    c = (2 * a * 17 + 15) * 17 + 4;
    if (b == c)
      break;
  }
  printf("%d", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0x7,%eax
shl    $0x3,%eax
add    $0x1,%eax
shl    $0x3,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
imul   $0x11,%eax,%eax
add    $0xf,%eax
imul   $0x11,%eax,%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    115d <main+0x4d>
jmp    1170 <main+0x60>
jmp    1162 <main+0x52>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
mov    -0x8(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x7c9,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1993)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int testSimpleAPI();
int testStreamingAPI();
int main(void) {
  int ret;
  ret = testSimpleAPI();
  if (ret)
    return ret;
  ret = testStreamingAPI();
  if (ret)
    return ret;
  fprintf(stderr, "OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <testSimpleAPI@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115e <main+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1199 <main+0x69>
mov    $0x0,%al
call   1030 <testStreamingAPI@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     117d <main+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1199 <main+0x69>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <testSimpleAPI@plt>
test   %eax,%eax
je     113e <main+0xe>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <testStreamingAPI@plt>
test   %eax,%eax
jne    113c <main+0xc>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @testSimpleAPI()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %17
8: ; preds = %0
%9 = call i32 (...) @testStreamingAPI()
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i32, i32* %2
store i32 %13, i32* %1
br label %17
14: ; preds = %8
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %17
17: ; preds = %14, %12, %6
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @testSimpleAPI()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = tail call i32 (...) @testStreamingAPI()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %3, %0, %6
%10 = phi i32 [ 0, %6 ], [ %1, %0 ], [ %4, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ go_to_other_pane();
int /*<<< orphan*/ switch_panes_content();
void switch_windows(void) {
  switch_panes_content();
  go_to_other_pane();
}


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

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

LLVM IR (-O0):
define void @switch_windows() {
%1 = call i32 (...) @switch_panes_content()
%2 = call i32 (...) @go_to_other_pane()
ret void
}

LLVM IR (-O2):
define void @switch_windows() {
%1 = tail call i32 (...) @switch_panes_content()
%2 = tail call i32 (...) @go_to_other_pane()
ret void
}
__attribute__((always_)) int pci_msi_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pci_msi_enabled() {
ret i32 0
}
char *sesstype_str(unsigned char c) {
  unsigned char b;
  char *s;
  b = ((c & 0xf0) >> 4);
  switch (b) {
  case 0:
    s = "IPMIv1.5";
    break;
  case 1:
    s = "IPMIv2/RMCP+";
    break;
  default:
    s = "Other";
    break;
  }
  return s;
}


x86 assembly (clang, -O0):
<sesstype_str>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shr    $0x4,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1139 <sesstype_str+0x39>
jmp    1128 <sesstype_str+0x28>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
je     1149 <sesstype_str+0x49>
jmp    1159 <sesstype_str+0x59>
lea    0xec0(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1164 <sesstype_str+0x64>
lea    0xeb9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1164 <sesstype_str+0x64>
lea    0xeb6(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sesstype_str>:
mov    %edi,%eax
and    $0xf0,%al
cmp    $0x10,%al
lea    0xefc(%rip),%rax
lea    0xf02(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x10,%dil
lea    0xedd(%rip),%rax
cmovae %rcx,%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"IPMIv1.5\00"
@.str.1 = [13 x i8] c"IPMIv2/RMCP+\00"
@.str.2 = [6 x i8] c"Other\00"
define i8* @sesstype_str(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = and i32 %6, 240
%8 = ashr i32 %7, 4
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
switch i32 %11, label %14 [
i32 0, label %12
i32 1, label %13
]
12: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %4
br label %15
13: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %15
14: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %4
br label %15
15: ; preds = %14, %13, %12
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
@.str = [9 x i8] c"IPMIv1.5\00"
@.str.1 = [13 x i8] c"IPMIv2/RMCP+\00"
@.str.2 = [6 x i8] c"Other\00"
define i8* @sesstype_str(i8 zeroext %0) {
%2 = and i8 %0, -16
%3 = icmp eq i8 %2, 16
%4 = select i1 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%5 = icmp ult i8 %0, 16
%6 = select i1 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ LowLevelInit();
int /*<<< orphan*/ PIT_setup();
int /*<<< orphan*/ SSC_Init();
int /*<<< orphan*/ SSC_Send(int);
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ enableIRQ();
int main(void) {
  LowLevelInit();
  PIT_setup();
  enableIRQ();
  SSC_Init();
  while (1) {
    SSC_Send(0x0F0F0F0F);
    delay(2000);
    SSC_Send(0x55555555);
    delay(2000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <LowLevelInit@plt>
mov    $0x0,%al
call   1080 <PIT_setup@plt>
mov    $0x0,%al
call   1040 <enableIRQ@plt>
mov    $0x0,%al
call   1050 <SSC_Init@plt>
mov    $0xf0f0f0f,%edi
call   1070 <SSC_Send@plt>
mov    $0x7d0,%edi
call   1060 <delay@plt>
mov    $0x55555555,%edi
call   1070 <SSC_Send@plt>
mov    $0x7d0,%edi
call   1060 <delay@plt>
jmp    118b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <LowLevelInit@plt>
xor    %eax,%eax
call   1080 <PIT_setup@plt>
xor    %eax,%eax
call   1040 <enableIRQ@plt>
xor    %eax,%eax
call   1050 <SSC_Init@plt>
nopl   (%rax)
mov    $0xf0f0f0f,%edi
call   1070 <SSC_Send@plt>
mov    $0x7d0,%edi
call   1060 <delay@plt>
mov    $0x55555555,%edi
call   1070 <SSC_Send@plt>
mov    $0x7d0,%edi
call   1060 <delay@plt>
jmp    1180 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @LowLevelInit()
%3 = call i32 (...) @PIT_setup()
%4 = call i32 (...) @enableIRQ()
%5 = call i32 (...) @SSC_Init()
br label %6
6: ; preds = %0, %6
%7 = call i32 @SSC_Send(i32 252645135)
%8 = call i32 @delay(i32 2000)
%9 = call i32 @SSC_Send(i32 1431655765)
%10 = call i32 @delay(i32 2000)
br label %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @LowLevelInit()
%2 = tail call i32 (...) @PIT_setup()
%3 = tail call i32 (...) @enableIRQ()
%4 = tail call i32 (...) @SSC_Init()
br label %5
5: ; preds = %0, %5
%6 = tail call i32 @SSC_Send(i32 252645135)
%7 = tail call i32 @delay(i32 2000)
%8 = tail call i32 @SSC_Send(i32 1431655765)
%9 = tail call i32 @delay(i32 2000)
br label %5
}
int uncompress_subclass(unsigned char csub) {
  if (csub & 0x80)
    return 1 << (csub & ~0x80 & 0x1F);
  else
    return csub;
}


x86 assembly (clang, -O0):
<uncompress_subclass>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1138 <uncompress_subclass+0x38>
movzbl -0x5(%rbp),%ecx
and    $0xffffff7f,%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <uncompress_subclass+0x3f>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncompress_subclass>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
test   $0x80,%cl
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @uncompress_subclass(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
%5 = and i32 %2, 31
%6 = shl nuw i32 1, %5
%7 = select i1 %4, i32 %2, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) { puts("Hello, world!"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int csvdb_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @csvdb_init() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getndelim2(char **, size_t *, size_t, int /*<<< orphan*/ *,
                              char, int /*<<< orphan*/, int /*<<< orphan*/);
ssize_t getline(char **lineptr, size_t *linesize, FILE *stream) {
  return getndelim2(lineptr, linesize, (size_t)(-1), stream, '\n', 0, 0);
}


x86 assembly (clang, -O0):
<getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0xffffffffffffffff,%rdx
mov    $0xa,%r8d
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <getndelim2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getline>:
push   %rax
mov    %rdx,%rcx
movl   $0x0,(%rsp)
mov    $0xffffffffffffffff,%rdx
mov    $0xa,%r8d
xor    %r9d,%r9d
call   1030 <getndelim2@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getline(i8** %0, i64* %1, i32* %2) {
%4 = tail call i32 @getndelim2(i8** %0, i64* %1, i64 -1, i32* %2, i8 signext 10, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("About to call exit from %s program .... \n", argv[0]);
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"About to call exit from %s program .... \0A\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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"About to call exit from %s program .... \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
u() {
  printf("Unimplemented Instruction\n");
  exit(2);
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Unimplemented Instruction\0A\00"
define i32 @u() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"Unimplemented Instruction\00"
define i32 @u() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int unsetenv(char const *);
int pyi_unsetenv(const char *variable) {
  int rc;
  rc = unsetenv(variable);
  return rc;
}


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

x86 assembly (clang, -O2):
<pyi_unsetenv>:
jmp    1030 <unsetenv@plt>

LLVM IR (-O0):
define i32 @pyi_unsetenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @unsetenv(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @pyi_unsetenv(i8* nocapture %0) {
%2 = tail call i32 @unsetenv(i8* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ islower(int);
scalar_t__ isupper(int);
int isalpha(int c) { return isupper(c) || islower(c); }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isalpha+0x37>
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @islower(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @islower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ parsex(char *);
void finclude(char *buf) { parsex(buf); }


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

x86 assembly (clang, -O2):
<finclude>:
jmp    1030 <parsex@plt>

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

LLVM IR (-O2):
define void @finclude(i8* %0) {
%2 = tail call i32 @parsex(i8* %0)
ret void
}
/* Variables and functions */
int snprintf(char *, size_t, char *);
int BYPASS_snprint(char *str, size_t size, void *priv) {
  return snprintf(str, size, " ");
}


x86 assembly (clang, -O0):
<BYPASS_snprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xecd(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BYPASS_snprint>:
lea    0xee9(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i32 @BYPASS_snprint(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i32 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %9
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @BYPASS_snprint(i8* nocapture writeonly %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ base10to36(char *, int);
void ion_xy_to_readname(char *id, int x, int y) {
  int num = x * 4096 + y;
  base10to36(id, num);
}


x86 assembly (clang, -O0):
<ion_xy_to_readname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0xc,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <base10to36@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ion_xy_to_readname>:
shl    $0xc,%esi
add    %edx,%esi
jmp    1030 <base10to36@plt>

LLVM IR (-O0):
define void @ion_xy_to_readname(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, 4096
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
store i32 %11, i32* %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %7
%14 = call i32 @base10to36(i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @ion_xy_to_readname(i8* %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 12
%5 = add nsw i32 %4, %2
%6 = tail call i32 @base10to36(i8* %0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int roll;
  srand(time(NULL));
  roll = rand() % 6 + 1;
  printf("Congratulations, you rolled a %d \n", roll);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Congratulations, you rolled a %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 6
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Congratulations, you rolled a %d \0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int main() { return -1 >= (unsigned long)-2; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
char *langRomTypePanasonic8() { return "Panasonic FM 8kB SRAM"; }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Panasonic FM 8kB SRAM\00"
define i8* @langRomTypePanasonic8() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [22 x i8] c"Panasonic FM 8kB SRAM\00"
define i8* @langRomTypePanasonic8() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}