xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void showusage(void) {
  fprintf(stderr,
          "usage: %1$s info <device>\n"
          "       %1$s read <device> <offset> <len> <dest-filename>\n"
          "       %1$s write <device> <offset> <len> <source-filename>\n"
          "       %1$s erase <device> <offset> <len>\n",
          "mtd_debug");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [186 x i8] c"usage: %1$s info <device>\0A %1$s read <device> <offset> <len> <dest-filename>\0A %1$s write <device> <offset> <len> <source-filename>\0A %1$s erase <device> <offset> <len>\0A\00"
@.str.1 = [10 x i8] c"mtd_debug\00"
define void @showusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([186 x i8], [186 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [186 x i8] c"usage: %1$s info <device>\0A %1$s read <device> <offset> <len> <dest-filename>\0A %1$s write <device> <offset> <len> <source-filename>\0A %1$s erase <device> <offset> <len>\0A\00"
@.str.1 = [10 x i8] c"mtd_debug\00"
define void @showusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([186 x i8], [186 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main() {
  int A, B, C, D;
  scanf("%d %d %d %d", &A, &B, &C, &D);
  printf("DIFERENCA = %d", (A * B - C * D));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
mov    0x10(%rsp),%esi
imul   0x14(%rsp),%esi
mov    0x8(%rsp),%eax
imul   0xc(%rsp),%eax
sub    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [15 x i8] c"DIFERENCA = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = mul nsw i32 %10, %11
%13 = sub nsw i32 %9, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [15 x i8] c"DIFERENCA = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, %10
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, %13
%16 = sub nsw i32 %12, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void error_msg(char *s) { printf("Error: %s\n", s); }


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

x86 assembly (clang, -O2):
<error_msg>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error_msg(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_vtalrm(int sig) { printf("VTALRM\n"); }


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

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

LLVM IR (-O2):
@str = [7 x i8] c"VTALRM\00"
define void @catch_vtalrm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_read_multprec_Laurent_system(int deci) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(570, &deci, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<syscon_read_multprec_Laurent_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x23a,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @syscon_read_multprec_Laurent_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 570, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ env_tilde_setup();
int /*<<< orphan*/ line_tilde_setup();
int /*<<< orphan*/ sig_tilde_setup();
int /*<<< orphan*/ snapshot_tilde_setup();
int /*<<< orphan*/ threshold_tilde_setup();
int /*<<< orphan*/ vline_tilde_setup();
int /*<<< orphan*/ vsnapshot_tilde_setup();
void d_ctl_setup(void) {
  sig_tilde_setup();
  line_tilde_setup();
  vline_tilde_setup();
  snapshot_tilde_setup();
  vsnapshot_tilde_setup();
  env_tilde_setup();
  threshold_tilde_setup();
}


x86 assembly (clang, -O0):
<d_ctl_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sig_tilde_setup@plt>
mov    $0x0,%al
call   1040 <line_tilde_setup@plt>
mov    $0x0,%al
call   1050 <vline_tilde_setup@plt>
mov    $0x0,%al
call   1080 <snapshot_tilde_setup@plt>
mov    $0x0,%al
call   1060 <vsnapshot_tilde_setup@plt>
mov    $0x0,%al
call   1070 <env_tilde_setup@plt>
mov    $0x0,%al
call   1090 <threshold_tilde_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ctl_setup>:
push   %rax
xor    %eax,%eax
call   1030 <sig_tilde_setup@plt>
xor    %eax,%eax
call   1040 <line_tilde_setup@plt>
xor    %eax,%eax
call   1050 <vline_tilde_setup@plt>
xor    %eax,%eax
call   1080 <snapshot_tilde_setup@plt>
xor    %eax,%eax
call   1060 <vsnapshot_tilde_setup@plt>
xor    %eax,%eax
call   1070 <env_tilde_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <threshold_tilde_setup@plt>

LLVM IR (-O0):
define void @d_ctl_setup() {
%1 = call i32 (...) @sig_tilde_setup()
%2 = call i32 (...) @line_tilde_setup()
%3 = call i32 (...) @vline_tilde_setup()
%4 = call i32 (...) @snapshot_tilde_setup()
%5 = call i32 (...) @vsnapshot_tilde_setup()
%6 = call i32 (...) @env_tilde_setup()
%7 = call i32 (...) @threshold_tilde_setup()
ret void
}

LLVM IR (-O2):
define void @d_ctl_setup() {
%1 = tail call i32 (...) @sig_tilde_setup()
%2 = tail call i32 (...) @line_tilde_setup()
%3 = tail call i32 (...) @vline_tilde_setup()
%4 = tail call i32 (...) @snapshot_tilde_setup()
%5 = tail call i32 (...) @vsnapshot_tilde_setup()
%6 = tail call i32 (...) @env_tilde_setup()
%7 = tail call i32 (...) @threshold_tilde_setup()
ret void
}
int ioctl_readtoc_session(unsigned char *b, int msf, int maxlen) { return 0; }


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

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

LLVM IR (-O0):
define i32 @ioctl_readtoc_session(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @ioctl_readtoc_session(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ./a.out group_addr  group_port\n");
  exit(errno);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: ./a.out group_addr group_port\0A\00"
@errno = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@str = [38 x i8] c"Usage: ./a.out group_addr group_port\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) extern void abort() {
  printf("Proper Kernel PANIC comming soon! \n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <abort+0x10>

x86 assembly (clang, -O2):
<abort>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <abort+0x10>

LLVM IR (-O0):
@.str = [36 x i8] c"Proper Kernel PANIC comming soon! \0A\00"
define void @abort() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@str = [35 x i8] c"Proper Kernel PANIC comming soon! \00"
define void @abort() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ TIPC_CMD_SET_LINK_TOL;
int /*<<< orphan*/ set_linkset_value(char *, char *, int /*<<< orphan*/);
void set_linkset_tolerance(char *args) {
  set_linkset_value(args, "tolerance", TIPC_CMD_SET_LINK_TOL);
}


x86 assembly (clang, -O0):
<set_linkset_tolerance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
lea    0xed0(%rip),%rsi
call   1030 <set_linkset_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_linkset_tolerance>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
lea    0xee0(%rip),%rsi
jmp    1030 <set_linkset_value@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"tolerance\00"
@TIPC_CMD_SET_LINK_TOL = global i32 0
define void @set_linkset_tolerance(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @TIPC_CMD_SET_LINK_TOL
%5 = call i32 @set_linkset_value(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"tolerance\00"
@TIPC_CMD_SET_LINK_TOL = global i32 0
define void @set_linkset_tolerance(i8* %0) {
%2 = load i32, i32* @TIPC_CMD_SET_LINK_TOL
%3 = tail call i32 @set_linkset_value(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notimplemented(char *);
void __svgalib_driver16p_copybox(int x1, int y1, int w, int h, int x2, int y2) {
  {
    notimplemented("16-bit paged copybox");
    return;
  };
}


x86 assembly (clang, -O0):
<__svgalib_driver16p_copybox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <notimplemented@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"16-bit paged copybox\00"
define void @__svgalib_driver16p_copybox(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
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = call i32 @notimplemented(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"16-bit paged copybox\00"
define void @__svgalib_driver16p_copybox(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @notimplemented(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void endit(int sig) {
  (sig += 0);
  fatal("Okay, bye bye!\n");
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Okay, bye bye!\0A\00"
define void @endit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 0
store i32 %4, i32* %2
%5 = call i32 @fatal(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Okay, bye bye!\0A\00"
define void @endit(i32 %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ SOCK_DGRAM;
int cv_socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int socket_create_udp_client() {
  return cv_socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
}


x86 assembly (clang, -O0):
<socket_create_udp_client>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
call   1030 <cv_socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_create_udp_client>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
jmp    1030 <cv_socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
define i32 @socket_create_udp_client() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = load i32, i32* @IPPROTO_UDP
%4 = call i32 @cv_socket(i32 %1, i32 %2, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
define i32 @socket_create_udp_client() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = load i32, i32* @IPPROTO_UDP
%4 = tail call i32 @cv_socket(i32 %1, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xef() {
  Assert_real((ispunct(239) == 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",
              1200, ("ispunct should be 0 for 0xef"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xef>:
push   %rax
mov    $0xef,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4b0,%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 0xef\00"
define void @t_ispunct_0xef() {
%1 = call i64 @ispunct(i32 239)
%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 1200, 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 0xef\00"
define void @t_ispunct_0xef() {
%1 = tail call i64 @ispunct(i32 239)
%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 1200, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int f(int n, int x, int stride) {
  int a, x1, x2, x3;
  a = x * stride;
  if (n > 64) {
    x1 = x - 1;
    a += x1 * stride;
    x2 = x1 - 1;
    a += x2 * stride;
  } else {
    x3 = x - 1;
    a += x3 * stride;
  }
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x40,-0x4(%rbp)
jle    1152 <f+0x52>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1168 <f+0x68>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %esi,%eax
mov    %edx,%ecx
imul   %esi,%ecx
cmp    $0x41,%edi
jl     111a <f+0x1a>
lea    (%rax,%rax,1),%esi
add    $0xfffffffd,%esi
imul   %edx,%esi
mov    %ecx,%eax
add    %esi,%eax
ret
add    $0xffffffff,%eax
imul   %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %7
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 64
br i1 %15, label %16, label %31
16: ; preds = %3
%17 = load i32, i32* %5
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = load i32, i32* %6
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %7
%23 = add nsw i32 %22, %21
store i32 %23, i32* %7
%24 = load i32, i32* %8
%25 = sub nsw i32 %24, 1
store i32 %25, i32* %9
%26 = load i32, i32* %9
%27 = load i32, i32* %6
%28 = mul nsw i32 %26, %27
%29 = load i32, i32* %7
%30 = add nsw i32 %29, %28
store i32 %30, i32* %7
br label %39
31: ; preds = %3
%32 = load i32, i32* %5
%33 = sub nsw i32 %32, 1
store i32 %33, i32* %10
%34 = load i32, i32* %10
%35 = load i32, i32* %6
%36 = mul nsw i32 %34, %35
%37 = load i32, i32* %7
%38 = add nsw i32 %37, %36
store i32 %38, i32* %7
br label %39
39: ; preds = %31, %16
%40 = load i32, i32* %7
ret i32 %40
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = icmp sgt i32 %0, 64
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = shl i32 %1, 1
%8 = add i32 %7, -3
%9 = mul i32 %8, %2
br label %13
10: ; preds = %3
%11 = add nsw i32 %1, -1
%12 = mul nsw i32 %11, %2
br label %13
13: ; preds = %10, %6
%14 = phi i32 [ %12, %10 ], [ %4, %6 ]
%15 = phi i32 [ %4, %10 ], [ %9, %6 ]
%16 = add i32 %15, %14
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srli_epi64(int /*<<< orphan*/, int);
__m128i test_mm_srli_epi64_2(__m128i A, int B) { return _mm_srli_epi64(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_srli_epi64_2>:
jmp    1030 <_mm_srli_epi64@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srli_epi64_2(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_srli_epi64(i32 %0, i32 %1)
ret i32 %3
}
void set(unsigned char *bm, int ndx) { bm[ndx >> 3] |= (1 << (ndx & 0x07)); }


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x3,%esi
movslq %esi,%rcx
or     %al,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @set(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 7
%7 = shl i32 1, %6
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = ashr i32 %9, 3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %14, %7
%16 = trunc i32 %15 to i8
store i8 %16, i8* %12
ret void
}

LLVM IR (-O2):
define void @set(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = ashr i32 %1, 3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %7
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1;
  ++a;
}


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

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
long ia64_getf(double);
int pfm_ia64_fls(unsigned long x) {
  double d = x;
  long exp;
  exp = ia64_getf(d);
  return exp - 0xffff;
}


x86 assembly (clang, -O0):
<pfm_ia64_fls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xedd(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xedc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <ia64_getf@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    $0xffff,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfm_ia64_fls>:
push   %rax
movq   %rdi,%xmm1
punpckldq 0xee2(%rip),%xmm1
subpd  0xeea(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
call   1030 <ia64_getf@plt>
add    $0xffff0001,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pfm_ia64_fls(i64 %0) {
%2 = alloca i64
%3 = alloca double
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = uitofp i64 %5 to double
store double %6, double* %3
%7 = load double, double* %3
%8 = call i64 @ia64_getf(double %7)
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = sub nsw i64 %9, 65535
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @pfm_ia64_fls(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = tail call i64 @ia64_getf(double %2)
%4 = trunc i64 %3 to i32
%5 = add i32 %4, -65535
ret i32 %5
}
/* Type definitions */
struct robot {
  int dummy;
};

/* Variables and functions */
int speed(struct robot *);
int cmd_speed(struct robot *robot, int *args) { return speed(robot); }


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

x86 assembly (clang, -O2):
<cmd_speed>:
jmp    1030 <speed@plt>

LLVM IR (-O0):
%struct.robot = type { i32 }
define i32 @cmd_speed(%struct.robot* %0, i32* %1) {
%3 = alloca %struct.robot*
%4 = alloca i32*
store %struct.robot* %0, %struct.robot** %3
store i32* %1, i32** %4
%5 = load %struct.robot*, %struct.robot** %3
%6 = call i32 @speed(%struct.robot* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.robot = type { i32 }
define i32 @cmd_speed(%struct.robot* %0, i32* nocapture readnone %1) {
%3 = tail call i32 @speed(%struct.robot* %0)
ret i32 %3
}
int compare_int(const void *a, const void *b) {
  int *a_i = (int *)a;
  int *b_i = (int *)b;
  return *a_i - *b_i;
}


x86 assembly (clang, -O0):
<compare_int>:
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):
<compare_int>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_int(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 @compare_int(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
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
void ParentProcess() {
  int i;
  pid_t pid;
  pid = getpid();
  for (i = 1; i <= 200; i++)
    printf("This line is from parent, value = %d, pid = %d\n", i, pid);
  printf("***Parent is done***\n");
}


x86 assembly (clang, -O0):
<ParentProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0xc8,-0x4(%rbp)
jg     1168 <ParentProcess+0x48>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <ParentProcess+0x19>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParentProcess>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %eax,%ebx
mov    $0x1,%ebp
lea    0xeb7(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    $0xc9,%ebp
jne    1150 <ParentProcess+0x20>
lea    0xec0(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"This line is from parent, value = %d, pid = %d\0A\00"
@.str.1 = [22 x i8] c"***Parent is done***\0A\00"
define void @ParentProcess() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getpid()
store i32 %3, i32* %2
store i32 1, i32* %1
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 200
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %4
14: ; preds = %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"This line is from parent, value = %d, pid = %d\0A\00"
@str = [21 x i8] c"***Parent is done***\00"
define void @ParentProcess() {
%1 = tail call i32 (...) @getpid()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %1)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 201
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct mldl_cfg {
  int dummy;
};

/* Variables and functions */
int mpu3050_set_i2c_bypass(struct mldl_cfg *, void *, unsigned char);
int mpu_set_i2c_bypass(struct mldl_cfg *mldl_cfg, void *mlsl_handle,
                       unsigned char enable) {
  return mpu3050_set_i2c_bypass(mldl_cfg, mlsl_handle, enable);
}


x86 assembly (clang, -O0):
<mpu_set_i2c_bypass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movzbl -0x11(%rbp),%edx
call   1030 <mpu3050_set_i2c_bypass@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpu_set_i2c_bypass>:
jmp    1030 <mpu3050_set_i2c_bypass@plt>

LLVM IR (-O0):
%struct.mldl_cfg = type { i32 }
define i32 @mpu_set_i2c_bypass(%struct.mldl_cfg* %0, i8* %1, i8 zeroext %2) {
%4 = alloca %struct.mldl_cfg*
%5 = alloca i8*
%6 = alloca i8
store %struct.mldl_cfg* %0, %struct.mldl_cfg** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load %struct.mldl_cfg*, %struct.mldl_cfg** %4
%8 = load i8*, i8** %5
%9 = load i8, i8* %6
%10 = call i32 @mpu3050_set_i2c_bypass(%struct.mldl_cfg* %7, i8* %8, i8 zeroext %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.mldl_cfg = type { i32 }
define i32 @mpu_set_i2c_bypass(%struct.mldl_cfg* %0, i8* %1, i8 zeroext %2) {
%4 = tail call i32 @mpu3050_set_i2c_bypass(%struct.mldl_cfg* %0, i8* %1, i8 zeroext %2)
ret i32 %4
}
/* Type definitions */
struct bp_hdr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_response(int, int /*<<< orphan*/);
int /*<<< orphan*/ wdog_start(int);
void handle_reboot(struct bp_hdr *hdr) {
  wdog_start(0x186a);
  send_response(0x0a4b4341, 0);
}


x86 assembly (clang, -O0):
<handle_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x186a,%edi
call   1030 <wdog_start@plt>
mov    $0xa4b4341,%edi
xor    %esi,%esi
call   1040 <send_response@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_reboot>:
push   %rax
mov    $0x186a,%edi
call   1030 <wdog_start@plt>
mov    $0xa4b4341,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <send_response@plt>

LLVM IR (-O0):
%struct.bp_hdr = type { i32 }
define void @handle_reboot(%struct.bp_hdr* %0) {
%2 = alloca %struct.bp_hdr*
store %struct.bp_hdr* %0, %struct.bp_hdr** %2
%3 = call i32 @wdog_start(i32 6250)
%4 = call i32 @send_response(i32 172704577, i32 0)
ret void
}

LLVM IR (-O2):
%struct.bp_hdr = type { i32 }
define void @handle_reboot(%struct.bp_hdr* nocapture readnone %0) {
%2 = tail call i32 @wdog_start(i32 6250)
%3 = tail call i32 @send_response(i32 172704577, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void mutex_lock(void *mutex) { pthread_mutex_lock((pthread_mutex_t *)mutex); }


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

x86 assembly (clang, -O2):
<mutex_lock>:
jmp    1030 <pthread_mutex_lock@plt>

LLVM IR (-O0):
define void @mutex_lock(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @pthread_mutex_lock(i32* %4)
ret void
}

LLVM IR (-O2):
define void @mutex_lock(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_mutex_lock(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x1f() {
  Assert_real((isupper(31) == 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_isupper.c",
              160, ("isupper should be 0 for 0x1f"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x1f>:
push   %rax
mov    $0x1f,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xa0,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x1f\00"
define void @t_isupper_0x1f() {
%1 = call i64 @isupper(i32 31)
%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 160, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x1f\00"
define void @t_isupper_0x1f() {
%1 = tail call i64 @isupper(i32 31)
%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 160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float cos_52s(float x) {
  const float c1 = 0.9999932946;
  const float c2 = -0.4999124376;
  const float c3 = 0.0414877472;
  const float c4 = -0.0012712095;
  float x2;
  x2 = x * x;
  return (c1 + x2 * (c2 + x2 * (c3 + c4 * x2)));
}


x86 assembly (clang, -O0):
<cos_52s>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee6(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movss  0xea5(%rip),%xmm3
mulss  %xmm3,%xmm2
movss  0xe9d(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movss  0xe85(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xe71(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_52s>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xeec(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xee4(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  0xedc(%rip),%xmm0
ret

LLVM IR (-O0):
define float @cos_52s(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %2
store float 0x3FEFFFF200000000, float* %3
store float 0xBFDFFE90C0000000, float* %4
store float 0x3FA53DE1C0000000, float* %5
store float 0xBF54D3D6C0000000, float* %6
%8 = load float, float* %2
%9 = load float, float* %2
%10 = fmul float %8, %9
store float %10, float* %7
%11 = load float, float* %7
%12 = load float, float* %7
%13 = load float, float* %7
%14 = call float @llvm.fmuladd.f32(float 0xBF54D3D6C0000000, float %13, float 0x3FA53DE1C0000000)
%15 = call float @llvm.fmuladd.f32(float %12, float %14, float 0xBFDFFE90C0000000)
%16 = call float @llvm.fmuladd.f32(float %11, float %15, float 0x3FEFFFF200000000)
ret float %16
}

LLVM IR (-O2):
define float @cos_52s(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @llvm.fmuladd.f32(float %2, float 0xBF54D3D6C0000000, float 0x3FA53DE1C0000000)
%4 = tail call float @llvm.fmuladd.f32(float %2, float %3, float 0xBFDFFE90C0000000)
%5 = tail call float @llvm.fmuladd.f32(float %2, float %4, float 0x3FEFFFF200000000)
ret float %5
}
void yy_2_ExternalLinkChoice(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_2_ExternalLinkChoice(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @yy_2_ExternalLinkChoice(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void USB_EndPoint14(uint32_t event) {}


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

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

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

LLVM IR (-O2):
define void @USB_EndPoint14(i32 %0) {
ret void
}
void f2(void) {
  int i, j;
#pragma omp ordered
  {
#pragma omp for
    for (j = 0; j < 3; j++)
      ;
#pragma omp sections
    {
      ;
#pragma omp section
      ;
    }
#pragma omp single
    ;
#pragma omp master
    ;
#pragma omp barrier
  }
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1128 <f2+0x28>
jmp    111a <f2+0x1a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110b <f2+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f2() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 3
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @f2() {
ret void
}
/* Variables and functions */
int getpid();
int r_sys_getpid() { return getpid(); }


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

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

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

LLVM IR (-O2):
define i32 @r_sys_getpid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
long long dusec_now();
long long dmsec_now(void) { return dusec_now() / 1000LL; }


x86 assembly (clang, -O0):
<dmsec_now>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dusec_now@plt>
mov    $0x3e8,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmsec_now>:
push   %rax
xor    %eax,%eax
call   1030 <dusec_now@plt>
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @dmsec_now() {
%1 = call i64 (...) @dusec_now()
%2 = sdiv i64 %1, 1000
ret i64 %2
}

LLVM IR (-O2):
define i64 @dmsec_now() {
%1 = tail call i64 (...) @dusec_now()
%2 = sdiv i64 %1, 1000
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm *dnk_date_time() {
  time_t t;
  t = time(NULL);
  return localtime(&t);
}


x86 assembly (clang, -O0):
<dnk_date_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnk_date_time>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @dnk_date_time() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %3
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @dnk_date_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %4
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ e_ident;
};
typedef TYPE_1__ Elf32_Ehdr;

/* Variables and functions */
int /*<<< orphan*/ ELFMAG;
int /*<<< orphan*/ SELFMAG;
scalar_t__ memcmp(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
bool is_elf(Elf32_Ehdr *ehdr) {
  return ehdr && memcmp(ehdr->e_ident, ELFMAG, SELFMAG) == 0;
}


x86 assembly (clang, -O0):
<is_elf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1153 <is_elf+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_elf>:
test   %rdi,%rdi
je     113f <is_elf+0x2f>
push   %rax
mov    (%rdi),%edi
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@ELFMAG = global i32 0
@SELFMAG = global i32 0
define i32 @is_elf(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = icmp ne %struct.TYPE_3__* %3, null
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @ELFMAG
%10 = load i32, i32* @SELFMAG
%11 = call i64 @memcmp(i32 %8, i32 %9, i32 %10)
%12 = icmp eq i64 %11, 0
br label %13
13: ; preds = %5, %1
%14 = phi i1 [ false, %1 ], [ %12, %5 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@ELFMAG = global i32 0
@SELFMAG = global i32 0
define i32 @is_elf(%struct.TYPE_3__* %0) {
%2 = icmp eq %struct.TYPE_3__* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @ELFMAG
%7 = load i32, i32* @SELFMAG
%8 = tail call i64 @memcmp(i32 %5, i32 %6, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x93() {
  Assert_real((isxdigit(147) == 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_isxdigit.c",
              740, ("isxdigit should be 0 for 0x93"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x93>:
push   %rax
mov    $0x93,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2e4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x93\00"
define void @t_isxdigit_0x93() {
%1 = call i64 @isxdigit(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x93\00"
define void @t_isxdigit_0x93() {
%1 = tail call i64 @isxdigit(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}