xunge/DecIR huggingface dataset:
/* Variables and functions */
float const simplexRawNoise(float const, float const);
float simplexScaledRawNoise(const float loBound, const float hiBound,
                            const float x, const float y) {
  return simplexRawNoise(x, y) * (hiBound - loBound) / 2 +
         (hiBound + loBound) / 2;
}


x86 assembly (clang, -O0):
<simplexScaledRawNoise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <simplexRawNoise@plt>
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xeaf(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
addss  -0x4(%rbp),%xmm1
movss  0xe99(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simplexScaledRawNoise>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
movaps %xmm2,%xmm0
movaps %xmm3,%xmm1
call   1030 <simplexRawNoise@plt>
movss  (%rsp),%xmm3
movaps %xmm3,%xmm1
movss  0x4(%rsp),%xmm2
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xebb(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm3,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @simplexScaledRawNoise(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %8
%11 = call float @simplexRawNoise(float %9, float %10)
%12 = load float, float* %6
%13 = load float, float* %5
%14 = fsub float %12, %13
%15 = fmul float %11, %14
%16 = fdiv float %15, 2.000000e+00
%17 = load float, float* %6
%18 = load float, float* %5
%19 = fadd float %17, %18
%20 = fdiv float %19, 2.000000e+00
%21 = fadd float %16, %20
ret float %21
}

LLVM IR (-O2):
define float @simplexScaledRawNoise(float %0, float %1, float %2, float %3) {
%5 = tail call float @simplexRawNoise(float %2, float %3)
%6 = fsub float %1, %0
%7 = fmul float %6, %5
%8 = fmul float %7, 5.000000e-01
%9 = fadd float %0, %1
%10 = fmul float %9, 5.000000e-01
%11 = fadd float %10, %8
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ fd_spi_sync_tx1(int, int);
int /*<<< orphan*/ fd_w25q16dw_wait_while_busy();
void fd_w25q16dw_enable_write(void) {
  fd_w25q16dw_wait_while_busy();
  fd_spi_sync_tx1(((0 << 16) | 0), 0x06);
}


x86 assembly (clang, -O0):
<fd_w25q16dw_enable_write>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fd_w25q16dw_wait_while_busy@plt>
xor    %edi,%edi
mov    $0x6,%esi
call   1030 <fd_spi_sync_tx1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_w25q16dw_enable_write>:
push   %rax
xor    %eax,%eax
call   1040 <fd_w25q16dw_wait_while_busy@plt>
xor    %edi,%edi
mov    $0x6,%esi
pop    %rax
jmp    1030 <fd_spi_sync_tx1@plt>

LLVM IR (-O0):
define void @fd_w25q16dw_enable_write() {
%1 = call i32 (...) @fd_w25q16dw_wait_while_busy()
%2 = call i32 @fd_spi_sync_tx1(i32 0, i32 6)
ret void
}

LLVM IR (-O2):
define void @fd_w25q16dw_enable_write() {
%1 = tail call i32 (...) @fd_w25q16dw_wait_while_busy()
%2 = tail call i32 @fd_spi_sync_tx1(i32 0, i32 6)
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int a[], int l, int r) {
  int j;
  if (l < r) {
    j = partition(a, l, r);
    quickSort(a, l, j - 1);
    quickSort(a, j + 1, r);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
__attribute__((always_)) void early_boot_irqs_on(void) {}


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

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

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

LLVM IR (-O2):
define void @early_boot_irqs_on() {
ret void
}
int max(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;
typedef int /*<<< orphan*/ posix_spawn_file_actions_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int __spawni(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/ const *,
             int /*<<< orphan*/ const *, char *const *, char *const *, int);
int posix_spawnp(pid_t *pid, const char *file,
                 const posix_spawn_file_actions_t *file_actions,
                 const posix_spawnattr_t *attrp, char *const argv[],
                 char *const envp[]) {
  return __spawni(pid, file, file_actions, attrp, argv, envp, 1);
}


x86 assembly (clang, -O0):
<posix_spawnp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
movl   $0x1,(%rsp)
call   1030 <__spawni@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnp>:
push   %rax
movl   $0x1,(%rsp)
call   1030 <__spawni@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @posix_spawnp(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5) {
%7 = tail call i32 @__spawni(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5, i32 1)
ret i32 %7
}
/* Variables and functions */
int backtrace(void **, int);
char **backtrace_symbols(void **, int);
int /*<<< orphan*/ free(char **);
void cmgr_backtrace(void) {
  void *trace[10];
  char **messages = NULL;
  int i, trace_size;
  trace_size = backtrace(trace, 10);
  messages = backtrace_symbols(trace, trace_size);
  for (i = 1; i < trace_size; i++) {
    ;
  }
  free(messages);
}


x86 assembly (clang, -O0):
<cmgr_backtrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movq   $0x0,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0xa,%esi
call   1050 <backtrace@plt>
mov    %eax,-0x60(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x60(%rbp),%esi
call   1040 <backtrace_symbols@plt>
mov    %rax,-0x58(%rbp)
movl   $0x1,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    1187 <cmgr_backtrace+0x57>
jmp    1179 <cmgr_backtrace+0x49>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1168 <cmgr_backtrace+0x38>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmgr_backtrace>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <backtrace@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <backtrace_symbols@plt>
mov    %rax,%rdi
call   1030 <free@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @cmgr_backtrace() {
%1 = alloca [10 x i8*]
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** null, i8*** %2
%5 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%6 = call i32 @backtrace(i8** %5, i32 10)
store i32 %6, i32* %4
%7 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%8 = load i32, i32* %4
%9 = call i8** @backtrace_symbols(i8** %7, i32 %8)
store i8** %9, i8*** %2
store i32 1, i32* %3
br label %10
10: ; preds = %15, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %18
14: ; preds = %10
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %10
18: ; preds = %10
%19 = load i8**, i8*** %2
%20 = call i32 @free(i8** %19)
ret void
}

LLVM IR (-O2):
define void @cmgr_backtrace() {
%1 = alloca [10 x i8*]
%2 = bitcast [10 x i8*]* %1 to i8*
%3 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%4 = call i32 @backtrace(i8** %3, i32 10)
%5 = call i8** @backtrace_symbols(i8** %3, i32 %4)
%6 = call i32 @free(i8** %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void geraSeed() { srand((unsigned)time(NULL)); }


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

x86 assembly (clang, -O2):
<geraSeed>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @geraSeed() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @geraSeed() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int /*<<< orphan*/ perror(char *);
scalar_t__ setsockopt(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int *, int);
void set_tcp_no_delay(evutil_socket_t fd) {
  int one = 1;
  if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof one) != 0) {
    perror("setsockopt/no_delay");
  }
}


x86 assembly (clang, -O0):
<set_tcp_no_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
je     116c <set_tcp_no_delay+0x4c>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_tcp_no_delay>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
test   %rax,%rax
jne    1152 <set_tcp_no_delay+0x32>
pop    %rax
ret
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
pop    %rax
ret

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
@.str = [20 x i8] c"setsockopt/no_delay\00"
define void @set_tcp_no_delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_TCP
%6 = load i32, i32* @TCP_NODELAY
%7 = call i64 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
@.str = [20 x i8] c"setsockopt/no_delay\00"
define void @set_tcp_no_delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_NODELAY
%6 = call i64 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *ndb_osdep_getOS() {
  static char os[50] = "\0";
  strcpy(os, "Unix/Linux");
  return os;
}


x86 assembly (clang, -O0):
<ndb_osdep_getOS>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2f12(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndb_osdep_getOS>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ndb_osdep_getOS.os = internal global [50 x i8] zeroinitializer
@.str = [11 x i8] c"Unix/Linux\00"
define i8* @ndb_osdep_getOS() {
%1 = call i32 @strcpy(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @ndb_osdep_getOS.os, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @ndb_osdep_getOS.os, i64 0, i64 0)
}

LLVM IR (-O2):
@ndb_osdep_getOS.os = internal global [50 x i8] zeroinitializer
@.str = [11 x i8] c"Unix/Linux\00"
define i8* @ndb_osdep_getOS() {
%1 = tail call i32 @strcpy(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @ndb_osdep_getOS.os, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @ndb_osdep_getOS.os, i64 0, i64 0)
}
char *state_name(int i) {
  if (i == -1) {
    return "unknown";
  }
  if (i == 0) {
    return "sleeping";
  }
  if (i == 1) {
    return "active";
  }
  return "internal error";
}


x86 assembly (clang, -O0):
<state_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1121 <state_name+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <state_name+0x60>
cmpl   $0x0,-0xc(%rbp)
jne    113b <state_name+0x3b>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <state_name+0x60>
cmpl   $0x1,-0xc(%rbp)
jne    1155 <state_name+0x55>
lea    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <state_name+0x60>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_name>:
add    $0x1,%edi
cmp    $0x2,%edi
ja     111a <state_name+0x1a>
movslq %edi,%rax
lea    0xf16(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xef7(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"unknown\00"
@.str.1 = [9 x i8] c"sleeping\00"
@.str.2 = [7 x i8] c"active\00"
@.str.3 = [15 x i8] c"internal error\00"
define i8* @state_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %11
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %16
15: ; preds = %11
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %15, %14, %10, %6
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
@.str.1 = [9 x i8] c"sleeping\00"
@.str.2 = [7 x i8] c"active\00"
@.str.3 = [15 x i8] c"internal error\00"
@reltable.state_name = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.state_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.state_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.state_name to i64)) to i32)]
define i8* @state_name(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.state_name to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
int omap5_thermal_report_temperature(struct omap_bandgap *bg_ptr, int id) {
  return 0;
}


x86 assembly (clang, -O0):
<omap5_thermal_report_temperature>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.omap_bandgap = type opaque
define i32 @omap5_thermal_report_temperature(%struct.omap_bandgap* %0, i32 %1) {
%3 = alloca %struct.omap_bandgap*
%4 = alloca i32
store %struct.omap_bandgap* %0, %struct.omap_bandgap** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.omap_bandgap = type opaque
define i32 @omap5_thermal_report_temperature(%struct.omap_bandgap* nocapture readnone %0, i32 %1) {
ret i32 0
}
unsigned int dek_hash(const char *str, unsigned int len) {
  unsigned int hash;
  unsigned int c;
  hash = len;
  c = 0;
  while ((c = (unsigned int)*str++))
    hash = ((hash << 5) ^ (hash >> 27)) ^ (c);
  return hash;
}


x86 assembly (clang, -O0):
<dek_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114f <dek_hash+0x4f>
mov    -0x10(%rbp),%eax
shl    $0x5,%eax
mov    -0x10(%rbp),%ecx
shr    $0x1b,%ecx
xor    %ecx,%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1118 <dek_hash+0x18>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dek_hash>:
mov    %esi,%eax
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <dek_hash+0x23>
add    $0x1,%rdi
nopl   0x0(%rax)
movsbl %cl,%ecx
rol    $0x5,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <dek_hash+0x10>
ret

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

LLVM IR (-O2):
define i32 @dek_hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = tail call i32 @llvm.fshl.i32(i32 %7, i32 %7, i32 5)
%12 = xor i32 %11, %9
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ %1, %2 ], [ %12, %5 ]
ret i32 %16
}
void test_fclose() {}


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

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

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

LLVM IR (-O2):
define void @test_fclose() {
ret void
}
__attribute__((visibility("default"))) int bindresvport(sd, sin)
int sd;
struct sockaddr_in *sin;
{
  return bindresvport_sa(sd, (struct sockaddr *)sin);
}


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

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

LLVM IR (-O0):
%struct.sockaddr_in = type opaque
%struct.sockaddr = type opaque
define i32 @bindresvport(i32 %0, %struct.sockaddr_in* %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in*
store i32 %0, i32* %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
%5 = load i32, i32* %3
%6 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%7 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%8 = call i32 (i32, %struct.sockaddr*, ...) bitcast (i32 (...)* @bindresvport_sa to i32 (i32, %struct.sockaddr*, ...)*)(i32 %5, %struct.sockaddr* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.sockaddr_in = type opaque
%struct.sockaddr = type opaque
define i32 @bindresvport(i32 %0, %struct.sockaddr_in* %1) {
%3 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%4 = tail call i32 (i32, %struct.sockaddr*, ...) bitcast (i32 (...)* @bindresvport_sa to i32 (i32, %struct.sockaddr*, ...)*)(i32 %0, %struct.sockaddr* %3)
ret i32 %4
}
void ScaleARGBRowDown2Linear_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBRowDown2Linear_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x7f() {
  Assert_real((isdigit(127) == 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_isdigit.c",
              640, ("isdigit should be 0 for 0x7f"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x7f>:
push   %rax
mov    $0x7f,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x280,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x7f\00"
define void @t_isdigit_0x7f() {
%1 = call i64 @isdigit(i32 127)
%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 640, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x7f\00"
define void @t_isdigit_0x7f() {
%1 = tail call i64 @isdigit(i32 127)
%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 640, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void __attribute__((visibility("internal"))) lib1_internal(void) {}


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

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

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

LLVM IR (-O2):
define hidden void @lib1_internal() {
ret void
}
int tern2dec(int *tryte) {
  int i;
  int placeval = 1;
  int accum = 0;
  for (i = 0; i < 6; i++) {
    accum = accum + (tryte[i] * placeval);
    placeval = placeval * 3;
  }
  return accum;
}


x86 assembly (clang, -O0):
<tern2dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1153 <tern2dec+0x53>
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
imul   $0x3,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <tern2dec+0x1d>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tern2dec>:
mov    0x4(%rdi),%eax
lea    (%rax,%rax,2),%ecx
movdqu 0x8(%rdi),%xmm0
movdqa 0xeed(%rip),%xmm1
pmuludq %xmm0,%xmm1
pshufd $0xe8,%xmm1,%xmm1
pshufd $0xf5,%xmm0,%xmm0
pmuludq 0xee7(%rip),%xmm0
pshufd $0xe8,%xmm0,%xmm0
punpckldq %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
add    %ecx,%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @tern2dec(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 3
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = bitcast i32* %6 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = mul nsw <4 x i32> %8, <i32 9, i32 27, i32 81, i32 243>
%10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %9)
%11 = add nsw i32 %10, %5
%12 = add nsw i32 %11, %2
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct serializer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ s_wl64(struct serializer *, int /*<<< orphan*/);
void s_wld(struct serializer *s, double d) {
  s_wl64(s, *(uint64_t *)&d);
  return;
}


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

x86 assembly (clang, -O2):
<s_wld>:
movq   %xmm0,%rsi
jmp    1030 <s_wl64@plt>

LLVM IR (-O0):
%struct.serializer = type { i32 }
define void @s_wld(%struct.serializer* %0, double %1) {
%3 = alloca %struct.serializer*
%4 = alloca double
store %struct.serializer* %0, %struct.serializer** %3
store double %1, double* %4
%5 = load %struct.serializer*, %struct.serializer** %3
%6 = bitcast double* %4 to i32*
%7 = load i32, i32* %6
%8 = call i32 @s_wl64(%struct.serializer* %5, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.serializer = type { i32 }
define void @s_wld(%struct.serializer* %0, double %1) {
%3 = bitcast double %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @s_wl64(%struct.serializer* %0, i32 %4)
ret void
}
/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
double now() { return (double)clock() / CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @now() {
%1 = call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @now() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}
/* Type definitions */
struct grecs_txtacc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ grecs_txtacc_grow(struct grecs_txtacc *, char const *,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int txtacc_fmt(const char *str, void *data) {
  struct grecs_txtacc *acc = data;
  grecs_txtacc_grow(acc, str, strlen(str));
  return 0;
}


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

x86 assembly (clang, -O2):
<txtacc_fmt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <grecs_txtacc_grow@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.grecs_txtacc = type { i32 }
define i32 @txtacc_fmt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.grecs_txtacc*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.grecs_txtacc*
store %struct.grecs_txtacc* %7, %struct.grecs_txtacc** %5
%8 = load %struct.grecs_txtacc*, %struct.grecs_txtacc** %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @grecs_txtacc_grow(%struct.grecs_txtacc* %8, i8* %9, i32 %11)
ret i32 0
}

LLVM IR (-O2):
%struct.grecs_txtacc = type { i32 }
define i32 @txtacc_fmt(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.grecs_txtacc*
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @grecs_txtacc_grow(%struct.grecs_txtacc* %3, i8* %0, i32 %4)
ret i32 0
}
/* Variables and functions */
int curr_pos(char const *);
scalar_t__ strlen(char const *);
int get_target_pos(const char board[], int times) {
  int temp_pos = (curr_pos(board) + times), len = (int)strlen(board);
  if (temp_pos < 0)
    temp_pos += len;
  return temp_pos % len;
}


x86 assembly (clang, -O0):
<get_target_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <curr_pos@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    115d <get_target_pos+0x3d>
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_target_pos>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <curr_pos@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    %ebp,%eax
sar    $0x1f,%eax
and    %ecx,%eax
add    %ebp,%eax
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_target_pos(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @curr_pos(i8* %7)
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
store i32 %10, i32* %5
%11 = load i8*, i8** %3
%12 = call i64 @strlen(i8* %11)
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %2
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = add nsw i32 %18, %17
store i32 %19, i32* %5
br label %20
20: ; preds = %16, %2
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = srem i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_target_pos(i8* %0, i32 %1) {
%3 = tail call i32 @curr_pos(i8* %0)
%4 = add nsw i32 %3, %1
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = trunc i64 %5 to i32
%7 = icmp slt i32 %4, 0
%8 = select i1 %7, i32 %6, i32 0
%9 = add nsw i32 %8, %4
%10 = srem i32 %9, %6
ret i32 %10
}
long f(int i, long l) { return i + l; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movslq %edi,%rax
add    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @f(i32 %0, i64 %1) {
%3 = sext i32 %0 to i64
%4 = add nsw i64 %3, %1
ret i64 %4
}
void pathcon_nm3_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathcon_nm3_incref() {
ret void
}
int ft_sqrt(int nb) {
  int sqrt;
  if (nb < 0)
    return (0);
  sqrt = 1;
  while ((sqrt * sqrt) < nb)
    sqrt++;
  return (((sqrt * sqrt) == nb) ? sqrt : 0);
}


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <ft_sqrt+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    116d <ft_sqrt+0x6d>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1142 <ft_sqrt+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <ft_sqrt+0x24>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    115d <ft_sqrt+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1167 <ft_sqrt+0x67>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1167 <ft_sqrt+0x67>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
test   %edi,%edi
js     1124 <ft_sqrt+0x24>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
jl     1110 <ft_sqrt+0x10>
xor    %eax,%eax
cmp    %edi,%edx
cmove  %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ft_sqrt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %29
8: ; preds = %1
store i32 1, i32* %4
br label %9
9: ; preds = %15, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %9
18: ; preds = %9
%19 = load i32, i32* %4
%20 = load i32, i32* %4
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %3
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = load i32, i32* %4
br label %27
26: ; preds = %18
br label %27
27: ; preds = %26, %24
%28 = phi i32 [ %25, %24 ], [ 0, %26 ]
store i32 %28, i32* %2
br label %29
29: ; preds = %27, %7
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @ft_sqrt(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = mul nsw i32 %4, %4
%6 = icmp slt i32 %5, %0
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = icmp eq i32 %5, %0
%10 = select i1 %9, i32 %4, i32 0
br label %11
11: ; preds = %1, %8
%12 = phi i32 [ %10, %8 ], [ 0, %1 ]
ret i32 %12
}
void BGRAToARGB() {}


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

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

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

LLVM IR (-O2):
define void @BGRAToARGB() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reset_tio();
void Reset_Tiff() { reset_tio(); }


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

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

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

LLVM IR (-O2):
define void @Reset_Tiff() {
%1 = tail call i32 (...) @reset_tio()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_get_format_info() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_get_format_info"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_format_info\00"
define i32 @pa_tagstruct_get_format_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int wait(int *);
r_wait(int *stat_loc) {
  pid_t retval;
  while (((retval = wait(stat_loc)) == -1) && (errno == EINTR))
    ;
  return retval;
}


x86 assembly (clang, -O0):
<r_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wait@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0xd(%rbp)
jne    1152 <r_wait+0x42>
mov    0x2ea1(%rip),%rax
mov    (%rax),%rax
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1162 <r_wait+0x52>
jmp    1167 <r_wait+0x57>
jmp    111c <r_wait+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_wait>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2ec1(%rip),%r14
mov    0x2eb2(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <wait@plt>
cmp    $0xffffffff,%eax
jne    1145 <r_wait+0x35>
mov    (%r15),%rcx
cmp    %rcx,(%r14)
je     1130 <r_wait+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_wait(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @wait(i32* %5)
store i32 %6, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i64, i64* @errno
%10 = load i64, i64* @EINTR
%11 = icmp eq i64 %9, %10
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ false, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_wait(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @wait(i32* %0)
%4 = icmp eq i32 %3, -1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EINTR
%7 = icmp eq i64 %5, %6
%8 = select i1 %4, i1 %7, i1 false
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SOCK_DGRAM;
int clientsock(int /*<<< orphan*/, char const *, int);
int clientUDPsock(const char *destination, int portN) {
  return clientsock(SOCK_DGRAM, destination, portN);
}


x86 assembly (clang, -O0):
<clientUDPsock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <clientsock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clientUDPsock>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <clientsock@plt>

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

LLVM IR (-O2):
@SOCK_DGRAM = global i32 0
define i32 @clientUDPsock(i8* %0, i32 %1) {
%3 = load i32, i32* @SOCK_DGRAM
%4 = tail call i32 @clientsock(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
int main(void) {
  int a = 5;
  *(&a + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x8f() {
  Assert_real((isalpha(143) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              720, ("isalpha should be 0 for 0x8f"));
}


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

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

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

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