xunge/DecIR huggingface dataset:
unsigned char rotr(unsigned char value, unsigned short int shift) {
  return (value >> shift) | (value << 8 - shift);
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
movzwl -0x4(%rbp),%esi
mov    $0x8,%ecx
sub    %esi,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @rotr(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = ashr i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = sub nsw i32 8, %13
%15 = shl i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @rotr(i8 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
short search(short val, short *table, short size) {
  short i;
  for (i = 0; i < size; i++) {
    if (val <= *table++)
      return (i);
  }
  return (size);
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %di,%cx
mov    %cx,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movswl -0x14(%rbp),%eax
movswl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jge    116d <search+0x6d>
movswl -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x2,%rdx
mov    %rdx,-0x10(%rbp)
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1157 <search+0x57>
mov    -0x14(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1175 <search+0x75>
jmp    115c <search+0x5c>
mov    -0x14(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x14(%rbp)
jmp    111c <search+0x1c>
mov    -0x12(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    %edx,%eax
test   %ax,%ax
jle    1121 <search+0x21>
movzwl %ax,%ecx
movzwl %ax,%edx
xor    %eax,%eax
nop
cmp    %di,(%rsi,%rax,2)
jge    1121 <search+0x21>
add    $0x1,%rax
cmp    %ax,%dx
jne    1110 <search+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i16 @search(i16 signext %0, i16* nocapture %1, i16 signext %2) {
%4 = icmp sgt i16 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %10
%6 = phi i16 [ %12, %10 ], [ 0, %3 ]
%7 = phi i16* [ %11, %10 ], [ %1, %3 ]
%8 = load i16, i16* %7
%9 = icmp slt i16 %8, %0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i16, i16* %7, i64 1
%12 = add nuw nsw i16 %6, 1
%13 = icmp eq i16 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %3
%15 = phi i16 [ %2, %3 ], [ %2, %10 ], [ %6, %5 ]
ret i16 %15
}
/* Variables and functions */
int /*<<< orphan*/ advance();
int /*<<< orphan*/ factor();
scalar_t__ match(int);
term_prime() {
  if (match(3)) {
    advance();
    factor();
    term_prime();
  }
}


x86 assembly (clang, -O0):
<term_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1050 <match@plt>
cmp    $0x0,%rax
je     116f <term_prime+0x2f>
mov    $0x0,%al
call   1030 <advance@plt>
mov    $0x0,%al
call   1060 <factor@plt>
call   1040 <term_prime@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_prime>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3,%edi
call   1040 <match@plt>
test   %rax,%rax
je     115f <term_prime+0x2f>
xor    %eax,%eax
call   1030 <advance@plt>
xor    %eax,%eax
call   1050 <factor@plt>
jmp    1140 <term_prime+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @term_prime() {
%1 = alloca i32
%2 = call i64 @match(i32 3)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 (...) @advance()
%6 = call i32 (...) @factor()
%7 = call i32 @term_prime()
br label %8
8: ; preds = %4, %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @term_prime() {
%1 = tail call i64 @match(i32 3)
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @advance()
%5 = tail call i32 (...) @factor()
%6 = tail call i64 @match(i32 3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret i32 undef
}
void _Free(void **ptr) {}


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

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

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

LLVM IR (-O2):
define void @_Free(i8** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xrd_SL();
int x_endp() {
  (void)xrd_SL();
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @x_endp() {
%1 = call i32 (...) @xrd_SL()
ret i32 0
}

LLVM IR (-O2):
define i32 @x_endp() {
%1 = tail call i32 (...) @xrd_SL()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_immediate2();
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_line(char *);
int /*<<< orphan*/ output_number(int);
void add_offset(int val) {
  gen_immediate2();
  output_number(val);
  newline();
  output_line("dad \td");
}


x86 assembly (clang, -O0):
<add_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <gen_immediate2@plt>
mov    -0x4(%rbp),%edi
call   1040 <output_number@plt>
mov    $0x0,%al
call   1030 <newline@plt>
lea    0xe98(%rip),%rdi
call   1050 <output_line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_offset>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <gen_immediate2@plt>
mov    %ebx,%edi
call   1040 <output_number@plt>
xor    %eax,%eax
call   1030 <newline@plt>
lea    0xea1(%rip),%rdi
pop    %rbx
jmp    1050 <output_line@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"dad \09d\00"
define void @add_offset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gen_immediate2()
%4 = load i32, i32* %2
%5 = call i32 @output_number(i32 %4)
%6 = call i32 (...) @newline()
%7 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"dad \09d\00"
define void @add_offset(i32 %0) {
%2 = tail call i32 (...) @gen_immediate2()
%3 = tail call i32 @output_number(i32 %0)
%4 = tail call i32 (...) @newline()
%5 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void if_gt(void) { printf("greater than\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"greater than\0A\00"
define void @if_gt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"greater than\00"
define void @if_gt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ epapr_platform_init(unsigned long, unsigned long,
                                       unsigned long, unsigned long,
                                       unsigned long);
void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
                   unsigned long r6, unsigned long r7) {
  epapr_platform_init(r3, r4, r5, r6, r7);
}


x86 assembly (clang, -O0):
<platform_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <epapr_platform_init@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_init>:
jmp    1030 <epapr_platform_init@plt>

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

LLVM IR (-O2):
define void @platform_init(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i32 @epapr_platform_init(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret void
}
void fb_hBlit_code_start(void) {}


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

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

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

LLVM IR (-O2):
define void @fb_hBlit_code_start() {
ret void
}
double FTtoKM(double FT) { return FT * 0.0003048; }


x86 assembly (clang, -O0):
<FTtoKM>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FTtoKM>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @FTtoKM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.048000e-04
ret double %4
}

LLVM IR (-O2):
define double @FTtoKM(double %0) {
%2 = fmul double %0, 3.048000e-04
ret double %2
}
void INT_Excep_CAN0_RXM0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CAN0_RXM0() {
ret void
}
void native_read_tsc(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<native_read_tsc>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_read_tsc>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.native_read_tsc = [16 x i8] c"native_read_tsc\00"
define void @native_read_tsc() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.native_read_tsc, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.native_read_tsc = [16 x i8] c"native_read_tsc\00"
define void @native_read_tsc() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.native_read_tsc, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RDP(char *);
void uc2_load_ucode() { RDP("uc2:load_ucode\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"uc2:load_ucode\0A\00"
define void @uc2_load_ucode() {
%1 = call i32 @RDP(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"uc2:load_ucode\0A\00"
define void @uc2_load_ucode() {
%1 = tail call i32 @RDP(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *pascal_to_ppp(char *target, double P) {
  int ic;
  if (P > 0) {
    ic = (int)(P * 0.1);
  } else {
    ic = (int)(-P * 0.1);
  }
  sprintf(target, "%03d", ic % 1000);
  return target;
}


x86 assembly (clang, -O0):
<pascal_to_ppp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114c <pascal_to_ppp+0x3c>
movsd  0xec5(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
jmp    117b <pascal_to_ppp+0x6b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe90(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
lea    0xe77(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pascal_to_ppp>:
push   %rbx
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
lea    0xedb(%rip),%rcx
mulsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
mov    %rdi,%rbx
movslq %eax,%rdx
imul   $0x10624dd3,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%edx
lea    0xeb9(%rip),%rsi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%03d\00"
define i8* @pascal_to_ppp(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca i32
store i8* %0, i8** %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double, double* %4
%10 = fmul double %9, 1.000000e-01
%11 = fptosi double %10 to i32
store i32 %11, i32* %5
br label %17
12: ; preds = %2
%13 = load double, double* %4
%14 = fneg double %13
%15 = fmul double %14, 1.000000e-01
%16 = fptosi double %15 to i32
store i32 %16, i32* %5
br label %17
17: ; preds = %12, %8
%18 = load i8*, i8** %3
%19 = load i32, i32* %5
%20 = srem i32 %19, 1000
%21 = call i32 @sprintf(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
@.str = [5 x i8] c"%03d\00"
define i8* @pascal_to_ppp(i8* returned writeonly %0, double %1) {
%3 = fcmp ogt double %1, 0.000000e+00
%4 = select i1 %3, double 1.000000e-01, double -1.000000e-01
%5 = fmul double %4, %1
%6 = fptosi double %5 to i32
%7 = srem i32 %6, 1000
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i8* %0
}
int strcmp(const char *s1, const char *s2) {
  unsigned c1, c2;
  for (;;) {
    c1 = *s1++;
    c2 = *s2++;
    if (c1 != c2) {
      if (c1 > c2)
        return 1;
      return -1;
    }
    if (c1 == 0)
      return 0;
  }
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     1166 <strcmp+0x66>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    115a <strcmp+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1181 <strcmp+0x81>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <strcmp+0x81>
cmpl   $0x0,-0x1c(%rbp)
jne    117c <strcmp+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    1181 <strcmp+0x81>
jmp    110c <strcmp+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
cmp    (%rsi,%rax,1),%cl
jne    1124 <strcmp+0x24>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
seta   %al
movzbl %al,%eax
add    %eax,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %12, %2
%4 = phi i8* [ %1, %2 ], [ %13, %12 ]
%5 = phi i8* [ %0, %2 ], [ %14, %12 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = icmp eq i8 %6, %7
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = icmp ugt i8 %6, %7
%11 = select i1 %10, i32 1, i32 -1
br label %16
12: ; preds = %3
%13 = getelementptr inbounds i8, i8* %4, i64 1
%14 = getelementptr inbounds i8, i8* %5, i64 1
%15 = icmp eq i8 %6, 0
br i1 %15, label %16, label %3
16: ; preds = %12, %9
%17 = phi i32 [ %11, %9 ], [ 0, %12 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, char);
int main() {
  for (int x = 0; x < 128; x++) {
    printf("%d = %c\n", x, (char)x);
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1166 <main+0x46>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%eax
lea    0xeb0(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
movsbl %bl,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x80,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d = %c\0A\00"
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 (...) @getchar()
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %7, %3 ]
%5 = trunc i32 %4 to i8
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i8 signext %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 128
br i1 %8, label %1, label %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_clear_graph() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_clear_graph>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_clear_graph>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_clear_graph() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_clear_graph() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __vm_lock(int);
int /*<<< orphan*/ __vm_unlock();
int syscall(int, void *, size_t);
int __munmap(void *start, size_t len) {
  int ret;
  __vm_lock(-1);
  __vm_unlock();
  ret = syscall((0x40000000 + 11), start, len);
  return ret;
}


x86 assembly (clang, -O0):
<__munmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1050 <__vm_lock@plt>
mov    $0x0,%al
call   1040 <__vm_unlock@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x4000000b,%edi
call   1030 <syscall@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__munmap>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xffffffff,%edi
call   1050 <__vm_lock@plt>
xor    %eax,%eax
call   1040 <__vm_unlock@plt>
mov    $0x4000000b,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @__munmap(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 @__vm_lock(i32 -1)
%7 = call i32 (...) @__vm_unlock()
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @syscall(i32 1073741835, i8* %8, i64 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @__munmap(i8* %0, i64 %1) {
%3 = tail call i32 @__vm_lock(i32 -1)
%4 = tail call i32 (...) @__vm_unlock()
%5 = tail call i32 @syscall(i32 1073741835, i8* %0, i64 %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x40() {
  Assert_real((islower(64) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              325, ("islower should be 0 for @"));
}


x86 assembly (clang, -O0):
<t_islower_0x40>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x145,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x40>:
push   %rax
mov    $0x40,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x145,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for @\00"
define void @t_islower_0x40() {
%1 = call i64 @islower(i32 64)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 325, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for @\00"
define void @t_islower_0x40() {
%1 = tail call i64 @islower(i32 64)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 325, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((__naked__)) void SGVObjcMsgSendSuperTrampolineObjc(void) {
  asm volatile("addq $"
               "8"
               ", "
               "%%rdi"
               "\n\t"
               "jmp "
               "_objc_msgSendSuper"
               "\n\t"
               :
               :
               : "rsi", "rdi");
}


x86 assembly (clang, -O0):
<SGVObjcMsgSendSuperTrampolineObjc>:
add    $0x8,%rdi
jmp    1030 <_objc_msgSendSuper@plt>

x86 assembly (clang, -O2):
<SGVObjcMsgSendSuperTrampolineObjc>:
add    $0x8,%rdi
jmp    1030 <_objc_msgSendSuper@plt>

LLVM IR (-O0):
define void @SGVObjcMsgSendSuperTrampolineObjc() {
unreachable
}

LLVM IR (-O2):
define void @SGVObjcMsgSendSuperTrampolineObjc() {
tail call void asm sideeffect "addq $$8, %rdi\0A\09jmp _objc_msgSendSuper\0A\09", "~{rsi},~{rdi},~{dirflag},~{fpsr},~{flags}"()
unreachable
}
/* Variables and functions */
char *decode_str(const char *buf, int len, int encoding) {
  char *in, *out = NULL;
  return out;
}


x86 assembly (clang, -O0):
<decode_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @decode_str(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* null
}
/* Variables and functions */
double long_long_to_double(int);
double sNaN(long long payload) {
  return long_long_to_double(0x7ff0000000000000 | payload);
}


x86 assembly (clang, -O0):
<sNaN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x7ff0000000000000,%rax
or     -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <long_long_to_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sNaN>:
jmp    1030 <long_long_to_double@plt>

LLVM IR (-O0):
define double @sNaN(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 9218868437227405312, %3
%5 = trunc i64 %4 to i32
%6 = call double @long_long_to_double(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @sNaN(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call double @long_long_to_double(i32 %2)
ret double %3
}
int main(void) {
  ;
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  bool t = true;
  assert(!(!t && !t));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jne    1141 <main+0x31>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
double __ieee754_y1(double);
double y1(double x) { return __ieee754_y1(x); }


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

x86 assembly (clang, -O2):
<y1>:
jmp    1030 <__ieee754_y1@plt>

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

LLVM IR (-O2):
define double @y1(double %0) {
%2 = tail call double @__ieee754_y1(double %0)
ret double %2
}
int kisprint(int c) { return (c >= 32 && c <= 126) ? 1 : 0; }


x86 assembly (clang, -O0):
<kisprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <kisprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kisprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @kisprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @kisprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x99() {
  Assert_real((isgraph(153) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              770, ("isgraph should be 0 for 0x99"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x99>:
push   %rbp
mov    %rsp,%rbp
mov    $0x99,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x302,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x99>:
push   %rax
mov    $0x99,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x302,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x99\00"
define void @t_isgraph_0x99() {
%1 = call i64 @isgraph(i32 153)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 770, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x99\00"
define void @t_isgraph_0x99() {
%1 = tail call i64 @isgraph(i32 153)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 770, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_CREAT;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
void lockcfile(char *filename) {
  int fh = 0;
  fh = open(filename, O_CREAT);
  if (fh != -1) {
    close(fh);
  }
}


x86 assembly (clang, -O0):
<lockcfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     115a <lockcfile+0x3a>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lockcfile>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     113c <lockcfile+0x1c>
mov    %eax,%edi
pop    %rax
jmp    1030 <close@plt>
pop    %rax
ret

LLVM IR (-O0):
@O_CREAT = global i32 0
define void @lockcfile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_CREAT
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @close(i32 %10)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@O_CREAT = global i32 0
define void @lockcfile(i8* nocapture %0) {
%2 = load i32, i32* @O_CREAT
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @close(i32 %3)
br label %7
7: ; preds = %5, %1
ret void
}
void insb(int port, void *buf, unsigned long count) {
  asm volatile("cld;rep;ins"
               "b"
               : "+c"(count), "+D"(buf)
               : "d"(port));
}


x86 assembly (clang, -O0):
<insb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
cld
rep insb (%dx),%es:(%rdi)
mov    %rcx,-0x18(%rbp)
mov    %rdi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insb>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
cld
rep insb (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insb(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = call { i64, i8* } asm sideeffect "cld;rep;insb", "={cx},={di},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %9, i64 %7, i8* %8)
%11 = extractvalue { i64, i8* } %10, 0
%12 = extractvalue { i64, i8* } %10, 1
store i64 %11, i64* %6
store i8* %12, i8** %5
ret void
}

LLVM IR (-O2):
define void @insb(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i64, i8* } asm sideeffect "cld;rep;insb", "={cx},={di},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i64 %2, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XFocusInEvent;

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


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

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

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

LLVM IR (-O2):
define i8* @alloc_XFocusInEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Type definitions */
struct hdr_histogram {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int hdr_init(int, int /*<<< orphan*/, int, struct hdr_histogram **);
int hdr_alloc(int64_t highest_trackable_value, int significant_figures,
              struct hdr_histogram **result) {
  return hdr_init(1, highest_trackable_value, significant_figures, result);
}


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

x86 assembly (clang, -O2):
<hdr_alloc>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <hdr_init@plt>

LLVM IR (-O0):
%struct.hdr_histogram = type { i32 }
define i32 @hdr_alloc(i32 %0, i32 %1, %struct.hdr_histogram** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.hdr_histogram**
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.hdr_histogram** %2, %struct.hdr_histogram*** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load %struct.hdr_histogram**, %struct.hdr_histogram*** %6
%10 = call i32 @hdr_init(i32 1, i32 %7, i32 %8, %struct.hdr_histogram** %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.hdr_histogram = type { i32 }
define i32 @hdr_alloc(i32 %0, i32 %1, %struct.hdr_histogram** %2) {
%4 = tail call i32 @hdr_init(i32 1, i32 %0, i32 %1, %struct.hdr_histogram** %2)
ret i32 %4
}
void foo_init(void) {}


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

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

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

LLVM IR (-O2):
define void @foo_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int x = 10;
  int y = 20;
  printf("x = %d; y = %d\n", x, y);
  {
    int t;
    t = x;
    x = y;
    y = t;
  }
  printf("x = %d; y = %d\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
mov    $0xa,%edx
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"x = %d; y = %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 20, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __disable_irq();
__attribute__((always_)) void __disable_excp_irq(void) { __disable_irq(); }


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

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

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

LLVM IR (-O2):
define void @__disable_excp_irq() {
%1 = tail call i32 (...) @__disable_irq()
ret void
}
void RTNetIPv4IsTCPValid(void) {}


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

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

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

LLVM IR (-O2):
define void @RTNetIPv4IsTCPValid() {
ret void
}
void free_matrix(mat, n, m) float **mat;
int n, m;
{
  int i;
  for (i = n; i >= 1; i--) {
    free((char *)(mat[i] + 1));
  }
  free((char *)(mat + 1));
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     1155 <free_matrix+0x45>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x4,%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <free_matrix+0x18>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1148 <free_matrix+0x38>
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x8(%r14,%rbx,8),%rdi
add    $0x4,%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <free_matrix+0x20>
add    $0x8,%r14
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_matrix(float** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds float*, float** %0, i64 %8
%10 = load float*, float** %9
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = bitcast float* %11 to i8*
tail call void @free(i8* %12)
%13 = add nsw i64 %8, -1
%14 = icmp ugt i64 %8, 1
br i1 %14, label %7, label %15
15: ; preds = %7, %3
%16 = getelementptr inbounds float*, float** %0, i64 1
%17 = bitcast float** %16 to i8*
tail call void @free(i8* %17)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char *);
int pthread_attr_init(int /*<<< orphan*/ *);
char *strerror(int);
int PTHREAD_ATTR_INIT(pthread_attr_t *a) {
  int err;
  if (err = pthread_attr_init(a)) {
    printf("%s\n", strerror(err));
    abort();
  }
}


x86 assembly (clang, -O0):
<PTHREAD_ATTR_INIT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pthread_attr_init@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     117f <PTHREAD_ATTR_INIT+0x3f>
mov    -0x14(%rbp),%edi
call   1060 <strerror@plt>
mov    %rax,%rsi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PTHREAD_ATTR_INIT>:
push   %rax
call   1050 <pthread_attr_init@plt>
test   %eax,%eax
jne    114c <PTHREAD_ATTR_INIT+0xc>
pop    %rcx
ret
mov    %eax,%edi
call   1060 <strerror@plt>
lea    0xea6(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @PTHREAD_ATTR_INIT(i32* %0) {
%2 = tail call i32 @pthread_attr_init(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i8* @strerror(i32 %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ uioPrint(char *);
int GreetUser(int argc, char *argv[]) {
  uioPrint("Hello.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"Hello.\0A\00"
define i32 @GreetUser(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @uioPrint(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}