xunge/DecIR huggingface dataset:
/* Variables and functions */
#define EAGAIN 131
#define EALREADY 130
#define EINPROGRESS 129
#define EINTR 128
int BIO_dgram_non_fatal_error(int err) {
  switch (err) {
  case EINTR:
  case EAGAIN:
  case EINPROGRESS:
  case EALREADY:
    return (1);
  default:
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<BIO_dgram_non_fatal_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x3,%eax
ja     1127 <BIO_dgram_non_fatal_error+0x27>
jmp    111b <BIO_dgram_non_fatal_error+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    1133 <BIO_dgram_non_fatal_error+0x33>
jmp    112c <BIO_dgram_non_fatal_error+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_dgram_non_fatal_error>:
and    $0xfffffffc,%edi
xor    %eax,%eax
cmp    $0x80,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @BIO_dgram_non_fatal_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 128, label %5
i32 131, label %5
i32 129, label %5
i32 130, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %8
6: ; preds = %1
br label %7
7: ; preds = %6
store i32 0, i32* %2
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @BIO_dgram_non_fatal_error(i32 %0) {
%2 = and i32 %0, -4
%3 = icmp eq i32 %2, 128
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_E4int16_mem(short *val) {
  return ((*val) & (0xE4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E4int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 228
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _rmdirs(char const *);
int rmdirs(const char *path) { return _rmdirs(path); }


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

x86 assembly (clang, -O2):
<rmdirs>:
jmp    1030 <_rmdirs@plt>

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

LLVM IR (-O2):
define i32 @rmdirs(i8* %0) {
%2 = tail call i32 @_rmdirs(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int sandbox_note(const char *note) {
  printf("%s\n", note);
  return 0;
}


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

x86 assembly (clang, -O2):
<sandbox_note>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @sandbox_note(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
int do_721() { return 721; }


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

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

LLVM IR (-O0):
define i32 @do_721() {
ret i32 721
}

LLVM IR (-O2):
define i32 @do_721() {
ret i32 721
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *);
void Jump_Ret(void) {
  Inst_Printf("mtctr", "r"
                       "3");
  Inst_Printf("bctr", "");
}


x86 assembly (clang, -O0):
<Jump_Ret>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <Inst_Printf@plt>
lea    0xedb(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <Inst_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Jump_Ret>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1030 <Inst_Printf@plt>
lea    0xede(%rip),%rdi
lea    0xed6(%rip),%rsi
pop    %rax
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"mtctr\00"
@.str.1 = [3 x i8] c"r3\00"
@.str.2 = [5 x i8] c"bctr\00"
@.str.3 = [1 x i8] zeroinitializer
define void @Jump_Ret() {
%1 = call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"mtctr\00"
@.str.1 = [3 x i8] c"r3\00"
@.str.2 = [5 x i8] c"bctr\00"
@.str.3 = [1 x i8] zeroinitializer
define void @Jump_Ret() {
%1 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int Section3Seconds(int *seconds) { return *seconds % 60; }


x86 assembly (clang, -O0):
<Section3Seconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section3Seconds>:
movslq (%rdi),%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Section3Seconds(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = srem i32 %4, 60
ret i32 %5
}

LLVM IR (-O2):
define i32 @Section3Seconds(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = srem i32 %2, 60
ret i32 %3
}
/* Variables and functions */
int clk_get_ddr_rate();
unsigned long clk_get_apb_rate(void) { return clk_get_ddr_rate() / 2; }


x86 assembly (clang, -O0):
<clk_get_apb_rate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clk_get_ddr_rate@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<clk_get_apb_rate>:
push   %rax
xor    %eax,%eax
call   1030 <clk_get_ddr_rate@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @clk_get_apb_rate() {
%1 = call i32 (...) @clk_get_ddr_rate()
%2 = sdiv i32 %1, 2
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @clk_get_apb_rate() {
%1 = tail call i32 (...) @clk_get_ddr_rate()
%2 = sdiv i32 %1, 2
%3 = sext i32 %2 to i64
ret i64 %3
}
reg0adrreg1_set(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ r0 = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<reg0adrreg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x43d11(%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @reg0adrreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printFilesInDir(char *);
int main(void) {
  printFilesInDir(".");
  printFilesInDir("/tmp");
  printFilesInDir("/does.not.exist");
}


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

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

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [16 x i8] c"/does.not.exist\00"
define i32 @main() {
%1 = call i32 @printFilesInDir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printFilesInDir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printFilesInDir(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [16 x i8] c"/does.not.exist\00"
define i32 @main() {
%1 = tail call i32 @printFilesInDir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printFilesInDir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printFilesInDir(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
int /*<<< orphan*/ get_input_iconv();
int /*<<< orphan*/ iconv_close(int /*<<< orphan*/);
char *string_do_convert(char const *, int /*<<< orphan*/);
char *string_to_utf8(const char *in) {
  iconv_t ic = get_input_iconv();
  char *ret = string_do_convert(in, ic);
  iconv_close(ic);
  return ret;
}


x86 assembly (clang, -O0):
<string_to_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_input_iconv@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <string_do_convert@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <iconv_close@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_to_utf8>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_input_iconv@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <string_do_convert@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1040 <iconv_close@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @string_to_utf8(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i32 (...) @get_input_iconv()
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i8* @string_do_convert(i8* %6, i32 %7)
store i8* %8, i8** %4
%9 = load i32, i32* %3
%10 = call i32 @iconv_close(i32 %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define i8* @string_to_utf8(i8* %0) {
%2 = tail call i32 (...) @get_input_iconv()
%3 = tail call i8* @string_do_convert(i8* %0, i32 %2)
%4 = tail call i32 @iconv_close(i32 %2)
ret i8* %3
}
/* Variables and functions */
long __fixdfsi(double);
long __fixsfsi(float a1) {
  double foo = a1;
  return __fixdfsi(foo);
}


x86 assembly (clang, -O0):
<__fixsfsi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <__fixdfsi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fixsfsi>:
cvtss2sd %xmm0,%xmm0
jmp    1030 <__fixdfsi@plt>

LLVM IR (-O0):
define i64 @__fixsfsi(float %0) {
%2 = alloca float
%3 = alloca double
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = call i64 @__fixdfsi(double %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @__fixsfsi(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @__fixdfsi(double %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ qprintf(char *, int);
int q__free_dma_memory(int hex) {
  qprintf("*** "
          "_free_dma_memory"
          "(%x)\n",
          hex);
  return 0;
}


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

x86 assembly (clang, -O2):
<q__free_dma_memory>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <qprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [26 x i8] c"*** _free_dma_memory(%x)\0A\00"
define i32 @q__free_dma_memory(i32 %0) {
%2 = tail call i32 @qprintf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *);
extern void dutch_UTF_8_close_env(struct SN_env *z) { SN_close_env(z); }


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

x86 assembly (clang, -O2):
<dutch_UTF_8_close_env>:
jmp    1030 <SN_close_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define void @dutch_UTF_8_close_env(%struct.SN_env* %0) {
%2 = alloca %struct.SN_env*
store %struct.SN_env* %0, %struct.SN_env** %2
%3 = load %struct.SN_env*, %struct.SN_env** %2
%4 = call i32 @SN_close_env(%struct.SN_env* %3)
ret void
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @dutch_UTF_8_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ process_syscall();
int main(int argc, char **argv) {
  printf("Esperant rpc al port 8181...\n");
  process_syscall();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Esperant rpc al port 8181...\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 ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @process_syscall()
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"Esperant rpc al port 8181...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @process_syscall()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __lib_destroy();
void __attribute__((destructor)) governorld_destroy(void) {
  __lib_destroy();
  return;
}


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @governorld_destroy, i8* null }]
define void @governorld_destroy() {
%1 = call i32 (...) @__lib_destroy()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @governorld_destroy, i8* null }]
define void @governorld_destroy() {
%1 = tail call i32 (...) @__lib_destroy()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void exit_bo_good_unreachable_bad() {
  int arr[1];
  exit(1);
  arr[42] = 42;
}


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

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

LLVM IR (-O0):
define void @exit_bo_good_unreachable_bad() {
%1 = alloca [1 x i32]
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @exit_bo_good_unreachable_bad() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_EXTRA_LED_OUTPUT() { set_io_bit(0x39, 4); }


x86 assembly (clang, -O0):
<TOSH_MAKE_EXTRA_LED_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
mov    $0x4,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_EXTRA_LED_OUTPUT>:
mov    $0x39,%edi
mov    $0x4,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_EXTRA_LED_OUTPUT() {
%1 = call i32 @set_io_bit(i32 57, i32 4)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_EXTRA_LED_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 57, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x86() {
  Assert_real((isspace(134) == 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_isspace.c",
              675, ("isspace should be 0 for 0x86"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x86>:
push   %rax
mov    $0x86,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2a3,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x86\00"
define void @t_isspace_0x86() {
%1 = call i64 @isspace(i32 134)
%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 675, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x86\00"
define void @t_isspace_0x86() {
%1 = tail call i64 @isspace(i32 134)
%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 675, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int syscall(int, int);
int setmyint(int value) { return syscall(316, value); }


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

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

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

LLVM IR (-O2):
define i32 @setmyint(i32 %0) {
%2 = tail call i32 @syscall(i32 316, i32 %0)
ret i32 %2
}
void foo_1_1_2_1_2_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_2_2_2_2() {
ret void
}
long double test4l(long double x) { return __builtin_expl(x); }


x86 assembly (clang, -O0):
<test4l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4l>:
jmp    1030 <expl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test4l(x86_fp80 %0) {
%2 = tail call x86_fp80 @expl(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
struct timespec {
  long member_0;
  long member_1;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void sleep(long sec, long nano) {
  long seconds = sec;
  long nanoseconds = nano;
  struct timespec reqDelay = {seconds, nanoseconds};
  nanosleep(&reqDelay, (struct timespec *)NULL);
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
mov    %rsi,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @sleep(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca %struct.timespec
store i64 %0, i64* %3
store i64 %1, i64* %4
%8 = load i64, i64* %3
store i64 %8, i64* %5
%9 = load i64, i64* %4
store i64 %9, i64* %6
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%11 = load i64, i64* %5
store i64 %11, i64* %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%13 = load i64, i64* %6
store i64 %13, i64* %12
%14 = call i32 @nanosleep(%struct.timespec* %7, %struct.timespec* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @sleep(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to i8*
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
store i64 %1, i64* %6
%7 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* null)
ret void
}
/* Type definitions */
struct buf {
  int dummy;
};

/* Variables and functions */
struct buf *buf_new(int /*<<< orphan*/ *);
struct buf *buf_empty(void) {
  return buf_new(NULL);
}


x86 assembly (clang, -O0):
<buf_empty>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <buf_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_empty>:
xor    %edi,%edi
jmp    1030 <buf_new@plt>

LLVM IR (-O0):
%struct.buf = type { i32 }
define %struct.buf* @buf_empty() {
%1 = call %struct.buf* @buf_new(i32* null)
ret %struct.buf* %1
}

LLVM IR (-O2):
%struct.buf = type { i32 }
define %struct.buf* @buf_empty() {
%1 = tail call %struct.buf* @buf_new(i32* null)
ret %struct.buf* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_sha224;
int jksengine_digests_update(int /*<<< orphan*/ *, void const *, unsigned long,
                             int /*<<< orphan*/);
int jksengine_sha224_update(EVP_MD_CTX *ctx, const void *data,
                            unsigned long count) {
  ;
  return (jksengine_digests_update(ctx, data, count, NID_sha224));
}


x86 assembly (clang, -O0):
<jksengine_sha224_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
call   1030 <jksengine_digests_update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_sha224_update>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <jksengine_digests_update@plt>

LLVM IR (-O0):
@NID_sha224 = global i32 0
define i32 @jksengine_sha224_update(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i32, i32* @NID_sha224
%11 = call i32 @jksengine_digests_update(i32* %7, i8* %8, i64 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@NID_sha224 = global i32 0
define i32 @jksengine_sha224_update(i32* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @NID_sha224
%5 = tail call i32 @jksengine_digests_update(i32* %0, i8* %1, i64 %2, i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetw(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int n;
  FILE *fp;
  fp = fopen("abc.txt", "rb");
  n = fgetw(fp);
  printf("%d", n);
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetw@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <fgetw@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"abc.txt\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetw(i32* %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %2
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"abc.txt\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fgetw(i32* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%4 = tail call i32 @fclose(i32* %1)
ret void
}
unsigned int odd(unsigned int target) { return (3 * target) + 1; }


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

x86 assembly (clang, -O2):
<odd>:
lea    (%rdi,%rdi,2),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @odd(i32 %0) {
%2 = mul i32 %0, 3
%3 = add i32 %2, 1
ret i32 %3
}
int sort_utils_pointer_cmp(const void *const a, const void *const b) {
  const void *const *x = (const void *const *)a;
  const void *const *y = (const void *const *)b;
  return (*x > *y) - (*x < *y);
}


x86 assembly (clang, -O0):
<sort_utils_pointer_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x20(%rbp),%rdx
cmp    (%rdx),%rcx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_utils_pointer_cmp>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
seta   %al
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @sort_utils_pointer_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = icmp ugt i8* %12, %14
%16 = zext i1 %15 to i32
%17 = load i8**, i8*** %5
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %6
%20 = load i8*, i8** %19
%21 = icmp ult i8* %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @sort_utils_pointer_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ugt i8* %5, %6
%8 = zext i1 %7 to i32
%9 = icmp ult i8* %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
void SSMR3PutGCPhys32(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutGCPhys32() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addscore(int, int);
void scorekill(int n) { addscore(n, 250); }


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

x86 assembly (clang, -O2):
<scorekill>:
mov    $0xfa,%esi
jmp    1030 <addscore@plt>

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

LLVM IR (-O2):
define void @scorekill(i32 %0) {
%2 = tail call i32 @addscore(i32 %0, i32 250)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int int_aleatorio(float a) {
  return (int)(((float)rand() / (float)(RAND_MAX)) * a);
}


x86 assembly (clang, -O0):
<int_aleatorio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2eb8(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_aleatorio>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2ebb(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
mulss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @int_aleatorio(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i64 (...) @rand()
%4 = sitofp i64 %3 to float
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to float
%7 = fdiv float %4, %6
%8 = load float, float* %2
%9 = fmul float %7, %8
%10 = fptosi float %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @int_aleatorio(float %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to float
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to float
%6 = fdiv float %3, %5
%7 = fmul float %6, %0
%8 = fptosi float %7 to i32
ret i32 %8
}
void skip_oneline_comment(char **input) {
  *input += (sizeof("//") - sizeof(""));
  for (; (*input)[0] != '\0'; ++(*input)) {
    if ((*input)[0] == '\n') {
      *input += (sizeof("\n") - sizeof(""));
      return;
    }
  }
}


x86 assembly (clang, -O0):
<skip_oneline_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1167 <skip_oneline_comment+0x67>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    114f <skip_oneline_comment+0x4f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1167 <skip_oneline_comment+0x67>
jmp    1154 <skip_oneline_comment+0x54>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1116 <skip_oneline_comment+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_oneline_comment>:
mov    (%rdi),%rax
add    $0x2,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,(%rdi)
movzbl (%rax),%ecx
test   %cl,%cl
je     1126 <skip_oneline_comment+0x26>
add    $0x1,%rax
cmp    $0xa,%cl
jne    1110 <skip_oneline_comment+0x10>
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @skip_oneline_comment(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 2
br label %4
4: ; preds = %9, %1
%5 = phi i8* [ %3, %1 ], [ %10, %9 ]
store i8* %5, i8** %0
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %11
i8 10, label %7
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
11: ; preds = %4, %7
ret void
}
/* Variables and functions */
unsigned int usb_sendbyte(unsigned char);
void usb_sendbuffer(void *buffer, unsigned int size) {
  unsigned char *sendbyte = (unsigned char *)buffer;
  unsigned int bytesleft = size;
  unsigned int returnvalue;
  while (bytesleft > 0) {
    returnvalue = usb_sendbyte(*sendbyte);
    if (returnvalue == 1) {
      sendbyte++;
      bytesleft--;
    }
  }
}


x86 assembly (clang, -O0):
<usb_sendbuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jbe    116a <usb_sendbuffer+0x5a>
mov    -0x18(%rbp),%rax
movzbl (%rax),%edi
call   1030 <usb_sendbyte@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    1165 <usb_sendbuffer+0x55>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <usb_sendbuffer+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_sendbuffer>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
je     1137 <usb_sendbuffer+0x27>
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax)
movzbl (%rbx),%edi
call   1030 <usb_sendbyte@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %rcx,%rbx
sub    %ecx,%ebp
jne    1120 <usb_sendbuffer+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @usb_sendbuffer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
store i8* %8, i8** %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
br label %10
10: ; preds = %24, %2
%11 = load i32, i32* %6
%12 = icmp ugt i32 %11, 0
br i1 %12, label %13, label %25
13: ; preds = %10
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = call i32 @usb_sendbyte(i8 zeroext %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %24
19: ; preds = %13
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %5
%22 = load i32, i32* %6
%23 = add i32 %22, -1
store i32 %23, i32* %6
br label %24
24: ; preds = %19, %13
br label %10
25: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @usb_sendbuffer(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %13, %4 ], [ %0, %2 ]
%6 = phi i32 [ %11, %4 ], [ %1, %2 ]
%7 = load i8, i8* %5
%8 = tail call i32 @usb_sendbyte(i8 zeroext %7)
%9 = icmp eq i32 %8, 1
%10 = sext i1 %9 to i32
%11 = add i32 %6, %10
%12 = zext i1 %9 to i64
%13 = getelementptr i8, i8* %5, i64 %12
%14 = icmp eq i32 %11, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *_tfopen(const char *filename, const char *mode) {
  return fopen(filename, mode);
}


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

x86 assembly (clang, -O2):
<_tfopen>:
jmp    1030 <fopen@plt>

LLVM IR (-O0):
define i32* @_tfopen(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 i32* @fopen(i8* %5, i8* %6)
ret i32* %7
}

LLVM IR (-O2):
define noalias i32* @_tfopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
int visLineIndex(int index) { return index + 1; }


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

x86 assembly (clang, -O2):
<visLineIndex>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @visLineIndex(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int qsort_asc_ivector(const void *a, const void *b) {
  return (*(int *)a - *(int *)b);
}


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

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

LLVM IR (-O0):
define i32 @qsort_asc_ivector(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 i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @qsort_asc_ivector(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ bme_server_shutdown();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void bme_shutdown() {
  bme_server_shutdown();
  fprintf(stderr, "BME shutdown complete\n");
  ;
}


x86 assembly (clang, -O0):
<bme_shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <bme_server_shutdown@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bme_shutdown>:
push   %rax
xor    %eax,%eax
call   1040 <bme_server_shutdown@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
pop    %rax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"BME shutdown complete\0A\00"
define void @bme_shutdown() {
%1 = call i32 (...) @bme_server_shutdown()
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"BME shutdown complete\0A\00"
define void @bme_shutdown() {
%1 = tail call i32 (...) @bme_server_shutdown()
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  if (s && f) {
    i = 0;
    while (s[i]) {
      f(i, (s + i));
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1164 <ft_striteri+0x64>
cmpq   $0x0,-0x10(%rbp)
je     1164 <ft_striteri+0x64>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     115f <ft_striteri+0x5f>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%ecx
add    %rcx,%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <ft_striteri+0x2d>
jmp    1164 <ft_striteri+0x64>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1133 <ft_striteri+0x33>
mov    %rsi,%r14
test   %rsi,%rsi
je     1133 <ft_striteri+0x33>
mov    %rdi,%r15
cmpb   $0x0,(%rdi)
je     1133 <ft_striteri+0x33>
xor    %ebx,%ebx
mov    %r15,%rsi
nop
mov    %ebx,%edi
call   *%r14
add    $0x1,%ebx
lea    (%r15,%rbx,1),%rsi
cmpb   $0x0,(%r15,%rbx,1)
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i32, i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %14, %9 ], [ %0, %6 ]
%11 = phi i32 [ %12, %9 ], [ 0, %6 ]
tail call void %1(i32 %11, i8* %10)
%12 = add i32 %11, 1
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6, %2
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void ReadTime(int *sec, int *msec) {
  struct timeval t;
  gettimeofday(&t, NULL);
  *sec = (int)t.tv_sec;
  *msec = (int)t.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<ReadTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadTime>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x10(%rsp),%eax
mov    %eax,(%rbx)
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
mov    %eax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @ReadTime(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.timeval
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = sdiv i32 %13, 1000
%15 = load i32*, i32** %4
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @ReadTime(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %0
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = sdiv i32 %11, 1000
store i32 %12, i32* %1
ret void
}