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

/* Variables and functions */
unsigned long has_zero32(unsigned long);
unsigned long has_zero64(unsigned long);
unsigned long has_zero(unsigned long x) {
  return (sizeof(x) == 8) ? has_zero64(x) : has_zero32(x);
}


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

x86 assembly (clang, -O2):
<has_zero>:
jmp    1030 <has_zero64@plt>

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

LLVM IR (-O2):
define i64 @has_zero(i64 %0) {
%2 = tail call i64 @has_zero64(i64 %0)
ret i64 %2
}
void exit(code) int code;
{
  _cleanup();
  _exit(code);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <_cleanup@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <_cleanup@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @_cleanup()
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 (...) @_cleanup()
tail call void @_exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *tu_malloc(size_t sz) {
  void *m;
  if (!sz)
    sz++;
  if (m = malloc(sz), !m)
    die("Out of memory");
  memset(m, 0, sz);
  return m;
}


x86 assembly (clang, -O0):
<tu_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <tu_malloc+0x23>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1177 <tu_malloc+0x47>
jmp    1183 <tu_malloc+0x53>
lea    0xe82(%rip),%rdi
call   1050 <die@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tu_malloc>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
mov    $0x1,%ebx
cmovne %rdi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
jne    115c <tu_malloc+0x2c>
lea    0xea9(%rip),%rdi
call   1050 <die@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @tu_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i64, i64* %2
%8 = add i64 %7, 1
store i64 %8, i64* %2
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %2
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
%14 = xor i1 %13, true
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %9
%18 = load i8*, i8** %3
%19 = load i64, i64* %2
%20 = call i32 @memset(i8* %18, i32 0, i64 %19)
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define i8* @tu_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
/* Variables and functions */
scalar_t__ config();
int /*<<< orphan*/ main_loop();
int /*<<< orphan*/ wi_start(int);
int main() {
  if (config())
    return 1;
  wi_start(10);
  main_loop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <config@plt>
cmp    $0x0,%rax
je     115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1174 <main+0x44>
mov    $0xa,%edi
call   1030 <wi_start@plt>
mov    $0x0,%al
call   1050 <main_loop@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <config@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1147 <main+0x17>
pop    %rcx
ret
mov    $0xa,%edi
call   1030 <wi_start@plt>
xor    %eax,%eax
call   1050 <main_loop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @config()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %8
5: ; preds = %0
%6 = call i32 @wi_start(i32 10)
%7 = call i32 (...) @main_loop()
store i32 0, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @config()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @wi_start(i32 10)
%5 = tail call i32 (...) @main_loop()
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void auto_indent(int levels) {
  for (int i = 0; i < levels; i++)
    putchar('\t');
}


x86 assembly (clang, -O0):
<auto_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <auto_indent+0x36>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <auto_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auto_indent>:
push   %rbx
test   %edi,%edi
jle    112f <auto_indent+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <auto_indent+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @auto_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i8 signext 9)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *memalign(int, size_t);
__attribute__((unused)) void *memalign16(size_t szB) {
  void *x;
  x = memalign(16, szB);
  assert(x);
  assert(0 == ((16 - 1) & (unsigned long)x));
  return x;
}


x86 assembly (clang, -O0):
<memalign16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x10,%edi
call   1040 <memalign@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rcx
and    $0xf,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memalign16>:
push   %rbx
mov    %rdi,%rsi
mov    $0x10,%edi
call   1040 <memalign@plt>
mov    %rax,%rbx
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @memalign16(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @memalign(i32 16, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %3
%10 = ptrtoint i8* %9 to i64
%11 = and i64 15, %10
%12 = icmp eq i64 0, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @memalign16(i64 %0) {
%2 = tail call align 16 i8* @memalign(i32 16, i64 %0)
%3 = ptrtoint i8* %2 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @assert(i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  printf("请输入一个ASCII码");
  char char_ASCII;
  scanf("%c", &char_ASCII);
  printf("%c的ASCII码值为%d", char_ASCII, char_ASCII);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%edx
lea    0xecf(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AAASCII\E7\A0\81\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [22 x i8] c"%c\E7\9A\84ASCII\E7\A0\81\E5\80\BC\E4\B8\BA%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AAASCII\E7\A0\81\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [22 x i8] c"%c\E7\9A\84ASCII\E7\A0\81\E5\80\BC\E4\B8\BA%d\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *_itoa(int n) {
  static char retbuf[100];
  sprintf(retbuf, "%d", n);
  return retbuf;
}


x86 assembly (clang, -O0):
<_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_itoa>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_itoa.retbuf = internal global [100 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @_itoa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @_itoa.retbuf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @_itoa.retbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@_itoa.retbuf = internal global [100 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @_itoa(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @_itoa.retbuf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @_itoa.retbuf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *pthread_wait_fn(void *arg) {
  sleep(100);
  return NULL;
}


x86 assembly (clang, -O0):
<pthread_wait_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_wait_fn>:
push   %rax
mov    $0x64,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @pthread_wait_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 100)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @pthread_wait_fn(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 100)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ one();
int /*<<< orphan*/ two();
int main() {
  one();
  two();
  one();
  two();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <one@plt>
mov    $0x0,%al
call   1030 <two@plt>
mov    $0x0,%al
call   1040 <one@plt>
mov    $0x0,%al
call   1030 <two@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @one()
%2 = call i32 (...) @two()
%3 = call i32 (...) @one()
%4 = call i32 (...) @two()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @one()
%2 = tail call i32 (...) @two()
%3 = tail call i32 (...) @one()
%4 = tail call i32 (...) @two()
ret i32 0
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ init_genrand(unsigned long);
void genrand_randomize(void) {
  struct timespec mytime;
  unsigned long seed;
  clock_gettime(CLOCK_MONOTONIC, &mytime);
  seed = (unsigned long)mytime.tv_nsec;
  init_genrand((unsigned long)seed);
}


x86 assembly (clang, -O0):
<genrand_randomize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <init_genrand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_randomize>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%rdi
call   1040 <init_genrand@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64 }
@CLOCK_MONOTONIC = global i32 0
define void @genrand_randomize() {
%1 = alloca %struct.timespec
%2 = alloca i64
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%6 = load i64, i64* %5
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = call i32 @init_genrand(i64 %7)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64 }
@CLOCK_MONOTONIC = global i32 0
define void @genrand_randomize() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = call i32 @init_genrand(i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void assertInt(long type) {
  if (type != 0) {
    fprintf(stderr, "ERROR operand is not an integer\n");
    exit(3);
  }
}


x86 assembly (clang, -O0):
<assertInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <assertInt+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertInt>:
test   %rdi,%rdi
jne    1126 <assertInt+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"ERROR operand is not an integer\0A\00"
define void @assertInt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 3)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"ERROR operand is not an integer\0A\00"
define void @assertInt(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 3)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char const *);
char *bar(void) {
  const char *s = "foo";
  char *s1 = s;
  s1 = s;
  foo(s);
  return s;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i8* @bar() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int creat(char const *, int);
int /*<<< orphan*/ die(char *, char const *);
int screat(const char *fname) {
  int fd = creat(fname, 0666);
  if (fd == -1)
    die("creat failed: %s", fname);
  return fd;
}


x86 assembly (clang, -O0):
<screat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1b6,%esi
call   1040 <creat@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1157 <screat+0x37>
mov    -0x8(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <die@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screat>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1b6,%esi
call   1040 <creat@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1146 <screat+0x26>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <die@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"creat failed: %s\00"
define i32 @screat(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @creat(i8* %4, i32 438)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [17 x i8] c"creat failed: %s\00"
define i32 @screat(i8* %0) {
%2 = tail call i32 @creat(i8* %0, i32 438)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int f1(int, int);
int main(int argc, char *argv[]) { return f1(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <f1@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @f1(i32 1, i32 2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xc9() {
  Assert_real((isodigit(201) == 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_isodigit.c",
              1010, ("isodigit should be 0 for 0xc9"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc9\00"
define void @t_isodigit_0xc9() {
%1 = call i64 @isodigit(i32 201)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1010, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc9\00"
define void @t_isodigit_0xc9() {
%1 = tail call i64 @isodigit(i32 201)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1010, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
extern __attribute__((gnu_)) double carmen_square(double val) {
  return (val * val);
}


x86 assembly (clang, -O0):
<carmen_square>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_square>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @carmen_square(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @carmen_square(double %0) {
%2 = fmul double %0, %0
ret double %2
}
double Inf(int sign) {
  union {
    double d;
    long x[2];
  } a;
  a.x[1] = (2047 << 20);
  a.x[0] = 0;
  if (sign < 0)
    a.x[1] |= (1 << 31);
  return a.d;
}


x86 assembly (clang, -O0):
<Inf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x7ff00000,-0x10(%rbp)
7f
movq   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112f <Inf+0x2f>
mov    -0x10(%rbp),%rax
or     $0xffffffff80000000,%rax
mov    %rax,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Inf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { [2 x i64] }
define double @Inf(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = bitcast %union.anon* %3 to [2 x i64]*
%5 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 1
store i64 2146435072, i64* %5
%6 = bitcast %union.anon* %3 to [2 x i64]*
%7 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 0
store i64 0, i64* %7
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = bitcast %union.anon* %3 to [2 x i64]*
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
%13 = load i64, i64* %12
%14 = or i64 %13, -2147483648
store i64 %14, i64* %12
br label %15
15: ; preds = %10, %1
%16 = bitcast %union.anon* %3 to double*
%17 = load double, double* %16
ret double %17
}

LLVM IR (-O2):
define double @Inf(i32 %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("tutu %c\n", 0x24);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x24,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x24,%esi
call   1030 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1130 <main+0x20>

LLVM IR (-O0):
@.str = [9 x i8] c"tutu %c\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 36)
br label %3
3: ; preds = %3, %0
br label %3
}

LLVM IR (-O2):
@.str = [9 x i8] c"tutu %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 36)
br label %2
2: ; preds = %2, %0
br label %2
}
void uzlib_init(void) {}


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

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

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

LLVM IR (-O2):
define void @uzlib_init() {
ret void
}
int os_exit(int status, int *rc) { return -1; }


x86 assembly (clang, -O0):
<os_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @os_exit(i32 %0, i32* nocapture readnone %1) {
ret i32 -1
}
int test_imm_4Fuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fuint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x4f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Fuint64_highword_reg>:
movabs $0x4f00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Fuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 79
%6 = icmp ne i64 %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_4Fuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 339302416384
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/, unsigned int);
int pidfd_open(pid_t pid, unsigned int flags) {
  return syscall(434, pid, flags);
}


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

x86 assembly (clang, -O2):
<pidfd_open>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1b2,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @pidfd_open(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 434, i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int eq_blake2b(int /*<<< orphan*/ *, void const *, void const *,
               int /*<<< orphan*/ const, int /*<<< orphan*/ const,
               int /*<<< orphan*/);
int eq_blake2(uint8_t *out, const void *in, const void *key,
              const uint8_t outlen, const uint64_t inlen, uint8_t keylen) {
  return eq_blake2b(out, in, key, outlen, inlen, keylen);
}


x86 assembly (clang, -O0):
<eq_blake2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <eq_blake2b@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq_blake2>:
jmp    1030 <eq_blake2b@plt>

LLVM IR (-O0):
define i32 @eq_blake2(i32* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @eq_blake2b(i32* %13, i8* %14, i8* %15, i32 %16, i32 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @eq_blake2(i32* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @eq_blake2b(i32* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
int main() {
  unsigned long long num;
  int i;
  num = 1;
  for (i = 0; i < 64; i++) {
    num *= 2;
    num += 1;
    printf("%lld\n", num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    116e <main+0x5e>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <main+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebx
mov    $0x40,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
add    %rbx,%rbx
add    $0x1,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi i64 [ 1, %0 ], [ %5, %1 ]
%4 = shl i64 %3, 1
%5 = or i64 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 64
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
u_int32_t extend_tu(u_int32_t base_tu, u_int32_t val, u_int32_t mask) {
  u_int32_t result;
  result = (base_tu & ~mask) | (val & mask);
  if ((base_tu & mask) > (val & mask))
    result += mask + 1;
  return result;
}


x86 assembly (clang, -O0):
<extend_tu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jle    1143 <extend_tu+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extend_tu>:
mov    %edx,%ecx
not    %ecx
and    %edi,%ecx
and    %edx,%esi
or     %esi,%ecx
and    %edx,%edi
add    $0x1,%edx
xor    %eax,%eax
cmp    %esi,%edi
cmovg  %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @extend_tu(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = or i32 %5, %6
%8 = and i32 %2, %0
%9 = icmp sgt i32 %8, %6
%10 = add nsw i32 %2, 1
%11 = select i1 %9, i32 %10, i32 0
%12 = add nsw i32 %7, %11
ret i32 %12
}
/* Variables and functions */
scalar_t__ u8_nextchar(char *, int *);
int u8_strlen(char *s) {
  int count = 0;
  int i = 0;
  while (u8_nextchar(s, &i) != 0)
    count++;
  return count;
}


x86 assembly (clang, -O0):
<u8_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <u8_nextchar@plt>
cmp    $0x0,%rax
je     114f <u8_strlen+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <u8_strlen+0x1a>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8_strlen>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0xc(%rsp)
mov    $0xffffffff,%ebp
lea    0xc(%rsp),%r14
nopl   (%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <u8_nextchar@plt>
add    $0x1,%ebp
test   %rax,%rax
jne    1130 <u8_strlen+0x20>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @u8_strlen(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %8, %4 ]
%6 = call i64 @u8_nextchar(i8* %0, i32* %2)
%7 = icmp eq i64 %6, 0
%8 = add nuw nsw i32 %5, 1
br i1 %7, label %9, label %4
9: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int right(int);
int compar(const void *p1, const void *p2) {
  int i1 = *(int *)p1;
  int i2 = *(int *)p2;
  int r1 = right(i1);
  int r2 = right(i2);
  return r1 - r2;
}


x86 assembly (clang, -O0):
<compar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <right@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <right@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%edi
mov    (%rsi),%ebx
call   1030 <right@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <right@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @right(i32 %4)
%8 = tail call i32 @right(i32 %6)
%9 = sub nsw i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int japi_getselend(int);
int j_getselend(int arg0) { return (japi_getselend(arg0)); }


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

x86 assembly (clang, -O2):
<j_getselend>:
jmp    1030 <japi_getselend@plt>

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

LLVM IR (-O2):
define i32 @j_getselend(i32 %0) {
%2 = tail call i32 @japi_getselend(i32 %0)
ret i32 %2
}
int digits_in_binary(int a) {
  int sum = 0;
  while (a) {
    if (a & 1)
      sum++;
    a = a >> 1;
  }
  return sum;
}


x86 assembly (clang, -O0):
<digits_in_binary>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <digits_in_binary+0x3e>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <digits_in_binary+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <digits_in_binary+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digits_in_binary>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <digits_in_binary+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <digits_in_binary+0x10>
ret

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

LLVM IR (-O2):
define i32 @digits_in_binary(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = ashr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void medlc_ShowHelp(FILE *outfile) {
  fprintf(outfile,
          "Computes a median light curve from all of the input light curves, "
          "and outputs the result to the file \"outfilename\". This command "
          "requires all of the light curves to be read-in. Also, all of the "
          "light curves must be the same length.\n\n");
}


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

x86 assembly (clang, -O2):
<medlc_ShowHelp>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xe9,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [234 x i8] c"Computes a median light curve from all of the input light curves, and outputs the result to the file \22outfilename\22. This command requires all of the light curves to be read-in. Also, all of the light curves must be the same length.\0A\0A\00"
define void @medlc_ShowHelp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([234 x i8], [234 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [234 x i8] c"Computes a median light curve from all of the input light curves, and outputs the result to the file \22outfilename\22. This command requires all of the light curves to be read-in. Also, all of the light curves must be the same length.\0A\0A\00"
define void @medlc_ShowHelp(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([234 x i8], [234 x i8]* @.str, i64 0, i64 0), i64 233, i64 1, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ PKEY_USAGE_PERIOD;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PKEY_USAGE_PERIOD_it;
void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a) {
  ASN1_item_free((ASN1_VALUE *)a, &PKEY_USAGE_PERIOD_it);
}


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

x86 assembly (clang, -O2):
<PKEY_USAGE_PERIOD_free>:
mov    0x2ee1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@PKEY_USAGE_PERIOD_it = global i32 0
define void @PKEY_USAGE_PERIOD_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @PKEY_USAGE_PERIOD_it)
ret void
}

LLVM IR (-O2):
@PKEY_USAGE_PERIOD_it = global i32 0
define void @PKEY_USAGE_PERIOD_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @PKEY_USAGE_PERIOD_it)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__4__GeneralIO__set();
void CC2420ControlP__CSN__set(void) { Msp430GpioC__4__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @CC2420ControlP__CSN__set() {
%1 = tail call i32 (...) @Msp430GpioC__4__GeneralIO__set()
ret void
}
/* Variables and functions */
void terminal_get_size(int *w, int *h) {}


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

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

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

LLVM IR (-O2):
define void @terminal_get_size(i32* nocapture %0, i32* nocapture %1) {
ret void
}
double max(double a, double b) {
  if (a > b)
    return a;
  else
    return b;
}


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

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

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

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void INT_Excep_RIIC0_EEI0(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @HelpItem88() {
ret i32 0
}
void PEOPS_SPUsetConfigFile(char *pCfg) {}


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

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

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

LLVM IR (-O2):
define void @PEOPS_SPUsetConfigFile(i8* nocapture %0) {
ret void
}