xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ flag(char *);
int /*<<< orphan*/ shape(char *);
void firstPad(void) {
  shape("SQUARE");
  flag("FIRST");
}


x86 assembly (clang, -O0):
<firstPad>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <shape@plt>
lea    0xed0(%rip),%rdi
call   1040 <flag@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstPad>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <shape@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1040 <flag@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"SQUARE\00"
@.str.1 = [6 x i8] c"FIRST\00"
define void @firstPad() {
%1 = call i32 @shape(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @flag(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"SQUARE\00"
@.str.1 = [6 x i8] c"FIRST\00"
define void @firstPad() {
%1 = tail call i32 @shape(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @flag(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void img_stdio_fclose(void *obj) {
  FILE *file = (FILE *)obj;
  fclose(file);
}


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

x86 assembly (clang, -O2):
<img_stdio_fclose>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @img_stdio_fclose(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret void
}
void WRITE_UINT16(void *addr, int value) {
  unsigned char *buf = (unsigned char *)addr;
  buf[0] = (value >> 8) & 0xFF;
  buf[1] = value & 0xFF;
}


x86 assembly (clang, -O0):
<WRITE_UINT16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WRITE_UINT16>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @WRITE_UINT16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i32, i32* %4
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @WRITE_UINT16(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
int help_state_pause(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @help_state_pause() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ERR_load_crypto_strings();
void crypto_init(void) { ERR_load_crypto_strings(); }


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

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

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

LLVM IR (-O2):
define void @crypto_init() {
%1 = tail call i32 (...) @ERR_load_crypto_strings()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void delay(int waittime) { usleep(waittime * 1000); }


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

x86 assembly (clang, -O2):
<delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
char *strerror(int);
char *strerror_l(int err, locale_t l) { return strerror(err); }


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

x86 assembly (clang, -O2):
<strerror_l>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @strerror_l(i32 %0, i32 %1) {
%3 = tail call i8* @strerror(i32 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led2Toggle();
void TelosbBaseStationC__Leds__led2Toggle(void) { LedsP__Leds__led2Toggle(); }


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

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

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

LLVM IR (-O2):
define void @TelosbBaseStationC__Leds__led2Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led2Toggle()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XCrossingEvent;

/* Variables and functions */
unsigned long get_XCrossingEvent_window(void *_p) {
  return (unsigned long)((XCrossingEvent *)_p)->window;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XCrossingEvent_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XCrossingEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
double i0(double);
scalar_t__ sqr(double);
double sqrt(scalar_t__);
double kaiser(double n, double m, double beta) {
  double alpha = m / 2;
  return i0(beta * sqrt(1 - sqr((n - alpha) / alpha))) / i0(beta);
}


x86 assembly (clang, -O0):
<kaiser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1030 <sqr@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <i0@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <i0@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kaiser>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
mulsd  0xebe(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
call   1030 <sqr@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <sqrt@plt>
mulsd  0x8(%rsp),%xmm0
call   1050 <i0@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <i0@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @kaiser(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = fdiv double %8, 2.000000e+00
store double %9, double* %7
%10 = load double, double* %6
%11 = load double, double* %4
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load double, double* %7
%15 = fdiv double %13, %14
%16 = call i64 @sqr(double %15)
%17 = sub nsw i64 1, %16
%18 = call double @sqrt(i64 %17)
%19 = fmul double %10, %18
%20 = call double @i0(double %19)
%21 = load double, double* %6
%22 = call double @i0(double %21)
%23 = fdiv double %20, %22
ret double %23
}

LLVM IR (-O2):
define double @kaiser(double %0, double %1, double %2) {
%4 = fmul double %1, 5.000000e-01
%5 = fsub double %0, %4
%6 = fdiv double %5, %4
%7 = tail call i64 @sqr(double %6)
%8 = sub nsw i64 1, %7
%9 = tail call double @sqrt(i64 %8)
%10 = fmul double %9, %2
%11 = tail call double @i0(double %10)
%12 = tail call double @i0(double %2)
%13 = fdiv double %11, %12
ret double %13
}
int ft_isprint(int c) {
  if (c >= 32 && c <= 126)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     1127 <ft_isprint+0x27>
cmpl   $0x7e,-0x8(%rbp)
jg     1127 <ft_isprint+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isprint+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ft_isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 126
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isprint(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 nfa_test();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int retval = 0;
  printf("nfa_test\n");
  retval = nfa_test();
  if (retval != 0) {
    return retval;
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <nfa_test@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1168 <main+0x48>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <main+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [9 x i8] c"nfa_test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @nfa_test()
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ xid_to_slice_id_fast(unsigned int);
int /*<<< orphan*/ xid_to_slice_id_slow(unsigned int);
uint32_t xid_to_slice_id(unsigned int xid) {
  uint32_t slice_id;
  if (xid == 0)
    return 0;
  else if ((slice_id = xid_to_slice_id_fast(xid)) != 0)
    return slice_id;
  else
    return xid_to_slice_id_slow(xid);
}


x86 assembly (clang, -O0):
<xid_to_slice_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <xid_to_slice_id+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116b <xid_to_slice_id+0x4b>
mov    -0x8(%rbp),%edi
call   1030 <xid_to_slice_id_fast@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1160 <xid_to_slice_id+0x40>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <xid_to_slice_id+0x4b>
mov    -0x8(%rbp),%edi
call   1040 <xid_to_slice_id_slow@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xid_to_slice_id>:
push   %rbx
test   %edi,%edi
je     1132 <xid_to_slice_id+0x12>
mov    %edi,%ebx
call   1030 <xid_to_slice_id_fast@plt>
test   %eax,%eax
je     1136 <xid_to_slice_id+0x16>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1040 <xid_to_slice_id_slow@plt>

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

LLVM IR (-O2):
define i32 @xid_to_slice_id(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @xid_to_slice_id_fast(i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @xid_to_slice_id_slow(i32 %0)
br label %8
8: ; preds = %3, %1, %6
%9 = phi i32 [ %7, %6 ], [ 0, %1 ], [ %4, %3 ]
ret i32 %9
}
/* Variables and functions */
unsigned int _blsr_u32(unsigned int);
unsigned int func_blsr32_2(unsigned int X) { return _blsr_u32(X); }


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

x86 assembly (clang, -O2):
<func_blsr32_2>:
jmp    1030 <_blsr_u32@plt>

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

LLVM IR (-O2):
define i32 @func_blsr32_2(i32 %0) {
%2 = tail call i32 @_blsr_u32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x7b() {
  Assert_real((isprint(123)),
              "/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_isprint.c",
              620, ("isprint should be 1 for {"));
}


x86 assembly (clang, -O0):
<t_isprint_0x7b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7b,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x26c,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x7b>:
push   %rax
mov    $0x7b,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x26c,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for {\00"
define void @t_isprint_0x7b() {
%1 = call i32 @isprint(i32 123)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 620, 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for {\00"
define void @t_isprint_0x7b() {
%1 = tail call i32 @isprint(i32 123)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 620, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int ptrdiff_t;

/* Variables and functions */
scalar_t__ memccpy(char *, char const *, char, int const);
char *put_string(const char *s, char *p, char *const e) {
  const ptrdiff_t n = e - p;
  char *const c = (char *)memccpy(p, s, '\0', n);
  return 0 != c ? c - 1 : e;
}


x86 assembly (clang, -O0):
<put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%ecx
xor    %edx,%edx
call   1030 <memccpy@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
je     1165 <put_string+0x55>
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x30(%rbp)
jmp    116d <put_string+0x5d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_string>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rax
mov    %ebx,%ecx
sub    %esi,%ecx
mov    %rsi,%rdi
mov    %rax,%rsi
xor    %edx,%edx
call   1030 <memccpy@plt>
lea    -0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @put_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = load i8*, i8** %5
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
store i32 %14, i32* %7
%15 = load i8*, i8** %5
%16 = load i8*, i8** %4
%17 = load i32, i32* %7
%18 = call i64 @memccpy(i8* %15, i8* %16, i8 signext 0, i32 %17)
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %8
%20 = load i8*, i8** %8
%21 = icmp ne i8* null, %20
br i1 %21, label %22, label %25
22: ; preds = %3
%23 = load i8*, i8** %8
%24 = getelementptr inbounds i8, i8* %23, i64 -1
br label %27
25: ; preds = %3
%26 = load i8*, i8** %6
br label %27
27: ; preds = %25, %22
%28 = phi i8* [ %24, %22 ], [ %26, %25 ]
ret i8* %28
}

LLVM IR (-O2):
define i8* @put_string(i8* nocapture %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
%8 = tail call i64 @memccpy(i8* %1, i8* %0, i8 signext 0, i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = icmp eq i64 %8, 0
%11 = getelementptr inbounds i8, i8* %9, i64 -1
%12 = select i1 %10, i8* %2, i8* %11
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SHR_L_IMM(int reg, int count) {
  if (reg & 8)
    addbyte(0x41);
  addbyte(0xc1);
  addbyte(0xc0 | (reg & 7) | 0x28);
  addbyte(count);
}


x86 assembly (clang, -O0):
<SHR_L_IMM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1137 <SHR_L_IMM+0x27>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xc1,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0xc0,%edi
or     $0x28,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHR_L_IMM>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   $0x8,%bpl
je     1127 <SHR_L_IMM+0x17>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xc1,%edi
call   1030 <addbyte@plt>
and    $0x7,%ebp
or     $0xe8,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SHR_L_IMM(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @addbyte(i32 65)
br label %10
10: ; preds = %8, %2
%11 = call i32 @addbyte(i32 193)
%12 = load i32, i32* %3
%13 = and i32 %12, 7
%14 = or i32 192, %13
%15 = or i32 %14, 40
%16 = call i32 @addbyte(i32 %15)
%17 = load i32, i32* %4
%18 = call i32 @addbyte(i32 %17)
ret void
}

LLVM IR (-O2):
define void @SHR_L_IMM(i32 %0, i32 %1) {
%3 = and i32 %0, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @addbyte(i32 65)
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @addbyte(i32 193)
%9 = and i32 %0, 7
%10 = or i32 %9, 232
%11 = tail call i32 @addbyte(i32 %10)
%12 = tail call i32 @addbyte(i32 %1)
ret void
}
void I_NoAppServicesLobbyMgrJoinLobbyAt(unsigned int idx) {}


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

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

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

LLVM IR (-O2):
define void @I_NoAppServicesLobbyMgrJoinLobbyAt(i32 %0) {
ret void
}
unsigned int kt_rand(unsigned int seed) { return (1103515245 * seed + 12345); }


x86 assembly (clang, -O0):
<kt_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x41c64e6d,-0x4(%rbp),%eax
add    $0x3039,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kt_rand>:
imul   $0x41c64e6d,%edi,%eax
add    $0x3039,%eax
ret

LLVM IR (-O0):
define i32 @kt_rand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 1103515245, %3
%5 = add i32 %4, 12345
ret i32 %5
}

LLVM IR (-O2):
define i32 @kt_rand(i32 %0) {
%2 = mul i32 %0, 1103515245
%3 = add i32 %2, 12345
ret i32 %3
}
void *Cyc_Fn_fp_apply(void *(*f)(void *), void *x) {
  void *_T0;
  _T0 = f(x);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Fn_fp_apply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Fn_fp_apply>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define i8* @Cyc_Fn_fp_apply(i8* (i8*)* nocapture %0, i8* %1) {
%3 = tail call i8* %0(i8* %1)
ret i8* %3
}
void thread_sleep() { __asm__ __volatile__(".word 0x000002DB;" : : :); }


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

x86 assembly (clang, -O2):
<thread_sleep>:
fildl  (%rdx)
ret

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

LLVM IR (-O2):
define void @thread_sleep() {
tail call void asm sideeffect ".word 0x000002DB;", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct sMail {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ resetMail(struct sMail *);
int /*<<< orphan*/ write(int, char *, int);
int reset(int cSocket, struct sMail *mail) {
  resetMail(mail);
  write(cSocket, "250 Reset OK\r\n", 15);
  return (0);
}


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <resetMail@plt>
mov    -0x4(%rbp),%edi
lea    0xebe(%rip),%rsi
mov    $0xf,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1040 <resetMail@plt>
lea    0xece(%rip),%rsi
mov    %ebx,%edi
mov    $0xf,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sMail = type { i32 }
@.str = [15 x i8] c"250 Reset OK\0D\0A\00"
define i32 @reset(i32 %0, %struct.sMail* %1) {
%3 = alloca i32
%4 = alloca %struct.sMail*
store i32 %0, i32* %3
store %struct.sMail* %1, %struct.sMail** %4
%5 = load %struct.sMail*, %struct.sMail** %4
%6 = call i32 @resetMail(%struct.sMail* %5)
%7 = load i32, i32* %3
%8 = call i32 @write(i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}

LLVM IR (-O2):
%struct.sMail = type { i32 }
@.str = [15 x i8] c"250 Reset OK\0D\0A\00"
define i32 @reset(i32 %0, %struct.sMail* %1) {
%3 = tail call i32 @resetMail(%struct.sMail* %1)
%4 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}
/* Variables and functions */
char *nextTok(char **);
int at_tok_nextstr(char **p_cur, char **p_out) {
  if (*p_cur == NULL) {
    return -1;
  }
  *p_out = nextTok(p_cur);
  return 0;
}


x86 assembly (clang, -O0):
<at_tok_nextstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113a <at_tok_nextstr+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <at_tok_nextstr+0x44>
mov    -0x10(%rbp),%rdi
call   1030 <nextTok@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_tok_nextstr>:
push   %rbx
cmpq   $0x0,(%rdi)
je     1126 <at_tok_nextstr+0x16>
mov    %rsi,%rbx
call   1030 <nextTok@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @at_tok_nextstr(i8** %0, i8** nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @nextTok(i8** %0)
store i8* %6, i8** %1
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}
int base_to_num(char base) {
  switch (base) {
  case 'C':
  case 'c':
    return 0;
  case 'A':
  case 'a':
    return 1;
  case 'T':
  case 't':
    return 2;
  case 'G':
  case 'g':
  default:
    return 3;
  }
}


x86 assembly (clang, -O0):
<base_to_num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x33,%eax
ja     115d <base_to_num+0x5d>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1164 <base_to_num+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1164 <base_to_num+0x64>
movl   $0x2,-0x4(%rbp)
jmp    1164 <base_to_num+0x64>
jmp    115d <base_to_num+0x5d>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_to_num>:
add    $0xffffffbf,%edi
cmp    $0x33,%edi
ja     1146 <base_to_num+0x46>
movabs $0x100000001,%rax
bt     %rdi,%rax
jb     1140 <base_to_num+0x40>
xor    %eax,%eax
movabs $0x400000004,%rcx
bt     %rdi,%rcx
jb     114b <base_to_num+0x4b>
movabs $0x8000000080000,%rax
bt     %rdi,%rax
jae    1146 <base_to_num+0x46>
mov    $0x2,%eax
ret
mov    $0x1,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @base_to_num(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 67, label %6
i32 99, label %6
i32 65, label %7
i32 97, label %7
i32 84, label %8
i32 116, label %8
i32 71, label %9
i32 103, label %9
]
6: ; preds = %1, %1
store i32 0, i32* %2
br label %11
7: ; preds = %1, %1
store i32 1, i32* %2
br label %11
8: ; preds = %1, %1
store i32 2, i32* %2
br label %11
9: ; preds = %1, %1
br label %10
10: ; preds = %1, %9
store i32 3, i32* %2
br label %11
11: ; preds = %10, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @base_to_num(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 67, label %6
i32 99, label %6
i32 65, label %3
i32 97, label %3
i32 84, label %4
i32 116, label %4
]
3: ; preds = %1, %1
br label %6
4: ; preds = %1, %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %5, %4, %3
%7 = phi i32 [ 3, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int *h();
int i(void) {
  int *iptr = h();
  return iptr[3];
}


x86 assembly (clang, -O0):
<i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <h@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i>:
push   %rax
xor    %eax,%eax
call   1030 <h@plt>
mov    0xc(%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @i() {
%1 = alloca i32*
%2 = call i32* (...) @h()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @i() {
%1 = tail call i32* (...) @h()
%2 = getelementptr inbounds i32, i32* %1, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("Usage: otp ORIGIN_FILE KEY_FILE OUT_FILE\n"); }


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"Usage: otp ORIGIN_FILE KEY_FILE OUT_FILE\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"Usage: otp ORIGIN_FILE KEY_FILE OUT_FILE\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isUgly(int);
int NthUglyNumber(int n) {
  int i = 1;
  int count = 1;
  while (n > count) {
    i++;
    if (isUgly(i))
      count++;
  }
  return i;
}


x86 assembly (clang, -O0):
<NthUglyNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    115e <NthUglyNumber+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isUgly@plt>
cmp    $0x0,%rax
je     1159 <NthUglyNumber+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <NthUglyNumber+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NthUglyNumber>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1146 <NthUglyNumber+0x36>
mov    %edi,%r14d
mov    $0x1,%ebx
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %ebp,%edi
call   1030 <isUgly@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
cmp    %r14d,%ebx
jl     1130 <NthUglyNumber+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @NthUglyNumber(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ 1, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = tail call i64 @isUgly(i32 %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %4, %9
%11 = icmp slt i32 %10, %0
br i1 %11, label %3, label %12
12: ; preds = %3, %1
%13 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %13
}
/* Type definitions */
struct uevent {
  int dummy;
};

/* Variables and functions */
char *uevent_get_dm_str(struct uevent const *, char *);
char *uevent_get_dm_name(const struct uevent *uev) {
  return uevent_get_dm_str(uev, "DM_NAME");
}


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

x86 assembly (clang, -O2):
<uevent_get_dm_name>:
lea    0xee9(%rip),%rsi
jmp    1030 <uevent_get_dm_str@plt>

LLVM IR (-O0):
%struct.uevent = type { i32 }
@.str = [8 x i8] c"DM_NAME\00"
define i8* @uevent_get_dm_name(%struct.uevent* %0) {
%2 = alloca %struct.uevent*
store %struct.uevent* %0, %struct.uevent** %2
%3 = load %struct.uevent*, %struct.uevent** %2
%4 = call i8* @uevent_get_dm_str(%struct.uevent* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.uevent = type { i32 }
@.str = [8 x i8] c"DM_NAME\00"
define i8* @uevent_get_dm_name(%struct.uevent* %0) {
%2 = tail call i8* @uevent_get_dm_str(%struct.uevent* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int fifo_inc_ct(int ct, int size) { return (++ct == size) ? 0 : ct; }


x86 assembly (clang, -O0):
<fifo_inc_ct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    -0x8(%rbp),%eax
jne    1126 <fifo_inc_ct+0x26>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <fifo_inc_ct+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_inc_ct>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    %esi,%ecx
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fifo_inc_ct(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = icmp eq i32 %3, %1
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
m_mult() { ol("MUL  BX"); }


x86 assembly (clang, -O0):
<m_mult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"MUL BX\00"
define i32 @m_mult() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"MUL BX\00"
define i32 @m_mult() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
unsigned long long bswap_32(unsigned long long);
unsigned long long bswap_64(unsigned long long x) {
  return (((unsigned long long)bswap_32(x & 0xffffffffull)) << 32) |
         (bswap_32(x >> 32));
}


x86 assembly (clang, -O0):
<bswap_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0xffffffff,%rdi
and    -0x8(%rbp),%rdi
call   1030 <bswap_32@plt>
shl    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
shr    $0x20,%rdi
call   1030 <bswap_32@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
or     %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_64>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %ebx,%edi
call   1030 <bswap_32@plt>
mov    %rax,%r14
shl    $0x20,%r14
shr    $0x20,%rbx
mov    %rbx,%rdi
call   1030 <bswap_32@plt>
or     %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @bswap_64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4294967295
%5 = call i64 @bswap_32(i64 %4)
%6 = shl i64 %5, 32
%7 = load i64, i64* %2
%8 = lshr i64 %7, 32
%9 = call i64 @bswap_32(i64 %8)
%10 = or i64 %6, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @bswap_64(i64 %0) {
%2 = and i64 %0, 4294967295
%3 = tail call i64 @bswap_32(i64 %2)
%4 = shl i64 %3, 32
%5 = lshr i64 %0, 32
%6 = tail call i64 @bswap_32(i64 %5)
%7 = or i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int syscall(int);
int vhangup(void) { return syscall(111); }


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

x86 assembly (clang, -O2):
<vhangup>:
mov    $0x6f,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @vhangup() {
%1 = call i32 @syscall(i32 111)
ret i32 %1
}

LLVM IR (-O2):
define i32 @vhangup() {
%1 = tail call i32 @syscall(i32 111)
ret i32 %1
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int UINT64_C(int);
int is_vdi_attr_obj(uint64_t oid) { return !!(oid & (UINT64_C(1) << 61)); }


x86 assembly (clang, -O0):
<is_vdi_attr_obj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%eax
mov    $0x3d,%ecx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_vdi_attr_obj(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @UINT64_C(i32 1)
%5 = shl i32 %4, 61
%6 = and i32 %3, %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_vdi_attr_obj(i32 %0) {
%2 = tail call i32 @UINT64_C(i32 1)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void zz_libc_del(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<zz_libc_del>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @zz_libc_del(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void DIGI_Enable() {}


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

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

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

LLVM IR (-O2):
define void @DIGI_Enable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
size_t j64_earr_encode(char *buf, size_t len) {
  len = ((len) < (2) ? (len) : (2));
  memcpy(buf, "[]", len);
  return len;
}


x86 assembly (clang, -O0):
<j64_earr_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
jae    1138 <j64_earr_encode+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1146 <j64_earr_encode+0x36>
mov    $0x2,%eax
mov    %rax,-0x18(%rbp)
jmp    1146 <j64_earr_encode+0x36>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j64_earr_encode>:
push   %rbx
cmp    $0x2,%rsi
mov    $0x2,%ebx
cmovb  %rsi,%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"[]\00"
define i64 @j64_earr_encode(i8* %0, i64 %1) {
%3 = icmp ult i64 %1, 2
%4 = select i1 %3, i64 %1, i64 2
%5 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("hello world c"); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"hello world c\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int le_it(int suc, int value) { return suc <= value; }


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

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

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

LLVM IR (-O2):
define i32 @le_it(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strcmp(char *const, char *const);
int comparator_strcmp(const void *left, const void *right) {
  return strcmp(*(char *const *)left, *(char *const *)right);
}


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

x86 assembly (clang, -O2):
<comparator_strcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @comparator_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @comparator_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_disable_sigpipe() {
  printf("NOT IMPLEMENTED:"
         "pa_disable_sigpipe"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_disable_sigpipe\00"
define i32 @pa_disable_sigpipe() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int ex_put_init_info(int, int, int, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int ne_test_piinf(int fileid) {
  char ftype[3];
  strcpy(ftype, "s");
  return (ex_put_init_info(fileid, 10, 10, ftype));
}


x86 assembly (clang, -O0):
<ne_test_piinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x7(%rbp),%rdi
lea    0xeca(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rcx
mov    $0xa,%edx
mov    %edx,%esi
call   1040 <ex_put_init_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_test_piinf>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%rsi
lea    0x5(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %ebx,%edi
mov    $0xa,%esi
mov    $0xa,%edx
mov    %r14,%rcx
call   1040 <ex_put_init_info@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"s\00"
define i32 @ne_test_piinf(i32 %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @ex_put_init_info(i32 %0, i32 10, i32 10, i8* %3)
ret i32 %5
}