xunge/DecIR huggingface dataset:
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR9C_set(void) { return U_WMRCORENONE_set("U_WMR9C"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR9C\00"
define i8* @U_WMR9C_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR9C\00"
define i8* @U_WMR9C_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ ALWAYS_ASSERT(int);
int /*<<< orphan*/ C67_asm(char *, int, int, int /*<<< orphan*/);
int abs(int);
void C67_ADDK_PARALLEL(int n, int r) {
  ALWAYS_ASSERT(abs(n) < 32767);
  C67_asm("||ADDK", n, r, 0);
}


x86 assembly (clang, -O0):
<C67_ADDK_PARALLEL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x7fff,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <ALWAYS_ASSERT@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9b(%rip),%rdi
xor    %ecx,%ecx
call   1040 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_ADDK_PARALLEL>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
mov    %esi,%ebp
xor    %edi,%edi
cmp    $0x7fff,%eax
setb   %dil
call   1040 <ALWAYS_ASSERT@plt>
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"||ADDK\00"
define void @C67_ADDK_PARALLEL(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 i32 @abs(i32 %5)
%7 = icmp slt i32 %6, 32767
%8 = zext i1 %7 to i32
%9 = call i32 @ALWAYS_ASSERT(i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @C67_asm(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"||ADDK\00"
define void @C67_ADDK_PARALLEL(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = icmp ult i32 %3, 32767
%5 = zext i1 %4 to i32
%6 = tail call i32 @ALWAYS_ASSERT(i32 %5)
%7 = tail call i32 @C67_asm(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
int _imagesize(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int bsize(int x, int y, int bpp) { return _imagesize(0, 0, x - 1, y - 1); }


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

x86 assembly (clang, -O2):
<bsize>:
lea    -0x1(%rdi),%edx
lea    -0x1(%rsi),%ecx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <_imagesize@plt>

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

LLVM IR (-O2):
define i32 @bsize(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, -1
%5 = add nsw i32 %1, -1
%6 = tail call i32 @_imagesize(i32 0, i32 0, i32 %4, i32 %5)
ret i32 %6
}
double jac_djacobi_P0(double x, double a, double b) { return 0.0; }


x86 assembly (clang, -O0):
<jac_djacobi_P0>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_djacobi_P0>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @jac_djacobi_P0(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @jac_djacobi_P0(double %0, double %1, double %2) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xaa() {
  Assert_real((isalpha(170) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              855, ("isalpha should be 0 for 0xaa"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xaa>:
push   %rax
mov    $0xaa,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x357,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xaa\00"
define void @t_isalpha_0xaa() {
%1 = call i64 @isalpha(i32 170)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xaa\00"
define void @t_isalpha_0xaa() {
%1 = tail call i64 @isalpha(i32 170)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
int main() {
  unsigned char c = ~0x7;
  printf("c: %u\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xf8,-0x5(%rbp)
lea    0xed6(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"c: %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 -8, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"c: %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext -8)
ret i32 0
}
void interrupt_handler(int signo) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @opcode_f4() {
ret void
}
int test_imm_FAuint32_mem(unsigned int *val) {
  return ((*val) & (0xFA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FAuint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xfa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_FAuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 250
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void cmpdestroy(void *arg) {}


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

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

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

LLVM IR (-O2):
define void @cmpdestroy(i8* nocapture %0) {
ret void
}
void network_destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @network_destroy() {
ret void
}
void drv_NULL_write(const __attribute__((unused)) int row,
                    const __attribute__((unused)) int col,
                    const __attribute__((unused)) char *data,
                    const __attribute__((unused)) int len) {}


x86 assembly (clang, -O0):
<drv_NULL_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @drv_NULL_write(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @drv_NULL_write(i32 %0, i32 %1, i8* nocapture %2, i32 %3) {
ret void
}
int execute_setreuid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_setreuid() {
ret i32 0
}
void __syscall() { asm("int $0x80"); }


x86 assembly (clang, -O0):
<__syscall>:
push   %rbp
mov    %rsp,%rbp
int    $0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall>:
int    $0x80
ret

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

LLVM IR (-O2):
define void @__syscall() {
tail call void asm sideeffect "int $$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int jam_strlen(char *string) {
  int len = 0;
  while (string[len] != '\0')
    ++len;
  return (len);
}


x86 assembly (clang, -O0):
<jam_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <jam_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <jam_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jam_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <jam_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @jam_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
float convertFahrenheit(int celsius) { return 1.8 * celsius + 32; }


x86 assembly (clang, -O0):
<convertFahrenheit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertFahrenheit>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @convertFahrenheit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %4, double 3.200000e+01)
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @convertFahrenheit(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ foo();
long main() { foo(); }


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

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

LLVM IR (-O0):
define i64 @main() {
%1 = alloca i64
%2 = call i32 (...) @foo()
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @main() {
%1 = tail call i32 (...) @foo()
ret i64 undef
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *display;
};
struct TYPE_4__ {
  TYPE_1__ xcirculate;
};
typedef TYPE_2__ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XEvent_xcirculate_display(void *_p, void *_v) {
  ((XEvent *)_p)->xcirculate.display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcirculate_display>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32* }
define void @set_XEvent_xcirculate_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_4__*
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
store i32* %6, i32** %10
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcirculate_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int add(int /*<<< orphan*/);
int /*<<< orphan*/ input(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("-->%d\n", add(input("input nums:")));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecf(%rip),%rdi
call   1030 <input@plt>
mov    %eax,%edi
call   1040 <add@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"-->%d\0A\00"
@.str.1 = [12 x i8] c"input nums:\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @input(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @add(i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"-->%d\0A\00"
@.str.1 = [12 x i8] c"input nums:\00"
define i32 @main() {
%1 = tail call i32 @input(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @add(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
typedef intptr_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ pn_is_power_of_two(intptr_t);
void *pn_align_up_pointer(void *p, uint32_t align) {
  assert(pn_is_power_of_two(align));
  return (void *)(((intptr_t)p + align - 1) & ~((intptr_t)align - 1));
}


x86 assembly (clang, -O0):
<pn_align_up_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pn_is_power_of_two@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pn_align_up_pointer>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <pn_is_power_of_two@plt>
mov    %eax,%edi
call   1030 <assert@plt>
lea    (%rbx,%r14,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rbx
and    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @pn_align_up_pointer(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 = call i32 @pn_is_power_of_two(i64 %5)
%7 = call i32 @assert(i32 %6)
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %8 to i64
%10 = load i64, i64* %4
%11 = add nsw i64 %9, %10
%12 = sub nsw i64 %11, 1
%13 = load i64, i64* %4
%14 = sub nsw i64 %13, 1
%15 = xor i64 %14, -1
%16 = and i64 %12, %15
%17 = inttoptr i64 %16 to i8*
ret i8* %17
}

LLVM IR (-O2):
define i8* @pn_align_up_pointer(i8* %0, i64 %1) {
%3 = tail call i32 @pn_is_power_of_two(i64 %1)
%4 = tail call i32 @assert(i32 %3)
%5 = ptrtoint i8* %0 to i64
%6 = add i64 %1, -1
%7 = add i64 %6, %5
%8 = sub i64 0, %1
%9 = and i64 %7, %8
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
/* Type definitions */
struct aa_ui_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_user_input(struct aa_ui_t *ui) { printf("\tINFO - got user input\n"); }


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

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

LLVM IR (-O0):
%struct.aa_ui_t = type { i32 }
@.str = [24 x i8] c"\09INFO - got user input\0A\00"
define void @get_user_input(%struct.aa_ui_t* %0) {
%2 = alloca %struct.aa_ui_t*
store %struct.aa_ui_t* %0, %struct.aa_ui_t** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.aa_ui_t = type { i32 }
@str = [23 x i8] c"\09INFO - got user input\00"
define void @get_user_input(%struct.aa_ui_t* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ TIMESPEC_TO_TIMEVAL(struct timeval *, struct timespec *);
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
void getmonotime(struct timeval *tv) {
  struct timespec t;
  if (clock_gettime(CLOCK_MONOTONIC, &t) == 0) {
    TIMESPEC_TO_TIMEVAL(tv, &t);
  } else {
    gettimeofday(tv, 0);
  }
}


x86 assembly (clang, -O0):
<getmonotime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
jne    116a <getmonotime+0x3a>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <TIMESPEC_TO_TIMEVAL@plt>
jmp    1175 <getmonotime+0x45>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmonotime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
test   %rax,%rax
je     115c <getmonotime+0x2c>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
jmp    1169 <getmonotime+0x39>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <TIMESPEC_TO_TIMEVAL@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @getmonotime(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca %struct.timespec
store %struct.timeval* %0, %struct.timeval** %2
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i64 @clock_gettime(i32 %4, %struct.timespec* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = call i32 @TIMESPEC_TO_TIMEVAL(%struct.timeval* %8, %struct.timespec* %3)
br label %13
10: ; preds = %1
%11 = load %struct.timeval*, %struct.timeval** %2
%12 = call i32 @gettimeofday(%struct.timeval* %11, i32 0)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @getmonotime(%struct.timeval* %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i64 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @TIMESPEC_TO_TIMEVAL(%struct.timeval* %0, %struct.timespec* %2)
br label %11
9: ; preds = %1
%10 = call i32 @gettimeofday(%struct.timeval* %0, i32 0)
br label %11
11: ; preds = %9, %7
ret void
}
__attribute__((no)) int two() { return 2; }


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

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

LLVM IR (-O0):
define i32 @two() {
ret i32 2
}

LLVM IR (-O2):
define i32 @two() {
ret i32 2
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *get_filename_ext(const char *filename) {
  const char *dot = strrchr(filename, '.');
  if (!dot || dot == filename)
    return "";
  return dot + 1;
}


x86 assembly (clang, -O0):
<get_filename_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <get_filename_ext+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1157 <get_filename_ext+0x47>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <get_filename_ext+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename_ext>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
cmp    %rbx,%rax
lea    0xed4(%rip),%rdx
cmove  %rdx,%rcx
test   %rax,%rax
cmove  %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_filename_ext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %2
br label %17
17: ; preds = %14, %13
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_filename_ext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %2, %0
%5 = or i1 %3, %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6
ret i8* %7
}
void gdk_window_clear() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_clear() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x3a() {
  Assert_real((isgraph(58)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              295, ("isgraph should be 1 for :"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x3a>:
push   %rax
mov    $0x3a,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x127,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for :\00"
define void @t_isgraph_0x3a() {
%1 = call i32 @isgraph(i32 58)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 295, 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for :\00"
define void @t_isgraph_0x3a() {
%1 = tail call i32 @isgraph(i32 58)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 295, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *const, int /*<<< orphan*/, int);
void cleanup(uint8_t *const masterKey, uint8_t *const sitePasswordSeed) {
  memset(masterKey, 0, 64);
  memset(sitePasswordSeed, 0, 32);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    %rsi,%rbx
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @cleanup(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 i32 @memset(i32* %5, i32 0, i32 64)
%7 = load i32*, i32** %4
%8 = call i32 @memset(i32* %7, i32 0, i32 32)
ret void
}

LLVM IR (-O2):
define void @cleanup(i32* %0, i32* %1) {
%3 = tail call i32 @memset(i32* %0, i32 0, i32 64)
%4 = tail call i32 @memset(i32* %1, i32 0, i32 32)
ret void
}
/* Variables and functions */
scalar_t__ call_ext(char *, char *, char *);
int /*<<< orphan*/ log_printf(char *);
void ext_msg(char *user, char *msg) {
  if (call_ext("xmsg", user, msg))
    log_printf("eERROR: ext_msg() unable to execute external command.");
}


x86 assembly (clang, -O0):
<ext_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <call_ext@plt>
cmp    $0x0,%rax
je     115a <ext_msg+0x3a>
lea    0xeb0(%rip),%rdi
call   1040 <log_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext_msg>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <call_ext@plt>
test   %rax,%rax
je     1145 <ext_msg+0x25>
lea    0xec6(%rip),%rdi
pop    %rax
jmp    1040 <log_printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"xmsg\00"
@.str.1 = [54 x i8] c"eERROR: ext_msg() unable to execute external command.\00"
define void @ext_msg(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 = load i8*, i8** %4
%7 = call i64 @call_ext(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @log_printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"xmsg\00"
@.str.1 = [54 x i8] c"eERROR: ext_msg() unable to execute external command.\00"
define void @ext_msg(i8* %0, i8* %1) {
%3 = tail call i64 @call_ext(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @log_printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int bits_getb(const uint8_t *vec, size_t size, uint8_t bit) {
  if (size <= (size_t)(bit >> 3))
    return -1;
  return (*(vec + (bit >> 3)) & (1 << (bit & 0x07))) != 0;
}


x86 assembly (clang, -O0):
<bits_getb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
ja     1131 <bits_getb+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <bits_getb+0x60>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x1c(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_getb>:
mov    %edx,%eax
sar    $0x3,%eax
movslq %eax,%rcx
mov    $0xffffffff,%eax
cmp    %rsi,%rcx
jae    111f <bits_getb+0x1f>
mov    (%rdi,%rcx,4),%eax
and    $0x7,%dl
mov    %edx,%ecx
shr    %cl,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bits_getb(i32* nocapture %0, i64 %1, i32 %2) {
%4 = ashr i32 %2, 3
%5 = sext i32 %4 to i64
%6 = icmp ult i64 %5, %1
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = getelementptr inbounds i32, i32* %0, i64 %5
%9 = load i32, i32* %8
%10 = and i32 %2, 7
%11 = lshr i32 %9, %10
%12 = and i32 %11, 1
br label %13
13: ; preds = %3, %7
%14 = phi i32 [ %12, %7 ], [ -1, %3 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ gettext(char *);
void print_usage(FILE *stream) {
  fputs(gettext("Usage: yppoll [-h host] [-d domain] mapname\n"), stream);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fputs@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Usage: yppoll [-h host] [-d domain] mapname\0A\00"
define void @print_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @gettext(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @fputs(i32 %3, i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Usage: yppoll [-h host] [-d domain] mapname\0A\00"
define void @print_usage(i32* %0) {
%2 = tail call i32 @gettext(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fputs(i32 %2, i32* %0)
ret void
}
int MStoSecond(int timeLimit) { return (int)(timeLimit + 1000) / 1000; }


x86 assembly (clang, -O0):
<MStoSecond>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3e8,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<MStoSecond>:
add    $0x3e8,%edi
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @MStoSecond(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1000
%5 = sdiv i32 %4, 1000
ret i32 %5
}

LLVM IR (-O2):
define i32 @MStoSecond(i32 %0) {
%2 = add nsw i32 %0, 1000
%3 = sdiv i32 %2, 1000
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void put_answer(int x) { printf("%d\n", x); }


x86 assembly (clang, -O0):
<put_answer>:
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):
<put_answer>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @put_answer(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
unsigned int bl2_uint4_cvt(unsigned int val) {
  unsigned int res;
  res = ((val & 255) * 256) + ((val >> 8) & 255);
  res = (res << 16) + (((val >> 16) & 255) * 256) + ((val >> 24) & 255);
  return res;
}


x86 assembly (clang, -O0):
<bl2_uint4_cvt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x18,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bl2_uint4_cvt>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @bl2_uint4_cvt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = mul i32 %5, 256
%7 = load i32, i32* %2
%8 = lshr i32 %7, 8
%9 = and i32 %8, 255
%10 = add i32 %6, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = shl i32 %11, 16
%13 = load i32, i32* %2
%14 = lshr i32 %13, 16
%15 = and i32 %14, 255
%16 = mul i32 %15, 256
%17 = add i32 %12, %16
%18 = load i32, i32* %2
%19 = lshr i32 %18, 24
%20 = and i32 %19, 255
%21 = add i32 %17, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @bl2_uint4_cvt(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ phone_book_util(char *, int, int /*<<< orphan*/, char *);
int strlen(char *);
void phone_book(char num[]) {
  int len = strlen(num);
  char name[len];
  phone_book_util(num, len, 0, name);
}


x86 assembly (clang, -O0):
<phone_book>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <phone_book_util@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phone_book>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%edx
mov    %rsp,%rcx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <phone_book_util@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @phone_book(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %4
%11 = alloca i8, i64 %9
store i64 %9, i64* %5
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = call i32 @phone_book_util(i8* %12, i32 %13, i32 0, i8* %11)
%15 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @phone_book(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = call i32 @phone_book_util(i8* %0, i32 %2, i32 0, i8* %4)
ret void
}
int test_imm_75int64_lowword_mem(long long *val) {
  return ((*val) & (0x75 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_75int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 117
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
char *luaL_check_string(int);
int /*<<< orphan*/ pushresult(int /*<<< orphan*/);
int /*<<< orphan*/ setreturn(int /*<<< orphan*/ *, char *);
void io_appendto(void) {
  char *s = luaL_check_string(1);
  FILE *fp = fopen(s, "a");
  if (fp != NULL)
    setreturn(fp, "_OUTPUT");
  else
    pushresult(0);
}


x86 assembly (clang, -O0):
<io_appendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <luaL_check_string@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118a <io_appendto+0x4a>
mov    -0x10(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1040 <setreturn@plt>
jmp    1191 <io_appendto+0x51>
xor    %edi,%edi
call   1030 <pushresult@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_appendto>:
push   %rax
mov    $0x1,%edi
call   1050 <luaL_check_string@plt>
lea    0xeae(%rip),%rsi
mov    %rax,%rdi
call   1060 <fopen@plt>
test   %rax,%rax
je     116f <io_appendto+0x2f>
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
pop    %rax
jmp    1040 <setreturn@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <pushresult@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [8 x i8] c"_OUTPUT\00"
define void @io_appendto() {
%1 = alloca i8*
%2 = alloca i32*
%3 = call i8* @luaL_check_string(i32 1)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32*, i32** %2
%10 = call i32 @setreturn(i32* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @pushresult(i32 0)
br label %13
13: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [8 x i8] c"_OUTPUT\00"
define void @io_appendto() {
%1 = tail call i8* @luaL_check_string(i32 1)
%2 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @setreturn(i32* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = tail call i32 @pushresult(i32 0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  exit(0);
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
void r14() { asm volatile("pushq %%r14\n\t" :::); }


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

x86 assembly (clang, -O2):
<r14>:
push   %r14
ret

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

LLVM IR (-O2):
define void @r14() {
tail call void asm sideeffect "pushq %r14\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void nseel_asm_or_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_or_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_backtrace(int);
void *time__Tm__gmtime(void *self) {
  void *var;
  printf("NOT YET IMPLEMENTED nitni for time#Tm#gmtime at "
         "lib/standard/time.nit:52,2--57,3\n");
  show_backtrace(1);
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<time__Tm__gmtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <show_backtrace@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time__Tm__gmtime>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <show_backtrace@plt>

LLVM IR (-O0):
@.str = [82 x i8] c"NOT YET IMPLEMENTED nitni for time#Tm#gmtime at lib/standard/time.nit:52,2--57,3\0A\00"
define i8* @time__Tm__gmtime(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @show_backtrace(i32 1)
br label %6
6: ; preds = %1
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
@str = [81 x i8] c"NOT YET IMPLEMENTED nitni for time#Tm#gmtime at lib/standard/time.nit:52,2--57,3\00"
define noalias i8* @time__Tm__gmtime(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @show_backtrace(i32 1)
ret i8* undef
}
int pp3(int bar) { return bar; }


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

x86 assembly (clang, -O2):
<pp3>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @pp3(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void SPI2_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @SPI2_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @SPI2_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}