xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pthread_once_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_once(int /*<<< orphan*/ *, void (*)());
void call_once(pthread_once_t *flag, void (*func)(void)) {
  pthread_once(flag, func);
}


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

x86 assembly (clang, -O2):
<call_once>:
jmp    1030 <pthread_once@plt>

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

LLVM IR (-O2):
define void @call_once(i32* %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @pthread_once(i32* %0, void (...)* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vec4d_normalize(double *);
void quatd_normalize(double v[4]) { vec4d_normalize(v); }


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

x86 assembly (clang, -O2):
<quatd_normalize>:
jmp    1030 <vec4d_normalize@plt>

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

LLVM IR (-O2):
define void @quatd_normalize(double* %0) {
%2 = tail call i32 @vec4d_normalize(double* %0)
ret void
}
/* Variables and functions */
unsigned short jsV_numbertoint32(double);
unsigned short jsV_numbertouint16(double n) { return jsV_numbertoint32(n); }


x86 assembly (clang, -O0):
<jsV_numbertouint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <jsV_numbertoint32@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsV_numbertouint16>:
jmp    1030 <jsV_numbertoint32@plt>

LLVM IR (-O0):
define zeroext i16 @jsV_numbertouint16(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call zeroext i16 @jsV_numbertoint32(double %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @jsV_numbertouint16(double %0) {
%2 = tail call zeroext i16 @jsV_numbertoint32(double %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_error_unknown_sentence() { printf("Error: unrecognized sentence.\n"); }


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

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

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

LLVM IR (-O2):
@str = [30 x i8] c"Error: unrecognized sentence.\00"
define void @msg_error_unknown_sentence() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cdll_push(void *, void *);
void cdll_copy_handler(void *data, void *new_list) {
  cdll_push(new_list, data);
}


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

x86 assembly (clang, -O2):
<cdll_copy_handler>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <cdll_push@plt>

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

LLVM IR (-O2):
define void @cdll_copy_handler(i8* %0, i8* %1) {
%3 = tail call i32 @cdll_push(i8* %1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xf0() {
  Assert_real((isdigit(240) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              1205, ("isdigit should be 0 for 0xf0"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xf0\00"
define void @t_isdigit_0xf0() {
%1 = tail call i64 @isdigit(i32 240)
%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 1205, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgc_strlen(char *);
int /*<<< orphan*/ write_bytes(char *, int /*<<< orphan*/);
void write_string(char *buf) { write_bytes(buf, cgc_strlen(buf)); }


x86 assembly (clang, -O0):
<write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cgc_strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <write_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <cgc_strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <write_bytes@plt>

LLVM IR (-O0):
define void @write_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @cgc_strlen(i8* %4)
%6 = call i32 @write_bytes(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @write_string(i8* %0) {
%2 = tail call i32 @cgc_strlen(i8* %0)
%3 = tail call i32 @write_bytes(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_BACK;
int /*<<< orphan*/ GL_CULL_FACE;
int /*<<< orphan*/ GL_ONE;
int /*<<< orphan*/ GL_SRC_ALPHA_SATURATE;
int /*<<< orphan*/ glBlendFunc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glCullFace(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void init(void) {
  glCullFace(GL_BACK);
  glEnable(GL_CULL_FACE);
  glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE);
  glClearColor(0.0, 0.0, 0.0, 0.0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1060 <glCullFace@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
mov    0x2e68(%rip),%rax
mov    (%rax),%esi
call   1030 <glBlendFunc@plt>
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1060 <glCullFace@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    0x2e6b(%rip),%rax
mov    (%rax),%esi
call   1030 <glBlendFunc@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
pop    %rax
jmp    1050 <glClearColor@plt>

LLVM IR (-O0):
@GL_BACK = global i32 0
@GL_CULL_FACE = global i32 0
@GL_SRC_ALPHA_SATURATE = global i32 0
@GL_ONE = global i32 0
define void @init() {
%1 = load i32, i32* @GL_BACK
%2 = call i32 @glCullFace(i32 %1)
%3 = load i32, i32* @GL_CULL_FACE
%4 = call i32 @glEnable(i32 %3)
%5 = load i32, i32* @GL_SRC_ALPHA_SATURATE
%6 = load i32, i32* @GL_ONE
%7 = call i32 @glBlendFunc(i32 %5, i32 %6)
%8 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_BACK = global i32 0
@GL_CULL_FACE = global i32 0
@GL_SRC_ALPHA_SATURATE = global i32 0
@GL_ONE = global i32 0
define void @init() {
%1 = load i32, i32* @GL_BACK
%2 = tail call i32 @glCullFace(i32 %1)
%3 = load i32, i32* @GL_CULL_FACE
%4 = tail call i32 @glEnable(i32 %3)
%5 = load i32, i32* @GL_SRC_ALPHA_SATURATE
%6 = load i32, i32* @GL_ONE
%7 = tail call i32 @glBlendFunc(i32 %5, i32 %6)
%8 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}
int RIGHT(int i) { return 2 * (i + 1); }


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

x86 assembly (clang, -O2):
<RIGHT>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @RIGHT(i32 %0) {
%2 = shl i32 %0, 1
%3 = add i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ euclideEtendu(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%d %d\n", &a, &b);
  euclideEtendu(a, b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <euclideEtendu@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @euclideEtendu(i32 %6, i32 %7)
ret i32 0
}
void foo(const char *c, ...) {
  char buf[256];
  buf[256 - 1] = '\0';
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x11(%rbp)
add    $0x90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 255
store i8 0, i8* %4
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int print_bus_wait(char *, char *);
int /*<<< orphan*/ strconcat(char *, char const *, char const *, int);
int print_bus_wait_(const char *func, const char *wait, const char *access) {
  char wait_name[(100)];
  char access_name[(100)];
  strconcat(wait_name, func, wait, (100));
  strconcat(access_name, func, access, (100));
  return print_bus_wait(wait_name, access_name);
}


x86 assembly (clang, -O0):
<print_bus_wait_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x64,%ecx
call   1040 <strconcat@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x64,%ecx
call   1040 <strconcat@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1030 <print_bus_wait@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bus_wait_>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rdx,%r14
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0x70(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x64,%ecx
call   1040 <strconcat@plt>
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x64,%ecx
call   1040 <strconcat@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <print_bus_wait@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @print_bus_wait_(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [100 x i8]
%8 = alloca [100 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i32 @strconcat(i8* %9, i8* %10, i8* %11, i32 100)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%14 = load i8*, i8** %4
%15 = load i8*, i8** %6
%16 = call i32 @strconcat(i8* %13, i8* %14, i8* %15, i32 100)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%19 = call i32 @print_bus_wait(i8* %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @print_bus_wait_(i8* %0, i8* %1, i8* %2) {
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%8 = call i32 @strconcat(i8* %6, i8* %0, i8* %1, i32 100)
%9 = call i32 @strconcat(i8* %7, i8* %0, i8* %2, i32 100)
%10 = call i32 @print_bus_wait(i8* %6, i8* %7)
ret i32 %10
}
/* Variables and functions */
int strlen(char *);
long hash(char *word) {
  long number = 42;
  int i;
  for (i = 0; i <= strlen(word) - 1; i++) {
    number += (i + 1) * word[i];
  }
  return number;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x2a,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1177 <hash+0x67>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
imul   %ecx,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <hash+0x1b>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    $0x2a,%r15d
test   %eax,%eax
jle    1150 <hash+0x40>
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%eax
add    $0x1,%rbx
imul   %ebx,%eax
cltq
add    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <hash+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @hash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %18
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i64 [ %14, %4 ], [ 42, %1 ]
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i64
%11 = mul i64 %7, %10
%12 = shl i64 %11, 32
%13 = ashr exact i64 %12, 32
%14 = add nsw i64 %6, %13
%15 = tail call i32 @strlen(i8* %0)
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %7, %16
br i1 %17, label %4, label %18
18: ; preds = %4, %1
%19 = phi i64 [ 42, %1 ], [ %14, %4 ]
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ luaL_check_string(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
int /*<<< orphan*/ system(int /*<<< orphan*/);
void io_execute(void) { lua_pushnumber(system(luaL_check_string(1))); }


x86 assembly (clang, -O0):
<io_execute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <luaL_check_string@plt>
mov    %eax,%edi
call   1030 <system@plt>
mov    %eax,%edi
call   1050 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_execute>:
push   %rax
mov    $0x1,%edi
call   1040 <luaL_check_string@plt>
mov    %eax,%edi
call   1030 <system@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @io_execute() {
%1 = call i32 @luaL_check_string(i32 1)
%2 = call i32 @system(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @io_execute() {
%1 = tail call i32 @luaL_check_string(i32 1)
%2 = tail call i32 @system(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
int Queue_insert(int);
int /*<<< orphan*/ printf(char *, char *, int);
int rand();
int /*<<< orphan*/ sleep(int);
void *Producer(void *arg) {
  int i, r;
  for (;;) {
    r = rand() % 10000;
    i = Queue_insert(r);
    if (i == -1)
      sleep(1);
    else
      printf("%s: INSERT %d into BUFFER\n", (char *)arg, r);
  }
}


x86 assembly (clang, -O0):
<Producer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <Queue_insert@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1182 <Producer+0x42>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1195 <Producer+0x55>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
jmp    114c <Producer+0xc>

x86 assembly (clang, -O2):
<Producer>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xeb1(%rip),%r14
jmp    116d <Producer+0x2d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rbx
imul   $0x68db8bad,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rax
add    %ecx,%eax
imul   $0x2710,%eax,%eax
sub    %eax,%ebx
mov    %ebx,%edi
call   1040 <Queue_insert@plt>
cmp    $0xffffffff,%eax
jne    1160 <Producer+0x20>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    116d <Producer+0x2d>

LLVM IR (-O0):
@.str = [27 x i8] c"%s: INSERT %d into BUFFER\0A\00"
define i8* @Producer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
br label %5
5: ; preds = %18, %1
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 10000
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @Queue_insert(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %5
%13 = call i32 @sleep(i32 1)
br label %18
14: ; preds = %5
%15 = load i8*, i8** %2
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16)
br label %18
18: ; preds = %14, %12
br label %5
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s: INSERT %d into BUFFER\0A\00"
define noalias i8* @Producer(i8* %0) {
br label %2
2: ; preds = %11, %1
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 10000
%5 = tail call i32 @Queue_insert(i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @sleep(i32 1)
br label %11
9: ; preds = %2
%10 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
br label %11
11: ; preds = %9, %7
br label %2
}
void ZgcRun() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_madd_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_madd_pi16(__m64 a, __m64 b) { return _mm_madd_pi16(a, b); }


x86 assembly (clang, -O0):
<test_mm_madd_pi16>:
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_madd_pi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_madd_pi16>:
jmp    1030 <_mm_madd_pi16@plt>

LLVM IR (-O0):
define i32 @test_mm_madd_pi16(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_madd_pi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_madd_pi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_madd_pi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xf3() {
  Assert_real((isupper(243) == 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",
              1220, ("isupper should be 0 for 0xf3"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xf3>:
push   %rax
mov    $0xf3,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4c4,%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 0xf3\00"
define void @t_isupper_0xf3() {
%1 = call i64 @isupper(i32 243)
%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 1220, 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 0xf3\00"
define void @t_isupper_0xf3() {
%1 = tail call i64 @isupper(i32 243)
%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 1220, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void TSIL_PrintVersion(void) {
  printf("(* TSIL Version: %s *)\n", "1.3");
  return;
}


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

x86 assembly (clang, -O2):
<TSIL_PrintVersion>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"(* TSIL Version: %s *)\0A\00"
@.str.1 = [4 x i8] c"1.3\00"
define void @TSIL_PrintVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"(* TSIL Version: %s *)\0A\00"
@.str.1 = [4 x i8] c"1.3\00"
define void @TSIL_PrintVersion() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int inv_J(int **);
int foo() {
  int mat[2][2];
  mat[0][0] = 1;
  mat[0][1] = 2;
  mat[1][0] = 4;
  mat[1][1] = 8;
  return inv_J(mat);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x8,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <inv_J@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <inv_J@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca [2 x [2 x i32]]
%2 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 0
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32 1, i32* %3
%4 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 0
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 2, i32* %5
%6 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 1
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 4, i32* %7
%8 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 1
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
store i32 8, i32* %9
%10 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 0
%11 = bitcast [2 x i32]* %10 to i32**
%12 = call i32 @inv_J(i32** %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @foo() {
%1 = alloca <4 x i32>
%2 = bitcast <4 x i32>* %1 to i8*
store <4 x i32> <i32 1, i32 2, i32 4, i32 8>, <4 x i32>* %1
%3 = bitcast <4 x i32>* %1 to i32**
%4 = call i32 @inv_J(i32** %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ intro();
scalar_t__ playagain();
int /*<<< orphan*/ playhand();
int /*<<< orphan*/ printf(char *);
int main() {
  intro();
  do
    playhand();
  while (playagain());
  printf("\nThanks for playing!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <intro@plt>
mov    $0x0,%al
call   1050 <playhand@plt>
mov    $0x0,%al
call   1060 <playagain@plt>
cmp    $0x0,%rax
jne    1166 <main+0x16>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <intro@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <playhand@plt>
xor    %eax,%eax
call   1060 <playagain@plt>
test   %rax,%rax
jne    1160 <main+0x10>
lea    0xe86(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\0AThanks for playing!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @intro()
br label %3
3: ; preds = %5, %0
%4 = call i32 (...) @playhand()
br label %5
5: ; preds = %3
%6 = call i64 (...) @playagain()
%7 = icmp ne i64 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"\0AThanks for playing!\00"
define i32 @main() {
%1 = tail call i32 (...) @intro()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @playhand()
%4 = tail call i64 (...) @playagain()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ compile(char *, char *, char *, char);
int /*<<< orphan*/ edit_reg(char *, char *);
void RE_compile(char *expr, char *exprbuf) {
  char buf[500];
  edit_reg(expr, buf);
  compile(buf, exprbuf, &exprbuf[500], '\0');
}


x86 assembly (clang, -O0):
<RE_compile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1040 <edit_reg@plt>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x1f4,%rdx
xor    %ecx,%ecx
call   1030 <compile@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RE_compile>:
push   %r14
push   %rbx
sub    $0x1f8,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
call   1040 <edit_reg@plt>
lea    0x1f4(%rbx),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %ecx,%ecx
call   1030 <compile@plt>
add    $0x1f8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @RE_compile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [500 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 0
%8 = call i32 @edit_reg(i8* %6, i8* %7)
%9 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 500
%13 = call i32 @compile(i8* %9, i8* %10, i8* %12, i8 signext 0)
ret void
}

LLVM IR (-O2):
define void @RE_compile(i8* %0, i8* %1) {
%3 = alloca [500 x i8]
%4 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%5 = call i32 @edit_reg(i8* %0, i8* %4)
%6 = getelementptr inbounds i8, i8* %1, i64 500
%7 = call i32 @compile(i8* %4, i8* %1, i8* %6, i8 signext 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ui_init_bcm91125ccmds();
int /*<<< orphan*/ ui_init_corecmds();
int /*<<< orphan*/ ui_init_memtestcmds();
int /*<<< orphan*/ ui_init_resetcmds();
int /*<<< orphan*/ ui_init_soccmds();
int /*<<< orphan*/ ui_init_tempsensorcmds();
int /*<<< orphan*/ ui_init_testcmds();
int /*<<< orphan*/ ui_init_toyclockcmds();
void board_final_init(void) {
  ui_init_bcm91125ccmds();
  ui_init_corecmds();
  ui_init_soccmds();
  ui_init_testcmds();
  ui_init_toyclockcmds();
  ui_init_tempsensorcmds();
  ui_init_memtestcmds();
  ui_init_resetcmds();
}


x86 assembly (clang, -O0):
<board_final_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ui_init_bcm91125ccmds@plt>
mov    $0x0,%al
call   1040 <ui_init_corecmds@plt>
mov    $0x0,%al
call   1080 <ui_init_soccmds@plt>
mov    $0x0,%al
call   1060 <ui_init_testcmds@plt>
mov    $0x0,%al
call   1090 <ui_init_toyclockcmds@plt>
mov    $0x0,%al
call   1030 <ui_init_tempsensorcmds@plt>
mov    $0x0,%al
call   1070 <ui_init_memtestcmds@plt>
mov    $0x0,%al
call   10a0 <ui_init_resetcmds@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_final_init>:
push   %rax
xor    %eax,%eax
call   1050 <ui_init_bcm91125ccmds@plt>
xor    %eax,%eax
call   1040 <ui_init_corecmds@plt>
xor    %eax,%eax
call   1080 <ui_init_soccmds@plt>
xor    %eax,%eax
call   1060 <ui_init_testcmds@plt>
xor    %eax,%eax
call   1090 <ui_init_toyclockcmds@plt>
xor    %eax,%eax
call   1030 <ui_init_tempsensorcmds@plt>
xor    %eax,%eax
call   1070 <ui_init_memtestcmds@plt>
xor    %eax,%eax
pop    %rcx
jmp    10a0 <ui_init_resetcmds@plt>

LLVM IR (-O0):
define void @board_final_init() {
%1 = call i32 (...) @ui_init_bcm91125ccmds()
%2 = call i32 (...) @ui_init_corecmds()
%3 = call i32 (...) @ui_init_soccmds()
%4 = call i32 (...) @ui_init_testcmds()
%5 = call i32 (...) @ui_init_toyclockcmds()
%6 = call i32 (...) @ui_init_tempsensorcmds()
%7 = call i32 (...) @ui_init_memtestcmds()
%8 = call i32 (...) @ui_init_resetcmds()
ret void
}

LLVM IR (-O2):
define void @board_final_init() {
%1 = tail call i32 (...) @ui_init_bcm91125ccmds()
%2 = tail call i32 (...) @ui_init_corecmds()
%3 = tail call i32 (...) @ui_init_soccmds()
%4 = tail call i32 (...) @ui_init_testcmds()
%5 = tail call i32 (...) @ui_init_toyclockcmds()
%6 = tail call i32 (...) @ui_init_tempsensorcmds()
%7 = tail call i32 (...) @ui_init_memtestcmds()
%8 = tail call i32 (...) @ui_init_resetcmds()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serialCommand(char *, int /*<<< orphan*/);
void hr20SetModeManu() { serialCommand("\rM00\r", 0); }


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

x86 assembly (clang, -O2):
<hr20SetModeManu>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <serialCommand@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\0DM00\0D\00"
define void @hr20SetModeManu() {
%1 = tail call i32 @serialCommand(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
float ocad_color_scale_rgbf(int);
int ocad_color_scale_rgb(int value) {
  float v = ocad_color_scale_rgbf(value);
  return (int)(255 * v + 0.5);
}


x86 assembly (clang, -O0):
<ocad_color_scale_rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ocad_color_scale_rgbf@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xed8(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ocad_color_scale_rgb>:
push   %rax
call   1030 <ocad_color_scale_rgbf@plt>
mulss  0xee2(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xede(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ocad_color_scale_rgb(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call float @ocad_color_scale_rgbf(i32 %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = fmul float 2.550000e+02, %6
%8 = fpext float %7 to double
%9 = fadd double %8, 5.000000e-01
%10 = fptosi double %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ocad_color_scale_rgb(i32 %0) {
%2 = tail call float @ocad_color_scale_rgbf(i32 %0)
%3 = fmul float %2, 2.550000e+02
%4 = fpext float %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
void get_name(char *s, int l) {
  const char name[] = "Guido";
  strncpy(s, name, l);
}


x86 assembly (clang, -O0):
<get_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x12(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_name>:
push   %rax
mov    %esi,%edx
movw   $0x6f,0x4(%rsp)
movl   $0x64697547,(%rsp)
mov    %rsp,%rsi
call   1030 <strncpy@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.get_name.name = [6 x i8] c"Guido\00"
define void @get_name(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [6 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [6 x i8]* %5 to i8*
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @strncpy(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@__const.get_name.name = [6 x i8] c"Guido\00"
define void @get_name(i8* %0, i32 %1) {
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%5 = call i32 @strncpy(i8* %0, i8* %4, i32 %1)
ret void
}
void XSyncIntToValue() {}


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

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

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

LLVM IR (-O2):
define void @XSyncIntToValue() {
ret void
}
int BitGetSum(const unsigned *bit_array, int i) {
  int sum;
  sum = 0;
  while (i > 0) {
    sum += bit_array[i];
    i -= i & -i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<BitGetSum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1144 <BitGetSum+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
sub    -0xc(%rbp),%eax
and    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1112 <BitGetSum+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BitGetSum>:
xor    %eax,%eax
test   %esi,%esi
jle    111e <BitGetSum+0x1e>
cs nopw 0x0(%rax,%rax,1)
mov    %esi,%ecx
add    (%rdi,%rcx,4),%eax
lea    -0x1(%rsi),%ecx
and    %esi,%ecx
mov    %ecx,%esi
jne    1110 <BitGetSum+0x10>
ret

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

LLVM IR (-O2):
define i32 @BitGetSum(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = add i32 %9, %5
%11 = add nsw i32 %6, -1
%12 = and i32 %11, %6
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ outop2str(char *);
void outpshs() { outop2str("PSHS"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"PSHS\00"
define void @outpshs() {
%1 = call i32 @outop2str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"PSHS\00"
define void @outpshs() {
%1 = tail call i32 @outop2str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  printf("Please input 3 numbers:\n");
  scanf("%*d %*d %d", &n);
  printf("The last number is: %d\n", n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Please input 3 numbers:\0A\00"
@.str.1 = [11 x i8] c"%*d %*d %d\00"
@.str.2 = [24 x i8] c"The last number is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"%*d %*d %d\00"
@.str.2 = [24 x i8] c"The last number is: %d\0A\00"
@str = [24 x i8] c"Please input 3 numbers:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
char _getCC_();
int /*<<< orphan*/ _sim_();
char OS_DI(void) {
  char temp;
  temp = _getCC_();
  _sim_();
  return temp;
}


x86 assembly (clang, -O0):
<OS_DI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <_getCC_@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <_sim_@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_DI>:
push   %rbx
xor    %eax,%eax
call   1040 <_getCC_@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <_sim_@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @OS_DI() {
%1 = tail call signext i8 (...) @_getCC_()
%2 = tail call i32 (...) @_sim_()
ret i8 %1
}
/* Variables and functions */
char *strncat(char *, char *, int);
char *xstrncat(char *des, char *str, int size) {
  char *result;
  result = strncat(des, str, size - 1);
  des[size - 1] = 0;
  return result;
}


x86 assembly (clang, -O0):
<xstrncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncat@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrncat>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %edx,%rbx
lea    -0x1(%rbx),%rdx
call   1030 <strncat@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrncat(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = call i8* @strncat(i8* %8, i8* %9, i32 %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
define i8* @xstrncat(i8* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i8* @strncat(i8* %0, i8* %1, i32 %4)
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret i8* %5
}
/* Variables and functions */
char *CSlim_BuyString(char *);
char *Import() { return CSlim_BuyString("OK"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
define i8* @Import() {
%1 = call i8* @CSlim_BuyString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define i8* @Import() {
%1 = tail call i8* @CSlim_BuyString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void reportError(int fd) {}


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

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

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

LLVM IR (-O2):
define void @reportError(i32 %0) {
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_del_entry(struct list_head *);
void list_del(struct list_head *entry) { __list_del_entry(entry); }


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

x86 assembly (clang, -O2):
<list_del>:
jmp    1030 <__list_del_entry@plt>

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

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_del(%struct.list_head* %0) {
%2 = tail call i32 @__list_del_entry(%struct.list_head* %0)
ret void
}