xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
main() {
  puts("#ifndef size_type");
  if (sizeof(unsigned int) == sizeof(char *)) {
    puts("#define size_type unsigned int");
  } else if (sizeof(long) == sizeof(char *)) {
    puts("#define size_type long");
  } else {
    fputs("funny pointer size\n", stderr);
    exit(1);
  }
  puts("#endif");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"#ifndef size_type\00"
@.str.1 = [23 x i8] c"#define size_type long\00"
@.str.2 = [7 x i8] c"#endif\00"
@stderr = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"#ifndef size_type\00"
@.str.1 = [23 x i8] c"#define size_type long\00"
@.str.2 = [7 x i8] c"#endif\00"
@stderr = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
void rop3_140_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D | stk3;
  stk1 = S & stk2;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_140_0_0>:
not    %dl
or     (%rdi),%dl
and    %sil,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_140_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_140_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = and i8 %6, %1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int prefix_sum();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", prefix_sum());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <prefix_sum@plt>
mov    %eax,%esi
lea    0xec1(%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 <prefix_sum@plt>
lea    0xed1(%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 (...) @prefix_sum()
%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 (...) @prefix_sum()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ valid;
};
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef TYPE_1__ ASN1_TLC;
typedef int /*<<< orphan*/ ASN1_TEMPLATE;

/* Variables and functions */
int asn1_template_ex_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ const *, int /*<<< orphan*/,
                         TYPE_1__ *);
int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
                      const ASN1_TEMPLATE *tt) {
  ASN1_TLC c;
  (&c)->valid = 0;
  return asn1_template_ex_d2i(pval, in, len, tt, 0, &c);
}


x86 assembly (clang, -O0):
<ASN1_template_d2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
lea    -0x28(%rbp),%r9
call   1030 <asn1_template_ex_d2i@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_template_d2i>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%r9
xor    %r8d,%r8d
call   1030 <asn1_template_ex_d2i@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define i32 @ASN1_template_d2i(i32** %0, i8** %1, i64 %2, i32* %3) {
%5 = alloca i32**
%6 = alloca i8**
%7 = alloca i64
%8 = alloca i32*
%9 = alloca %struct.TYPE_3__
store i32** %0, i32*** %5
store i8** %1, i8*** %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
store i64 0, i64* %10
%11 = load i32**, i32*** %5
%12 = load i8**, i8*** %6
%13 = load i64, i64* %7
%14 = load i32*, i32** %8
%15 = call i32 @asn1_template_ex_d2i(i32** %11, i8** %12, i64 %13, i32* %14, i32 0, %struct.TYPE_3__* %9)
ret i32 %15
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
define i32 @ASN1_template_d2i(i32** %0, i8** %1, i64 %2, i32* %3) {
%5 = alloca %struct.TYPE_3__
%6 = bitcast %struct.TYPE_3__* %5 to i8*
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i64 0, i32 0
store i64 0, i64* %7
%8 = call i32 @asn1_template_ex_d2i(i32** %0, i8** %1, i64 %2, i32* %3, i32 0, %struct.TYPE_3__* %5)
ret i32 %8
}
int digit_to_int(char digit) {
  switch (digit) {
  case 'I':
    return 1;
  case 'V':
    return 5;
  case 'X':
    return 10;
  case 'L':
    return 50;
  case 'C':
    return 100;
  case 'D':
    return 500;
  case 'M':
    return 1000;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<digit_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1188 <digit_to_int+0x88>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    118f <digit_to_int+0x8f>
movl   $0x5,-0x4(%rbp)
jmp    118f <digit_to_int+0x8f>
movl   $0xa,-0x4(%rbp)
jmp    118f <digit_to_int+0x8f>
movl   $0x32,-0x4(%rbp)
jmp    118f <digit_to_int+0x8f>
movl   $0x64,-0x4(%rbp)
jmp    118f <digit_to_int+0x8f>
movl   $0x1f4,-0x4(%rbp)
jmp    118f <digit_to_int+0x8f>
movl   $0x3e8,-0x4(%rbp)
jmp    118f <digit_to_int+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_to_int>:
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     1129 <digit_to_int+0x29>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x64,%eax
ret
mov    $0x1f4,%eax
ret
xor    %eax,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret
mov    $0x3e8,%eax
ret

LLVM IR (-O0):
define i32 @digit_to_int(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 %13 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
i32 68, label %11
i32 77, label %12
]
6: ; preds = %1
store i32 1, i32* %2
br label %14
7: ; preds = %1
store i32 5, i32* %2
br label %14
8: ; preds = %1
store i32 10, i32* %2
br label %14
9: ; preds = %1
store i32 50, i32* %2
br label %14
10: ; preds = %1
store i32 100, i32* %2
br label %14
11: ; preds = %1
store i32 500, i32* %2
br label %14
12: ; preds = %1
store i32 1000, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @digit_to_int(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 73, label %10
i32 86, label %3
i32 88, label %4
i32 76, label %5
i32 67, label %6
i32 68, label %7
i32 77, label %8
]
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3
%11 = phi i32 [ 0, %9 ], [ 1000, %8 ], [ 500, %7 ], [ 100, %6 ], [ 50, %5 ], [ 10, %4 ], [ 5, %3 ], [ 1, %1 ]
ret i32 %11
}
void ff_hevc_put_hevc_epel_v16_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_v16_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float kg;
  printf("Kg: ");
  scanf("%f", &kg);
  printf("Libra: %.2f", kg / 0.45);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea2(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xeb7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Kg: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [12 x i8] c"Libra: %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fdiv double %6, 4.500000e-01
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"Kg: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [12 x i8] c"Libra: %.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fdiv double %6, 4.500000e-01
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Type definitions */
struct link_map {
  int dummy;
};
typedef int /*<<< orphan*/ Elf64_Rela;
typedef int /*<<< orphan*/ Elf64_Addr;

/* Variables and functions */
Elf64_Addr elf_machine_plt_value(struct link_map *map, const Elf64_Rela *reloc,
                                 Elf64_Addr value) {
  return value;
}


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

x86 assembly (clang, -O2):
<elf_machine_plt_value>:
mov    %edx,%eax
ret

LLVM IR (-O0):
%struct.link_map = type { i32 }
define i32 @elf_machine_plt_value(%struct.link_map* %0, i32* %1, i32 %2) {
%4 = alloca %struct.link_map*
%5 = alloca i32*
%6 = alloca i32
store %struct.link_map* %0, %struct.link_map** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.link_map = type { i32 }
define i32 @elf_machine_plt_value(%struct.link_map* nocapture readnone %0, i32* nocapture readnone %1, i32 returned %2) {
ret i32 %2
}
void gtk_text_iter_inside_sentence() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_inside_sentence() {
ret void
}
int ftrace_init_nop(struct module *mod, struct dyn_ftrace *rec) { return 0; }


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

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

LLVM IR (-O0):
%struct.module = type opaque
%struct.dyn_ftrace = type opaque
define i32 @ftrace_init_nop(%struct.module* %0, %struct.dyn_ftrace* %1) {
%3 = alloca %struct.module*
%4 = alloca %struct.dyn_ftrace*
store %struct.module* %0, %struct.module** %3
store %struct.dyn_ftrace* %1, %struct.dyn_ftrace** %4
ret i32 0
}

LLVM IR (-O2):
%struct.module = type opaque
%struct.dyn_ftrace = type opaque
define i32 @ftrace_init_nop(%struct.module* nocapture readnone %0, %struct.dyn_ftrace* nocapture readnone %1) {
ret i32 0
}
void q6audio_register_analog_ops(struct q6audio_analog_ops *ops) {}


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

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

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

LLVM IR (-O2):
%struct.q6audio_analog_ops = type opaque
define void @q6audio_register_analog_ops(%struct.q6audio_analog_ops* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main(int argc, char *argv[]) {
  reverse(argv[1]);
  printf("%s\n", argv[1]);
  return 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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <reverse@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <reverse@plt>
mov    0x8(%rbx),%rsi
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
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, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @reverse(i8* %8)
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
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 @reverse(i8* %4)
%6 = load i8*, i8** %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_goto_stmt(void) {
  test("acbd", "main(){A: printf(\"a\"); goto C; B: printf(\"b\"); goto D; C: "
               "printf(\"c\"); goto B; D: printf(\"d\");}");
}


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

x86 assembly (clang, -O2):
<TEST_goto_stmt>:
lea    0xee9(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"acbd\00"
@.str.1 = [96 x i8] c"main(){A: printf(\22a\22); goto C; B: printf(\22b\22); goto D; C: printf(\22c\22); goto B; D: printf(\22d\22);}\00"
define void @TEST_goto_stmt() {
%1 = call i32 @test(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"acbd\00"
@.str.1 = [96 x i8] c"main(){A: printf(\22a\22); goto C; B: printf(\22b\22); goto D; C: printf(\22c\22); goto B; D: printf(\22d\22);}\00"
define void @TEST_goto_stmt() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ keystatus;
typedef int /*<<< orphan*/ enum_t;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ xdr_enum(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_keystatus(XDR *xdrs, keystatus *objp) {
  if (!xdr_enum(xdrs, (enum_t *)objp))
    return FALSE;
  return TRUE;
}


x86 assembly (clang, -O0):
<xdr_keystatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <xdr_enum@plt>
cmp    $0x0,%eax
jne    1147 <xdr_keystatus+0x37>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <xdr_keystatus+0x43>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_keystatus>:
push   %rax
call   1030 <xdr_enum@plt>
test   %eax,%eax
jne    1123 <xdr_keystatus+0x13>
mov    0x2eb7(%rip),%rax
jmp    112a <xdr_keystatus+0x1a>
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_keystatus(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %4
%7 = load i32*, i32** %5
%8 = call i32 @xdr_enum(i32* %6, i32* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = load i32, i32* @FALSE
store i32 %11, i32* %3
br label %14
12: ; preds = %2
%13 = load i32, i32* @TRUE
store i32 %13, i32* %3
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_keystatus(i32* %0, i32* %1) {
%3 = tail call i32 @xdr_enum(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* @FALSE
%6 = load i32, i32* @TRUE
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
/* Type definitions */
typedef unsigned long long uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t microtime(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (uint64_t)tv.tv_sec * 1000000ULL + (uint64_t)tv.tv_usec;
}


x86 assembly (clang, -O0):
<microtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<microtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @microtime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = add i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @microtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}
min(int x, int y) {
  int z;
  if (x < y)
    z = x;
  else
    z = y;
  return z;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ wFree(char *);
int /*<<< orphan*/ wNotYet(char *);
scalar_t__ wPopNumber();
char *wPopString();
void wBasInsert() {
  char *source, *target;
  int index;
  index = (int)wPopNumber();
  target = wPopString();
  source = wPopString();
  wNotYet("Insert");
  wFree(source);
  wFree(target);
}


x86 assembly (clang, -O0):
<wBasInsert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <wPopNumber@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <wPopString@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <wPopString@plt>
mov    %rax,-0x8(%rbp)
lea    0xe91(%rip),%rdi
call   1050 <wNotYet@plt>
mov    -0x8(%rbp),%rdi
call   1060 <wFree@plt>
mov    -0x10(%rbp),%rdi
call   1060 <wFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasInsert>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <wPopNumber@plt>
xor    %eax,%eax
call   1030 <wPopString@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <wPopString@plt>
mov    %rax,%rbx
lea    0xe9a(%rip),%rdi
call   1050 <wNotYet@plt>
mov    %rbx,%rdi
call   1060 <wFree@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <wFree@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Insert\00"
define void @wBasInsert() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
%4 = call i64 (...) @wPopNumber()
%5 = trunc i64 %4 to i32
store i32 %5, i32* %3
%6 = call i8* (...) @wPopString()
store i8* %6, i8** %2
%7 = call i8* (...) @wPopString()
store i8* %7, i8** %1
%8 = call i32 @wNotYet(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %1
%10 = call i32 @wFree(i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 @wFree(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Insert\00"
define void @wBasInsert() {
%1 = tail call i64 (...) @wPopNumber()
%2 = tail call i8* (...) @wPopString()
%3 = tail call i8* (...) @wPopString()
%4 = tail call i32 @wNotYet(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @wFree(i8* %3)
%6 = tail call i32 @wFree(i8* %2)
ret void
}
int test_imm_D7uint8_mem(unsigned char *val) {
  return ((*val) & (0xD7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D7uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xd7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D7uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -41
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int args_shift(int n, int *argc, char ***argv) {
  if (*argc >= n) {
    *argc -= n;
    *argv += n;
  }
  return *argc - n;
}


x86 assembly (clang, -O0):
<args_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jl     1142 <args_shift+0x42>
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<args_shift>:
mov    (%rsi),%eax
mov    %eax,%ecx
sub    %edi,%ecx
jl     1116 <args_shift+0x16>
mov    %ecx,(%rsi)
movslq %edi,%rax
shl    $0x3,%rax
add    %rax,(%rdx)
mov    %ecx,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @args_shift(i32 %0, i32* nocapture %1, i8*** nocapture %2) {
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, %0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = sub nsw i32 %4, %0
store i32 %7, i32* %1
%8 = load i8**, i8*** %2
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds i8*, i8** %8, i64 %9
store i8** %10, i8*** %2
br label %11
11: ; preds = %6, %3
%12 = phi i32 [ %7, %6 ], [ %4, %3 ]
%13 = sub nsw i32 %12, %0
ret i32 %13
}
unsigned int reverse(lwrd)
register unsigned int lwrd;
{
  return ((lwrd >> 24) | (lwrd >> 8 & 0xff00) | (lwrd << 8 & 0xff0000) |
          (lwrd << 24));
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @reverse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = and i32 %6, 65280
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = and i32 %10, 16711680
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = shl i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int fact = 1;
  int c;
  int test = 10;
  for (c = 1; c <= test; c++)
    fact = fact * c;
  printf("Factoriel 10 = %d\n", fact);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1158 <main+0x48>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"Factoriel 10 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 3628800)
ret i32 0
}
/* Variables and functions */
int rand();
int rnd(int n) { return (((rand() & 0x7FFF) % n)); }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x7fff,%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7fff,%eax
xor    %edx,%edx
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = and i32 %3, 32767
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @rnd(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = and i32 %2, 32767
%4 = srem i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ prtime();
void mymeot() {
  prtime();
  printf("Meta TrkEnd\n");
}


x86 assembly (clang, -O0):
<mymeot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <prtime@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Meta TrkEnd\00"
define void @mymeot() {
%1 = tail call i32 (...) @prtime()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void vtScrollRegion(void *pointer, int start, int end) {
  struct virtualTerminal *vt = (struct virtualTerminal *)pointer;
}


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

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

LLVM IR (-O0):
%struct.virtualTerminal = type opaque
define void @vtScrollRegion(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.virtualTerminal*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.virtualTerminal*
store %struct.virtualTerminal* %9, %struct.virtualTerminal** %7
ret void
}

LLVM IR (-O2):
define void @vtScrollRegion(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
void *realloc(void *p, unsigned s) {
  asm("int $0x40" ::"a"(68), "b"(12), "c"(p), "d"(s));
}


x86 assembly (clang, -O0):
<realloc>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%edx
mov    $0x44,%eax
mov    $0xc,%ebx
int    $0x40
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rcx
mov    $0x44,%eax
mov    $0xc,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @realloc(i8* %0, i32 %1) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 12, i8* %0, i32 %1)
ret i8* undef
}
void help(char **name) {}


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

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

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

LLVM IR (-O2):
define void @help(i8** nocapture %0) {
ret void
}
/* Type definitions */
struct extent_buffer {
  int dummy;
};
struct btrfs_node {
  int dummy;
};

/* Variables and functions */
struct btrfs_node *btrfs_buffer_node(struct extent_buffer *eb) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.btrfs_node = type { i32 }
%struct.extent_buffer = type { i32 }
define %struct.btrfs_node* @btrfs_buffer_node(%struct.extent_buffer* %0) {
%2 = alloca %struct.extent_buffer*
store %struct.extent_buffer* %0, %struct.extent_buffer** %2
ret %struct.btrfs_node* null
}

LLVM IR (-O2):
%struct.btrfs_node = type { i32 }
%struct.extent_buffer = type { i32 }
define noalias %struct.btrfs_node* @btrfs_buffer_node(%struct.extent_buffer* nocapture readnone %0) {
ret %struct.btrfs_node* null
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_COPY_unsigned(unsigned *const dest, unsigned const src) {
  return (((*dest) = src), true);
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_COPY_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_COPY_unsigned(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 1
}
/* Variables and functions */
int ptrtest2(int a) { return a * 2; }


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

x86 assembly (clang, -O2):
<ptrtest2>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @ptrtest2(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
unsigned char unsignedchar_ignoring_signedlong(unsigned char x, signed long y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_signedlong>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedchar_ignoring_signedlong>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_signedlong(i8 returned zeroext %0, i64 %1) {
ret i8 %0
}
void RTDbgModSegmentRva(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModSegmentRva() {
ret void
}
/* Variables and functions */
long long m(int);
long long sequence(int n) { return m(n); }


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

x86 assembly (clang, -O2):
<sequence>:
jmp    1030 <m@plt>

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

LLVM IR (-O2):
define i64 @sequence(i32 %0) {
%2 = tail call i64 @m(i32 %0)
ret i64 %2
}
/* Type definitions */
struct testforty_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ testforty_state_write_str(struct testforty_state *,
                                             char const *);
void testforty_state_pop(const char *name, void *context) {
  struct testforty_state *s = context;
  testforty_state_write_str(s, " /");
  testforty_state_write_str(s, name);
}


x86 assembly (clang, -O0):
<testforty_state_pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <testforty_state_write_str@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <testforty_state_write_str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testforty_state_pop>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <testforty_state_write_str@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <testforty_state_write_str@plt>

LLVM IR (-O0):
%struct.testforty_state = type { i32 }
@.str = [3 x i8] c" /\00"
define void @testforty_state_pop(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.testforty_state*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.testforty_state*
store %struct.testforty_state* %7, %struct.testforty_state** %5
%8 = load %struct.testforty_state*, %struct.testforty_state** %5
%9 = call i32 @testforty_state_write_str(%struct.testforty_state* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = load %struct.testforty_state*, %struct.testforty_state** %5
%11 = load i8*, i8** %3
%12 = call i32 @testforty_state_write_str(%struct.testforty_state* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.testforty_state = type { i32 }
@.str = [3 x i8] c" /\00"
define void @testforty_state_pop(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.testforty_state*
%4 = tail call i32 @testforty_state_write_str(%struct.testforty_state* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @testforty_state_write_str(%struct.testforty_state* %3, i8* %0)
ret void
}
void PyDTrace_GC_DONE(int arg0) {}


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

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

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

LLVM IR (-O2):
define void @PyDTrace_GC_DONE(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ brk(void *);
void *my_free(void *heap_mm) { brk(heap_mm); }


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

x86 assembly (clang, -O2):
<my_free>:
jmp    1030 <brk@plt>

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

LLVM IR (-O2):
define noalias i8* @my_free(i8* %0) {
%2 = tail call i32 @brk(i8* %0)
ret i8* undef
}
/* Variables and functions */
int __get_array_size(char const *);
int /*<<< orphan*/ __infer_set_flag(char *, char *);
char *strcpy(char *s1, const char *s2) {
  int size1;
  int size2;
  __infer_set_flag("ignore_return", "");
  size1 = __get_array_size(s1);
  size2 = __get_array_size(s2);
  if (size2 > size1)
    while (1)
      ;
  return s1;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
lea    0xecf(%rip),%rsi
call   1030 <__infer_set_flag@plt>
mov    -0x8(%rbp),%rdi
call   1040 <__get_array_size@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__get_array_size@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1171 <strcpy+0x51>
jmp    116c <strcpy+0x4c>
jmp    116c <strcpy+0x4c>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <__infer_set_flag@plt>
mov    %rbx,%rdi
call   1040 <__get_array_size@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <__get_array_size@plt>
cmp    %ebp,%eax
jle    1162 <strcpy+0x42>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
jmp    1160 <strcpy+0x40>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"ignore_return\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @strcpy(i8* returned %0, i8* %1) {
%3 = tail call i32 @__infer_set_flag(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @__get_array_size(i8* %0)
%5 = tail call i32 @__get_array_size(i8* %1)
%6 = icmp sgt i32 %5, %4
br i1 %6, label %7, label %8
7: ; preds = %2, %7
br label %7
8: ; preds = %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void main(void) {
  int sum1, sum2, i;
  for (i = 1; i <= 100; ++i) {
    sum1 += i * i;
    sum2 += i;
  }
  sum2 *= sum2;
  printf("%d - %d = %d\n", sum2, sum1, sum2 - sum1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jg     114d <main+0x3d>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <main+0xf>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"%d - %d = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %3
br label %4
4: ; preds = %16, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %1
%12 = add nsw i32 %11, %10
store i32 %12, i32* %1
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %13
store i32 %15, i32* %2
br label %16
16: ; preds = %7
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
%20 = load i32, i32* %2
%21 = load i32, i32* %2
%22 = mul nsw i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = load i32, i32* %1
%27 = sub nsw i32 %25, %26
%28 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24, i32 %27)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d - %d = %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 undef, i32 undef, i32 undef)
ret void
}
int test_imm_4Buint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x4B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Buint64_lowword_reg>:
test   $0x4b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Buint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 75
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}