xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ uart_send(int);
void uart_send_hex_nibble(int rc) {
  if (rc > 9)
    rc += 0x37;
  else
    rc += 0x30;
  uart_send(rc);
}


x86 assembly (clang, -O0):
<uart_send_hex_nibble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    1133 <uart_send_hex_nibble+0x23>
mov    -0x4(%rbp),%eax
add    $0x37,%eax
mov    %eax,-0x4(%rbp)
jmp    113c <uart_send_hex_nibble+0x2c>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <uart_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_send_hex_nibble>:
lea    0x30(%rdi),%ecx
lea    0x37(%rdi),%eax
cmp    $0xa,%edi
cmovl  %ecx,%eax
mov    %eax,%edi
jmp    1030 <uart_send@plt>

LLVM IR (-O0):
define void @uart_send_hex_nibble(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 9
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 55
store i32 %7, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 48
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5
%12 = load i32, i32* %2
%13 = call i32 @uart_send(i32 %12)
ret void
}

LLVM IR (-O2):
define void @uart_send_hex_nibble(i32 %0) {
%2 = icmp sgt i32 %0, 9
%3 = select i1 %2, i32 55, i32 48
%4 = add nsw i32 %3, %0
%5 = tail call i32 @uart_send(i32 %4)
ret void
}
double rad2deg(double x) { return 180.0 * x / 3.14159265358979323846; }


x86 assembly (clang, -O0):
<rad2deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad2deg>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @rad2deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 1.800000e+02, %3
%5 = fdiv double %4, 0x400921FB54442D18
ret double %5
}

LLVM IR (-O2):
define double @rad2deg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = fdiv double %2, 0x400921FB54442D18
ret double %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ REG_UART_BASE(scalar_t__);
__attribute__((always_)) __attribute__((flatten)) uint32_t UART_ID(uint32_t i) {
  return (REG_UART_BASE(i) + 0x7c);
}


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

x86 assembly (clang, -O2):
<UART_ID>:
push   %rax
call   1030 <REG_UART_BASE@plt>
add    $0x7c,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @UART_ID(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @REG_UART_BASE(i64 %3)
%5 = add nsw i64 %4, 124
ret i64 %5
}

LLVM IR (-O2):
define i64 @UART_ID(i64 %0) {
%2 = tail call i64 @REG_UART_BASE(i64 %0)
%3 = add nsw i64 %2, 124
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage \n");
  printf("p4 number \n");
  return;
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage \0A\00"
@.str.1 = [12 x i8] c"p4 number \0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage \00"
@str.2 = [11 x i8] c"p4 number \00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *mem_alloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<mem_alloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
AR0AR1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[10000000]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2625a00(%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    0x10f444(%rcx),%eax
ja     113e <AR0AR1+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <AR0AR1+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0AR1>:
mov    0x2625a00(%r8),%ecx
xor    %eax,%eax
cmp    0x10f444(%r9),%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @AR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %4, i64 10000000
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %5, i64 277777
%10 = load i32, i32* %9
%11 = icmp ule i32 %8, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void msg(const char *str) { fprintf(stderr, "mrlogin: %s\r\n", str); }


x86 assembly (clang, -O0):
<msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"mrlogin: %s\0D\0A\00"
define void @msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"mrlogin: %s\0D\0A\00"
define void @msg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
int is_file(char *fn) {
  struct stat statbuf;
  if (stat(fn, &statbuf) < 0)
    return 0;
  return S_ISREG(statbuf.st_mode);
}


x86 assembly (clang, -O0):
<is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    114f <is_file+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <is_file+0x3a>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1138 <is_file+0x18>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISREG(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISREG(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
int int_cmp(const void *a, const void *b) {
  const int *a_i = a;
  const int *b_i = b;
  return *a_i - *b_i;
}


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

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

LLVM IR (-O0):
define i32 @int_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @int_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ clts();
void fpu_trap_off(void) { clts(); }


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

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

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

LLVM IR (-O2):
define void @fpu_trap_off() {
%1 = tail call i32 (...) @clts()
ret void
}
char *mlt_version_get_string() { return "6.23.0"; }


x86 assembly (clang, -O0):
<mlt_version_get_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlt_version_get_string>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"6.23.0\00"
define i8* @mlt_version_get_string() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"6.23.0\00"
define i8* @mlt_version_get_string() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
double min(double x, double y) { return (x < y ? x : y); }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <min+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @min(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("The md5 value generation/comparision tool.\n");
  printf("md5 -g filename : to generate md5 file.\n");
  printf("md5 -c filename : to compare md5 value.\n");
  return;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xf23(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"The md5 value generation/comparision tool.\0A\00"
@.str.1 = [41 x i8] c"md5 -g filename : to generate md5 file.\0A\00"
@.str.2 = [41 x i8] c"md5 -c filename : to compare md5 value.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c"The md5 value generation/comparision tool.\00"
@str.3 = [40 x i8] c"md5 -g filename : to generate md5 file.\00"
@str.4 = [40 x i8] c"md5 -c filename : to compare md5 value.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tracecmd_input {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char const *, int /*<<< orphan*/);
struct tracecmd_input *tracecmd_open_fd(int);
struct tracecmd_input *tracecmd_open(const char *file) {
  int fd;
  fd = open(file, O_RDONLY);
  if (fd < 0)
    return NULL;
  return tracecmd_open_fd(fd);
}


x86 assembly (clang, -O0):
<tracecmd_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1158 <tracecmd_open+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1164 <tracecmd_open+0x44>
mov    -0x14(%rbp),%edi
call   1030 <tracecmd_open_fd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracecmd_open>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
test   %eax,%eax
js     113b <tracecmd_open+0x1b>
mov    %eax,%edi
pop    %rax
jmp    1030 <tracecmd_open_fd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tracecmd_input = type { i32 }
@O_RDONLY = global i32 0
define %struct.tracecmd_input* @tracecmd_open(i8* %0) {
%2 = alloca %struct.tracecmd_input*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store %struct.tracecmd_input* null, %struct.tracecmd_input** %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call %struct.tracecmd_input* @tracecmd_open_fd(i32 %12)
store %struct.tracecmd_input* %13, %struct.tracecmd_input** %2
br label %14
14: ; preds = %11, %10
%15 = load %struct.tracecmd_input*, %struct.tracecmd_input** %2
ret %struct.tracecmd_input* %15
}

LLVM IR (-O2):
%struct.tracecmd_input = type { i32 }
@O_RDONLY = global i32 0
define %struct.tracecmd_input* @tracecmd_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call %struct.tracecmd_input* @tracecmd_open_fd(i32 %3)
br label %7
7: ; preds = %1, %5
%8 = phi %struct.tracecmd_input* [ %6, %5 ], [ null, %1 ]
ret %struct.tracecmd_input* %8
}
/* Variables and functions */
int /*<<< orphan*/ CallbackInfoHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void CallbackInfoLogging() { UAVObjLogging(CallbackInfoHandle()); }


x86 assembly (clang, -O0):
<CallbackInfoLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CallbackInfoHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjLogging@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @CallbackInfoLogging() {
%1 = call i32 (...) @CallbackInfoHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @CallbackInfoLogging() {
%1 = tail call i32 (...) @CallbackInfoHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
int ad7887_scan_from_ring(struct ad7887_state *st, long mask) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ad7887_state = type opaque
define i32 @ad7887_scan_from_ring(%struct.ad7887_state* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ __atomic_cmpxchg(int, int, int volatile *);
int __atomic_dec(volatile int *ptr) {
  int oldValue;
  do {
    oldValue = *ptr;
  } while (__atomic_cmpxchg(oldValue, oldValue - 1, ptr));
  return oldValue;
}


x86 assembly (clang, -O0):
<__atomic_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0x8(%rbp),%rdx
call   1030 <__atomic_cmpxchg@plt>
cmp    $0x0,%rax
jne    111c <__atomic_dec+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_dec>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    (%r14),%ebx
lea    -0x1(%rbx),%esi
mov    %ebx,%edi
mov    %r14,%rdx
call   1030 <__atomic_cmpxchg@plt>
test   %rax,%rax
jne    1120 <__atomic_dec+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @__atomic_dec(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %7, %1
%5 = load i32*, i32** %2
%6 = load volatile i32, i32* %5
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = load i32*, i32** %2
%12 = call i64 @__atomic_cmpxchg(i32 %8, i32 %10, i32* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %4, label %14
14: ; preds = %7
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @__atomic_dec(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* %0
%4 = add nsw i32 %3, -1
%5 = tail call i64 @__atomic_cmpxchg(i32 %3, i32 %4, i32* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc_or_die(unsigned long long);
int /*<<< orphan*/ parse_event_file(char *, unsigned long long, char *);
int /*<<< orphan*/ read_or_die(char *, unsigned long long);
void read_event_file(char *sys, unsigned long long size) {
  char *buf;
  buf = malloc_or_die(size);
  read_or_die(buf, size);
  parse_event_file(buf, size, sys);
  free(buf);
}


x86 assembly (clang, -O0):
<read_event_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc_or_die@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <read_or_die@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1040 <parse_event_file@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_event_file>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <malloc_or_die@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1060 <read_or_die@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <parse_event_file@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @read_event_file(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc_or_die(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i64, i64* %4
%10 = call i32 @read_or_die(i8* %8, i64 %9)
%11 = load i8*, i8** %5
%12 = load i64, i64* %4
%13 = load i8*, i8** %3
%14 = call i32 @parse_event_file(i8* %11, i64 %12, i8* %13)
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
define void @read_event_file(i8* %0, i64 %1) {
%3 = tail call i8* @malloc_or_die(i64 %1)
%4 = tail call i32 @read_or_die(i8* %3, i64 %1)
%5 = tail call i32 @parse_event_file(i8* %3, i64 %1, i8* %0)
%6 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
bool nrf52_errata_36(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_36() {
ret i32 0
}
/* Type definitions */
struct timeval {
  long long tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long cur_secs(void) {
  struct timeval cur_time;
  if (gettimeofday(&cur_time, NULL) != 0) {
    return (-1);
  }
  return (cur_time.tv_sec);
}


x86 assembly (clang, -O0):
<cur_secs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     113c <cur_secs+0x2c>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1144 <cur_secs+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cur_secs>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
neg    %rax
sbb    %rax,%rax
or     (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i64 @cur_secs() {
%1 = alloca i64
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i64 -1, i64* %1
br label %9
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%8 = load i64, i64* %7
store i64 %8, i64* %1
br label %9
9: ; preds = %6, %5
%10 = load i64, i64* %1
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i64 @cur_secs() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = select i1 %4, i64 %6, i64 -1
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
main() {
  initscr();
  printw("Hello world!\n\nHello\n\n\n\n\find "
         "me\n\n\n\n\n\t\t\t\t\t\t\t\t\t\t\tover here!");
  refresh();
  getch();
  endwin();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe9e(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xea1(%rip),%rdi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Hello world!\0A\0AHello\0A\0A\0A\0A\0Cind me\0A\0A\0A\0A\0A\09\09\09\09\09\09\09\09\09\09\09over here!\00"
define i32 @main() {
%1 = call i32 (...) @initscr()
%2 = call i32 @printw(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @refresh()
%4 = call i32 (...) @getch()
%5 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [57 x i8] c"Hello world!\0A\0AHello\0A\0A\0A\0A\0Cind me\0A\0A\0A\0A\0A\09\09\09\09\09\09\09\09\09\09\09over here!\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @printw(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @getch()
%5 = tail call i32 (...) @endwin()
ret i32 0
}
double max(double new, double old) {
  if (new > old) {
    return new;
  }
  return old;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <max+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void signal_handler(int signum) { printf("RINGRING!\n"); }


x86 assembly (clang, -O0):
<signal_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):
<signal_handler>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [10 x i8] c"RINGRING!\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
main() {
  int *pt = (void *)0;
  float fp = 0;
  f(fp);
  f(pt);
  g(fp);
  g(pt);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <f@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <f@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <g@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <g@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xorps  %xmm0,%xmm0
mov    $0x1,%al
call   1030 <f@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1030 <f@plt>
xorps  %xmm0,%xmm0
mov    $0x1,%al
call   1040 <g@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca float
store i32* null, i32** %1
store float 0.000000e+00, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i32 (double, ...) bitcast (i32 (...)* @f to i32 (double, ...)*)(double %4)
%6 = load i32*, i32** %1
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @f to i32 (i32*, ...)*)(i32* %6)
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = call i32 (double, ...) bitcast (i32 (...)* @g to i32 (double, ...)*)(double %9)
%11 = load i32*, i32** %1
%12 = call i32 (i32*, ...) bitcast (i32 (...)* @g to i32 (i32*, ...)*)(i32* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (double, ...) bitcast (i32 (...)* @f to i32 (double, ...)*)(double 0.000000e+00)
%2 = tail call i32 (i32*, ...) bitcast (i32 (...)* @f to i32 (i32*, ...)*)(i32* null)
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @g to i32 (double, ...)*)(double 0.000000e+00)
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @g to i32 (i32*, ...)*)(i32* null)
ret i32 0
}
unsigned int umull_fxp16(unsigned int x, unsigned int y) {
  return (unsigned int)(((unsigned long long)x * (unsigned long long)y) >> 16);
}


x86 assembly (clang, -O0):
<umull_fxp16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
shr    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umull_fxp16>:
mov    %edi,%ecx
mov    %esi,%eax
imul   %rcx,%rax
shr    $0x10,%rax
ret

LLVM IR (-O0):
define i32 @umull_fxp16(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 = zext i32 %5 to i64
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = mul i64 %6, %8
%10 = lshr i64 %9, 16
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @umull_fxp16(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = zext i32 %1 to i64
%5 = mul nuw i64 %4, %3
%6 = lshr i64 %5, 16
%7 = trunc i64 %6 to i32
ret i32 %7
}
int fio_swab_16(int val) {
  int x;
  val &= 0xffff;
  x = (val & 0xff) << 8;
  x |= (val >> 8);
  return x;
}


x86 assembly (clang, -O0):
<fio_swab_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fio_swab_16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @fio_swab_16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 65535
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = load i32, i32* %3
%12 = or i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @fio_swab_16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xcb() {
  Assert_real((ispunct(203) == 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",
              1020, ("ispunct should be 0 for 0xcb"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xcb>:
push   %rax
mov    $0xcb,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3fc,%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 0xcb\00"
define void @t_ispunct_0xcb() {
%1 = call i64 @ispunct(i32 203)
%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 1020, 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 0xcb\00"
define void @t_ispunct_0xcb() {
%1 = tail call i64 @ispunct(i32 203)
%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 1020, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void nopio_char_han(unsigned char ch) {}


x86 assembly (clang, -O0):
<nopio_char_han>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @nopio_char_han(i8 zeroext %0) {
ret void
}
void swap(char *w, int m, int n) {
  char t;
  t = *(w + n);
  *(w + n) = *(w + m);
  *(w + m) = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %edx,%rax
mov    (%rdi,%rax,1),%r8b
movslq %esi,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %r8b,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int write_dobldobl_target_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(766, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_dobldobl_target_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2fe,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_dobldobl_target_Laurent_system>:
mov    $0x2fe,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @write_dobldobl_target_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 766, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_dobldobl_target_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 766, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
unsigned int bitcount5(unsigned int x) {
  switch (x) {
  case 0:
    return 0;
  case 1:
    return 1;
  case 2:
    return 1;
  case 3:
    return 2;
  default:
    return bitcount5(x / 4) + bitcount5(x % 4);
  }
}


x86 assembly (clang, -O0):
<bitcount5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     1170 <bitcount5+0x60>
mov    -0x10(%rbp),%rax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1193 <bitcount5+0x83>
movl   $0x1,-0x4(%rbp)
jmp    1193 <bitcount5+0x83>
movl   $0x1,-0x4(%rbp)
jmp    1193 <bitcount5+0x83>
movl   $0x2,-0x4(%rbp)
jmp    1193 <bitcount5+0x83>
mov    -0x8(%rbp),%edi
shr    $0x2,%edi
call   1030 <bitcount5@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
and    $0x3,%edi
call   1030 <bitcount5@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount5>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
and    $0x3,%ebp
xor    %ebx,%ebx
cmp    $0x4,%edi
jb     1131 <bitcount5+0x21>
nop
shr    $0x2,%edi
call   1030 <bitcount5@plt>
add    %eax,%ebx
mov    %ebp,%edi
cmp    $0x4,%edi
jae    1120 <bitcount5+0x10>
movslq %edi,%rax
lea    0xec5(%rip),%rcx
add    (%rcx,%rax,4),%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bitcount5(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i32 0, i32* %2
br label %17
6: ; preds = %1
store i32 1, i32* %2
br label %17
7: ; preds = %1
store i32 1, i32* %2
br label %17
8: ; preds = %1
store i32 2, i32* %2
br label %17
9: ; preds = %1
%10 = load i32, i32* %3
%11 = udiv i32 %10, 4
%12 = call i32 @bitcount5(i32 %11)
%13 = load i32, i32* %3
%14 = urem i32 %13, 4
%15 = call i32 @bitcount5(i32 %14)
%16 = add i32 %12, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %9, %8, %7, %6, %5
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@switch.table.bitcount5 = [4 x i32] [i32 0, i32 1, i32 1, i32 2]
define i32 @bitcount5(i32 %0) {
%2 = and i32 %0, 3
br label %3
3: ; preds = %7, %1
%4 = phi i32 [ 0, %1 ], [ %10, %7 ]
%5 = phi i32 [ %0, %1 ], [ %2, %7 ]
%6 = icmp ult i32 %5, 4
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = lshr i32 %5, 2
%9 = tail call i32 @bitcount5(i32 %8)
%10 = add i32 %9, %4
br label %3
11: ; preds = %3
%12 = sext i32 %5 to i64
%13 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.bitcount5, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = add i32 %14, %4
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ gameQuit();
int /*<<< orphan*/ printf(char *);
void gameWin() {
  printf("You win!\n");
  gameQuit();
}


x86 assembly (clang, -O0):
<gameWin>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <gameQuit@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"You win!\0A\00"
define void @gameWin() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @gameQuit()
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"You win!\00"
define void @gameWin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @gameQuit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, n, k;
  scanf("%d", &n);
  scanf("%d", &i);
  printf(" ^operation %d\n", n & i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
and    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
and    0x8(%rsp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c" ^operation %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = and i32 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c" ^operation %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = and i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
int compareint(const void *a, const void *b) {
  if (*(int *)a < *(int *)b)
    return -1;
  if (*(int *)a == *(int *)b)
    return 0;
  if (*(int *)a > *(int *)b)
    return 1;
}


x86 assembly (clang, -O0):
<compareint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <compareint+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <compareint+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <compareint+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1161 <compareint+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    1161 <compareint+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareint>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compareint(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp slt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %32
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp eq i32 %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %3
br label %32
23: ; preds = %14
%24 = load i8*, i8** %4
%25 = bitcast i8* %24 to i32*
%26 = load i32, i32* %25
%27 = load i8*, i8** %5
%28 = bitcast i8* %27 to i32*
%29 = load i32, i32* %28
%30 = icmp sgt i32 %26, %29
br i1 %30, label %31, label %32
31: ; preds = %23
store i32 1, i32* %3
br label %32
32: ; preds = %13, %22, %31, %23
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @compareint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fred() {
  printf("fred\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"fred\00"
define i32 @fred() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ memcmp(char *, char *, int);
void memcmp3() {
  char a[] = {1, 2, 3, 4};
  if (memcmp(a, a, 4))
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<memcmp3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
je     113d <memcmp3+0x2d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcmp3>:
push   %rax
movl   $0x4030201,0x4(%rsp)
04
lea    0x4(%rsp),%rdi
mov    %rdi,%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.memcmp3.a = [4 x i8] c"\01\02\03\04"
define void @memcmp3() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%5 = call i64 @memcmp(i8* %3, i8* %4, i32 4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @memcmp3() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%3 = call i64 @memcmp(i8* %2, i8* %2, i32 4)
ret void
}