xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(const char *cs, const char *ct) {
  unsigned char c1, c2;
  int res = 0;
  do {
    c1 = *cs++;
    c2 = *ct++;
    res = c1 - c2;
    if (res)
      break;
  } while (c1);
  return res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movzbl -0x11(%rbp),%eax
movzbl -0x12(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1157 <strcmp+0x57>
jmp    1166 <strcmp+0x66>
jmp    115c <strcmp+0x5c>
cmpb   $0x0,-0x11(%rbp)
jne    1113 <strcmp+0x13>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%edx
movzbl (%rsi,%rcx,1),%r8d
mov    %edx,%eax
sub    %r8d,%eax
jne    1128 <strcmp+0x28>
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcmp+0x10>
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %8, %3 ]
%5 = phi i8* [ %0, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %4
%10 = zext i8 %7 to i32
%11 = zext i8 %9 to i32
%12 = sub nsw i32 %10, %11
%13 = icmp eq i32 %12, 0
%14 = icmp ne i8 %7, 0
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %3, label %16
16: ; preds = %3
ret i32 %12
}
/* Type definitions */
struct char_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ char_buffer_append(struct char_buffer *, char *, size_t);
size_t snprintf(char *, int, char *, float);
void char_buffer_append_float(struct char_buffer *b, float f) {
  char digits[64] = {0};
  size_t count = snprintf(digits, 64, "%f", f);
  char_buffer_append(b, digits, count);
}


x86 assembly (clang, -O0):
<char_buffer_append_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
lea    -0x50(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
mov    $0x40,%esi
lea    0xe9a(%rip),%rdx
call   1030 <snprintf@plt>
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
call   1050 <char_buffer_append@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_buffer_append_float>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
xorps  %xmm1,%xmm1
movaps %xmm1,0x30(%rsp)
movaps %xmm1,0x20(%rsp)
movaps %xmm1,0x10(%rsp)
movaps %xmm1,(%rsp)
lea    0xeb9(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <char_buffer_append@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.char_buffer = type { i32 }
@.str = [3 x i8] c"%f\00"
define void @char_buffer_append_float(%struct.char_buffer* %0, float %1) {
%3 = alloca %struct.char_buffer*
%4 = alloca float
%5 = alloca [64 x i8]
%6 = alloca i64
store %struct.char_buffer* %0, %struct.char_buffer** %3
store float %1, float* %4
%7 = bitcast [64 x i8]* %5 to i8*
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%9 = load float, float* %4
%10 = call i64 @snprintf(i8* %8, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %9)
store i64 %10, i64* %6
%11 = load %struct.char_buffer*, %struct.char_buffer** %3
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%13 = load i64, i64* %6
%14 = call i32 @char_buffer_append(%struct.char_buffer* %11, i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
%struct.char_buffer = type { i32 }
@.str = [3 x i8] c"%f\00"
define void @char_buffer_append_float(%struct.char_buffer* %0, float %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i64 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %1)
%6 = call i32 @char_buffer_append(%struct.char_buffer* %0, i8* %4, i64 %5)
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getpid();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ write_to_file_of_pids(int);
int exit_wrapper(int status) {
  static int did_exit_wrapper = 0;
  if (did_exit_wrapper) {
    return status;
  }
  did_exit_wrapper = 1;
  pid_t pid = getpid();
  if (0)
    fprintf(stderr, "exit from %d\n", pid);
  write_to_file_of_pids(-pid);
  return status;
}


x86 assembly (clang, -O0):
<exit_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,0x2f02(%rip)
je     1143 <exit_wrapper+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <exit_wrapper+0x47>
movl   $0x1,0x2ee7(%rip)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
sub    -0xc(%rbp),%edi
call   1040 <write_to_file_of_pids@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_wrapper>:
push   %rbx
mov    %edi,%ebx
cmpb   $0x0,0x2f0a(%rip)
jne    1143 <exit_wrapper+0x23>
movb   $0x1,0x2f01(%rip)
xor    %eax,%eax
call   1030 <getpid@plt>
neg    %eax
mov    %eax,%edi
call   1040 <write_to_file_of_pids@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@exit_wrapper.did_exit_wrapper = internal global i32 0
@stderr = global i32 0
define i32 @exit_wrapper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* @exit_wrapper.did_exit_wrapper
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %15
9: ; preds = %1
store i32 1, i32* @exit_wrapper.did_exit_wrapper
%10 = call i32 (...) @getpid()
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = call i32 @write_to_file_of_pids(i32 %12)
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %9, %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@exit_wrapper.did_exit_wrapper = internal unnamed_addr global i1 false
@stderr = global i32 0
define i32 @exit_wrapper(i32 returned %0) {
%2 = load i1, i1* @exit_wrapper.did_exit_wrapper
br i1 %2, label %7, label %3
3: ; preds = %1
store i1 true, i1* @exit_wrapper.did_exit_wrapper
%4 = tail call i32 (...) @getpid()
%5 = sub nsw i32 0, %4
%6 = tail call i32 @write_to_file_of_pids(i32 %5)
br label %7
7: ; preds = %1, %3
ret i32 %0
}
/* Variables and functions */
scalar_t__ sqrt(double);
long double sqrtl(long double x) { return (long double)sqrt((double)x); }


x86 assembly (clang, -O0):
<sqrtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sqrt@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @sqrtl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @sqrt(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @sqrtl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @sqrt(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Variables and functions */
int /*<<< orphan*/ soar_ecExplainChunkCondition(char *, int);
void explain_chunk(char *name, int cond_number) {
  soar_ecExplainChunkCondition(name, cond_number);
}


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

x86 assembly (clang, -O2):
<explain_chunk>:
jmp    1030 <soar_ecExplainChunkCondition@plt>

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

LLVM IR (-O2):
define void @explain_chunk(i8* %0, i32 %1) {
%3 = tail call i32 @soar_ecExplainChunkCondition(i8* %0, i32 %1)
ret void
}
void fa140(void) {
a:
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        p025A:
          goto p025A;
          goto a;
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa140>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fa140+0x9>
jmp    1109 <fa140+0x9>

x86 assembly (clang, -O2):
<fa140>:
jmp    1100 <fa140>

LLVM IR (-O0):
define void @fa140() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %0
br label %8
8: ; preds = %8, %7
br label %8
9: ; No predecessors!
br label %10
10: ; preds = %10, %9
br label %10
11: ; preds = %11
br label %11
12: ; No predecessors!
br label %13
13: ; preds = %13, %12
br label %13
14: ; preds = %14
br label %14
15: ; preds = %15
br label %15
16: ; No predecessors!
br label %17
17: ; preds = %17, %16
br label %17
18: ; No predecessors!
br label %19
19: ; preds = %19, %18
br label %19
20: ; preds = %20
br label %20
21: ; No predecessors!
br label %22
22: ; preds = %22, %21
br label %22
23: ; preds = %23
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa140() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_ExitRepeatOutOfContext(long p_position) {
  _Error(p_position, "'exit repeat' must appear within a repeat");
}


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

x86 assembly (clang, -O2):
<Error_ExitRepeatOutOfContext>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"'exit repeat' must appear within a repeat\00"
define void @Error_ExitRepeatOutOfContext(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"'exit repeat' must appear within a repeat\00"
define void @Error_ExitRepeatOutOfContext(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char uint32_t;

/* Variables and functions */
uint32_t get_32_le(char *buf, char **end) {
  *end = buf + 4;
  return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
}


x86 assembly (clang, -O0):
<get_32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
add    $0x4,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_32_le>:
lea    0x4(%rdi),%rax
mov    %rax,(%rsi)
mov    (%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @get_32_le(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 4
%7 = load i8**, i8*** %4
store i8* %6, i8** %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = or i32 %11, %16
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = shl i32 %21, 16
%23 = or i32 %17, %22
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = shl i32 %27, 24
%29 = or i32 %23, %28
%30 = trunc i32 %29 to i8
ret i8 %30
}

LLVM IR (-O2):
define signext i8 @get_32_le(i8* %0, i8** nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 4
store i8* %3, i8** %1
%4 = load i8, i8* %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ spamm_exit(int const *const);
void spamm_exit__(const int *const exitcode) { spamm_exit(exitcode); }


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

x86 assembly (clang, -O2):
<spamm_exit__>:
jmp    1030 <spamm_exit@plt>

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

LLVM IR (-O2):
define void @spamm_exit__(i32* %0) {
%2 = tail call i32 @spamm_exit(i32* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef size_t uint16_t;

/* Variables and functions */
uint32_t get_uint32(const uint8_t *buf, uint16_t pos) {
  return (((uint32_t)buf[pos] << 24) | ((uint32_t)buf[pos + 1] << 16) |
          ((uint32_t)buf[pos + 2] << 8) | buf[pos + 3]);
}


x86 assembly (clang, -O0):
<get_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
mov    0x4(%rcx,%rdx,4),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
mov    0x8(%rcx,%rdx,4),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
or     0xc(%rcx,%rdx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint32>:
mov    (%rdi,%rsi,4),%eax
mov    0x4(%rdi,%rsi,4),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi,%rsi,4),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @get_uint32(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = load i32, i32* %7
%9 = shl i32 %8, 24
%10 = load i32*, i32** %3
%11 = load i64, i64* %4
%12 = add i64 %11, 1
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = shl i32 %14, 16
%16 = or i32 %9, %15
%17 = load i32*, i32** %3
%18 = load i64, i64* %4
%19 = add i64 %18, 2
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = shl i32 %21, 8
%23 = or i32 %16, %22
%24 = load i32*, i32** %3
%25 = load i64, i64* %4
%26 = add i64 %25, 3
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
%29 = or i32 %23, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @get_uint32(i32* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 %1
%4 = load i32, i32* %3
%5 = shl i32 %4, 24
%6 = add i64 %1, 1
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %9, %5
%11 = add i64 %1, 2
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = or i32 %10, %14
%16 = add i64 %1, 3
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = or i32 %15, %18
ret i32 %19
}
int ftw(const char *dir,
        int (*fn)(const char *file, const struct stat *sb, int flag),
        int nopenfd) {
  fn("", 0, 0);
}


x86 assembly (clang, -O0):
<ftw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    0xee6(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   *-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftw>:
mov    %rsi,%rax
lea    0xef6(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
jmp    *%rax

LLVM IR (-O0):
%struct.stat = type opaque
@.str = [1 x i8] zeroinitializer
define i32 @ftw(i8* %0, i32 (i8*, %struct.stat*, i32)* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32 (i8*, %struct.stat*, i32)*
%7 = alloca i32
store i8* %0, i8** %5
store i32 (i8*, %struct.stat*, i32)* %1, i32 (i8*, %struct.stat*, i32)** %6
store i32 %2, i32* %7
%8 = load i32 (i8*, %struct.stat*, i32)*, i32 (i8*, %struct.stat*, i32)** %6
%9 = call i32 %8(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.stat* null, i32 0)
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type opaque
@.str = [1 x i8] zeroinitializer
define i32 @ftw(i8* nocapture readnone %0, i32 (i8*, %struct.stat*, i32)* nocapture %1, i32 %2) {
%4 = tail call i32 %1(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.stat* null, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_cue() {
  printf(
      "        <circle cx=\"7.00\" cy=\"12.50\" r=\"3.50\" fill=\"red\" />\n");
  printf(
      "        <circle cx=\"7.00\" cy=\"23.50\" r=\"3.50\" fill=\"red\" />\n");
  printf("        <polygon points=\"14.00,4.00 14.00,32.00 25.60,32.00\" />\n");
  printf(
      "        <polygon points=\"134.00,4.00 145.60,4.00 145.60,32.00\" />\n");
}


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

x86 assembly (clang, -O2):
<print_cue>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xf48(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [61 x i8] c" <circle cx=\227.00\22 cy=\2212.50\22 r=\223.50\22 fill=\22red\22 />\0A\00"
@.str.1 = [61 x i8] c" <circle cx=\227.00\22 cy=\2223.50\22 r=\223.50\22 fill=\22red\22 />\0A\00"
@.str.2 = [65 x i8] c" <polygon points=\2214.00,4.00 14.00,32.00 25.60,32.00\22 />\0A\00"
@.str.3 = [67 x i8] c" <polygon points=\22134.00,4.00 145.60,4.00 145.60,32.00\22 />\0A\00"
define void @print_cue() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [60 x i8] c" <circle cx=\227.00\22 cy=\2212.50\22 r=\223.50\22 fill=\22red\22 />\00"
@str.4 = [60 x i8] c" <circle cx=\227.00\22 cy=\2223.50\22 r=\223.50\22 fill=\22red\22 />\00"
@str.5 = [64 x i8] c" <polygon points=\2214.00,4.00 14.00,32.00 25.60,32.00\22 />\00"
@str.6 = [66 x i8] c" <polygon points=\22134.00,4.00 145.60,4.00 145.60,32.00\22 />\00"
define void @print_cue() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.6, i64 0, i64 0))
ret void
}
void RTAvlroGCPhysInsert(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPhysInsert() {
ret void
}
/* Variables and functions */
int maze_test();
int main(int argc, char *argv[]) {
  int iRet = 0;
  iRet = maze_test();
  return iRet;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <maze_test@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @maze_test()
ret i32 %3
}
/* Variables and functions */
int isUgly(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", isUgly(19));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @isUgly(i32 19)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int fun1192() { return 1192; }


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

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

LLVM IR (-O0):
define i32 @fun1192() {
ret i32 1192
}

LLVM IR (-O2):
define i32 @fun1192() {
ret i32 1192
}
main() {
  typedef void *size_t;
  size_t p = (void *)5;
  return (int)p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* inttoptr (i64 5 to i8*), i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
scalar_t__ OPENSSL_sk_pop(int /*<<< orphan*/ *);
const char *sk_OPENSSL_CSTRING_pop(struct stack_st_OPENSSL_CSTRING *sk) {
  return (const char *)OPENSSL_sk_pop((OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_CSTRING_pop>:
jmp    1030 <OPENSSL_sk_pop@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i8* @sk_OPENSSL_CSTRING_pop(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = alloca %struct.stack_st_OPENSSL_CSTRING*
store %struct.stack_st_OPENSSL_CSTRING* %0, %struct.stack_st_OPENSSL_CSTRING** %2
%3 = load %struct.stack_st_OPENSSL_CSTRING*, %struct.stack_st_OPENSSL_CSTRING** %2
%4 = bitcast %struct.stack_st_OPENSSL_CSTRING* %3 to i32*
%5 = call i64 @OPENSSL_sk_pop(i32* %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i8* @sk_OPENSSL_CSTRING_pop(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_CSTRING, %struct.stack_st_OPENSSL_CSTRING* %0, i64 0, i32 0
%3 = tail call i64 @OPENSSL_sk_pop(i32* %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int signbit(double);
int main(void) {
  printf("signbit(+0.0) = %d\n", signbit(+0.0));
  printf("signbit(-0.0) = %d\n", signbit(-0.0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
call   1040 <signbit@plt>
mov    %eax,%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xebe(%rip),%xmm0
call   1040 <signbit@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xorps  %xmm0,%xmm0
call   1040 <signbit@plt>
lea    0xed8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movsd  0xec1(%rip),%xmm0
call   1040 <signbit@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"signbit(+0.0) = %d\0A\00"
@.str.1 = [20 x i8] c"signbit(-0.0) = %d\0A\00"
define i32 @main() {
%1 = call i32 @signbit(double 0.000000e+00)
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @signbit(double -0.000000e+00)
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"signbit(+0.0) = %d\0A\00"
@.str.1 = [20 x i8] c"signbit(-0.0) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @signbit(double 0.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @signbit(double -0.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
char toupper(char);
int to_uppercase(char *keyword, int nchar) {
  char *pos;
  for (pos = keyword; pos < (keyword + nchar); pos++) {
    *pos = toupper(*pos);
  }
  return (nchar);
}


x86 assembly (clang, -O0):
<to_uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1164 <to_uppercase+0x54>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <to_uppercase+0x17>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_uppercase>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
test   %esi,%esi
jle    1143 <to_uppercase+0x33>
mov    %rdi,%rbx
movslq %r14d,%rbp
add    %rdi,%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
cmp    %rbp,%rbx
jb     1130 <to_uppercase+0x20>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @to_uppercase(i8* %0, i32 returned %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %12
6: ; preds = %2, %6
%7 = phi i8* [ %10, %6 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = tail call signext i8 @toupper(i8 signext %8)
store i8 %9, i8* %7
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = icmp ult i8* %10, %4
br i1 %11, label %6, label %12
12: ; preds = %6, %2
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ doit();
int /*<<< orphan*/ init();
int /*<<< orphan*/ init2();
int main() {
  init();
  init2();
  doit();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @init2()
%3 = tail call i32 (...) @doit()
ret i32 0
}
void ps_init() {}


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

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

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

LLVM IR (-O2):
define void @ps_init() {
ret void
}
void foo_1_1_2_2_2_1_2_1_2() {}


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

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

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

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

/* Variables and functions */
int ci_send_obj(int, int, int /*<<< orphan*/ *, int);
int ci_send_menu_answer(int fd, int slot, uint8_t answ) {
  return ci_send_obj(fd, 0x9F880B, &answ, 1);
}


x86 assembly (clang, -O0):
<ci_send_menu_answer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x9f880b,%esi
lea    -0xc(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <ci_send_obj@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ci_send_menu_answer>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x9f880b,%esi
mov    $0x1,%ecx
call   1030 <ci_send_obj@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ci_send_menu_answer(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @ci_send_obj(i32 %7, i32 10455051, i32* %6, i32 1)
ret i32 %8
}

LLVM IR (-O2):
define i32 @ci_send_menu_answer(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @ci_send_obj(i32 %0, i32 10455051, i32* %4, i32 1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ guess_the_number(int);
int /*<<< orphan*/ guess_the_number_dowhile(int, int /*<<< orphan*/, int,
                                            int /*<<< orphan*/);
int /*<<< orphan*/ guess_the_number_for(int, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ guess_the_number_while(int, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *);
void apps() {
  printf("Hello, Apps!\n\n");
  guess_the_number(5);
  guess_the_number(5);
  guess_the_number_for(5, 0, 9, 5);
  guess_the_number_while(5, 0, 9, 5);
  guess_the_number_dowhile(5, 0, 9, 0);
}


x86 assembly (clang, -O0):
<apps>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1050 <guess_the_number@plt>
mov    $0x5,%edi
call   1050 <guess_the_number@plt>
mov    $0x5,%ecx
xor    %esi,%esi
mov    $0x9,%edx
mov    %ecx,%edi
call   1030 <guess_the_number_for@plt>
mov    $0x5,%ecx
xor    %esi,%esi
mov    $0x9,%edx
mov    %ecx,%edi
call   1060 <guess_the_number_while@plt>
mov    $0x5,%edi
xor    %ecx,%ecx
mov    $0x9,%edx
mov    %ecx,%esi
call   1070 <guess_the_number_dowhile@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<apps>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1050 <guess_the_number@plt>
mov    $0x5,%edi
call   1050 <guess_the_number@plt>
mov    $0x5,%edi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x5,%ecx
call   1040 <guess_the_number_for@plt>
mov    $0x5,%edi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x5,%ecx
call   1060 <guess_the_number_while@plt>
mov    $0x5,%edi
xor    %esi,%esi
mov    $0x9,%edx
xor    %ecx,%ecx
pop    %rax
jmp    1070 <guess_the_number_dowhile@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, Apps!\0A\0A\00"
define void @apps() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @guess_the_number(i32 5)
%3 = call i32 @guess_the_number(i32 5)
%4 = call i32 @guess_the_number_for(i32 5, i32 0, i32 9, i32 5)
%5 = call i32 @guess_the_number_while(i32 5, i32 0, i32 9, i32 5)
%6 = call i32 @guess_the_number_dowhile(i32 5, i32 0, i32 9, i32 0)
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, Apps!\0A\00"
define void @apps() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @guess_the_number(i32 5)
%3 = tail call i32 @guess_the_number(i32 5)
%4 = tail call i32 @guess_the_number_for(i32 5, i32 0, i32 9, i32 5)
%5 = tail call i32 @guess_the_number_while(i32 5, i32 0, i32 9, i32 5)
%6 = tail call i32 @guess_the_number_dowhile(i32 5, i32 0, i32 9, i32 0)
ret void
}
adr0imm1_set(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (*((char *)10000000)) = 33; }


x86 assembly (clang, -O0):
<adr0imm1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movb   $0x21,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0imm1_set>:
movb   $0x21,0x989680
21
ret

LLVM IR (-O0):
define i32 @adr0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8 33, i8* inttoptr (i64 10000000 to i8*)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @adr0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
store i8 33, i8* inttoptr (i64 10000000 to i8*)
ret i32 undef
}
int main_hidden_func() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @main_hidden_func() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  sleep(120);
  exit(0);
}


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    $0x78,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x78,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <exit@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 @sleep(i32 120)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sleep(i32 120)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int ncpus(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ncpus() {
ret i32 0
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
char encode_char(uint8_t *key, size_t key_len, char input_char,
                 size_t *key_index) {
  char current_key_char = key[*key_index];
  (*key_index)++;
  if (*key_index == key_len) {
    *key_index = 0;
  }
  return input_char ^ current_key_char;
}


x86 assembly (clang, -O0):
<encode_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    1150 <encode_char+0x50>
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
movsbl -0x11(%rbp),%eax
movsbl -0x21(%rbp),%ecx
xor    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_char>:
mov    (%rcx),%r8
lea    0x1(%r8),%rax
xor    %r9d,%r9d
cmp    %rsi,%rax
cmovne %rax,%r9
mov    %edx,%eax
xor    (%rdi,%r8,1),%al
mov    %r9,(%rcx)
ret

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

LLVM IR (-O2):
define signext i8 @encode_char(i8* nocapture %0, i64 %1, i8 signext %2, i64* nocapture %3) {
%5 = load i64, i64* %3
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = add i64 %5, 1
%9 = icmp eq i64 %8, %1
%10 = select i1 %9, i64 0, i64 %8
store i64 %10, i64* %3
%11 = xor i8 %7, %2
ret i8 %11
}
void rop3_33_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk1 = S | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_33_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_33_1_1>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %dl,%cl
or     %edx,%esi
or     %sil,%cl
not    %cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_33_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_33_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %2, %1
%7 = or i8 %6, %5
%8 = xor i8 %7, -1
%9 = and i8 %4, %6
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sig_ill_handler(int sig) { exit(0); }


x86 assembly (clang, -O0):
<sig_ill_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sig_ill_handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @sig_ill_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
void CMUTIL_NetworkClear() {}


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

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

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

LLVM IR (-O2):
define void @CMUTIL_NetworkClear() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void h1() { printf("H1\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"H1\00"
define void @h1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
void network_attach_image(unsigned int unit, const char *filename) {}


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

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

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

LLVM IR (-O2):
define void @network_attach_image(i32 %0, i8* nocapture %1) {
ret void
}
void err_exit(n) int n;
{
  printf("\n\n    CreHtmlc: error code %d\n", n);
  exit(1);
}


x86 assembly (clang, -O0):
<err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_exit>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0A\0A CreHtmlc: error code %d\0A\00"
define void @err_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0A\0A CreHtmlc: error code %d\0A\00"
define void @err_exit(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
tail call void @exit(i32 1)
unreachable
}
void crc32_init(unsigned int *p) { *p = 0xffffffff; }


x86 assembly (clang, -O0):
<crc32_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32_init>:
movl   $0xffffffff,(%rdi)
ret

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

LLVM IR (-O2):
define void @crc32_init(i32* nocapture writeonly %0) {
store i32 -1, i32* %0
ret void
}