xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
scalar_t__ strtoul(char *, int /*<<< orphan*/ *, int);
void mls_type_data_str_to_ushort(char *instr, unsigned short *outb) {
  char token[4 + 1];
  memcpy(token, instr, 4);
  token[4] = '\0';
  *outb = (unsigned short)strtoul(token, NULL, 16);
}


x86 assembly (clang, -O0):
<mls_type_data_str_to_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x15(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x15(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mls_type_data_str_to_ushort>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x3(%rsp),%r14
mov    %r14,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movb   $0x0,0x7(%rsp)
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %ax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mls_type_data_str_to_ushort(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
%5 = alloca [5 x i8]
store i8* %0, i8** %3
store i16* %1, i16** %4
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @memcpy(i8* %6, i8* %7, i32 4)
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 4
store i8 0, i8* %9
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%11 = call i64 @strtoul(i8* %10, i32* null, i32 16)
%12 = trunc i64 %11 to i16
%13 = load i16*, i16** %4
store i16 %12, i16* %13
ret void
}

LLVM IR (-O2):
define void @mls_type_data_str_to_ushort(i8* %0, i16* nocapture writeonly %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* %0, i32 4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 4
store i8 0, i8* %6
%7 = call i64 @strtoul(i8* nocapture %4, i32* null, i32 16)
%8 = trunc i64 %7 to i16
store i16 %8, i16* %1
ret void
}
void ifx_ppa_pwm_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ifx_ppa_pwm_init() {
ret void
}
void placer_navires_hum() {}


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

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

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

LLVM IR (-O2):
define void @placer_navires_hum() {
ret void
}
/* Variables and functions */
scalar_t__ ioctl(int, int, int *);
char *k_strerr();
int /*<<< orphan*/ printf(char *, char *);
int ksock_ioctl(int fd, int op, int *out) {
  if (0 != ioctl(fd, op, out)) {
    printf("ioctl :%s\n", k_strerr());
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ksock_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1181 <ksock_ioctl+0x51>
mov    $0x0,%al
call   1050 <k_strerr@plt>
mov    %rax,%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1188 <ksock_ioctl+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ksock_ioctl>:
push   %rax
call   1040 <ioctl@plt>
test   %rax,%rax
je     1158 <ksock_ioctl+0x28>
xor    %eax,%eax
call   1050 <k_strerr@plt>
lea    0xeb7(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"ioctl :%s\0A\00"
define i32 @ksock_ioctl(i32 %0, i32 %1, i32* %2) {
%4 = tail call i64 @ioctl(i32 %0, i32 %1, i32* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i8* (...) @k_strerr()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %10
}
int test_imm_90int8_reg(signed char val) {
  return ((val) & (-0x90 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_90int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff70,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_90int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -144
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pmu_adc_enable();
int /*<<< orphan*/ pmu_adc_reset_setting();
int /*<<< orphan*/ pmu_enable_4V_harvesting();
int /*<<< orphan*/ pmu_prep_sar_ratio();
int /*<<< orphan*/ pmu_reg_write(int, int);
int /*<<< orphan*/ pmu_set_clk_init();
void pmu_init() {
  pmu_set_clk_init();
  pmu_enable_4V_harvesting();
  pmu_reg_write(0x45, ((0x00 << 9) | (0x00 << 8) | (0x48 << 0)));
  pmu_reg_write(0x10, ((0x70A20 << 4) | (1 << 0)));
  pmu_adc_reset_setting();
  pmu_adc_enable();
  pmu_prep_sar_ratio();
}


x86 assembly (clang, -O0):
<pmu_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <pmu_set_clk_init@plt>
mov    $0x0,%al
call   1030 <pmu_enable_4V_harvesting@plt>
mov    $0x45,%edi
mov    $0x48,%esi
call   1050 <pmu_reg_write@plt>
mov    $0x10,%edi
mov    $0x70a201,%esi
call   1050 <pmu_reg_write@plt>
mov    $0x0,%al
call   1070 <pmu_adc_reset_setting@plt>
mov    $0x0,%al
call   1060 <pmu_adc_enable@plt>
mov    $0x0,%al
call   1040 <pmu_prep_sar_ratio@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_init>:
push   %rax
xor    %eax,%eax
call   1080 <pmu_set_clk_init@plt>
xor    %eax,%eax
call   1030 <pmu_enable_4V_harvesting@plt>
mov    $0x45,%edi
mov    $0x48,%esi
call   1050 <pmu_reg_write@plt>
mov    $0x10,%edi
mov    $0x70a201,%esi
call   1050 <pmu_reg_write@plt>
xor    %eax,%eax
call   1070 <pmu_adc_reset_setting@plt>
xor    %eax,%eax
call   1060 <pmu_adc_enable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pmu_prep_sar_ratio@plt>

LLVM IR (-O0):
define void @pmu_init() {
%1 = call i32 (...) @pmu_set_clk_init()
%2 = call i32 (...) @pmu_enable_4V_harvesting()
%3 = call i32 @pmu_reg_write(i32 69, i32 72)
%4 = call i32 @pmu_reg_write(i32 16, i32 7381505)
%5 = call i32 (...) @pmu_adc_reset_setting()
%6 = call i32 (...) @pmu_adc_enable()
%7 = call i32 (...) @pmu_prep_sar_ratio()
ret void
}

LLVM IR (-O2):
define void @pmu_init() {
%1 = tail call i32 (...) @pmu_set_clk_init()
%2 = tail call i32 (...) @pmu_enable_4V_harvesting()
%3 = tail call i32 @pmu_reg_write(i32 69, i32 72)
%4 = tail call i32 @pmu_reg_write(i32 16, i32 7381505)
%5 = tail call i32 (...) @pmu_adc_reset_setting()
%6 = tail call i32 (...) @pmu_adc_enable()
%7 = tail call i32 (...) @pmu_prep_sar_ratio()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glScissor(int, int, int, int);
void Scissor(int x, int y, int w, int h) { glScissor(x, y, w, h); }


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

x86 assembly (clang, -O2):
<Scissor>:
jmp    1030 <glScissor@plt>

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

LLVM IR (-O2):
define void @Scissor(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @glScissor(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
void caller_1_1_2_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_2_1_1_1_1() {
ret void
}
void main() {
  int i = 0, j = 0;
  int s = 0;
  for (i = 0; i < (1000L); i++) {
    for (j = 0; j < (1000L); j++) {
      s = s + 100;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0x3e8,%rax
jge    1171 <main+0x71>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x3e8,%rax
jge    115e <main+0x5e>
mov    -0xc(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <main+0x37>
jmp    1163 <main+0x63>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1120 <main+0x20>
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __get_unaligned_le32(int /*<<< orphan*/ const *);
u_int32_t get_unaligned_le32(const void *p) {
  return __get_unaligned_le32((const u_char *)p);
}


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

x86 assembly (clang, -O2):
<get_unaligned_le32>:
jmp    1030 <__get_unaligned_le32@plt>

LLVM IR (-O0):
define i32 @get_unaligned_le32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @__get_unaligned_le32(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_unaligned_le32(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @__get_unaligned_le32(i32* %2)
ret i32 %3
}
/* Type definitions */
struct timeval {
  int tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long get_millis() {
  struct timeval time;
  gettimeofday(&time, NULL);
  return ((time.tv_sec) * 1000 + time.tv_usec / 1000.0) + 0.5;
}


x86 assembly (clang, -O0):
<get_millis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xecb(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_millis>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%eax
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
divsd  0xec6(%rip),%xmm1
addsd  %xmm0,%xmm1
addsd  0xec2(%rip),%xmm1
cvttsd2si %xmm1,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, double }
define i64 @get_millis() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+03
%10 = fadd double %6, %9
%11 = fadd double %10, 5.000000e-01
%12 = fptosi double %11 to i64
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, double }
define i64 @get_millis() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+03
%11 = fadd double %10, %7
%12 = fadd double %11, 5.000000e-01
%13 = fptosi double %12 to i64
ret i64 %13
}
void *test_anti_range_67(unsigned n) {
  extern void *alloc_anti_range_67(unsigned) __attribute__((alloc_size(1)));
  if (0 <= n && n <= 0)
    n = 0 - 1;
  return alloc_anti_range_67(n);
}


x86 assembly (clang, -O0):
<test_anti_range_67>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
ja     1137 <test_anti_range_67+0x27>
cmpl   $0x0,-0x4(%rbp)
ja     1137 <test_anti_range_67+0x27>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_67@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_67>:
cmp    $0x1,%edi
sbb    %eax,%eax
or     %eax,%edi
jmp    1030 <alloc_anti_range_67@plt>

LLVM IR (-O0):
define i8* @test_anti_range_67(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 0, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ule i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -1, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_67(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_67(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 -1, i32 %0
%4 = tail call i8* @alloc_anti_range_67(i32 %3)
ret i8* %4
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_hosts(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_hosts>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_hosts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_hosts(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
char const *strerror(int errnum) {
  if (errnum < 0) {
    return "General Error";
  } else {
    return "No Error";
  }
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1121 <strerror+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <strerror+0x2c>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
test   %edi,%edi
lea    0xef7(%rip),%rcx
lea    0xefe(%rip),%rax
cmovs  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"General Error\00"
@.str.1 = [9 x i8] c"No Error\00"
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [14 x i8] c"General Error\00"
@.str.1 = [9 x i8] c"No Error\00"
define i8* @strerror(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *getenv(char *);
int /*<<< orphan*/ stat(char *, struct stat *);
void has_recent_files() {
  char *recentFiles = getenv("CSIDL_RECENT");
  if (!recentFiles) {
    0;
  }
  0;
  0;
  struct stat stats;
  stat(recentFiles, &stats);
  if (S_ISDIR(stats.st_mode)) {
    0;
  } else {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<has_recent_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1168 <has_recent_files+0x28>
jmp    1168 <has_recent_files+0x28>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <stat@plt>
mov    -0x10(%rbp),%edi
call   1040 <S_ISDIR@plt>
cmp    $0x0,%rax
je     118c <has_recent_files+0x4c>
jmp    1193 <has_recent_files+0x53>
xor    %edi,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_recent_files>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rsp,%rsi
mov    %rax,%rdi
call   1050 <stat@plt>
mov    (%rsp),%edi
call   1040 <S_ISDIR@plt>
test   %rax,%rax
je     1167 <has_recent_files+0x27>
pop    %rax
ret
xor    %edi,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [13 x i8] c"CSIDL_RECENT\00"
define void @has_recent_files() {
%1 = alloca %struct.stat
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = bitcast %struct.stat* %1 to i8*
%4 = call i32 @stat(i8* %2, %struct.stat* %1)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i64 @S_ISDIR(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ espcomm_delay_ms(int);
int /*<<< orphan*/ serialport_set_dtr(int);
void board_wifio_ra() {
  serialport_set_dtr(0);
  espcomm_delay_ms(5);
  serialport_set_dtr(1);
}


x86 assembly (clang, -O0):
<board_wifio_ra>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <serialport_set_dtr@plt>
mov    $0x5,%edi
call   1030 <espcomm_delay_ms@plt>
mov    $0x1,%edi
call   1040 <serialport_set_dtr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_wifio_ra>:
push   %rax
xor    %edi,%edi
call   1040 <serialport_set_dtr@plt>
mov    $0x5,%edi
call   1030 <espcomm_delay_ms@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <serialport_set_dtr@plt>

LLVM IR (-O0):
define void @board_wifio_ra() {
%1 = call i32 @serialport_set_dtr(i32 0)
%2 = call i32 @espcomm_delay_ms(i32 5)
%3 = call i32 @serialport_set_dtr(i32 1)
ret void
}

LLVM IR (-O2):
define void @board_wifio_ra() {
%1 = tail call i32 @serialport_set_dtr(i32 0)
%2 = tail call i32 @espcomm_delay_ms(i32 5)
%3 = tail call i32 @serialport_set_dtr(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int panic(void) {
  fprintf(stderr, "Can't compute alignment\n");
  exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Can't compute alignment\0A\00"
define i32 @panic() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Can't compute alignment\0A\00"
define i32 @panic() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ compute_tree(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char current_file[] = "/home/dragos/work/teme";
  compute_tree(current_file, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xec8(%rip),%ax
mov    %ax,-0x1c(%rbp)
mov    0xec0(%rip),%al
mov    %al,-0x1a(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
call   1030 <compute_tree@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x656d65742f6b72,%rax
mov    %rax,0xf(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <compute_tree@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.current_file = [23 x i8] c"/home/dragos/work/teme\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [23 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [23 x i8]* %6 to i8*
%8 = getelementptr inbounds [23 x i8], [23 x i8]* %6, i64 0, i64 0
%9 = call i32 @compute_tree(i8* %8, i32 0)
ret i32 0
}

LLVM IR (-O2):
@__const.main.current_file = [23 x i8] c"/home/dragos/work/teme\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [23 x i8]
%4 = getelementptr inbounds [23 x i8], [23 x i8]* %3, i64 0, i64 0
%5 = call i32 @compute_tree(i8* %4, i32 0)
ret i32 0
}
void *fossil_utf8_to_unicode(const char *zUtf8) { return (void *)zUtf8; }


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

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

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

LLVM IR (-O2):
define i8* @fossil_utf8_to_unicode(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ lcd_write_char(char);
int /*<<< orphan*/ uart1_writeb(char);
int putchar(int c) {
  uart1_writeb((char)c);
  lcd_write_char((char)c);
  return c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1030 <uart1_writeb@plt>
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1040 <lcd_write_char@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movsbl %bl,%ebp
mov    %ebp,%edi
call   1030 <uart1_writeb@plt>
mov    %ebp,%edi
call   1040 <lcd_write_char@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @uart1_writeb(i8 signext %4)
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
%8 = call i32 @lcd_write_char(i8 signext %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @uart1_writeb(i8 signext %2)
%4 = tail call i32 @lcd_write_char(i8 signext %2)
ret i32 %0
}
/* Variables and functions */
float AngleMod(float a) {
  a = (360.0 / 65536) * ((int)(a * (65536 / 360.0)) & 65535);
  return a;
}


x86 assembly (clang, -O0):
<AngleMod>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
and    $0xffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AngleMod>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
movzwl %ax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xee6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @AngleMod(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x4066C16C16C16C17
%6 = fptosi double %5 to i32
%7 = and i32 %6, 65535
%8 = sitofp i32 %7 to double
%9 = fmul double 0x3F76800000000000, %8
%10 = fptrunc double %9 to float
store float %10, float* %2
%11 = load float, float* %2
ret float %11
}

LLVM IR (-O2):
define float @AngleMod(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x4066C16C16C16C17
%4 = fptosi double %3 to i32
%5 = and i32 %4, 65535
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x3F76800000000000
%8 = fptrunc double %7 to float
ret float %8
}
void gdk_threads_set_lock_functions() {}


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

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

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

LLVM IR (-O2):
define void @gdk_threads_set_lock_functions() {
ret void
}
/* Type definitions */
struct dstr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dstr_free(struct dstr *);
int /*<<< orphan*/ dstr_init_move(struct dstr *, struct dstr *);
void dstr_move(struct dstr *dst, struct dstr *src) {
  dstr_free(dst);
  dstr_init_move(dst, src);
}


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

x86 assembly (clang, -O2):
<dstr_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <dstr_free@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <dstr_init_move@plt>

LLVM IR (-O0):
%struct.dstr = type { i32 }
define void @dstr_move(%struct.dstr* %0, %struct.dstr* %1) {
%3 = alloca %struct.dstr*
%4 = alloca %struct.dstr*
store %struct.dstr* %0, %struct.dstr** %3
store %struct.dstr* %1, %struct.dstr** %4
%5 = load %struct.dstr*, %struct.dstr** %3
%6 = call i32 @dstr_free(%struct.dstr* %5)
%7 = load %struct.dstr*, %struct.dstr** %3
%8 = load %struct.dstr*, %struct.dstr** %4
%9 = call i32 @dstr_init_move(%struct.dstr* %7, %struct.dstr* %8)
ret void
}

LLVM IR (-O2):
%struct.dstr = type { i32 }
define void @dstr_move(%struct.dstr* %0, %struct.dstr* %1) {
%3 = tail call i32 @dstr_free(%struct.dstr* %0)
%4 = tail call i32 @dstr_init_move(%struct.dstr* %0, %struct.dstr* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ proc1();
int /*<<< orphan*/ proc5();
void l(int param1) {
  proc1();
  if (param1 > 1) {
    proc5();
  }
  return;
}


x86 assembly (clang, -O0):
<l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <proc1@plt>
cmpl   $0x1,-0x4(%rbp)
jle    1143 <l+0x23>
mov    $0x0,%al
call   1040 <proc5@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <proc1@plt>
cmp    $0x2,%ebx
jl     1137 <l+0x17>
xor    %eax,%eax
pop    %rbx
jmp    1040 <proc5@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @l(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @proc1()
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @proc5()
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @l(i32 %0) {
%2 = tail call i32 (...) @proc1()
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @proc5()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  int sum = 0;
  for (i = 0; i <= 100; i++) {
    sum += i;
  }
  printf("1~100数字求和：%d\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     114e <main+0x3e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"1~100\E6\95\B0\E5\AD\97\E6\B1\82\E5\92\8C\EF\BC\9A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [24 x i8] c"1~100\E6\95\B0\E5\AD\97\E6\B1\82\E5\92\8C\EF\BC\9A%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 5050)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SCRend();
int /*<<< orphan*/ SCRstart();
int /*<<< orphan*/ mainloop();
int main(int argc, char *argv[]) {
  SCRstart();
  mainloop();
  SCRend();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @SCRstart()
%4 = tail call i32 (...) @mainloop()
%5 = tail call i32 (...) @SCRend()
ret i32 0
}
int _open(char *path, int flags, ...) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_open(i8* nocapture readnone %0, i32 %1, ...) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ pbkdf2_sha1(int /*<<< orphan*/ const *, size_t,
                               int /*<<< orphan*/ const *, size_t,
                               int /*<<< orphan*/, int /*<<< orphan*/ *,
                               size_t);
void fastpbkdf2_hmac_sha1(const uint8_t *pw, size_t npw, const uint8_t *salt,
                          size_t nsalt, uint32_t iterations, uint8_t *out,
                          size_t nout) {
  pbkdf2_sha1(pw, npw, salt, nsalt, iterations, out, nout);
}


x86 assembly (clang, -O0):
<fastpbkdf2_hmac_sha1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <pbkdf2_sha1@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastpbkdf2_hmac_sha1>:
jmp    1030 <pbkdf2_sha1@plt>

LLVM IR (-O0):
define void @fastpbkdf2_hmac_sha1(i32* %0, i64 %1, i32* %2, i64 %3, i32 %4, i32* %5, i64 %6) {
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i32*
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i64
store i32* %0, i32** %8
store i64 %1, i64* %9
store i32* %2, i32** %10
store i64 %3, i64* %11
store i32 %4, i32* %12
store i32* %5, i32** %13
store i64 %6, i64* %14
%15 = load i32*, i32** %8
%16 = load i64, i64* %9
%17 = load i32*, i32** %10
%18 = load i64, i64* %11
%19 = load i32, i32* %12
%20 = load i32*, i32** %13
%21 = load i64, i64* %14
%22 = call i32 @pbkdf2_sha1(i32* %15, i64 %16, i32* %17, i64 %18, i32 %19, i32* %20, i64 %21)
ret void
}

LLVM IR (-O2):
define void @fastpbkdf2_hmac_sha1(i32* %0, i64 %1, i32* %2, i64 %3, i32 %4, i32* %5, i64 %6) {
%8 = tail call i32 @pbkdf2_sha1(i32* %0, i64 %1, i32* %2, i64 %3, i32 %4, i32* %5, i64 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int int64_t;

/* Variables and functions */
int var_get_u64(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                int /*<<< orphan*/ *);
int var_get_s64(uint8_t *cp, const uint8_t *endp, int64_t *i) {
  int b = var_get_u64(cp, endp, (uint64_t *)i);
  *i = (*i >> 1) ^ -(*i & 1);
  return b;
}


x86 assembly (clang, -O0):
<var_get_s64>:
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),%rdx
call   1030 <var_get_u64@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sar    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
and    $0x1,%edx
xor    %eax,%eax
sub    %edx,%eax
xor    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_get_s64>:
push   %rbx
mov    %rdx,%rbx
call   1030 <var_get_u64@plt>
mov    (%rbx),%ecx
mov    %ecx,%edx
sar    %edx
and    $0x1,%ecx
neg    %ecx
xor    %edx,%ecx
mov    %ecx,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @var_get_s64(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @var_get_u64(i32* %0, i32* %1, i32* %2)
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = and i32 %5, 1
%8 = sub nsw i32 0, %7
%9 = xor i32 %6, %8
store i32 %9, i32* %2
ret i32 %4
}
/* Type definitions */
struct aiocb {
  int __error_code;
};

/* Variables and functions */
int aio_error(const struct aiocb *aiocbp) { return aiocbp->__error_code; }


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

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

LLVM IR (-O0):
%struct.aiocb = type { i32 }
define i32 @aio_error(%struct.aiocb* %0) {
%2 = alloca %struct.aiocb*
store %struct.aiocb* %0, %struct.aiocb** %2
%3 = load %struct.aiocb*, %struct.aiocb** %2
%4 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.aiocb = type { i32 }
define i32 @aio_error(%struct.aiocb* nocapture %0) {
%2 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int opus_packet_get_mode(const unsigned char *data) {
  int mode;
  if (data[0] & 0x80) {
    mode = 1002;
  } else if ((data[0] & 0x60) == 0x60) {
    mode = 1001;
  } else {
    mode = 1000;
  }
  return mode;
}


x86 assembly (clang, -O0):
<opus_packet_get_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1129 <opus_packet_get_mode+0x29>
movl   $0x3ea,-0xc(%rbp)
jmp    1154 <opus_packet_get_mode+0x54>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x60,%eax
cmp    $0x60,%eax
jne    1148 <opus_packet_get_mode+0x48>
movl   $0x3e9,-0xc(%rbp)
jmp    114f <opus_packet_get_mode+0x4f>
movl   $0x3e8,-0xc(%rbp)
jmp    1154 <opus_packet_get_mode+0x54>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opus_packet_get_mode>:
movzbl (%rdi),%eax
mov    %eax,%ecx
not    %ecx
xor    %edx,%edx
test   $0x60,%cl
sete   %dl
or     $0x3e8,%edx
test   $0x80,%al
mov    $0x3ea,%eax
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @opus_packet_get_mode(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %7, 128
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1002, i32* %3
br label %21
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = and i32 %15, 96
%17 = icmp eq i32 %16, 96
br i1 %17, label %18, label %19
18: ; preds = %11
store i32 1001, i32* %3
br label %20
19: ; preds = %11
store i32 1000, i32* %3
br label %20
20: ; preds = %19, %18
br label %21
21: ; preds = %20, %10
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @opus_packet_get_mode(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = and i32 %3, 128
%5 = icmp eq i32 %4, 0
%6 = and i32 %3, 96
%7 = icmp eq i32 %6, 96
%8 = select i1 %7, i32 1001, i32 1000
%9 = select i1 %5, i32 %8, i32 1002
ret i32 %9
}
int isPrime(num) {
  int i = 2;
  for (; i < num; i++) {
    if (num % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isPrime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isPrime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <isPrime+0x50>
jmp    113b <isPrime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isPrime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <isPrime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isPrime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isPrime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
int local_player() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @local_player() {
ret i32 0
}
/* Variables and functions */
float float_add(float, int /*<<< orphan*/);
int /*<<< orphan*/ float_mul(float, float);
float float_fmac(float a, float b, float c) {
  return float_add(a, float_mul(b, c));
}


x86 assembly (clang, -O0):
<float_fmac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1040 <float_mul@plt>
movss  -0x10(%rbp),%xmm0
mov    %eax,%edi
call   1030 <float_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_fmac>:
push   %rax
movss  %xmm0,0x4(%rsp)
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1040 <float_mul@plt>
movss  0x4(%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1030 <float_add@plt>

LLVM IR (-O0):
define float @float_fmac(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call i32 @float_mul(float %8, float %9)
%11 = call float @float_add(float %7, i32 %10)
ret float %11
}

LLVM IR (-O2):
define float @float_fmac(float %0, float %1, float %2) {
%4 = tail call i32 @float_mul(float %1, float %2)
%5 = tail call float @float_add(float %0, i32 %4)
ret float %5
}
/* Variables and functions */
int send_mpeg_pes_packet_ll(unsigned char *, int, int, unsigned long long, int,
                            int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/, int (*)(unsigned char *, int));
int send_mpeg_pes_packet(unsigned char *data, int len, int id,
                         unsigned long long pts, int type,
                         int my_write(unsigned char *data, int len)) {
  return send_mpeg_pes_packet_ll(data, len, id, pts, type, NULL, 0, 0,
                                 my_write);
}


x86 assembly (clang, -O0):
<send_mpeg_pes_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%rax
xor    %r9d,%r9d
xor    %r10d,%r10d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <send_mpeg_pes_packet_ll@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_mpeg_pes_packet>:
push   %rax
mov    %r9,%rax
sub    $0x8,%rsp
xor    %r9d,%r9d
push   %rax
push   $0x0
push   $0x0
call   1030 <send_mpeg_pes_packet_ll@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @send_mpeg_pes_packet(i8* %0, i32 %1, i32 %2, i64 %3, i32 %4, i32 (i8*, i32)* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32 (i8*, i32)*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i64 %3, i64* %10
store i32 %4, i32* %11
store i32 (i8*, i32)* %5, i32 (i8*, i32)** %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i64, i64* %10
%17 = load i32, i32* %11
%18 = load i32 (i8*, i32)*, i32 (i8*, i32)** %12
%19 = call i32 @send_mpeg_pes_packet_ll(i8* %13, i32 %14, i32 %15, i64 %16, i32 %17, i32* null, i32 0, i32 0, i32 (i8*, i32)* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @send_mpeg_pes_packet(i8* %0, i32 %1, i32 %2, i64 %3, i32 %4, i32 (i8*, i32)* %5) {
%7 = tail call i32 @send_mpeg_pes_packet_ll(i8* %0, i32 %1, i32 %2, i64 %3, i32 %4, i32* null, i32 0, i32 0, i32 (i8*, i32)* %5)
ret i32 %7
}