xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ntohl(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  uint32_t a = ntohl(0x12345678);
  printf("a is 0x%x\n", a);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"a is 0x%x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @ntohl(i32 305419896)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"a is 0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 @ntohl(i32 305419896)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int fflush(int /*<<< orphan*/ *);
int sca_fflush(FILE *Stream) {
  int value;
  value = -1;
  errno = EINTR;
  while (value == -1 && errno == EINTR) {
    value = fflush(Stream);
  }
  return value;
}


x86 assembly (clang, -O0):
<sca_fflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%rcx
mov    0x2eac(%rip),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
cmpl   $0xffffffff,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jne    1160 <sca_fflush+0x50>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1170 <sca_fflush+0x60>
jmp    1181 <sca_fflush+0x71>
mov    -0x8(%rbp),%rdi
call   1030 <fflush@plt>
mov    %eax,-0xc(%rbp)
jmp    1137 <sca_fflush+0x27>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sca_fflush>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eb9(%rip),%r14
mov    (%r14),%rax
mov    0x2eb7(%rip),%r15
mov    %rax,(%r15)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <fflush@plt>
cmp    $0xffffffff,%eax
jne    1145 <sca_fflush+0x35>
mov    (%r14),%rcx
cmp    %rcx,(%r15)
je     1130 <sca_fflush+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EINTR = global i64 0
@errno = global i64 0
define i32 @sca_fflush(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 -1, i32* %3
%4 = load i64, i64* @EINTR
store i64 %4, i64* @errno
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i64, i64* @errno
%10 = load i64, i64* @EINTR
%11 = icmp eq i64 %9, %10
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %17
14: ; preds = %12
%15 = load i32*, i32** %2
%16 = call i32 @fflush(i32* %15)
store i32 %16, i32* %3
br label %5
17: ; preds = %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@EINTR = global i64 0
@errno = global i64 0
define i32 @sca_fflush(i32* nocapture %0) {
%2 = load i64, i64* @EINTR
store i64 %2, i64* @errno
br label %3
3: ; preds = %1, %3
%4 = tail call i32 @fflush(i32* %0)
%5 = icmp eq i32 %4, -1
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
%9 = select i1 %5, i1 %8, i1 false
br i1 %9, label %3, label %10
10: ; preds = %3
ret i32 %4
}
/* Type definitions */
struct core_instr_params {
  int dummy;
};
struct core_cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ core_cpu_i__jump(struct core_cpu *,
                                    struct core_instr_params *,
                                    int /*<<< orphan*/);
void core_cpu_i_op_jp(struct core_cpu *cpu, struct core_instr_params *p) {
  core_cpu_i__jump(cpu, p, 0);
}


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

x86 assembly (clang, -O2):
<core_cpu_i_op_jp>:
xor    %edx,%edx
jmp    1030 <core_cpu_i__jump@plt>

LLVM IR (-O0):
%struct.core_cpu = type { i32 }
%struct.core_instr_params = type { i32 }
define void @core_cpu_i_op_jp(%struct.core_cpu* %0, %struct.core_instr_params* %1) {
%3 = alloca %struct.core_cpu*
%4 = alloca %struct.core_instr_params*
store %struct.core_cpu* %0, %struct.core_cpu** %3
store %struct.core_instr_params* %1, %struct.core_instr_params** %4
%5 = load %struct.core_cpu*, %struct.core_cpu** %3
%6 = load %struct.core_instr_params*, %struct.core_instr_params** %4
%7 = call i32 @core_cpu_i__jump(%struct.core_cpu* %5, %struct.core_instr_params* %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.core_cpu = type { i32 }
%struct.core_instr_params = type { i32 }
define void @core_cpu_i_op_jp(%struct.core_cpu* %0, %struct.core_instr_params* %1) {
%3 = tail call i32 @core_cpu_i__jump(%struct.core_cpu* %0, %struct.core_instr_params* %1, i32 0)
ret void
}
/* Variables and functions */
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ log10(int);
int integerLength(int n) {
  if (n == 0) {
    return 1;
  } else {
    double l = floor(log10(n)) + 1;
    return (int)l;
  }
}


x86 assembly (clang, -O0):
<integerLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <integerLength+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1164 <integerLength+0x44>
mov    -0x8(%rbp),%edi
call   1030 <log10@plt>
mov    %eax,%edi
call   1040 <floor@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integerLength>:
test   %edi,%edi
je     1139 <integerLength+0x19>
push   %rax
call   1030 <log10@plt>
mov    %eax,%edi
call   1040 <floor@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @integerLength(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @log10(i32 %0)
%5 = tail call i32 @floor(i32 %4)
%6 = add nsw i32 %5, 1
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ foo(int, int, int, int);
start() {
  foo(1, 2, 3, 4);
  exit(5);
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <foo@plt>
mov    $0x5,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<start>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <foo@plt>
mov    $0x5,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @start() {
%1 = call i32 @foo(i32 1, i32 2, i32 3, i32 4)
%2 = call i32 @exit(i32 5)
unreachable
}

LLVM IR (-O2):
define i32 @start() {
%1 = tail call i32 @foo(i32 1, i32 2, i32 3, i32 4)
%2 = tail call i32 @exit(i32 5)
unreachable
}
int f(int **i) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32** nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t const);
void *nhr_malloc(size_t const);
void *nhr_malloc_zero(const size_t size) {
  void *mem = nhr_malloc(size);
  if (mem) {
    memset(mem, 0, size);
  }
  return mem;
}


x86 assembly (clang, -O0):
<nhr_malloc_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nhr_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <nhr_malloc_zero+0x33>
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):
<nhr_malloc_zero>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <nhr_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <nhr_malloc_zero+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @nhr_malloc_zero(i64 %0) {
%2 = tail call i8* @nhr_malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char s[] = "\0\1\2\3\4";
  printf("%c", 'A' + s[3]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
movsbl -0x7(%rbp),%eax
add    $0x41,%eax
lea    0xec5(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [6 x i8] c"\00\01\02\03\04\00"
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = add nsw i32 65, %6
%8 = trunc i32 %7 to i8
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 68)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int ac() {
  printf("Hello world!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @ac() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @ac() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned long unsignedlong_ignoring_signedlongint(unsigned long x,
                                                  signed long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlong_ignoring_signedlongint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlong_ignoring_signedlongint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlong_ignoring_signedlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dagutil_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @dagutil_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int sscanf(char const *, char *, unsigned int *, unsigned int *);
int is_version_number(const char *version) {
  unsigned int d1, d2;
  return (sscanf(version, "%u.%u", &d1, &d2) == 2);
}


x86 assembly (clang, -O0):
<is_version_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <sscanf@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_version_number>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%u.%u\00"
define i32 @is_version_number(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"%u.%u\00"
define i32 @is_version_number(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
int main(void) {
  char ch;
  ch = getchar();
  while (ch != '\n') {
    if (ch == ' ')
      putchar(ch);
    else
      putchar(ch + 1);
    ch = getchar();
  }
  putchar(ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     117f <main+0x5f>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1161 <main+0x41>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    1170 <main+0x50>
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
jmp    1139 <main+0x19>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
jmp    1138 <main+0x18>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x20,%al
je     1130 <main+0x10>
cmp    $0xa,%al
je     114b <main+0x2b>
add    $0x1,%al
jmp    1130 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %2
br label %4
4: ; preds = %21, %0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %23
8: ; preds = %4
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i8, i8* %2
%14 = call i32 @putchar(i8 signext %13)
br label %21
15: ; preds = %8
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = add nsw i32 %17, 1
%19 = trunc i32 %18 to i8
%20 = call i32 @putchar(i8 signext %19)
br label %21
21: ; preds = %15, %12
%22 = call signext i8 (...) @getchar()
store i8 %22, i8* %2
br label %4
23: ; preds = %4
%24 = load i8, i8* %2
%25 = call i32 @putchar(i8 signext %24)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %5, %0
%2 = tail call signext i8 (...) @getchar()
switch i8 %2, label %3 [
i8 10, label %8
i8 32, label %5
]
3: ; preds = %1
%4 = add i8 %2, 1
br label %5
5: ; preds = %1, %3
%6 = phi i8 [ %4, %3 ], [ %2, %1 ]
%7 = tail call i32 @putchar(i8 signext %6)
br label %1
8: ; preds = %1
%9 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
void gtk_icon_view_path_is_selected() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_path_is_selected() {
ret void
}
const char *get_package_description(void) {
  return "Emulator for 8051 family microcontrollers";
}


x86 assembly (clang, -O0):
<get_package_description>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_package_description>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Emulator for 8051 family microcontrollers\00"
define i8* @get_package_description() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [42 x i8] c"Emulator for 8051 family microcontrollers\00"
define i8* @get_package_description() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char const *);
int phBlindTransferCall(int cid, const char *uri) {
  char reqbuf[1000];
  snprintf(reqbuf, sizeof(reqbuf), "BTXCALL CID=%d TO=%s", cid, uri);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phBlindTransferCall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x3e8,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phBlindTransferCall>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsi,%r8
mov    %edi,%ecx
lea    0xecc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"BTXCALL CID=%d TO=%s\00"
define i32 @phBlindTransferCall(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [1000 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 1000, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = call i32 @ph_rpc(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [21 x i8] c"BTXCALL CID=%d TO=%s\00"
define i32 @phBlindTransferCall(i32 %0, i8* %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 1000, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%6 = call i32 @ph_rpc(i8* %4)
ret i32 %6
}
int fibo(int n) {
  if (n < 2)
    return 1;
  else
    return fibo(n - 1) + fibo(n - 2);
}


x86 assembly (clang, -O0):
<fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1131 <fibo+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fibo+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fibo+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fibo@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fibo+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibo(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibo(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int release_driver() {
  puts("release_driver ");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"release_driver \00"
define i32 @release_driver() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
scalar_t__ syscall(int /*<<< orphan*/);
long udi_get_thread_id(int pid) { return (long)syscall(SYS_gettid); }


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

x86 assembly (clang, -O2):
<udi_get_thread_id>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i64 @udi_get_thread_id(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_gettid
%4 = call i64 @syscall(i32 %3)
ret i64 %4
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i64 @udi_get_thread_id(i32 %0) {
%2 = load i32, i32* @SYS_gettid
%3 = tail call i64 @syscall(i32 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int readProgramAndCount();
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int numProgram, level;
  scanf("%d", &numProgram);
  while (numProgram) {
    printf("%d\n", readProgramAndCount());
    numProgram--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     117c <main+0x4c>
mov    $0x0,%al
call   1030 <readProgramAndCount@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
je     1178 <main+0x48>
lea    0xeaf(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <readProgramAndCount@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
addl   $0xffffffff,0xc(%rsp)
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = call i32 (...) @readProgramAndCount()
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t wcrtomb(char *s, wchar_t wc, mbstate_t *ps) {
  if (s != NULL)
    *s = 1;
  return 1;
}


x86 assembly (clang, -O0):
<wcrtomb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1121 <wcrtomb+0x21>
mov    -0x8(%rbp),%rax
movb   $0x1,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcrtomb>:
test   %rdi,%rdi
je     1108 <wcrtomb+0x8>
movb   $0x1,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @wcrtomb(i8* writeonly %0, i32 %1, i32* nocapture readnone %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8 1, i8* %0
br label %6
6: ; preds = %5, %3
ret i64 1
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ accept(int, struct sockaddr *, int /*<<< orphan*/ *);
int util_safeio_get_fd(int /*<<< orphan*/);
int util_safeio_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
  return util_safeio_get_fd(accept(sockfd, addr, addrlen));
}


x86 assembly (clang, -O0):
<util_safeio_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <accept@plt>
mov    %eax,%edi
call   1040 <util_safeio_get_fd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_safeio_accept>:
push   %rax
call   1030 <accept@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <util_safeio_get_fd@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @util_safeio_accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32*, i32** %6
%10 = call i32 @accept(i32 %7, %struct.sockaddr* %8, i32* %9)
%11 = call i32 @util_safeio_get_fd(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @util_safeio_accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = tail call i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %2)
%5 = tail call i32 @util_safeio_get_fd(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ASN1_add_oid_module();
int /*<<< orphan*/ ENGINE_add_conf_module();
void OPENSSL_load_builtin_modules(void) {
  ASN1_add_oid_module();
  ENGINE_add_conf_module();
}


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

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

LLVM IR (-O0):
define void @OPENSSL_load_builtin_modules() {
%1 = call i32 (...) @ASN1_add_oid_module()
%2 = call i32 (...) @ENGINE_add_conf_module()
ret void
}

LLVM IR (-O2):
define void @OPENSSL_load_builtin_modules() {
%1 = tail call i32 (...) @ASN1_add_oid_module()
%2 = tail call i32 (...) @ENGINE_add_conf_module()
ret void
}
void HDrawImage(unsigned char *p, int x, int y, int width, int height) {}


x86 assembly (clang, -O0):
<HDrawImage>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @HDrawImage(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @HDrawImage(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
int B64ToB256Bytes(int numB64Bytes) { return (numB64Bytes * 6) / 8; }


x86 assembly (clang, -O0):
<B64ToB256Bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x6,-0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<B64ToB256Bytes>:
add    %edi,%edi
lea    (%rdi,%rdi,2),%ecx
lea    (%rdi,%rdi,2),%eax
add    $0x7,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @B64ToB256Bytes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 6
%5 = sdiv i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @B64ToB256Bytes(i32 %0) {
%2 = mul nsw i32 %0, 6
%3 = sdiv i32 %2, 8
ret i32 %3
}
char *__argp_short_program_name(void) { return ""; }


x86 assembly (clang, -O0):
<__argp_short_program_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__argp_short_program_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @__argp_short_program_name() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @__argp_short_program_name() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
int ecore_direct_compare(const void *key1, const void *key2) {
  unsigned long k1, k2;
  k1 = (unsigned long)key1;
  k2 = (unsigned long)key2;
  if (k1 > k2)
    return 1;
  if (k1 < k2)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<ecore_direct_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    1136 <ecore_direct_compare+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1157 <ecore_direct_compare+0x57>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1150 <ecore_direct_compare+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <ecore_direct_compare+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecore_direct_compare>:
cmp    %rsi,%rdi
sbb    %ecx,%ecx
cmp    %rsi,%rdi
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ecore_direct_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp ugt i8* %0, %1
%4 = icmp ult i8* %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test_stress(int);
int main(void) {
  test_stress(100);
  test_stress(1000);
  test_stress(10000);
  test_stress(100000);
  test_stress(1000000);
  test_stress(10000000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1030 <test_stress@plt>
mov    $0x3e8,%edi
call   1030 <test_stress@plt>
mov    $0x2710,%edi
call   1030 <test_stress@plt>
mov    $0x186a0,%edi
call   1030 <test_stress@plt>
mov    $0xf4240,%edi
call   1030 <test_stress@plt>
mov    $0x989680,%edi
call   1030 <test_stress@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1030 <test_stress@plt>
mov    $0x3e8,%edi
call   1030 <test_stress@plt>
mov    $0x2710,%edi
call   1030 <test_stress@plt>
mov    $0x186a0,%edi
call   1030 <test_stress@plt>
mov    $0xf4240,%edi
call   1030 <test_stress@plt>
mov    $0x989680,%edi
call   1030 <test_stress@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test_stress(i32 100)
%3 = call i32 @test_stress(i32 1000)
%4 = call i32 @test_stress(i32 10000)
%5 = call i32 @test_stress(i32 100000)
%6 = call i32 @test_stress(i32 1000000)
%7 = call i32 @test_stress(i32 10000000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_stress(i32 100)
%2 = tail call i32 @test_stress(i32 1000)
%3 = tail call i32 @test_stress(i32 10000)
%4 = tail call i32 @test_stress(i32 100000)
%5 = tail call i32 @test_stress(i32 1000000)
%6 = tail call i32 @test_stress(i32 10000000)
ret i32 0
}
/* Variables and functions */
int strlen(char const *);
int StrVisualLength(const char *str) { return (strlen(str)); }


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

x86 assembly (clang, -O2):
<StrVisualLength>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @StrVisualLength(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
double power(double x, unsigned n) {
  if (n == 0)
    return 1;
  double y = power(x, n / 2);
  if (n % 2 == 0) {
    return y * y;
  } else {
    return x * y * y;
  }
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    113c <power+0x2c>
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1188 <power+0x78>
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
shr    $0x1,%edi
call   1030 <power@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1174 <power+0x64>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1188 <power+0x78>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
push   %rbx
sub    $0x10,%rsp
test   %edi,%edi
je     1135 <power+0x25>
mov    %edi,%ebx
shr    %edi
movsd  %xmm0,0x8(%rsp)
call   1030 <power@plt>
test   $0x1,%bl
je     113f <power+0x2f>
movsd  0x8(%rsp),%xmm1
jmp    1147 <power+0x37>
movsd  0xec3(%rip),%xmm1
jmp    114f <power+0x3f>
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @power(double %0, i32 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
store double %0, double* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store double 1.000000e+00, double* %3
br label %28
10: ; preds = %2
%11 = load double, double* %4
%12 = load i32, i32* %5
%13 = udiv i32 %12, 2
%14 = call double @power(double %11, i32 %13)
store double %14, double* %6
%15 = load i32, i32* %5
%16 = urem i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %10
%19 = load double, double* %6
%20 = load double, double* %6
%21 = fmul double %19, %20
store double %21, double* %3
br label %28
22: ; preds = %10
%23 = load double, double* %4
%24 = load double, double* %6
%25 = fmul double %23, %24
%26 = load double, double* %6
%27 = fmul double %25, %26
store double %27, double* %3
br label %28
28: ; preds = %22, %18, %9
%29 = load double, double* %3
ret double %29
}

LLVM IR (-O2):
define double @power(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi double [ %13, %6 ], [ 1.000000e+00, %2 ]
ret double %5
6: ; preds = %2
%7 = lshr i32 %1, 1
%8 = tail call double @power(double %0, i32 %7)
%9 = and i32 %1, 1
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, double 1.000000e+00, double %0
%12 = fmul double %11, %8
%13 = fmul double %8, %12
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ closetty();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vito_close();
void exit_handler(int exitcode) {
  printf("\n");
  fprintf(stderr, "\nAbort caught!\n");
  sleep(3);
  vito_close();
  closetty();
  exit(exitcode);
}


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    0xe79(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x3,%edi
call   1080 <sleep@plt>
mov    $0x0,%al
call   1050 <vito_close@plt>
mov    $0x0,%al
call   1030 <closetty@plt>
mov    -0x4(%rbp),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<exit_handler>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0xe83(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x3,%edi
call   1080 <sleep@plt>
xor    %eax,%eax
call   1050 <vito_close@plt>
xor    %eax,%eax
call   1030 <closetty@plt>
mov    %ebx,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"\0AAbort caught!\0A\00"
define void @exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @sleep(i32 3)
%7 = call i32 (...) @vito_close()
%8 = call i32 (...) @closetty()
%9 = load i32, i32* %2
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [16 x i8] c"\0AAbort caught!\0A\00"
define void @exit_handler(i32 %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 3)
%6 = tail call i32 (...) @vito_close()
%7 = tail call i32 (...) @closetty()
%8 = tail call i32 @exit(i32 %0)
unreachable
}
void OnCloseCB0(const char *connectionID, int isClosedByClient, int code,
                const char *reason, int length) {}


x86 assembly (clang, -O0):
<OnCloseCB0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @OnCloseCB0(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @OnCloseCB0(i8* nocapture %0, i32 %1, i32 %2, i8* nocapture %3, i32 %4) {
ret void
}
int alt_up_rs232_check_parity(unsigned int data_reg) {
  unsigned parity_error = (data_reg & 0x00000200) >> 9;
  return (parity_error ? -1 : 0);
}


x86 assembly (clang, -O0):
<alt_up_rs232_check_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x200,%eax
shr    $0x9,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alt_up_rs232_check_parity>:
mov    %edi,%eax
shl    $0x16,%eax
sar    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @alt_up_rs232_check_parity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 512
%6 = lshr i32 %5, 9
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @alt_up_rs232_check_parity(i32 %0) {
%2 = shl i32 %0, 22
%3 = ashr i32 %2, 31
ret i32 %3
}
void foo644() {}


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

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

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

LLVM IR (-O2):
define void @foo644() {
ret void
}
/* Variables and functions */
int atoi(char *);
int getint_cb(void *arg, int argc, char **argv, char **colname) {
  *((int *)arg) = atoi(argv[0]);
  return 1;
}


x86 assembly (clang, -O0):
<getint_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getint_cb>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdx),%rdi
call   1030 <atoi@plt>
mov    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getint_cb(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%9 = load i8**, i8*** %7
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
ret i32 1
}

LLVM IR (-O2):
define i32 @getint_cb(i8* nocapture writeonly %0, i32 %1, i8** nocapture %2, i8** nocapture readnone %3) {
%5 = load i8*, i8** %2
%6 = tail call i32 @atoi(i8* %5)
%7 = bitcast i8* %0 to i32*
store i32 %6, i32* %7
ret i32 1
}
/* Type definitions */
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int ftrylockfile(int /*<<< orphan*/);
int my_ftrylockfile(struct aFILE *fp) {
  return ftrylockfile(_get_actual_fp(fp));
}


x86 assembly (clang, -O0):
<my_ftrylockfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_get_actual_fp@plt>
mov    %eax,%edi
call   1030 <ftrylockfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ftrylockfile>:
push   %rax
call   1040 <_get_actual_fp@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ftrylockfile@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_ftrylockfile(%struct.aFILE* %0) {
%2 = alloca %struct.aFILE*
store %struct.aFILE* %0, %struct.aFILE** %2
%3 = load %struct.aFILE*, %struct.aFILE** %2
%4 = call i32 @_get_actual_fp(%struct.aFILE* %3)
%5 = call i32 @ftrylockfile(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_ftrylockfile(%struct.aFILE* %0) {
%2 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%3 = tail call i32 @ftrylockfile(i32 %2)
ret i32 %3
}
/* Variables and functions */
double exp(double);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("%f\n", exp(123.3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
call   1040 <exp@plt>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @exp(double 1.233000e+02)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x4B0D88ABBF99ACE1)
ret i32 0
}