xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void sclose(int fd) {
  int ret;
  ret = close(fd);
  if (ret == -1) {
    fprintf(stderr, "cannot close()\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<sclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1173 <sclose+0x43>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sclose>:
push   %rax
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     113d <sclose+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"cannot close()\0A\00"
@EXIT_FAILURE = global i32 0
define void @sclose(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"cannot close()\0A\00"
@EXIT_FAILURE = global i32 0
define void @sclose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *, char const *);
int /*<<< orphan*/ stderr;
void __assert_c99(const char *expr, const char *file, int line,
                  const char *func) {
  fprintf(stderr, "%s:%i: %s: Assertion `%s` failed.\n", file, line, func,
          expr);
  abort();
}


x86 assembly (clang, -O0):
<__assert_c99>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x8(%rbp),%r9
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__assert_c99>:
push   %rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r9
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"%s:%i: %s: Assertion `%s` failed.\0A\00"
define void @__assert_c99(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = load i8*, i8** %5
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12, i8* %13)
%15 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"%s:%i: %s: Assertion `%s` failed.\0A\00"
define void @__assert_c99(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3, i8* %0)
%7 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
__attribute__((weak)) int _kill(int pid, int sig) {
  if (pid == 1)
    _exit(sig);
  return 0;
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1130 <_kill+0x20>
mov    -0x8(%rbp),%edi
call   1030 <_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill>:
cmp    $0x1,%edi
je     1118 <_kill+0x8>
xor    %eax,%eax
ret
push   %rax
mov    %esi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define weak i32 @_kill(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 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @_exit(i32 %8)
unreachable
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define weak i32 @_kill(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @_exit(i32 %1)
unreachable
6: ; preds = %2
ret i32 0
}
int sgx_ecall(void) { return 1; }


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

x86 assembly (clang, -O2):
<sgx_ecall>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @sgx_ecall() {
ret i32 1
}

LLVM IR (-O2):
define i32 @sgx_ecall() {
ret i32 1
}
/* Variables and functions */
scalar_t__ EINTR;
int close(int);
scalar_t__ errno;
void xClose(int fd) {
  while (close(fd) == -1)
    if (errno != EINTR)
      break;
}


x86 assembly (clang, -O0):
<xClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1150 <xClose+0x40>
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
je     114b <xClose+0x3b>
jmp    1150 <xClose+0x40>
jmp    111b <xClose+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xClose>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec2(%rip),%r14
mov    0x2eb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1144 <xClose+0x34>
mov    (%r14),%rax
cmp    (%r15),%rax
je     1130 <xClose+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define void @xClose(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %12, %1
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %13
12: ; preds = %7
br label %3
13: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define void @xClose(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
br i1 %8, label %2, label %9
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, long);
main(void) {
  int c;
  long num_char;
  num_char = 0;
  while ((c = getchar()) != EOF && c != '\n') {
    ++num_char;
  }
  printf("%ld\n", num_char);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
mov    0x2e9c(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x11(%rbp)
je     1161 <main+0x41>
cmpl   $0xa,-0x8(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1171 <main+0x51>
jmp    1182 <main+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>
mov    -0x10(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    $0xa,%eax
je     1155 <main+0x35>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %3
br label %4
4: ; preds = %13, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 10
br label %11
11: ; preds = %8, %4
%12 = phi i1 [ false, %4 ], [ %10, %8 ]
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = load i64, i64* %3
%15 = add nsw i64 %14, 1
store i64 %15, i64* %3
br label %4
16: ; preds = %11
%17 = load i64, i64* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %17)
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %8, %1 ]
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, 10
%7 = and i1 %6, %5
%8 = add nuw nsw i64 %2, 1
br i1 %7, label %1, label %9
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
void output_root(unsigned char root, unsigned char *destination,
                 long *position) {
  destination[*position] = root;
  *position = *position + 1;
}


x86 assembly (clang, -O0):
<output_root>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_root>:
mov    (%rdx),%rax
mov    %dil,(%rsi,%rax,1)
addq   $0x1,(%rdx)
ret

LLVM IR (-O0):
define void @output_root(i8 zeroext %0, i8* %1, i64* %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i64*
store i8 %0, i8* %4
store i8* %1, i8** %5
store i64* %2, i64** %6
%7 = load i8, i8* %4
%8 = load i8*, i8** %5
%9 = load i64*, i64** %6
%10 = load i64, i64* %9
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 %7, i8* %11
%12 = load i64*, i64** %6
%13 = load i64, i64* %12
%14 = add nsw i64 %13, 1
%15 = load i64*, i64** %6
store i64 %14, i64* %15
ret void
}

LLVM IR (-O2):
define void @output_root(i8 zeroext %0, i8* nocapture writeonly %1, i64* nocapture %2) {
%4 = load i64, i64* %2
%5 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %0, i8* %5
%6 = load i64, i64* %2
%7 = add nsw i64 %6, 1
store i64 %7, i64* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char const *);
void unlink_wrap(const char *file) { unlink(file); }


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

x86 assembly (clang, -O2):
<unlink_wrap>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @unlink_wrap(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_container_to_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(6, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @copy_container_to_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 6, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int sum(int n) {
  int s;
  s = 0;
  while (n != 0) {
    s = s + n;
    n = n - 1;
  }
  return s;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <sum+0x2f>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <sum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %edi,%edi
je     1119 <sum+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
double periodSqKepler(double T_ref, double a_ref, double a) {
  double aratio = a / a_ref;
  return aratio * aratio * aratio * T_ref * T_ref;
}


x86 assembly (clang, -O0):
<periodSqKepler>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<periodSqKepler>:
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @periodSqKepler(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = load double, double* %5
%10 = fdiv double %8, %9
store double %10, double* %7
%11 = load double, double* %7
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = load double, double* %4
%17 = fmul double %15, %16
%18 = load double, double* %4
%19 = fmul double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @periodSqKepler(double %0, double %1, double %2) {
%4 = fdiv double %2, %1
%5 = fmul double %4, %4
%6 = fmul double %4, %5
%7 = fmul double %6, %0
%8 = fmul double %7, %0
ret double %8
}
/* Type definitions */
struct state_block_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ requeue_i(struct state_block_s *, int /*<<< orphan*/);
void requeue(struct state_block_s *sp) { requeue_i(sp, 0); }


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

x86 assembly (clang, -O2):
<requeue>:
xor    %esi,%esi
jmp    1030 <requeue_i@plt>

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

LLVM IR (-O2):
%struct.state_block_s = type { i32 }
define void @requeue(%struct.state_block_s* %0) {
%2 = tail call i32 @requeue_i(%struct.state_block_s* %0, i32 0)
ret void
}
void testTortureExecute(void) {
  char blah[33] = "01234567890123456789";
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x21,%edx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.testTortureExecute.blah = [33 x i8] c"01234567890123456789\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @testTortureExecute() {
%1 = alloca [33 x i8]
%2 = bitcast [33 x i8]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
ret void
}
int mem_safe(addr)
unsigned char *addr;
{
  if (addr < ((unsigned char *)0x600000))
    return 1;
  if (addr < ((unsigned char *)0xa00000))
    return 0;
  if (addr < ((unsigned char *)0xff680000))
    return 1;
  if (addr < ((unsigned char *)0xff800000))
    return 0;
}


x86 assembly (clang, -O0):
<mem_safe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    $0x600000,%eax
cmp    %rax,-0x10(%rbp)
jae    1123 <mem_safe+0x23>
movl   $0x1,-0x4(%rbp)
jmp    116f <mem_safe+0x6f>
mov    $0xa00000,%eax
cmp    %rax,-0x10(%rbp)
jae    113e <mem_safe+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116f <mem_safe+0x6f>
mov    $0xff680000,%eax
cmp    %rax,-0x10(%rbp)
jae    1159 <mem_safe+0x59>
movl   $0x1,-0x4(%rbp)
jmp    116f <mem_safe+0x6f>
mov    $0xff800000,%eax
cmp    %rax,-0x10(%rbp)
jae    116f <mem_safe+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_safe>:
mov    $0x1,%eax
cmp    $0x600000,%rdi
jb     1129 <mem_safe+0x29>
xor    %eax,%eax
cmp    $0xa00000,%rdi
jb     1129 <mem_safe+0x29>
shr    $0x13,%rdi
xor    %eax,%eax
cmp    $0x1fed,%rdi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @mem_safe(i8* readnone %0) {
%2 = icmp ult i8* %0, inttoptr (i64 6291456 to i8*)
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i8* %0, inttoptr (i64 10485760 to i8*)
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i8* %0, inttoptr (i64 4285005824 to i8*)
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %7, %5 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ values_equal_display_error(unsigned long long const,
                                              unsigned long long const);
void _assert_int_equal(const unsigned long long a, const unsigned long long b,
                       const char *const file, const int line) {
  if (!values_equal_display_error(a, b)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_int_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <values_equal_display_error@plt>
cmp    $0x0,%eax
jne    1159 <_assert_int_equal+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_int_equal>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1030 <values_equal_display_error@plt>
test   %eax,%eax
je     1138 <_assert_int_equal+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_fail@plt>

LLVM IR (-O0):
define void @_assert_int_equal(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i32 @values_equal_display_error(i64 %9, i64 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %4
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @_fail(i8* %14, i32 %15)
br label %17
17: ; preds = %13, %4
ret void
}

LLVM IR (-O2):
define void @_assert_int_equal(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @values_equal_display_error(i64 %0, i64 %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @_fail(i8* %2, i32 %3)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
unsigned int devil_table_item_hash(const char *key, size_t limit) {
  unsigned int hash_key = 0;
  while ('\0' != *key)
    hash_key = 33 * hash_key ^ *key++;
  hash_key %= limit;
  return hash_key;
}


x86 assembly (clang, -O0):
<devil_table_item_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1144 <devil_table_item_hash+0x44>
imul   $0x21,-0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <devil_table_item_hash+0x13>
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%eax
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<devil_table_item_hash>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1129 <devil_table_item_hash+0x29>
add    $0x1,%rdi
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <devil_table_item_hash+0x10>
mov    %eax,%eax
cmp    %rsi,%rax
jb     1134 <devil_table_item_hash+0x34>
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @devil_table_item_hash(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %11, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = mul i32 %7, 33
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = xor i32 %10, %9
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = zext i32 %12 to i64
br label %17
17: ; preds = %15, %2
%18 = phi i64 [ 0, %2 ], [ %16, %15 ]
%19 = urem i64 %18, %1
%20 = trunc i64 %19 to i32
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __memoria_liberar(void *ptr) {
  if (ptr != NULL) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<__memoria_liberar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <__memoria_liberar+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__memoria_liberar>:
test   %rdi,%rdi
je     111a <__memoria_liberar+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @__memoria_liberar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @__memoria_liberar(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void logger_platform_out(const char *text) { write(1, text, strlen(text)); }


x86 assembly (clang, -O0):
<logger_platform_out>:
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   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_platform_out>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @logger_platform_out(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
char *str_str(char *, char *);
scalar_t__ strcmp(char *, char *);
char *str_str_001() {
  char *rel = str_str("1234567", "456");
  do {
    return 0 == strcmp("4567", rel) ? NULL
                                    : "expect ["
                                      "\"4567\""
                                      "]";
  } while (0);
  ;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <str_str@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    %eax,%ecx
lea    0xeaf(%rip),%rax
cmp    %rdx,%rcx
cmove  %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1040 <str_str@plt>
lea    0xec8(%rip),%rdi
mov    %rax,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
lea    0xebf(%rip),%rcx
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"1234567\00"
@.str.1 = [4 x i8] c"456\00"
@.str.2 = [5 x i8] c"4567\00"
@.str.3 = [16 x i8] c"expect [\224567\22]\00"
define i8* @str_str_001() {
%1 = alloca i8*
%2 = call i8* @str_str(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i8* %2, i8** %1
br label %3
3: ; preds = %0
%4 = load i8*, i8** %1
%5 = call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%6 = icmp eq i64 0, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* null, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0)
br label %9
9: ; preds = %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"1234567\00"
@.str.1 = [4 x i8] c"456\00"
@.str.2 = [5 x i8] c"4567\00"
@.str.3 = [16 x i8] c"expect [\224567\22]\00"
define i8* @str_str_001() {
%1 = tail call i8* @str_str(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0)
ret i8* %4
}
int spl_debug_msg(void *arg, int subsys, int mask, const char *file,
                  const char *fn, const int line, const char *format, ...) {
  return (0);
}


x86 assembly (clang, -O0):
<spl_debug_msg>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @spl_debug_msg(i8* %0, i32 %1, i32 %2, i8* %3, i8* %4, i32 %5, i8* %6, ...) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i8* %6, i8** %14
ret i32 0
}

LLVM IR (-O2):
define i32 @spl_debug_msg(i8* nocapture readnone %0, i32 %1, i32 %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i32 %5, i8* nocapture readnone %6, ...) {
ret i32 0
}
/* Type definitions */
struct s390Device {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int compareDevice(struct device *, struct device *);
int s390CompareDevice(struct s390Device *dev1, struct s390Device *dev2) {
  return compareDevice((struct device *)dev1, (struct device *)dev2);
}


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

x86 assembly (clang, -O2):
<s390CompareDevice>:
jmp    1030 <compareDevice@plt>

LLVM IR (-O0):
%struct.s390Device = type { i32 }
%struct.device = type { i32 }
define i32 @s390CompareDevice(%struct.s390Device* %0, %struct.s390Device* %1) {
%3 = alloca %struct.s390Device*
%4 = alloca %struct.s390Device*
store %struct.s390Device* %0, %struct.s390Device** %3
store %struct.s390Device* %1, %struct.s390Device** %4
%5 = load %struct.s390Device*, %struct.s390Device** %3
%6 = bitcast %struct.s390Device* %5 to %struct.device*
%7 = load %struct.s390Device*, %struct.s390Device** %4
%8 = bitcast %struct.s390Device* %7 to %struct.device*
%9 = call i32 @compareDevice(%struct.device* %6, %struct.device* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.s390Device = type { i32 }
%struct.device = type { i32 }
define i32 @s390CompareDevice(%struct.s390Device* %0, %struct.s390Device* %1) {
%3 = bitcast %struct.s390Device* %0 to %struct.device*
%4 = bitcast %struct.s390Device* %1 to %struct.device*
%5 = tail call i32 @compareDevice(%struct.device* %3, %struct.device* %4)
ret i32 %5
}
/* Variables and functions */
char *malloc(unsigned int);
int /*<<< orphan*/ memcpy(char *, char const *, unsigned int);
char *strndup(const char *s, unsigned int len) {
  char *x;
  if ((x = malloc(len + 1)) == 0)
    return 0;
  memcpy(x, s, len);
  x[len] = '\0';
  return x;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1155 <strndup+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1178 <strndup+0x58>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
lea    0x1(%r14),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1151 <strndup+0x31>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <memcpy@plt>
mov    %r14d,%eax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strndup(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = add i32 %7, 1
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %6
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i8* null, i8** %3
br label %22
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = call i32 @memcpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %6
%18 = load i32, i32* %5
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 0, i8* %20
%21 = load i8*, i8** %6
store i8* %21, i8** %3
br label %22
22: ; preds = %12, %11
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @strndup(i8* %0, i32 %1) {
%3 = add i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%8 = zext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %2, %6
ret i8* %4
}
int test_imm_A9int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xA9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A9int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xa9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A9int64_midword_mem>:
testb  $0xa9,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A9int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11075584
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int compare_mode(void const *aa, void const *bb) {
  int *a, *b;
  a = (int *)aa;
  b = (int *)bb;
  return (*a * 10000 + *(a + 1) > *b * 10000 + *(b + 1));
}


x86 assembly (clang, -O0):
<compare_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
imul   $0x2710,(%rax),%eax
mov    -0x18(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x20(%rbp),%rcx
imul   $0x2710,(%rcx),%ecx
mov    -0x20(%rbp),%rdx
add    0x4(%rdx),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_mode>:
imul   $0x2710,(%rdi),%ecx
add    0x4(%rdi),%ecx
imul   $0x2710,(%rsi),%edx
add    0x4(%rsi),%edx
xor    %eax,%eax
cmp    %edx,%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @compare_mode(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = mul nsw i32 %12, 10000
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = add nsw i32 %13, %16
%18 = load i32*, i32** %6
%19 = load i32, i32* %18
%20 = mul nsw i32 %19, 10000
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = add nsw i32 %20, %23
%25 = icmp sgt i32 %17, %24
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @compare_mode(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = mul nsw i32 %5, 10000
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = add nsw i32 %6, %9
%11 = load i32, i32* %4
%12 = mul nsw i32 %11, 10000
%13 = getelementptr inbounds i8, i8* %1, i64 4
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
%16 = add nsw i32 %12, %15
%17 = icmp sgt i32 %10, %16
%18 = zext i1 %17 to i32
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int try_parse_int_imp(char *, void *, int, int);
bool try_parse_uint16(char *str, uint16_t *value_ptr) {
  return try_parse_int_imp(str, (void *)value_ptr, sizeof(uint16_t), false);
}


x86 assembly (clang, -O0):
<try_parse_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <try_parse_int_imp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_parse_uint16>:
mov    $0x4,%edx
xor    %ecx,%ecx
jmp    1030 <try_parse_int_imp@plt>

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

LLVM IR (-O2):
define i32 @try_parse_uint16(i8* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @try_parse_int_imp(i8* %0, i8* %3, i32 4, i32 0)
ret i32 %4
}
/* Variables and functions */
int a();
int b();
int c() { return a() * b(); }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <a@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <b@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbx
xor    %eax,%eax
call   1040 <a@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <b@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @c() {
%1 = call i32 (...) @a()
%2 = call i32 (...) @b()
%3 = mul nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @c() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @b()
%3 = mul nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
scalar_t__ cholsolve(double *, double *, int);
int /*<<< orphan*/ qerror(char *, char *);
void poly_solve(double *a, double *b, int n) {
  double *vmat, *wmat;
  if (cholsolve(a, b, n))
    qerror("*Error*: singular matrix found ", "while deprojecting");
  return;
}


x86 assembly (clang, -O0):
<poly_solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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
call   1030 <cholsolve@plt>
cmp    $0x0,%rax
je     1160 <poly_solve+0x40>
lea    0xeac(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <qerror@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly_solve>:
push   %rax
call   1030 <cholsolve@plt>
test   %rax,%rax
je     113f <poly_solve+0x1f>
lea    0xece(%rip),%rdi
lea    0xee7(%rip),%rsi
pop    %rax
jmp    1040 <qerror@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"*Error*: singular matrix found \00"
@.str.1 = [19 x i8] c"while deprojecting\00"
define void @poly_solve(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = load double*, double** %5
%11 = load i32, i32* %6
%12 = call i64 @cholsolve(double* %9, double* %10, i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @qerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"*Error*: singular matrix found \00"
@.str.1 = [19 x i8] c"while deprojecting\00"
define void @poly_solve(double* %0, double* %1, i32 %2) {
%4 = tail call i64 @cholsolve(double* %0, double* %1, i32 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @qerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x4d() {
  Assert_real((isprint(77)),
              "/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_isprint.c",
              390, ("isprint should be 1 for M"));
}


x86 assembly (clang, -O0):
<t_isprint_0x4d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4d,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x186,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x4d>:
push   %rax
mov    $0x4d,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x186,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for M\00"
define void @t_isprint_0x4d() {
%1 = call i32 @isprint(i32 77)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for M\00"
define void @t_isprint_0x4d() {
%1 = tail call i32 @isprint(i32 77)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glIndexs(short);
void Indexs(short v) { glIndexs(v); }


x86 assembly (clang, -O0):
<Indexs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <glIndexs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Indexs>:
jmp    1030 <glIndexs@plt>

LLVM IR (-O0):
define void @Indexs(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @glIndexs(i16 signext %3)
ret void
}

LLVM IR (-O2):
define void @Indexs(i16 signext %0) {
%2 = tail call i32 @glIndexs(i16 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main() {
  char Buf[100];
  int Count;
  for (Count = 1; Count <= 20; Count++) {
    sprintf(Buf, "->%02d<-\n", Count);
    printf("%s", Buf);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x74(%rbp)
cmpl   $0x14,-0x74(%rbp)
jg     1174 <main+0x54>
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%edx
lea    0xeaf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    $0x1,%ebx
lea    0xec9(%rip),%r14
mov    %rsp,%r15
lea    0xec9(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <sprintf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x15,%ebx
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"->%02d<-\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 20
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"->%02d<-\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 1, %0 ], [ %7, %3 ]
%5 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 21
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}