xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ track(int);
void recurser_void(int n) {
  if (n == 0 || n == 7)
    track(n);
  if (n == 10)
    return;
  recurser_void(n + 1);
}


x86 assembly (clang, -O0):
<recurser_void>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113f <recurser_void+0x1f>
cmpl   $0x7,-0x4(%rbp)
jne    1147 <recurser_void+0x27>
mov    -0x4(%rbp),%edi
call   1030 <track@plt>
cmpl   $0xa,-0x4(%rbp)
jne    1156 <recurser_void+0x36>
jmp    1161 <recurser_void+0x41>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <recurser_void@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurser_void>:
push   %rbx
mov    %edi,%ebx
jmp    112a <recurser_void+0x1a>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <track@plt>
add    $0x1,%ebx
test   %ebx,%ebx
je     1120 <recurser_void+0x10>
cmp    $0x7,%ebx
je     1120 <recurser_void+0x10>
cmp    $0xa,%ebx
jne    1127 <recurser_void+0x17>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @recurser_void(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ %0, %1 ], [ %7, %6 ]
switch i32 %3, label %6 [
i32 7, label %4
i32 0, label %4
i32 10, label %8
]
4: ; preds = %2, %2
%5 = tail call i32 @track(i32 %3)
br label %6
6: ; preds = %4, %2
%7 = add nsw i32 %3, 1
br label %2
8: ; preds = %2
ret void
}
/* Type definitions */
struct stream {
  int dummy;
};

/* Variables and functions */
int decode_address_context(unsigned char const *, struct stream *);
int decode_address_context_32bit_is1(const unsigned char *pkt,
                                     struct stream *stream) {
  return decode_address_context(pkt, stream);
}


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

x86 assembly (clang, -O2):
<decode_address_context_32bit_is1>:
jmp    1030 <decode_address_context@plt>

LLVM IR (-O0):
%struct.stream = type { i32 }
define i32 @decode_address_context_32bit_is1(i8* %0, %struct.stream* %1) {
%3 = alloca i8*
%4 = alloca %struct.stream*
store i8* %0, i8** %3
store %struct.stream* %1, %struct.stream** %4
%5 = load i8*, i8** %3
%6 = load %struct.stream*, %struct.stream** %4
%7 = call i32 @decode_address_context(i8* %5, %struct.stream* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stream = type { i32 }
define i32 @decode_address_context_32bit_is1(i8* %0, %struct.stream* %1) {
%3 = tail call i32 @decode_address_context(i8* %0, %struct.stream* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void g() { f(99); }


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

x86 assembly (clang, -O2):
<g>:
mov    $0x63,%edi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @g() {
%1 = call i32 @f(i32 99)
ret void
}

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 @f(i32 99)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dash();
int /*<<< orphan*/ dot();
void sY() {
  dash();
  dot();
  dash();
  dash();
  cBreak();
}


x86 assembly (clang, -O0):
<sY>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1050 <cBreak@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sY>:
push   %rax
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cBreak@plt>

LLVM IR (-O0):
define void @sY() {
%1 = call i32 (...) @dash()
%2 = call i32 (...) @dot()
%3 = call i32 (...) @dash()
%4 = call i32 (...) @dash()
%5 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sY() {
%1 = tail call i32 (...) @dash()
%2 = tail call i32 (...) @dot()
%3 = tail call i32 (...) @dash()
%4 = tail call i32 (...) @dash()
%5 = tail call i32 (...) @cBreak()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fatal(const char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int isnan(double);
int iguinan_(double *p) { return isnan(*p); }


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

x86 assembly (clang, -O2):
<iguinan_>:
movsd  (%rdi),%xmm0
jmp    1030 <isnan@plt>

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

LLVM IR (-O2):
define i32 @iguinan_(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 @isnan(double %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ __logb(double);
long double __logbl(long double x) { return ((long double)__logb((double)x)); }


x86 assembly (clang, -O0):
<__logbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <__logb@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__logbl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <__logb@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__logbl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @__logb(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @__logbl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @__logb(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ rt_OneStep();
void model_step(uint8_t timerID) { rt_OneStep(); }


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

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

LLVM IR (-O0):
define void @model_step(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rt_OneStep()
ret void
}

LLVM IR (-O2):
define void @model_step(i32 %0) {
%2 = tail call i32 (...) @rt_OneStep()
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ xorr_gpr32(scalar_t__ *, scalar_t__ const *, size_t);
void maddrc2_gpr32(uint8_t *region1, const uint8_t *region2, uint8_t constant,
                   size_t length) {
  if (constant != 0)
    xorr_gpr32(region1, region2, length);
}


x86 assembly (clang, -O0):
<maddrc2_gpr32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1144 <maddrc2_gpr32+0x34>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <xorr_gpr32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maddrc2_gpr32>:
test   %rdx,%rdx
je     111d <maddrc2_gpr32+0xd>
mov    %rcx,%rdx
jmp    1030 <xorr_gpr32@plt>
ret

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

LLVM IR (-O2):
define void @maddrc2_gpr32(i64* %0, i64* %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @xorr_gpr32(i64* %0, i64* %1, i64 %3)
br label %8
8: ; preds = %6, %4
ret void
}
unsigned char __attribute__((regparm(2))) Def_READB(unsigned long adr) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @Def_READB(i64 %0) {
ret i8 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int rx(int /*<<< orphan*/ *, int);
int rx_ack(int, int);
int rx_ack_chksum(int ackbyte, uint8_t *chksum_p, int timeout) {
  int err;
  err = rx_ack(ackbyte, timeout);
  if (err != 0)
    return err;
  if (rx(chksum_p, 1) != 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<rx_ack_chksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <rx_ack@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1155 <rx_ack_chksum+0x35>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <rx_ack_chksum+0x5f>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <rx@plt>
cmp    $0x1,%eax
je     1178 <rx_ack_chksum+0x58>
movl   $0x1,-0x4(%rbp)
jmp    117f <rx_ack_chksum+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rx_ack_chksum>:
push   %rbx
mov    %rsi,%rbx
mov    %edx,%esi
call   1030 <rx_ack@plt>
test   %eax,%eax
je     1131 <rx_ack_chksum+0x11>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <rx@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rx_ack_chksum(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%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
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = call i32 @rx_ack(i32 %9, i32 %10)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = load i32, i32* %8
store i32 %15, i32* %4
br label %22
16: ; preds = %3
%17 = load i32*, i32** %6
%18 = call i32 @rx(i32* %17, i32 1)
%19 = icmp ne i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %4
br label %22
21: ; preds = %16
store i32 0, i32* %4
br label %22
22: ; preds = %21, %20, %14
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @rx_ack_chksum(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @rx_ack(i32 %0, i32 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @rx(i32* %1, i32 1)
%8 = icmp ne i32 %7, 1
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ %4, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int iswprint(wint_t c) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @iswprint(i32 %0) {
ret i32 0
}
void __libc_csu_irel(void) {}


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

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

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

LLVM IR (-O2):
define void @__libc_csu_irel() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PushPop_instr(int);
void POP(void) { PushPop_instr(193); }


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

x86 assembly (clang, -O2):
<POP>:
mov    $0xc1,%edi
jmp    1030 <PushPop_instr@plt>

LLVM IR (-O0):
define void @POP() {
%1 = call i32 @PushPop_instr(i32 193)
ret void
}

LLVM IR (-O2):
define void @POP() {
%1 = tail call i32 @PushPop_instr(i32 193)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int smallest_digit(int);
int main() {
  int n;
  scanf("%d", &n);
  printf("smallest digit is %d :\n", smallest_digit(n));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <smallest_digit@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <smallest_digit@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [24 x i8] c"smallest digit is %d :\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @smallest_digit(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [24 x i8] c"smallest digit is %d :\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @smallest_digit(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
long str_hash(char *cp) {
  long hVal = 0;
  char c;
  while ((c = *cp++) != '\0') {
    hVal = (hVal * 63) + (c & 0xFF);
  }
  return (hVal);
}


x86 assembly (clang, -O0):
<str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114e <str_hash+0x4e>
imul   $0x3f,-0x10(%rbp),%rax
movsbl -0x11(%rbp),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <str_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <str_hash+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rax,%rdx
shl    $0x6,%rdx
sub    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @str_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul nsw i64 %7, 63
%10 = zext i8 %5 to i64
%11 = add nsw i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
int DRV_GET_LINUXSYSTYPE(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @DRV_GET_LINUXSYSTYPE() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @DRV_GET_LINUXSYSTYPE() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ MAIN__();
int dblat2_() {
  MAIN__();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @dblat2_() {
%1 = tail call i32 (...) @MAIN__()
ret i32 0
}
int cairo_code_draw_casRuleLabel_get_width() { return 247; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casRuleLabel_get_width() {
ret i32 247
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casRuleLabel_get_width() {
ret i32 247
}
int test_imm_7Eint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x7E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Eint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x7e,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Eint64_midword_mem>:
testb  $0x7e,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Eint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8257536
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long long foo(long long a, int *b, int *c) { return a + (long long)*b * *c; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    -0x18(%rbp),%rdx
movslq (%rdx),%rdx
imul   %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movslq (%rsi),%rcx
movslq (%rdx),%rax
imul   %rcx,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0, i32* %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32*
store i64 %0, i64* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i64, i64* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = mul nsw i64 %10, %13
%15 = add nsw i64 %7, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @foo(i64 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = mul nsw i64 %7, %5
%9 = add nsw i64 %8, %0
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_backtrace();
scalar_t__ write(int, char *, int);
void sig_segv_handler(int signum __attribute__((unused))) {
  if (write(1, "SIGSEGV received\n", 18) < 0) {
  }
  print_backtrace();
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<sig_segv_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xeb9(%rip),%rsi
mov    $0x12,%edx
call   1040 <write@plt>
cmp    $0x0,%rax
jge    1160 <sig_segv_handler+0x30>
jmp    1160 <sig_segv_handler+0x30>
mov    $0x0,%al
call   1030 <print_backtrace@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sig_segv_handler>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
mov    $0x12,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <print_backtrace@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"SIGSEGV received\0A\00"
@EXIT_FAILURE = global i32 0
define void @sig_segv_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 @write(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 18)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
%7 = call i32 (...) @print_backtrace()
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"SIGSEGV received\0A\00"
@EXIT_FAILURE = global i32 0
define void @sig_segv_handler(i32 %0) {
%2 = tail call i64 @write(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 18)
%3 = tail call i32 (...) @print_backtrace()
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pr__int(int x) { printf("%d", x); }


x86 assembly (clang, -O0):
<pr__int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr__int>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @pr__int(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int fun1245() { return 1245; }


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

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

LLVM IR (-O0):
define i32 @fun1245() {
ret i32 1245
}

LLVM IR (-O2):
define i32 @fun1245() {
ret i32 1245
}
/* Type definitions */
struct pt_regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printk(char *, int);
void bogus_int(int irq, void *dev_id, struct pt_regs *regs) {
  printk("Got interrupt %i!\n", irq);
}


x86 assembly (clang, -O0):
<bogus_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printk@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bogus_int>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printk@plt>

LLVM IR (-O0):
%struct.pt_regs = type { i32 }
@.str = [19 x i8] c"Got interrupt %i!\0A\00"
define void @bogus_int(i32 %0, i8* %1, %struct.pt_regs* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.pt_regs*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.pt_regs* %2, %struct.pt_regs** %6
%7 = load i32, i32* %4
%8 = call i32 @printk(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type { i32 }
@.str = [19 x i8] c"Got interrupt %i!\0A\00"
define void @bogus_int(i32 %0, i8* nocapture readnone %1, %struct.pt_regs* nocapture readnone %2) {
%4 = tail call i32 @printk(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
void stub1(char, long long);
void testClosureBLLrV(void (*closure)(char, long long), char a1, long long a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureBLLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1131 <testClosureBLLrV+0x31>
mov    -0x8(%rbp),%rax
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rsi
movsbl %cl,%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureBLLrV>:
test   %rdi,%rdi
je     1111 <testClosureBLLrV+0x11>
mov    %rdi,%rax
movsbl %sil,%edi
mov    %rdx,%rsi
jmp    *%rax
ret

LLVM IR (-O0):
define void @testClosureBLLrV(void (i8, i64)* %0, i8 signext %1, i64 %2) {
%4 = alloca void (i8, i64)*
%5 = alloca i8
%6 = alloca i64
store void (i8, i64)* %0, void (i8, i64)** %4
store i8 %1, i8* %5
store i64 %2, i64* %6
%7 = load void (i8, i64)*, void (i8, i64)** %4
%8 = icmp ne void (i8, i64)* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load void (i8, i64)*, void (i8, i64)** %4
%11 = load i8, i8* %5
%12 = load i64, i64* %6
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @testClosureBLLrV(void (i8, i64)* %0, i8 signext %1, i64 %2) {
%4 = icmp eq void (i8, i64)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i8 signext %1, i64 %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qemu_system_reset_request();
void do_sys_reset(void *opaque, int n, int level) {
  if (level) {
    qemu_system_reset_request();
  }
}


x86 assembly (clang, -O0):
<do_sys_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1133 <do_sys_reset+0x23>
mov    $0x0,%al
call   1030 <qemu_system_reset_request@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_sys_reset>:
test   %edx,%edx
je     111b <do_sys_reset+0xb>
xor    %eax,%eax
jmp    1030 <qemu_system_reset_request@plt>
ret

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

LLVM IR (-O2):
define void @do_sys_reset(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (...) @qemu_system_reset_request()
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
scalar_t__ LexIsDigit(char);
int LexIsHexDigit(char c) {
  if (LexIsDigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f')) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<LexIsHexDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <LexIsDigit@plt>
cmp    $0x0,%rax
jne    116d <LexIsHexDigit+0x5d>
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     114f <LexIsHexDigit+0x3f>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jle    116d <LexIsHexDigit+0x5d>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1179 <LexIsHexDigit+0x69>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1179 <LexIsHexDigit+0x69>
movl   $0x1,-0x4(%rbp)
jmp    1180 <LexIsHexDigit+0x70>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LexIsHexDigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <LexIsDigit@plt>
test   %rax,%rax
setne  %al
and    $0xdf,%bl
add    $0xbf,%bl
cmp    $0x6,%bl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @LexIsHexDigit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @LexIsDigit(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 65, %9
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 70
br i1 %14, label %23, label %15
15: ; preds = %11, %7
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 97, %17
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 102
br i1 %22, label %23, label %24
23: ; preds = %19, %11, %1
store i32 1, i32* %2
br label %25
24: ; preds = %19, %15
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @LexIsHexDigit(i8 signext %0) {
%2 = tail call i64 @LexIsDigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int unpacki16(unsigned char *);
extern int deserialize_int16(unsigned char *buf) { return (unpacki16(buf)); }


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

x86 assembly (clang, -O2):
<deserialize_int16>:
jmp    1030 <unpacki16@plt>

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

LLVM IR (-O2):
define i32 @deserialize_int16(i8* %0) {
%2 = tail call i32 @unpacki16(i8* %0)
ret i32 %2
}
void foo() {
  int c;
  c = 1 + 2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
double AF_Step(double x) {
  double r = 0;
  if (x >= 0) {
    r = 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<AF_Step>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1130 <AF_Step+0x30>
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AF_Step>:
xorpd  %xmm1,%xmm1
cmpnlesd %xmm0,%xmm1
movsd  0xeef(%rip),%xmm0
andnpd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @AF_Step(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %3
br label %7
7: ; preds = %6, %1
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @AF_Step(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, double 0.000000e+00, double 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle7() { kprintf("ISR %d.\n", 7); }


x86 assembly (clang, -O0):
<isrHandle7>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x7,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle7() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle7() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eval_exp(int *);
int /*<<< orphan*/ printf(char *, int);
int call_putch(void) {
  int value;
  eval_exp(&value);
  printf("%c", value);
  return value;
}


x86 assembly (clang, -O0):
<call_putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <eval_exp@plt>
mov    -0x4(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_putch>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <eval_exp@plt>
mov    0x4(%rsp),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @call_putch() {
%1 = alloca i32
%2 = call i32 @eval_exp(i32* %1)
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @call_putch() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @eval_exp(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}
/* Type definitions */
struct event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printReset(void *oldStateData, struct event *event, void *newStateData) {
  puts("Resetting");
}


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

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

LLVM IR (-O0):
%struct.event = type { i32 }
@.str = [10 x i8] c"Resetting\00"
define void @printReset(i8* %0, %struct.event* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.event*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.event* %1, %struct.event** %5
store i8* %2, i8** %6
%7 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.event = type { i32 }
@.str = [10 x i8] c"Resetting\00"
define void @printReset(i8* nocapture readnone %0, %struct.event* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ft_memdel(void **ap) {
  if (!ap || !*ap)
    return;
  free(*ap);
  *ap = 0;
}


x86 assembly (clang, -O0):
<ft_memdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1135 <ft_memdel+0x25>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113a <ft_memdel+0x2a>
jmp    1151 <ft_memdel+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memdel>:
push   %rbx
test   %rdi,%rdi
je     112d <ft_memdel+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <ft_memdel+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_memdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %1, %3, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: dirname path\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"usage: dirname path\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"usage: dirname path\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void f_char(char b) { f_char(0); }


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

x86 assembly (clang, -O2):
<f_char>:
jmp    1100 <f_char>

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

LLVM IR (-O2):
define void @f_char(i8 signext %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void termination_handler(int signum) {}


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

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

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

LLVM IR (-O2):
define void @termination_handler(i32 %0) {
ret void
}
void INT_Excep_TMR0_OVI0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TMR0_OVI0() {
ret void
}
int do_791() { return 791; }


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

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

LLVM IR (-O0):
define i32 @do_791() {
ret i32 791
}

LLVM IR (-O2):
define i32 @do_791() {
ret i32 791
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_UTCTIME;

/* Variables and functions */
int /*<<< orphan*/ ASN1_UTCTIME_it;
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
ASN1_UTCTIME *d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, const unsigned char **in,
                               long len) {
  return (ASN1_UTCTIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                       &ASN1_UTCTIME_it);
}


x86 assembly (clang, -O0):
<d2i_ASN1_UTCTIME>:
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
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_ASN1_UTCTIME>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ASN1_UTCTIME_it = global i32 0
define i32* @d2i_ASN1_UTCTIME(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 i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ASN1_UTCTIME_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ASN1_UTCTIME_it = global i32 0
define i32* @d2i_ASN1_UTCTIME(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ASN1_UTCTIME_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
long labs(long i) { return i < 0 ? -i : i; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ liftPosition(int);
void gotoPos(int position) {
  if (position == 1) {
    liftPosition(254);
  }
  if (position == 2) {
    liftPosition(432);
  }
  if (position == 3) {
    liftPosition(1230);
  }
  if (position == 0) {
    liftPosition(0);
  }
}


x86 assembly (clang, -O0):
<gotoPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    112f <gotoPos+0x1f>
mov    $0xfe,%edi
call   1030 <liftPosition@plt>
cmpl   $0x2,-0x4(%rbp)
jne    1143 <gotoPos+0x33>
mov    $0x1b0,%edi
call   1030 <liftPosition@plt>
cmpl   $0x3,-0x4(%rbp)
jne    1157 <gotoPos+0x47>
mov    $0x4ce,%edi
call   1030 <liftPosition@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1168 <gotoPos+0x58>
xor    %edi,%edi
call   1030 <liftPosition@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoPos>:
cmp    $0x3,%edi
ja     1127 <gotoPos+0x17>
movslq %edi,%rax
lea    0xee1(%rip),%rcx
mov    (%rcx,%rax,4),%edi
jmp    1030 <liftPosition@plt>
ret

LLVM IR (-O0):
define void @gotoPos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @liftPosition(i32 254)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @liftPosition(i32 432)
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 3
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @liftPosition(i32 1230)
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @liftPosition(i32 0)
br label %22
22: ; preds = %20, %17
ret void
}

LLVM IR (-O2):
@switch.table.gotoPos = [4 x i32] [i32 0, i32 254, i32 432, i32 1230]
define void @gotoPos(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.gotoPos, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @liftPosition(i32 %6)
br label %8
8: ; preds = %1, %3
ret void
}
/* Variables and functions */
int _access(char const *, int);
int access(const char *path, int mode) { return _access(path, mode); }


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

x86 assembly (clang, -O2):
<access>:
jmp    1030 <_access@plt>

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

LLVM IR (-O2):
define i32 @access(i8* %0, i32 %1) {
%3 = tail call i32 @_access(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isalnum(char);
scalar_t__ rand();
char rand_char(void) {
  char c;
  for (;;) {
    c = (char)rand();
    if (isalnum(c) || c == '.' || c == '/')
      break;
  }
  return c;
}


x86 assembly (clang, -O0):
<rand_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
jne    115f <rand_char+0x3f>
movsbl -0x1(%rbp),%eax
cmp    $0x2e,%eax
je     115f <rand_char+0x3f>
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
jne    1164 <rand_char+0x44>
jmp    1169 <rand_char+0x49>
jmp    1128 <rand_char+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_char>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rax,%rbx
movsbl %bl,%edi
call   1030 <isalnum@plt>
test   %rax,%rax
jne    114f <rand_char+0x2f>
mov    %ebx,%eax
and    $0xfe,%al
cmp    $0x2e,%al
jne    1130 <rand_char+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @rand_char() {
%1 = alloca i8
br label %2
2: ; preds = %17, %0
%3 = call i64 (...) @rand()
%4 = trunc i64 %3 to i8
store i8 %4, i8* %1
%5 = load i8, i8* %1
%6 = call i64 @isalnum(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %2
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 46
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = load i8, i8* %1
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 47
br i1 %15, label %16, label %17
16: ; preds = %12, %8, %2
br label %18
17: ; preds = %12
br label %2
18: ; preds = %16
%19 = load i8, i8* %1
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @rand_char() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @rand()
%3 = trunc i64 %2 to i8
%4 = tail call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
%6 = and i8 %3, -2
%7 = icmp eq i8 %6, 46
%8 = or i1 %5, %7
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = trunc i64 %2 to i8
ret i8 %10
}