xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
void printDone(int line) {
  move(line, 52);
  printw(" [ok]");
  refresh();
}


x86 assembly (clang, -O0):
<printDone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x34,%esi
call   1050 <move@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDone>:
push   %rax
mov    $0x34,%esi
call   1050 <move@plt>
lea    0xebe(%rip),%rdi
call   1030 <printw@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <refresh@plt>

LLVM IR (-O0):
@.str = [6 x i8] c" [ok]\00"
define void @printDone(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @move(i32 %3, i32 52)
%5 = call i32 @printw(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" [ok]\00"
define void @printDone(i32 %0) {
%2 = tail call i32 @move(i32 %0, i32 52)
%3 = tail call i32 @printw(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_to_sample_spec2() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_to_sample_spec2"
         "\n");
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int settimeofday(const struct timeval *tv, const struct timezone *tz) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<settimeofday>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<settimeofday>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @settimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @settimeofday(%struct.timeval* nocapture readnone %0, %struct.timezone* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
void INT_Excep_SECURITY_WR(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SECURITY_WR() {
ret void
}
int get_fpu_rounding_mode(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_fpu_rounding_mode() {
ret i32 0
}
int fibonacci(int n) {
  int a = 1;
  int b = 1;
  while (n-- > 1) {
    int t = a;
    a = b;
    b += t;
  }
  return b;
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x1,%eax
jle    1143 <fibonacci+0x43>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <fibonacci+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1130 <fibonacci+0x30>
add    $0x1,%edi
mov    $0x1,%eax
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
mov    %eax,%edx
mov    %ecx,%eax
add    %edx,%eax
add    $0xffffffff,%edi
mov    %edx,%ecx
cmp    $0x2,%edi
ja     1120 <fibonacci+0x20>
ret

LLVM IR (-O0):
define i32 @fibonacci(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 1, i32* %4
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp sgt i32 %7, 1
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %3
store i32 %11, i32* %5
%12 = load i32, i32* %4
store i32 %12, i32* %3
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = add nsw i32 %14, %13
store i32 %15, i32* %4
br label %6
16: ; preds = %6
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 1, %1 ]
%6 = phi i32 [ %5, %3 ], [ 1, %1 ]
%7 = add nsw i32 %4, -1
%8 = add nsw i32 %5, %6
%9 = icmp ugt i32 %4, 2
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
double tan(double);
double a2r_rect(double A, double K) { return tan(A); }


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

x86 assembly (clang, -O2):
<a2r_rect>:
jmp    1030 <tan@plt>

LLVM IR (-O0):
define double @a2r_rect(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @tan(double %5)
ret double %6
}

LLVM IR (-O2):
define double @a2r_rect(double %0, double %1) {
%3 = tail call double @tan(double %0)
ret double %3
}
int test_imm_8Cint8_reg(signed char val) {
  return ((val) & (0x8C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Cint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x8c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Cint8_reg>:
test   $0x8c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Cint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 140
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_8Cint8_reg(i8 signext %0) {
%2 = and i8 %0, -116
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xce() {
  Assert_real((ispunct(206) == 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",
              1035, ("ispunct should be 0 for 0xce"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xce>:
push   %rax
mov    $0xce,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x40b,%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 0xce\00"
define void @t_ispunct_0xce() {
%1 = call i64 @ispunct(i32 206)
%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 1035, 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 0xce\00"
define void @t_ispunct_0xce() {
%1 = tail call i64 @ispunct(i32 206)
%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 1035, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int findmaxsum(int *, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a[] = {-3, -2, 1, 4, 3, -7, 0, 5, 6};
  printf(" Max sum is %d", findmaxsum(a, (sizeof(a) / sizeof a[0])));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1050 <findmaxsum@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <findmaxsum@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [9 x i32] [i32 -3, i32 -2, i32 1, i32 4, i32 3, i32 -7, i32 0, i32 5, i32 6]
@.str = [15 x i8] c" Max sum is %d\00"
define void @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @findmaxsum(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@__const.main.a = [9 x i32] [i32 -3, i32 -2, i32 1, i32 4, i32 3, i32 -7, i32 0, i32 5, i32 6]
@.str = [15 x i8] c" Max sum is %d\00"
define void @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @findmaxsum(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int cr_zero_set(unsigned this_cr) { return (this_cr & 0x2); }


x86 assembly (clang, -O0):
<cr_zero_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cr_zero_set>:
mov    %edi,%eax
and    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @cr_zero_set(i32 %0) {
%2 = and i32 %0, 2
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ svc_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ *svcfd_create(int, int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  int test_status = 1;
  int fd = 0;
  SVCXPRT *svcr = NULL;
  svcr = svcfd_create(fd, 0, 0);
  svc_destroy(svcr);
  test_status = 0;
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <svcfd_create@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <svc_destroy@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <svcfd_create@plt>
mov    %rax,%rdi
call   1040 <svc_destroy@plt>
lea    0xeb5(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32* @svcfd_create(i32 0, i32 0, i32 0)
%2 = tail call i32 @svc_destroy(i32* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
void *realloc(void *ptr, size_t size) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @realloc(i8* nocapture readnone %0, i64 %1) {
ret i8* null
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
void second_(double *time) {
  clock_t zeit;
  zeit = clock();
  *time = (double)zeit / CLOCKS_PER_SEC;
}


x86 assembly (clang, -O0):
<second_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
mov    0x2eb4(%rip),%rax
divsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @second_(double* %0) {
%2 = alloca double*
%3 = alloca i64
store double* %0, double** %2
%4 = call i64 (...) @clock()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to double
%7 = load double, double* @CLOCKS_PER_SEC
%8 = fdiv double %6, %7
%9 = load double*, double** %2
store double %8, double* %9
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @second_(double* nocapture writeonly %0) {
%2 = tail call i64 (...) @clock()
%3 = sitofp i64 %2 to double
%4 = load double, double* @CLOCKS_PER_SEC
%5 = fdiv double %3, %4
store double %5, double* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *getTimeStr(void) {
  time_t tm = time(NULL);
  static char s[33];
  strncpy(s, ctime(&tm), 24);
  s[24] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<getTimeStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <ctime@plt>
mov    %eax,%esi
lea    0x2efa(%rip),%rdi
mov    $0x18,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x2f01(%rip)
lea    0x2ee2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeStr>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <ctime@plt>
lea    0x2eff(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x18,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x2f01(%rip)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@getTimeStr.s = internal global [33 x i8] zeroinitializer
define i8* @getTimeStr() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call i32 @ctime(i32* %1)
%4 = call i32 @strncpy(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @getTimeStr.s, i64 0, i64 0), i32 %3, i32 24)
store i8 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @getTimeStr.s, i64 0, i64 24)
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @getTimeStr.s, i64 0, i64 0)
}

LLVM IR (-O2):
@getTimeStr.s = internal global [33 x i8] zeroinitializer
define i8* @getTimeStr() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @ctime(i32* %1)
%5 = call i32 @strncpy(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @getTimeStr.s, i64 0, i64 0), i32 %4, i32 24)
store i8 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @getTimeStr.s, i64 0, i64 24)
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @getTimeStr.s, i64 0, i64 0)
}
int test_imm_94uint8_reg(unsigned char val) {
  return ((val) & (-0x94 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_94uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff6c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_94uint8_reg>:
test   $0x6c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_94uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -148
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_94uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 108
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void gotoxy(char x, char y) { printf("\033[%d;%dH", y, x); }


x86 assembly (clang, -O0):
<gotoxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x1(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoxy>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @gotoxy(i8 signext %0, i8 signext %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 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @gotoxy(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %1, i8 signext %0)
ret void
}
/* Type definitions */
struct gameoptions {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct gameoptions *);
void gameoptions_destroy(struct gameoptions *opt) { free(opt); }


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

x86 assembly (clang, -O2):
<gameoptions_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.gameoptions = type { i32 }
define void @gameoptions_destroy(%struct.gameoptions* nocapture %0) {
%2 = tail call i32 @free(%struct.gameoptions* %0)
ret void
}
int htoi(char c) {
  int first = c / 16 - 3;
  int second = c % 16;
  int result = first * 10 + second;
  if (result > 9)
    result--;
  return result;
}


x86 assembly (clang, -O0):
<htoi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
sub    $0x3,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jle    1148 <htoi+0x48>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htoi>:
mov    %edi,%eax
sar    $0x7,%al
shr    $0x4,%al
add    %dil,%al
mov    %eax,%ecx
and    $0xf0,%cl
sub    %cl,%dil
sar    $0x4,%al
movzbl %al,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
movsbl %al,%ecx
add    $0xe2,%dil
movsbl %dil,%eax
add    %ecx,%eax
xor    %ecx,%ecx
cmp    $0xa,%eax
setge  %cl
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @htoi(i8 signext %0) {
%2 = sdiv i8 %0, 16
%3 = srem i8 %0, 16
%4 = mul nsw i8 %2, 10
%5 = sext i8 %4 to i32
%6 = add nsw i8 %3, -30
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, %5
%9 = icmp sgt i32 %8, 9
%10 = sext i1 %9 to i32
%11 = add nsw i32 %8, %10
ret i32 %11
}
void *test_anti_range_90(unsigned short n) {
  extern void *alloc_anti_range_90(unsigned short)
      __attribute__((alloc_size(1)));
  if ((0x7fff * 2 + 1) - 2 <= n && n <= (0x7fff * 2 + 1) - 1)
    n = (0x7fff * 2 + 1) - 2 - 1;
  return alloc_anti_range_90(n);
}


x86 assembly (clang, -O0):
<test_anti_range_90>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
mov    $0xfffd,%eax
cmp    %ecx,%eax
jg     1145 <test_anti_range_90+0x35>
movzwl -0x2(%rbp),%eax
cmp    $0xfffe,%eax
jg     1145 <test_anti_range_90+0x35>
movw   $0xfffc,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_90@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_90>:
lea    0x3(%rdi),%eax
cmp    $0x2,%ax
mov    $0xfffc,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_90@plt>

LLVM IR (-O0):
define i8* @test_anti_range_90(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp sle i32 65533, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = icmp sle i32 %8, 65534
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -4, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_90(i16 zeroext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_90(i16 zeroext %0) {
%2 = add i16 %0, 3
%3 = icmp ult i16 %2, 2
%4 = select i1 %3, i16 -4, i16 %0
%5 = tail call i8* @alloc_anti_range_90(i16 zeroext %4)
ret i8* %5
}
unsigned sub_sat_u(unsigned minuend, unsigned subtrahend, unsigned limit) {
  if ((minuend < limit) || ((minuend - limit) < subtrahend))
    return limit;
  return (minuend - subtrahend);
}


x86 assembly (clang, -O0):
<sub_sat_u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jb     1128 <sub_sat_u+0x28>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1133 <sub_sat_u+0x33>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113c <sub_sat_u+0x3c>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_sat_u>:
mov    %edi,%ecx
sub    %edx,%ecx
mov    %edi,%eax
sub    %esi,%eax
cmp    %esi,%ecx
cmovb  %edx,%eax
cmp    %edx,%edi
cmovb  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @sub_sat_u(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %0, %2
%5 = sub i32 %0, %2
%6 = icmp ult i32 %5, %1
%7 = or i1 %4, %6
%8 = sub i32 %0, %1
%9 = select i1 %7, i32 %2, i32 %8
ret i32 %9
}
void ADCMoniEnable(unsigned long ulBase, unsigned long ulChanType) {
  ;

  ;
  if (ulChanType == 0x00000001) {
    (*((volatile unsigned long *)(ulBase + 0x00000004))) |= 0x00000001;
  } else if (ulChanType == 0x00000002) {
    (*((volatile unsigned long *)(ulBase + 0x00000004))) |= 0x00000002;
  } else {
    (*((volatile unsigned long *)(ulBase + 0x00000004))) |=
        (0x00000001 | 0x00000002);
  }
}


x86 assembly (clang, -O0):
<ADCMoniEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    112c <ADCMoniEnable+0x2c>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0x4(%rax)
jmp    1161 <ADCMoniEnable+0x61>
cmpq   $0x2,-0x10(%rbp)
jne    114c <ADCMoniEnable+0x4c>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     $0x2,%rcx
mov    %rcx,0x4(%rax)
jmp    115c <ADCMoniEnable+0x5c>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     $0x3,%rcx
mov    %rcx,0x4(%rax)
jmp    1161 <ADCMoniEnable+0x61>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCMoniEnable>:
xor    %eax,%eax
cmp    $0x2,%rsi
sete   %al
xor    $0x3,%rax
cmp    $0x1,%rsi
cmove  %rsi,%rax
or     %rax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @ADCMoniEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add i64 %8, 4
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, 1
store volatile i64 %12, i64* %10
br label %29
13: ; preds = %2
%14 = load i64, i64* %4
%15 = icmp eq i64 %14, 2
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = load i64, i64* %3
%18 = add i64 %17, 4
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = or i64 %20, 2
store volatile i64 %21, i64* %19
br label %28
22: ; preds = %13
%23 = load i64, i64* %3
%24 = add i64 %23, 4
%25 = inttoptr i64 %24 to i64*
%26 = load volatile i64, i64* %25
%27 = or i64 %26, 3
store volatile i64 %27, i64* %25
br label %28
28: ; preds = %22, %16
br label %29
29: ; preds = %28, %7
ret void
}

LLVM IR (-O2):
define void @ADCMoniEnable(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 2
%4 = select i1 %3, i64 2, i64 3
%5 = icmp eq i64 %1, 1
%6 = select i1 %5, i64 1, i64 %4
%7 = add i64 %0, 4
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %6
store volatile i64 %10, i64* %8
ret void
}
/* Type definitions */
struct map_session_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ atcommand_killmonster_sub(int const,
                                             struct map_session_data *,
                                             char const *, int /*<<< orphan*/);
atcommand_killmonster2(const int fd, struct map_session_data *sd,
                       const char *command, const char *message) {
  atcommand_killmonster_sub(fd, sd, message, 0);
  return 0;
}


x86 assembly (clang, -O0):
<atcommand_killmonster2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <atcommand_killmonster_sub@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atcommand_killmonster2>:
push   %rax
mov    %rcx,%rdx
xor    %ecx,%ecx
call   1030 <atcommand_killmonster_sub@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.map_session_data = type { i32 }
define i32 @atcommand_killmonster2(i32 %0, %struct.map_session_data* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca %struct.map_session_data*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store %struct.map_session_data* %1, %struct.map_session_data** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load %struct.map_session_data*, %struct.map_session_data** %6
%11 = load i8*, i8** %8
%12 = call i32 @atcommand_killmonster_sub(i32 %9, %struct.map_session_data* %10, i8* %11, i32 0)
ret i32 0
}

LLVM IR (-O2):
%struct.map_session_data = type { i32 }
define i32 @atcommand_killmonster2(i32 %0, %struct.map_session_data* %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @atcommand_killmonster_sub(i32 %0, %struct.map_session_data* %1, i8* %3, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ reset_current_packet_pointer();
int CFC_filter_duplicate_sn_client() {
  int nb_packets = 0;
  puts("Cloaking - Removing the duplicate SN for the client");
  reset_current_packet_pointer();
  return nb_packets;
}


x86 assembly (clang, -O0):
<CFC_filter_duplicate_sn_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <reset_current_packet_pointer@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [52 x i8] c"Cloaking - Removing the duplicate SN for the client\00"
define i32 @CFC_filter_duplicate_sn_client() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @reset_current_packet_pointer()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [52 x i8] c"Cloaking - Removing the duplicate SN for the client\00"
define i32 @CFC_filter_duplicate_sn_client() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @reset_current_packet_pointer()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ m46_reset();
int /*<<< orphan*/ p32c8init(int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/ *, int /*<<< orphan*/);
void m46_init(uint8_t *prgROMin, uint32_t prgROMsizeIn, uint8_t *prgRAMin,
              uint32_t prgRAMsizeIn, uint8_t *chrROMin, uint32_t chrROMsizeIn) {
  p32c8init(prgROMin, prgROMsizeIn, prgRAMin, prgRAMsizeIn, chrROMin,
            chrROMsizeIn);
  m46_reset();
}


x86 assembly (clang, -O0):
<m46_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1040 <p32c8init@plt>
mov    $0x0,%al
call   1030 <m46_reset@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m46_init>:
push   %rax
call   1040 <p32c8init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <m46_reset@plt>

LLVM IR (-O0):
define void @m46_init(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 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32*, i32** %9
%16 = load i32, i32* %10
%17 = load i32*, i32** %11
%18 = load i32, i32* %12
%19 = call i32 @p32c8init(i32* %13, i32 %14, i32* %15, i32 %16, i32* %17, i32 %18)
%20 = call i32 (...) @m46_reset()
ret void
}

LLVM IR (-O2):
define void @m46_init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5) {
%7 = tail call i32 @p32c8init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5)
%8 = tail call i32 (...) @m46_reset()
ret void
}
int opa_isspace(char b) {
  return b == ' ' || b == '\r' || b == '\n' || b == '\t';
}


x86 assembly (clang, -O0):
<opa_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <opa_isspace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <opa_isspace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <opa_isspace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opa_isspace>:
cmp    $0x20,%dil
ja     1120 <opa_isspace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002400,%rdx
bt     %rcx,%rdx
jae    1120 <opa_isspace+0x20>
ret
xor    %eax,%eax
cmp    $0x9,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @opa_isspace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 13
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 9
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @opa_isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int isdblquote(int c) {
  if (c == '"') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isdblquote>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x22,-0x8(%rbp)
jne    111d <isdblquote+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <isdblquote+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdblquote>:
xor    %eax,%eax
cmp    $0x22,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isdblquote(i32 %0) {
%2 = icmp eq i32 %0, 34
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
unsigned long bit_mask(unsigned long);
unsigned long bitfield_mask(register unsigned long start,
                            register unsigned long length) {
  return (bit_mask(length) << (start));
}


x86 assembly (clang, -O0):
<bitfield_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <bit_mask@plt>
mov    -0x8(%rbp),%rcx
shl    %cl,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitfield_mask>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <bit_mask@plt>
mov    %ebx,%ecx
shl    %cl,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @bitfield_mask(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i64 @bit_mask(i64 %5)
%7 = load i64, i64* %3
%8 = shl i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @bitfield_mask(i64 %0, i64 %1) {
%3 = tail call i64 @bit_mask(i64 %1)
%4 = shl i64 %3, %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
__attribute__((always_)) void _tu_set_foreground(const char *color_str) {
  fputs(color_str, stdout);
}


x86 assembly (clang, -O0):
<_tu_set_foreground>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tu_set_foreground>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @_tu_set_foreground(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @_tu_set_foreground(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int myNumber = 5;
  int mySecondNumber = 7;
  int myThirdNumber = myNumber + mySecondNumber;
  printf("%i", myThirdNumber);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void jtag_instruction(volatile uint32_t *host, uint32_t inst) {
  host[0] = 0x80000000 | (3 << 16) | 0x03;
  host[0] = 0x40000000 | (9 << 16) | inst;
  host[0] = 0x80000000 | (1 << 16) | 0x01;
}


x86 assembly (clang, -O0):
<jtag_instruction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x80030003,(%rax)
mov    -0xc(%rbp),%ecx
or     $0x40090000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x80010001,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<jtag_instruction>:
movl   $0x80030003,(%rdi)
or     $0x40090000,%esi
mov    %esi,(%rdi)
movl   $0x80010001,(%rdi)
ret

LLVM IR (-O0):
define void @jtag_instruction(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 = getelementptr inbounds i32, i32* %5, i64 0
store volatile i32 -2147287037, i32* %6
%7 = load i32, i32* %4
%8 = or i32 1074331648, %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 0
store volatile i32 %8, i32* %10
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 0
store volatile i32 -2147418111, i32* %12
ret void
}

LLVM IR (-O2):
define void @jtag_instruction(i32* %0, i32 %1) {
store volatile i32 -2147287037, i32* %0
%3 = or i32 %1, 1074331648
store volatile i32 %3, i32* %0
store volatile i32 -2147418111, i32* %0
ret void
}
adr0indreg1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((*((int *)10000000)) <= (*p1))
    return 1;
  else
    return 0;
}


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

x86 assembly (clang, -O2):
<adr0indreg1>:
mov    0x989680,%ecx
xor    %eax,%eax
cmp    (%r9),%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @adr0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = load i32, i32* inttoptr (i64 10000000 to i32*)
%8 = load i32, i32* %5
%9 = icmp sle i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ setjmp1();
int /*<<< orphan*/ setjmp2();
int main() {
  setjmp1();
  setjmp2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <setjmp1@plt>
mov    $0x0,%al
call   1040 <setjmp2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <setjmp1@plt>
xor    %eax,%eax
call   1040 <setjmp2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setjmp1()
%3 = call i32 (...) @setjmp2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setjmp1()
%2 = tail call i32 (...) @setjmp2()
ret i32 0
}
int Min(int i1, int i2) { return i1 <= i2 ? i1 : i2; }


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

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

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

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

/* Variables and functions */
int IPC_CREAT;
int IPC_EXCL;
int /*<<< orphan*/ getkey(int);
int semget(int /*<<< orphan*/, int, int);
int crearsem(int identif, int nsem) {
  key_t clave;
  clave = getkey(identif);
  return (semget(clave, nsem, IPC_CREAT | IPC_EXCL | 0660));
}


x86 assembly (clang, -O0):
<crearsem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <getkey@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
or     $0x1b0,%edx
call   1030 <semget@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crearsem>:
push   %rbx
mov    %esi,%ebx
call   1040 <getkey@plt>
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edx
mov    0x2eb8(%rip),%rcx
or     (%rcx),%edx
or     $0x1b0,%edx
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <semget@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
define i32 @crearsem(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @getkey(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* @IPC_CREAT
%11 = load i32, i32* @IPC_EXCL
%12 = or i32 %10, %11
%13 = or i32 %12, 432
%14 = call i32 @semget(i32 %8, i32 %9, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
define i32 @crearsem(i32 %0, i32 %1) {
%3 = tail call i32 @getkey(i32 %0)
%4 = load i32, i32* @IPC_CREAT
%5 = load i32, i32* @IPC_EXCL
%6 = or i32 %4, %5
%7 = or i32 %6, 432
%8 = tail call i32 @semget(i32 %3, i32 %1, i32 %7)
ret i32 %8
}