xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ kernelpanic(char *);
void secure_pabort() { kernelpanic("secure world pabort\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"secure world pabort\0A\00"
define void @secure_pabort() {
%1 = call i32 @kernelpanic(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"secure world pabort\0A\00"
define void @secure_pabort() {
%1 = tail call i32 @kernelpanic(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
int movsbw_1(void) {
  int res;
  __asm__ __volatile__("movl $0x12345678, %%eax\n\t"
                       "movb $0x22, %%al\n\t"
                       "movsbw %%al,%%ax\n\t"
                       "mov %%eax, %0"
                       : "=r"(res)
                       :
                       : "eax");
  return res;
}


x86 assembly (clang, -O0):
<movsbw_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12345678,%eax
mov    $0x22,%al
movsbw %al,%ax
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movsbw_1>:
mov    $0x12345678,%eax
mov    $0x22,%al
movsbw %al,%ax
mov    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @movsbw_1() {
%1 = alloca i32
%2 = call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movb $$0x22, %al\0A\09movsbw %al,%ax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @movsbw_1() {
%1 = tail call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movb $$0x22, %al\0A\09movsbw %al,%ax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
int japi_getscreenwidth();
int j_getscreenwidth() { return (japi_getscreenwidth()); }


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

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

LLVM IR (-O0):
define i32 @j_getscreenwidth() {
%1 = call i32 (...) @japi_getscreenwidth()
ret i32 %1
}

LLVM IR (-O2):
define i32 @j_getscreenwidth() {
%1 = tail call i32 (...) @japi_getscreenwidth()
ret i32 %1
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_seq_split(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_seq_split>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_seq_split(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_seq_split(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void foo209() {}


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

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

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

LLVM IR (-O2):
define void @foo209() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wattroff(int /*<<< orphan*/ *, int);
int ncurses_wattroff(WINDOW *win, int attr) { return wattroff(win, attr); }


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

x86 assembly (clang, -O2):
<ncurses_wattroff>:
jmp    1030 <wattroff@plt>

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

LLVM IR (-O2):
define i32 @ncurses_wattroff(i32* %0, i32 %1) {
%3 = tail call i32 @wattroff(i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ get_interval(double *, int const, double);
int test2() {
  const int nt = 2;
  double t[] = {0.0, 1.0};
  double treq = 0.5;
  int i = -2;
  i = (int)get_interval(t, nt, treq);
  return (i == 0);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x2,-0x4(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x18(%rbp)
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0xfffffffe,-0x2c(%rbp)
lea    -0x20(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
mov    $0x2,%esi
call   1030 <get_interval@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
sub    $0x18,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
movsd  0xed6(%rip),%xmm0
mov    $0x2,%esi
call   1030 <get_interval@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test2.t = [2 x double] [double 0.000000e+00, double 1.000000e+00]
define i32 @test2() {
%1 = alloca i32
%2 = alloca [2 x double]
%3 = alloca double
%4 = alloca i32
store i32 2, i32* %1
%5 = bitcast [2 x double]* %2 to i8*
store double 5.000000e-01, double* %3
store i32 -2, i32* %4
%6 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%7 = load double, double* %3
%8 = call i64 @get_interval(double* %6, i32 2, double %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__const.test2.t = [2 x double] [double 0.000000e+00, double 1.000000e+00]
define i32 @test2() {
%1 = alloca [2 x double]
%2 = bitcast [2 x double]* %1 to i8*
%3 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 0
%4 = call i64 @get_interval(double* %3, i32 2, double 5.000000e-01)
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int sig) { printf("Received SIGINT\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Received SIGINT\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void update_bootpart(const char *val, int *part) {
  int v = atoi(val);
  if (v > 0) {
    *part = v;
  } else {
    printf("Bad boot partition '%s', should be a number >= 1\n", val);
  }
}


x86 assembly (clang, -O0):
<update_bootpart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1154 <update_bootpart+0x34>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1164 <update_bootpart+0x44>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_bootpart>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <atoi@plt>
test   %eax,%eax
jle    113e <update_bootpart+0x1e>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Bad boot partition '%s', should be a number >= 1\0A\00"
define void @update_bootpart(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 @atoi(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
br label %16
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Bad boot partition '%s', should be a number >= 1\0A\00"
define void @update_bootpart(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @atoi(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
store i32 %3, i32* %1
br label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scalbln(double, long);
int /*<<< orphan*/ scalblnf(float, long);
int /*<<< orphan*/ scalblnl(long double, long);
void uninivar_scalbln(void) {
  float f;
  long int i1;
  (void)scalblnf(f, i1);
  double d;
  long int i2;
  (void)scalbln(d, i2);
  long double ld;
  long int i3;
  (void)scalblnl(ld, i3);
}


x86 assembly (clang, -O0):
<uninivar_scalbln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1040 <scalblnf@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rdi
call   1030 <scalbln@plt>
fldt   -0x30(%rbp)
mov    -0x38(%rbp),%rdi
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <scalblnl@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninivar_scalbln>:
sub    $0x18,%rsp
call   1040 <scalblnf@plt>
call   1030 <scalbln@plt>
call   1050 <scalblnl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninivar_scalbln() {
%1 = alloca float
%2 = alloca i64
%3 = alloca double
%4 = alloca i64
%5 = alloca x86_fp80
%6 = alloca i64
%7 = load float, float* %1
%8 = load i64, i64* %2
%9 = call i32 @scalblnf(float %7, i64 %8)
%10 = load double, double* %3
%11 = load i64, i64* %4
%12 = call i32 @scalbln(double %10, i64 %11)
%13 = load x86_fp80, x86_fp80* %5
%14 = load i64, i64* %6
%15 = call i32 @scalblnl(x86_fp80 %13, i64 %14)
ret void
}

LLVM IR (-O2):
define void @uninivar_scalbln() {
%1 = tail call i32 @scalblnf(float undef, i64 undef)
%2 = tail call i32 @scalbln(double undef, i64 undef)
%3 = tail call i32 @scalblnl(x86_fp80 undef, i64 undef)
ret void
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ netif_stop_queue(struct net_device *);
void netif_tx_stop_all_queues(struct net_device *dev) { netif_stop_queue(dev); }


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

x86 assembly (clang, -O2):
<netif_tx_stop_all_queues>:
jmp    1030 <netif_stop_queue@plt>

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

LLVM IR (-O2):
%struct.net_device = type { i32 }
define void @netif_tx_stop_all_queues(%struct.net_device* %0) {
%2 = tail call i32 @netif_stop_queue(%struct.net_device* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ terminate();
int /*<<< orphan*/ txt_write_to_screens(char const *, int, int /*<<< orphan*/,
                                        int);
void panick(const char *what) {
  txt_write_to_screens(what, 23, 0, 0x0C);
  terminate();
}


x86 assembly (clang, -O0):
<panick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x17,%esi
xor    %edx,%edx
mov    $0xc,%ecx
call   1030 <txt_write_to_screens@plt>
mov    $0x0,%al
call   1040 <terminate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panick>:
push   %rax
mov    $0x17,%esi
xor    %edx,%edx
mov    $0xc,%ecx
call   1030 <txt_write_to_screens@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <terminate@plt>

LLVM IR (-O0):
define void @panick(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @txt_write_to_screens(i8* %3, i32 23, i32 0, i32 12)
%5 = call i32 (...) @terminate()
ret void
}

LLVM IR (-O2):
define void @panick(i8* %0) {
%2 = tail call i32 @txt_write_to_screens(i8* %0, i32 23, i32 0, i32 12)
%3 = tail call i32 (...) @terminate()
ret void
}
/* Variables and functions */
int close(int);
int bfd_close(int s) { return close(s); }


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

x86 assembly (clang, -O2):
<bfd_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @bfd_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void reshPackBufferDestroy(char **buffer) {
  if (buffer)
    Free(__func__,
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/libcdi/src/"
         "resource_handle.c",
         582, (*buffer));
}


x86 assembly (clang, -O0):
<reshPackBufferDestroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1148 <reshPackBufferDestroy+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
lea    0xecb(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x246,%edx
mov    $0x0,%al
call   1030 <Free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshPackBufferDestroy>:
test   %rdi,%rdi
je     1132 <reshPackBufferDestroy+0x22>
mov    (%rdi),%rcx
lea    0xee1(%rip),%rdi
lea    0xef0(%rip),%rsi
mov    $0x246,%edx
xor    %eax,%eax
jmp    1030 <Free@plt>
ret

LLVM IR (-O0):
@__func__.reshPackBufferDestroy = [22 x i8] c"reshPackBufferDestroy\00"
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/libcdi/src/resource_handle.c\00"
define void @reshPackBufferDestroy(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.reshPackBufferDestroy, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 582, i8* %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@__func__.reshPackBufferDestroy = [22 x i8] c"reshPackBufferDestroy\00"
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/libcdi/src/resource_handle.c\00"
define void @reshPackBufferDestroy(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.reshPackBufferDestroy, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 582, i8* %4)
br label %6
6: ; preds = %3, %1
ret void
}
long add_xy(long x, long y) { return x + y; }


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

x86 assembly (clang, -O2):
<add_xy>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @add_xy(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @add_xy(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int do_print();
int /*<<< orphan*/ putchar(char);
int do_echo() {
  int ret = do_print();
  putchar('\n');
  return ret;
}


x86 assembly (clang, -O0):
<do_echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <do_print@plt>
mov    %eax,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_echo>:
push   %rbx
xor    %eax,%eax
call   1040 <do_print@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @do_echo() {
%1 = alloca i32
%2 = call i32 (...) @do_print()
store i32 %2, i32* %1
%3 = call i32 @putchar(i8 signext 10)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @do_echo() {
%1 = tail call i32 (...) @do_print()
%2 = tail call i32 @putchar(i8 signext 10)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int m_entry_nr2(void) {
  int res = 1;
  printf("\n>> Called m_entry_nr2\n");
  res = 0;
  return res;
}


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"\0A>> Called m_entry_nr2\00"
define i32 @m_entry_nr2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void rop3_178_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk2 = S ^ T;
  stk3 = *D ^ S;
  stk2 = stk2 | stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_178_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_178_0_0>:
xor    %esi,%edx
mov    (%rdi),%al
xor    %sil,%al
or     %dl,%al
xor    %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_178_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %5
%20 = zext i8 %19 to i32
%21 = xor i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %9
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = load i8, i8* %9
%26 = zext i8 %25 to i32
%27 = or i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %8
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = load i8, i8* %8
%32 = zext i8 %31 to i32
%33 = xor i32 %30, %32
%34 = trunc i32 %33 to i8
store i8 %34, i8* %7
%35 = load i8, i8* %7
%36 = load i8*, i8** %4
store i8 %35, i8* %36
ret void
}

LLVM IR (-O2):
define void @rop3_178_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %1
%7 = or i8 %6, %4
%8 = xor i8 %7, %1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ report(char *);
void fatal(char *label) {
  report(label);
  exit(1);
}


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

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

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @report(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* %0) {
%2 = tail call i32 @report(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *);
void free2d(void *pp) {
  void *p;
  assert(pp != NULL);
  p = ((void **)pp)[0];
  free(pp);
  assert(p != NULL);
  free(p);
}


x86 assembly (clang, -O0):
<free2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free2d>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%r14
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free2d(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i8**
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
store i8* %11, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %3
%15 = icmp ne i8* %14, null
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i8*, i8** %3
%19 = call i32 @free(i8* %18)
ret void
}

LLVM IR (-O2):
define void @free2d(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = bitcast i8* %0 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %0)
%8 = icmp ne i8* %6, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @free(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _reboot_error(char const *message, int ret) {
  fputs("reboot"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_reboot_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_reboot_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"reboot: \00"
@stderr = global i32 0
define i32 @_reboot_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"reboot: \00"
@stderr = global i32 0
define i32 @_reboot_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ustrcasestr(char const *, char const *);
int proc_find_match(const char *shell_cmd, const char *search_str) {
  return !!ustrcasestr(shell_cmd, search_str);
}


x86 assembly (clang, -O0):
<proc_find_match>:
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 <ustrcasestr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_find_match>:
push   %rax
call   1030 <ustrcasestr@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @proc_find_match(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 @ustrcasestr(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @proc_find_match(i8* %0, i8* %1) {
%3 = tail call i32 @ustrcasestr(i8* %0, i8* %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ OutOfMemory();
void *malloc(size_t);
void *vlmcsd_malloc(size_t len) {
  void *buf = malloc(len);
  if (!buf)
    OutOfMemory();
  return buf;
}


x86 assembly (clang, -O0):
<vlmcsd_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <vlmcsd_malloc+0x2b>
mov    $0x0,%al
call   1030 <OutOfMemory@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlmcsd_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <vlmcsd_malloc+0x15>
xor    %eax,%eax
call   1030 <OutOfMemory@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @vlmcsd_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @OutOfMemory()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ tmpbuf;

/* Variables and functions */
int /*<<< orphan*/ jsonq(char const *, char const *, char *, int);
int /*<<< orphan*/ sscanf(char *, char *, double *);
double jsonq_real(const char *s, const char *name) {
  char tmpbuf[256];
  double v = 0.0;
  jsonq(s, name, tmpbuf, sizeof(tmpbuf));
  sscanf(tmpbuf, "%lg", &v);
  return v;
}


x86 assembly (clang, -O0):
<jsonq_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x110(%rbp),%rdx
mov    $0x100,%ecx
call   1030 <jsonq@plt>
lea    -0x110(%rbp),%rdi
lea    0xe9b(%rip),%rsi
lea    -0x118(%rbp),%rdx
call   1040 <sscanf@plt>
movsd  -0x118(%rbp),%xmm0
ff
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonq_real>:
push   %rbx
sub    $0x110,%rsp
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdx
mov    $0x100,%ecx
call   1030 <jsonq@plt>
lea    0xeb6(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <sscanf@plt>
movsd  0x8(%rsp),%xmm0
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lg\00"
define double @jsonq_real(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [256 x i8]
%6 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
store double 0.000000e+00, double* %6
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = call i32 @jsonq(i8* %7, i8* %8, i8* %9, i32 256)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%12 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%13 = load double, double* %6
ret double %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lg\00"
define double @jsonq_real(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = alloca double
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %4
%7 = call i32 @jsonq(i8* %0, i8* %1, i8* %5, i32 256)
%8 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%9 = load double, double* %4
ret double %9
}
void TA0_0_IRQHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<TA0_0_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <TA0_0_IRQHandler+0x9>
jmp    1109 <TA0_0_IRQHandler+0x9>

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

LLVM IR (-O0):
define void @TA0_0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @TA0_0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xb5() {
  Assert_real((isgraph(181) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              910, ("isgraph should be 0 for 0xb5"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xb5\00"
define void @t_isgraph_0xb5() {
%1 = call i64 @isgraph(i32 181)
%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 910, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xb5\00"
define void @t_isgraph_0xb5() {
%1 = tail call i64 @isgraph(i32 181)
%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 910, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_int8_t(int8_t const k1, int8_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_int8_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_int8_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int doerror(char *, int);
int NoMemory(char *fnName) { return doerror(fnName, -16); }


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

x86 assembly (clang, -O2):
<NoMemory>:
mov    $0xfffffff0,%esi
jmp    1030 <doerror@plt>

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

LLVM IR (-O2):
define i32 @NoMemory(i8* %0) {
%2 = tail call i32 @doerror(i8* %0, i32 -16)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ module_register();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("1\n");
  module_register();
  printf("2\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <module_register@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@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 <module_register@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [2 x i8] c"1\00"
@str.2 = [2 x i8] c"2\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @module_register()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int write_block(int, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/);
int motor_bwd(void) { return write_block(107, 0, 0, 0); }


x86 assembly (clang, -O0):
<motor_bwd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6b,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <write_block@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<motor_bwd>:
mov    $0x6b,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <write_block@plt>

LLVM IR (-O0):
define i32 @motor_bwd() {
%1 = call i32 @write_block(i32 107, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @motor_bwd() {
%1 = tail call i32 @write_block(i32 107, i32 0, i32 0, i32 0)
ret i32 %1
}
void interrupt(void) { return; }


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

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

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

LLVM IR (-O2):
define void @interrupt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ mvaddch(int, int, char);
void printVerticalHallway(int x, int y) {
  move(y, 0);
  for (int i = 2; i < x; i++) {
    mvaddch(i, y, '#');
  }
}


x86 assembly (clang, -O0):
<printVerticalHallway>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1040 <move@plt>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1169 <printVerticalHallway+0x49>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x23,%edx
call   1030 <mvaddch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <printVerticalHallway+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printVerticalHallway>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %esi,%edi
xor    %esi,%esi
call   1040 <move@plt>
cmp    $0x3,%ebp
jl     1156 <printVerticalHallway+0x36>
mov    $0x2,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %r14d,%esi
mov    $0x23,%edx
call   1030 <mvaddch@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1140 <printVerticalHallway+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @printVerticalHallway(i32 %0, i32 %1) {
%3 = tail call i32 @move(i32 %1, i32 0)
%4 = icmp sgt i32 %0, 2
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 2, %2 ]
%8 = tail call i32 @mvaddch(i32 %7, i32 %1, i8 signext 35)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %5, label %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void die_alloc() {
  fprintf(stderr, "failed to allocate memory\n");
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"failed to allocate memory\0A\00"
define void @die_alloc() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x84() {
  Assert_real((ispunct(132) == 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_ispunct.c",
              665, ("ispunct should be 0 for 0x84"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x84>:
push   %rax
mov    $0x84,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x299,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x84\00"
define void @t_ispunct_0x84() {
%1 = call i64 @ispunct(i32 132)
%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 665, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x84\00"
define void @t_ispunct_0x84() {
%1 = tail call i64 @ispunct(i32 132)
%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 665, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long string_hash(const unsigned char *name) {
  unsigned long h = 0, g;
  while (*name) {
    h = (h << 4) + *name++;
    if ((g = h & 0xf0000000) != 0) {
      h ^= g >> 24;
    }
    h &= ~g;
  }
  return h;
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     117f <string_hash+0x7f>
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movabs $0xf0000000,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116a <string_hash+0x6a>
mov    -0x18(%rbp),%rax
shr    $0x18,%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <string_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113d <string_hash+0x3d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%rax
movzbl %cl,%ecx
add    %rax,%rcx
mov    %ecx,%eax
and    $0xf0000000,%eax
mov    %rax,%rdx
shr    $0x18,%rdx
xor    %rcx,%rdx
not    %rax
and    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %17, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %16, %4 ], [ 0, %1 ]
%8 = shl i64 %7, 4
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = zext i8 %5 to i64
%11 = add i64 %8, %10
%12 = and i64 %11, 4026531840
%13 = lshr exact i64 %12, 24
%14 = xor i64 %13, %11
%15 = xor i64 %12, -1
%16 = and i64 %14, %15
%17 = load i8, i8* %9
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %4
19: ; preds = %4, %1
%20 = phi i64 [ 0, %1 ], [ %16, %4 ]
ret i64 %20
}
/* Variables and functions */
int printf(char *, int, char, char);
int signed_char(void) {
  signed char a = 0x65;
  int b = 3;
  return printf("%lu, %d, %d\n", sizeof(a << b), a << b, a >> b);
}


x86 assembly (clang, -O0):
<signed_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x65,-0x1(%rbp)
movl   $0x3,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %al,-0x9(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x9(%rbp),%cl
lea    0xebe(%rip),%rdi
mov    $0x4,%esi
movsbl %cl,%edx
movsbl %al,%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
mov    $0x28,%edx
mov    $0xc,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%lu, %d, %d\0A\00"
define i32 @signed_char() {
%1 = alloca i8
%2 = alloca i32
store i8 101, i8* %1
store i32 3, i32* %2
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = load i32, i32* %2
%6 = shl i32 %4, %5
%7 = trunc i32 %6 to i8
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = load i32, i32* %2
%11 = ashr i32 %9, %10
%12 = trunc i32 %11 to i8
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4, i8 signext %7, i8 signext %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"%lu, %d, %d\0A\00"
define i32 @signed_char() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4, i8 signext 40, i8 signext 12)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void strncpy_empty() {
  char dst[] = "123";
  char src[] = "";
  strncpy(dst, src, 4);
}


x86 assembly (clang, -O0):
<strncpy_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
lea    -0x4(%rbp),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_empty>:
push   %rax
movl   $0x333231,0x4(%rsp)
movb   $0x0,0x3(%rsp)
lea    0x4(%rsp),%rdi
lea    0x3(%rsp),%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.strncpy_empty.dst = [4 x i8] c"123\00"
define void @strncpy_empty() {
%1 = alloca [4 x i8]
%2 = alloca [1 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = bitcast [1 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%7 = call i32 @strncpy(i8* %5, i8* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @strncpy_empty() {
%1 = alloca i32
%2 = alloca [1 x i8]
%3 = bitcast i32* %1 to i8*
store i32 3355185, i32* %1
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 0, i8* %4
%5 = call i32 @strncpy(i8* %3, i8* %4, i32 4)
ret void
}