xunge/DecIR huggingface dataset:
/* Variables and functions */
int bbm_write(void *, unsigned short, unsigned char);
int bbm_com_write(void *handle, unsigned short addr, unsigned char data) {
  int res;
  res = bbm_write(handle, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
movzwl %ax,%esi
movzbl -0xb(%rbp),%edx
call   1030 <bbm_write@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_write>:
jmp    1030 <bbm_write@plt>

LLVM IR (-O0):
define i32 @bbm_com_write(i8* %0, i16 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i8
%7 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i16, i16* %5
%10 = load i8, i8* %6
%11 = call i32 @bbm_write(i8* %8, i16 zeroext %9, i8 zeroext %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @bbm_com_write(i8* %0, i16 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @bbm_write(i8* %0, i16 zeroext %1, i8 zeroext %2)
ret i32 %4
}
int accidental_to_code(char xaccidental) {
  switch (xaccidental) {
  case ' ':
    return 10;
    break;
  case '_':
    return -1;
    break;
  case '^':
    return 1;
    break;
  case '=':
    return 0;
    break;
  default:
    return 10;
  }
}


x86 assembly (clang, -O0):
<accidental_to_code>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x20,%eax
je     1152 <accidental_to_code+0x52>
jmp    111f <accidental_to_code+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x3d,%eax
je     1176 <accidental_to_code+0x76>
jmp    1130 <accidental_to_code+0x30>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
je     116a <accidental_to_code+0x6a>
jmp    1141 <accidental_to_code+0x41>
mov    -0xc(%rbp),%eax
sub    $0x5f,%eax
je     115e <accidental_to_code+0x5e>
jmp    1182 <accidental_to_code+0x82>
movl   $0xa,-0x4(%rbp)
jmp    1189 <accidental_to_code+0x89>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <accidental_to_code+0x89>
movl   $0x1,-0x4(%rbp)
jmp    1189 <accidental_to_code+0x89>
movl   $0x0,-0x4(%rbp)
jmp    1189 <accidental_to_code+0x89>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<accidental_to_code>:
cmp    $0x3d,%edi
je     111a <accidental_to_code+0x1a>
cmp    $0x5e,%edi
je     111d <accidental_to_code+0x1d>
mov    $0xa,%eax
cmp    $0x5f,%edi
jne    111c <accidental_to_code+0x1c>
mov    $0xffffffff,%eax
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @accidental_to_code(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 32, label %6
i32 95, label %7
i32 94, label %8
i32 61, label %9
]
6: ; preds = %1
store i32 10, i32* %2
br label %11
7: ; preds = %1
store i32 -1, i32* %2
br label %11
8: ; preds = %1
store i32 1, i32* %2
br label %11
9: ; preds = %1
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 10, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @accidental_to_code(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 61, label %5
i32 95, label %3
i32 94, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i32 [ 0, %5 ], [ 1, %4 ], [ -1, %3 ], [ 10, %1 ]
ret i32 %7
}
double get_data() {}


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

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

LLVM IR (-O0):
define double @get_data() {
%1 = alloca double
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @get_data() {
ret double undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int xkill(int pid) {
  printf("kill() not implemented\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<xkill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xkill>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"kill() not implemented\0A\00"
define i32 @xkill(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"kill() not implemented\00"
define i32 @xkill(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ by_ref_actual_already_in_footprint2(int /*<<< orphan*/ *);
void call_by_ref_actual_already_in_footprint_bad() {
  by_ref_actual_already_in_footprint2(NULL);
}


x86 assembly (clang, -O0):
<call_by_ref_actual_already_in_footprint_bad>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <by_ref_actual_already_in_footprint2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_by_ref_actual_already_in_footprint_bad>:
xor    %edi,%edi
jmp    1030 <by_ref_actual_already_in_footprint2@plt>

LLVM IR (-O0):
define void @call_by_ref_actual_already_in_footprint_bad() {
%1 = call i32 @by_ref_actual_already_in_footprint2(i32* null)
ret void
}

LLVM IR (-O2):
define void @call_by_ref_actual_already_in_footprint_bad() {
%1 = tail call i32 @by_ref_actual_already_in_footprint2(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/);
void HTTPWrapperInitRandomeNumber() { srand((unsigned int)time(0)); }


x86 assembly (clang, -O0):
<HTTPWrapperInitRandomeNumber>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTTPWrapperInitRandomeNumber>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @HTTPWrapperInitRandomeNumber() {
%1 = call i64 @time(i32 0)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @HTTPWrapperInitRandomeNumber() {
%1 = tail call i64 @time(i32 0)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
int main(void) {
  struct {
    int x;
    struct {
      int y, z;
      struct {
        int u, v;
      };
    };
  } a;
  return a.x + a.y + a.z + a.u + a.v;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, %struct.anon.0 }
%struct.anon.0 = type { i32, i32, %struct.anon.1 }
%struct.anon.1 = type { i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%6 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = add nsw i32 %4, %7
%9 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%10 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = add nsw i32 %8, %11
%13 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%14 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %13, i32 0, i32 2
%15 = getelementptr inbounds %struct.anon.1, %struct.anon.1* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = add nsw i32 %12, %16
%18 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%19 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %18, i32 0, i32 2
%20 = getelementptr inbounds %struct.anon.1, %struct.anon.1* %19, i32 0, i32 1
%21 = load i32, i32* %20
%22 = add nsw i32 %17, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
void gtk_scrolled_window_get_vadjustment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_scrolled_window_get_vadjustment() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Say(char *, int);
void talk(void) { Say("A pretty nice bed.  Looks a lot like my last one.", 1); }


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <Say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <Say@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"A pretty nice bed. Looks a lot like my last one.\00"
define void @talk() {
%1 = call i32 @Say(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"A pretty nice bed. Looks a lot like my last one.\00"
define void @talk() {
%1 = tail call i32 @Say(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
struct termio {
  int /*<<< orphan*/ c_lflag;
};

/* Variables and functions */
int /*<<< orphan*/ ECHO;
int /*<<< orphan*/ TCGETA;
int /*<<< orphan*/ TCSETA;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct termio *);
void timedout2(int sig) {
  struct termio ti;
  ioctl(0, TCGETA, &ti);
  ti.c_lflag |= ECHO;
  ioctl(0, TCSETA, &ti);
  exit(0);
}


x86 assembly (clang, -O0):
<timedout2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<timedout2>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rdx
call   1030 <ioctl@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
or     %eax,0x8(%rsp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1030 <ioctl@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.termio = type { i32 }
@TCGETA = global i32 0
@ECHO = global i32 0
@TCSETA = global i32 0
define void @timedout2(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.termio
store i32 %0, i32* %2
%4 = load i32, i32* @TCGETA
%5 = call i32 @ioctl(i32 0, i32 %4, %struct.termio* %3)
%6 = load i32, i32* @ECHO
%7 = getelementptr inbounds %struct.termio, %struct.termio* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = or i32 %8, %6
store i32 %9, i32* %7
%10 = load i32, i32* @TCSETA
%11 = call i32 @ioctl(i32 0, i32 %10, %struct.termio* %3)
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.termio = type { i32 }
@TCGETA = global i32 0
@ECHO = global i32 0
@TCSETA = global i32 0
define void @timedout2(i32 %0) {
%2 = alloca %struct.termio
%3 = bitcast %struct.termio* %2 to i8*
%4 = load i32, i32* @TCGETA
%5 = call i32 @ioctl(i32 0, i32 %4, %struct.termio* %2)
%6 = load i32, i32* @ECHO
%7 = getelementptr inbounds %struct.termio, %struct.termio* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = or i32 %8, %6
store i32 %9, i32* %7
%10 = load i32, i32* @TCSETA
%11 = call i32 @ioctl(i32 0, i32 %10, %struct.termio* %2)
%12 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_cursor() { printf("\x1b[?25h"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25h\00"
define void @show_cursor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25h\00"
define void @show_cursor() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
void c_pomp_barrier_exit_(struct ompregdescr *r) { (void)0; }


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

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

LLVM IR (-O0):
%struct.ompregdescr = type opaque
define void @c_pomp_barrier_exit_(%struct.ompregdescr* %0) {
%2 = alloca %struct.ompregdescr*
store %struct.ompregdescr* %0, %struct.ompregdescr** %2
ret void
}

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_barrier_exit_(%struct.ompregdescr* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
void sd_ct_mainpid(pid_t pid) {}


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

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

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

LLVM IR (-O2):
define void @sd_ct_mainpid(i32 %0) {
ret void
}
int testchar(char ch1, char ch2) {
  if (ch1 == ch2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<testchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jne    112c <testchar+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <testchar+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testchar>:
xor    %eax,%eax
cmp    %sil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @testchar(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @testchar(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void code_segment_gtext() {
  output_line("\t.area  SMALLC_GENERATED  (REL,CON,CSEG)");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"\09.area SMALLC_GENERATED (REL,CON,CSEG)\00"
define void @code_segment_gtext() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"\09.area SMALLC_GENERATED (REL,CON,CSEG)\00"
define void @code_segment_gtext() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct in6_addr {
  scalar_t__ s6_addr;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, scalar_t__, int);
uint16_t in6_teredo_flags(const struct in6_addr *ip6) {
  uint16_t flags;
  memcpy(&flags, ip6->s6_addr + 8, 2);
  return flags;
}


x86 assembly (clang, -O0):
<in6_teredo_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
add    $0x8,%rsi
lea    -0xc(%rbp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in6_teredo_flags>:
push   %rax
mov    (%rdi),%rsi
add    $0x8,%rsi
lea    0x4(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i64 }
define i32 @in6_teredo_flags(%struct.in6_addr* %0) {
%2 = alloca %struct.in6_addr*
%3 = alloca i32
store %struct.in6_addr* %0, %struct.in6_addr** %2
%4 = load %struct.in6_addr*, %struct.in6_addr** %2
%5 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %6, 8
%8 = call i32 @memcpy(i32* %3, i64 %7, i32 2)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
%struct.in6_addr = type { i64 }
define i32 @in6_teredo_flags(%struct.in6_addr* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = add nsw i64 %5, 8
%7 = call i32 @memcpy(i32* %2, i64 %6, i32 2)
%8 = load i32, i32* %2
ret i32 %8
}
/* Variables and functions */
size_t ft_strlen(char const *str) {
  char *s;
  s = (char *)str;
  while (*s)
    s++;
  return (s - str);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <ft_strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ft_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @ft_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ _soundterm();
int /*<<< orphan*/ soundterm();
void audio_fin(void) {
  _soundterm();
  soundterm();
}


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

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

LLVM IR (-O0):
define void @audio_fin() {
%1 = call i32 (...) @_soundterm()
%2 = call i32 (...) @soundterm()
ret void
}

LLVM IR (-O2):
define void @audio_fin() {
%1 = tail call i32 (...) @_soundterm()
%2 = tail call i32 (...) @soundterm()
ret void
}
int vhangup(void) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(111));
  do {
    return (int)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<vhangup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6f,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vhangup>:
mov    $0x6f,%eax
int    $0x80
ret

LLVM IR (-O0):
define i32 @vhangup() {
%1 = alloca i64
%2 = call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 111)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @vhangup() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 111)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
unsigned int mask(int, int);
unsigned int bits(int val, int offset, int len) {
  return mask(val >> offset, len);
}


x86 assembly (clang, -O0):
<bits>:
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    -0x8(%rbp),%ecx
sar    %cl,%edi
mov    -0xc(%rbp),%esi
call   1030 <mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits>:
mov    %esi,%ecx
sar    %cl,%edi
mov    %edx,%esi
jmp    1030 <mask@plt>

LLVM IR (-O0):
define i32 @bits(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 = load i32, i32* %5
%9 = ashr i32 %7, %8
%10 = load i32, i32* %6
%11 = call i32 @mask(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @bits(i32 %0, i32 %1, i32 %2) {
%4 = ashr i32 %0, %1
%5 = tail call i32 @mask(i32 %4, i32 %2)
ret i32 %5
}
void UI_filter_translate(buffer, size) char *buffer;
int size;
{}


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

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

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

LLVM IR (-O2):
define void @UI_filter_translate(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help() {
  printf("USAGE: skinless [options] <file> [more options and/or files]\n");
  printf("OPTIONS:\n");
  printf("        -o [string] : output filename (NOTE: affects only the next "
         "input file)\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xf16(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"USAGE: skinless [options] <file> [more options and/or files]\0A\00"
@.str.1 = [10 x i8] c"OPTIONS:\0A\00"
@.str.2 = [80 x i8] c" -o [string] : output filename (NOTE: affects only the next input file)\0A\00"
define i32 @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [61 x i8] c"USAGE: skinless [options] <file> [more options and/or files]\00"
@str.3 = [9 x i8] c"OPTIONS:\00"
@str.4 = [79 x i8] c" -o [string] : output filename (NOTE: affects only the next input file)\00"
define i32 @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.4, i64 0, i64 0))
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ byte_order;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
int get_XImage_byte_order(void *_p) { return (int)((XImage *)_p)->byte_order; }


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

x86 assembly (clang, -O2):
<get_XImage_byte_order>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XImage_byte_order(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XImage_byte_order(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int qual_fault(const char *s, int bitflag, int not ) { return -1; }


x86 assembly (clang, -O0):
<qual_fault>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @qual_fault(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @qual_fault(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ errExit(char *);
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
void fileSeek(int fd, off_t amount) {
  if (lseek(fd, amount, SEEK_CUR) == -1)
    errExit("lseek: seeking by one byte");
}


x86 assembly (clang, -O0):
<fileSeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
call   1040 <lseek@plt>
cmp    $0xffffffff,%eax
jne    1157 <fileSeek+0x37>
lea    0xeae(%rip),%rdi
call   1030 <errExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileSeek>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
call   1040 <lseek@plt>
cmp    $0xffffffff,%eax
je     1136 <fileSeek+0x16>
pop    %rax
ret
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1030 <errExit@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
@.str = [27 x i8] c"lseek: seeking by one byte\00"
define void @fileSeek(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* @SEEK_CUR
%8 = call i32 @lseek(i32 %5, i32 %6, i32 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @errExit(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
@.str = [27 x i8] c"lseek: seeking by one byte\00"
define void @fileSeek(i32 %0, i32 %1) {
%3 = load i32, i32* @SEEK_CUR
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @errExit(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ rmdir(char *);
int main(int argc, char **argv) {
  rmdir(*++argv);
  return EXIT_SUCCESS;
}


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    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <rmdir@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <rmdir@plt>
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i32 1
store i8** %7, i8*** %5
%8 = load i8*, i8** %7
%9 = call i32 @rmdir(i8* %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @rmdir(i8* %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ call_f();
int /*<<< orphan*/ printf(char *);
int main() {
  call_f();
  printf("hello, this is \"main\"\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"hello, this is \22main\22\00"
define i32 @main() {
%1 = tail call i32 (...) @call_f()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ write_dword(int);
void write_qword(uint64_t data) {
  write_dword(data >> 32);
  write_dword(data & 0xffffffff);
}


x86 assembly (clang, -O0):
<write_qword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <write_dword@plt>
mov    -0x4(%rbp),%edi
and    $0xffffffff,%edi
call   1030 <write_dword@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_qword>:
push   %rbx
mov    %edi,%ebx
call   1030 <write_dword@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <write_dword@plt>

LLVM IR (-O0):
define void @write_qword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 32
%5 = call i32 @write_dword(i32 %4)
%6 = load i32, i32* %2
%7 = and i32 %6, -1
%8 = call i32 @write_dword(i32 %7)
ret void
}

LLVM IR (-O2):
define void @write_qword(i32 %0) {
%2 = tail call i32 @write_dword(i32 poison)
%3 = tail call i32 @write_dword(i32 %0)
ret void
}
void keyup(unsigned char key, int x, int y) {
  switch (key) {
  case 'd':
    break;
  case 'o':
    break;
  case 'q':
    break;
  default:;
  }
}


x86 assembly (clang, -O0):
<keyup>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x64,%eax
je     1147 <keyup+0x47>
jmp    1125 <keyup+0x25>
mov    -0x10(%rbp),%eax
sub    $0x6f,%eax
je     114c <keyup+0x4c>
jmp    1136 <keyup+0x36>
mov    -0x10(%rbp),%eax
sub    $0x71,%eax
je     1151 <keyup+0x51>
jmp    1156 <keyup+0x56>
jmp    115b <keyup+0x5b>
jmp    115b <keyup+0x5b>
jmp    115b <keyup+0x5b>
jmp    115b <keyup+0x5b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @keyup(i8 zeroext %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 = zext i8 %7 to i32
switch i32 %8, label %12 [
i32 100, label %9
i32 111, label %10
i32 113, label %11
]
9: ; preds = %3
br label %13
10: ; preds = %3
br label %13
11: ; preds = %3
br label %13
12: ; preds = %3
br label %13
13: ; preds = %12, %11, %10, %9
ret void
}

LLVM IR (-O2):
define void @keyup(i8 zeroext %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wt_test_error_printf(char const *, int, char *,
                                        char const *);
void wt_test_expect(const char *file, int line, bool cond,
                    const char *cond_str) {
  if (cond)
    return;
  wt_test_error_printf(file, line, "expect(%s)", cond_str);
}


x86 assembly (clang, -O0):
<wt_test_expect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1135 <wt_test_expect+0x25>
jmp    114c <wt_test_expect+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
lea    0xeb9(%rip),%rdx
call   1030 <wt_test_error_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wt_test_expect>:
test   %edx,%edx
je     1115 <wt_test_expect+0x5>
ret
lea    0xee4(%rip),%rdx
jmp    1030 <wt_test_error_printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"expect(%s)\00"
define void @wt_test_expect(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %4
br label %17
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = load i8*, i8** %8
%16 = call i32 @wt_test_error_printf(i8* %13, i32 %14, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"expect(%s)\00"
define void @wt_test_expect(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %2, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @wt_test_error_printf(i8* %0, i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %8
8: ; preds = %4, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_puts(char const *);
void log_debug(const char *msg) {
  uart_puts(msg);
  uart_puts("\n");
}


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

x86 assembly (clang, -O2):
<log_debug>:
push   %rax
call   1030 <uart_puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <uart_puts@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @log_debug(i8* %0) {
%2 = tail call i32 @uart_puts(i8* %0)
%3 = tail call i32 @uart_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned long long nextCollatz(unsigned long long n) {
  return n % 2 == 0 ? n / 2 : n * 3 + 1;
}


x86 assembly (clang, -O0):
<nextCollatz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    112b <nextCollatz+0x2b>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <nextCollatz+0x38>
imul   $0x3,-0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextCollatz>:
mov    %rdi,%rcx
shr    %rcx
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @nextCollatz(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = urem i64 %3, 2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = udiv i64 %7, 2
br label %13
9: ; preds = %1
%10 = load i64, i64* %2
%11 = mul i64 %10, 3
%12 = add i64 %11, 1
br label %13
13: ; preds = %9, %6
%14 = phi i64 [ %8, %6 ], [ %12, %9 ]
ret i64 %14
}

LLVM IR (-O2):
define i64 @nextCollatz(i64 %0) {
%2 = and i64 %0, 1
%3 = icmp eq i64 %2, 0
%4 = lshr i64 %0, 1
%5 = mul i64 %0, 3
%6 = add i64 %5, 1
%7 = select i1 %3, i64 %4, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ alloc_fail();
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *sdb_strdup(const char *s) {
  char *p;
  if (s)
    p = malloc(strlen(s) + 1);
  else
    p = NULL;
  if (p == NULL)
    alloc_fail();
  else
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<sdb_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1175 <sdb_strdup+0x35>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
jmp    117d <sdb_strdup+0x3d>
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1194 <sdb_strdup+0x54>
mov    $0x0,%al
call   1040 <alloc_fail@plt>
jmp    11a1 <sdb_strdup+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdb_strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     116f <sdb_strdup+0x2f>
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
test   %rax,%rax
je     116f <sdb_strdup+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1178 <sdb_strdup+0x38>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <alloc_fail@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @sdb_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1, %3
%9 = tail call i32 (...) @alloc_fail()
br label %12
10: ; preds = %3
%11 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %12
12: ; preds = %10, %8
%13 = phi i8* [ %6, %10 ], [ null, %8 ]
ret i8* %13
}
int XGetWindowAttributes() {}


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

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

LLVM IR (-O0):
define i32 @XGetWindowAttributes() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XGetWindowAttributes() {
ret i32 undef
}
int main() {
  int i = 0;
  int c = 0;
  while (i < 20) {
    i++;
    if (i <= 10)
      continue;
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1149 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     113b <main+0x3b>
jmp    1119 <main+0x19>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
int um(int A, int B, int C) {
  C = (A * 360) + (B * 30) + C;
  return (C);
}


x86 assembly (clang, -O0):
<um>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x168,-0x4(%rbp),%eax
imul   $0x1e,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<um>:
imul   $0x168,%edi,%ecx
mov    %esi,%eax
shl    $0x5,%eax
sub    %esi,%eax
sub    %esi,%eax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @um(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 = mul nsw i32 %7, 360
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 30
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @um(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 360
%5 = mul nsw i32 %1, 30
%6 = add nsw i32 %5, %4
%7 = add nsw i32 %6, %2
ret i32 %7
}
void rt_stk_check(void) { ; }


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

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

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

LLVM IR (-O2):
define void @rt_stk_check() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ softvec_setintr(int, void *);
int softvec_init(void) {
  int type;
  for (type = 0; type < 3; type++)
    softvec_setintr(type, ((void *)0));
  return 0;
}


x86 assembly (clang, -O0):
<softvec_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1143 <softvec_init+0x33>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <softvec_setintr@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <softvec_init+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softvec_init>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <softvec_setintr@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <softvec_setintr@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <softvec_setintr@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @softvec_init() {
%1 = tail call i32 @softvec_setintr(i32 0, i8* null)
%2 = tail call i32 @softvec_setintr(i32 1, i8* null)
%3 = tail call i32 @softvec_setintr(i32 2, i8* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_wsr64(char *, unsigned long long);
void wsr64(unsigned long long v) { __builtin_arm_wsr64("cp1:2:c3", v); }


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

x86 assembly (clang, -O2):
<wsr64>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <__builtin_arm_wsr64@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"cp1:2:c3\00"
define void @wsr64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @__builtin_arm_wsr64(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"cp1:2:c3\00"
define void @wsr64(i64 %0) {
%2 = tail call i32 @__builtin_arm_wsr64(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
void I_NoAppServicesSetAchievementProgress(const char *nameID, int current,
                                           int max) {}


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

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

LLVM IR (-O0):
define void @I_NoAppServicesSetAchievementProgress(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
ret void
}

LLVM IR (-O2):
define void @I_NoAppServicesSetAchievementProgress(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
void ClearCodeTable(int *ct) {
  int i;
  for (i = 0; i < 1024 * 1024; i++) {
    ct[i] = -1;
  }
}


x86 assembly (clang, -O0):
<ClearCodeTable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x100000,-0xc(%rbp)
jge    1139 <ClearCodeTable+0x39>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ClearCodeTable+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearCodeTable>:
push   %rax
mov    $0x400000,%edx
mov    $0xff,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ClearCodeTable(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1048576
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 -1, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @ClearCodeTable(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  char *sname;
};
typedef TYPE_1__ X509_PURPOSE;

/* Variables and functions */
char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp) { return xp->sname; }


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

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i8* }
define i8* @X509_PURPOSE_get0_sname(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i8* }
define i8* @X509_PURPOSE_get0_sname(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i8*, i8** %2
ret i8* %3
}