xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_menu() {
  printf("\n******************Manager application********************\n        "
         "   \n           Operations:\n           \n           [1] Edit pass "
         "file\n           [2] Backup copy\n           [3] Automatic time "
         "display (CNTRL-C for CET/UTC display change)\n           [4] PPT: "
         "Parrallel Password Treatment\n           [5] Ordered shutdown\n      "
         "     \n           \t\tSelect option:");
}


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

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

LLVM IR (-O0):
@.str = [359 x i8] c"\0A******************Manager application********************\0A \0A Operations:\0A \0A [1] Edit pass file\0A [2] Backup copy\0A [3] Automatic time display (CNTRL-C for CET/UTC display change)\0A [4] PPT: Parrallel Password Treatment\0A [5] Ordered shutdown\0A \0A \09\09Select option:\00"
define void @print_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([359 x i8], [359 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [359 x i8] c"\0A******************Manager application********************\0A \0A Operations:\0A \0A [1] Edit pass file\0A [2] Backup copy\0A [3] Automatic time display (CNTRL-C for CET/UTC display change)\0A [4] PPT: Parrallel Password Treatment\0A [5] Ordered shutdown\0A \0A \09\09Select option:\00"
define void @print_menu() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([359 x i8], [359 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long long foo(unsigned long long);
__attribute__((no, noclone)) unsigned long long bar(unsigned long long *x) {
  return ((unsigned long long)foo(*x) << 32) | foo(*x >> 32);
}


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

x86 assembly (clang, -O2):
<bar>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1030 <foo@plt>
mov    %rax,%rbx
shl    $0x20,%rbx
mov    0x4(%r14),%edi
call   1030 <foo@plt>
or     %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @bar(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i64 @foo(i64 %4)
%6 = shl i64 %5, 32
%7 = load i64*, i64** %2
%8 = load i64, i64* %7
%9 = lshr i64 %8, 32
%10 = call i64 @foo(i64 %9)
%11 = or i64 %6, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @bar(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i64 @foo(i64 %2)
%4 = shl i64 %3, 32
%5 = load i64, i64* %0
%6 = lshr i64 %5, 32
%7 = tail call i64 @foo(i64 %6)
%8 = or i64 %7, %4
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float n, m, product;
  printf("Enter two numbers: \n");
  scanf("%f %f", &n, &m);
  product = n * m;
  printf("Product is: %f", product);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb2(%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    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter two numbers: \0A\00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [15 x i8] c"Product is: %f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fmul float %6, %7
store float %8, float* %3
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [15 x i8] c"Product is: %f\00"
@str = [20 x i8] c"Enter two numbers: \00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%7 = load float, float* %1
%8 = load float, float* %2
%9 = fmul float %7, %8
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ this_seems_bad(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Correct usage: ./overflow2 (string)\n");
  }
  this_seems_bad(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)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <this_seems_bad@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1135 <main+0x15>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rdi
call   1040 <this_seems_bad@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Correct usage: ./overflow2 (string)\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 i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @this_seems_bad(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@str = [36 x i8] c"Correct usage: ./overflow2 (string)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @this_seems_bad(i8* %8)
ret i32 0
}
/* Variables and functions */
int biscSendByte(unsigned char);
int biscChangeMode(unsigned char mode) {
  if (mode != 132 && mode != 131 && mode != 128)
    return -1;
  if (biscSendByte(128) == -1)
    return -1;
  return biscSendByte(mode);
}


x86 assembly (clang, -O0):
<biscChangeMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x84,%eax
je     1157 <biscChangeMode+0x47>
movzbl -0x5(%rbp),%eax
cmp    $0x83,%eax
je     1157 <biscChangeMode+0x47>
movzbl -0x5(%rbp),%eax
cmp    $0x80,%eax
je     1157 <biscChangeMode+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <biscChangeMode+0x72>
mov    $0x80,%edi
call   1030 <biscSendByte@plt>
cmp    $0xffffffff,%eax
jne    1176 <biscChangeMode+0x66>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <biscChangeMode+0x72>
movzbl -0x5(%rbp),%edi
call   1030 <biscSendByte@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biscChangeMode>:
push   %rbx
mov    %edi,%ebx
lea    -0x80(%rbx),%eax
cmp    $0x4,%al
ja     113f <biscChangeMode+0x2f>
movzbl %al,%eax
mov    $0x19,%ecx
bt     %eax,%ecx
jae    113f <biscChangeMode+0x2f>
mov    $0x80,%edi
call   1030 <biscSendByte@plt>
cmp    $0xffffffff,%eax
je     113f <biscChangeMode+0x2f>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <biscSendByte@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @biscChangeMode(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp ne i32 %5, 132
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp ne i32 %9, 131
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = icmp ne i32 %13, 128
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 -1, i32* %2
br label %23
16: ; preds = %11, %7, %1
%17 = call i32 @biscSendByte(i8 zeroext -128)
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 -1, i32* %2
br label %23
20: ; preds = %16
%21 = load i8, i8* %3
%22 = call i32 @biscSendByte(i8 zeroext %21)
store i32 %22, i32* %2
br label %23
23: ; preds = %20, %19, %15
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @biscChangeMode(i8 zeroext %0) {
switch i8 %0, label %7 [
i8 -124, label %2
i8 -125, label %2
i8 -128, label %2
]
2: ; preds = %1, %1, %1
%3 = tail call i32 @biscSendByte(i8 zeroext -128)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @biscSendByte(i8 zeroext %0)
br label %7
7: ; preds = %2, %1, %5
%8 = phi i32 [ %6, %5 ], [ -1, %1 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x44() {
  Assert_real((isgraph(68)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              345, ("isgraph should be 1 for D"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x44>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x159,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x44>:
push   %rax
mov    $0x44,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x159,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for D\00"
define void @t_isgraph_0x44() {
%1 = call i32 @isgraph(i32 68)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for D\00"
define void @t_isgraph_0x44() {
%1 = tail call i32 @isgraph(i32 68)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "Usage %s [options] [interface]\n"
          "-h:	this help",
          name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage %s [options] [interface]\0A-h:\09this help\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage %s [options] [interface]\0A-h:\09this help\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void ff_hevc_put_hevc_bi_epel_v24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v24_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
int /*<<< orphan*/ genlab(int);
int label();
int /*<<< orphan*/ lgen(char *, char *, int);
void cgbr(char *how, int n) {
  int lab = label();
  gen("orq\t%rax,%rax");
  lgen("%s\t%c%d", how, lab);
  lgen("%s\t%c%d", "jmp", n);
  genlab(lab);
}


x86 assembly (clang, -O0):
<cgbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <label@plt>
mov    %eax,-0x10(%rbp)
lea    0xea0(%rip),%rdi
call   1060 <gen@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xe9b(%rip),%rdi
call   1030 <lgen@plt>
mov    -0xc(%rbp),%edx
lea    0xe8c(%rip),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <lgen@plt>
mov    -0x10(%rbp),%edi
call   1050 <genlab@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgbr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <label@plt>
mov    %eax,%ebp
lea    0xea3(%rip),%rdi
call   1060 <gen@plt>
lea    0xea5(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <lgen@plt>
lea    0xe99(%rip),%rsi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <lgen@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <genlab@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"orq\09%rax,%rax\00"
@.str.1 = [8 x i8] c"%s\09%c%d\00"
@.str.2 = [4 x i8] c"jmp\00"
define void @cgbr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (...) @label()
store i32 %6, i32* %5
%7 = call i32 @gen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %5
%14 = call i32 @genlab(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"orq\09%rax,%rax\00"
@.str.1 = [8 x i8] c"%s\09%c%d\00"
@.str.2 = [4 x i8] c"jmp\00"
define void @cgbr(i8* %0, i32 %1) {
%3 = tail call i32 (...) @label()
%4 = tail call i32 @gen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %3)
%6 = tail call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%7 = tail call i32 @genlab(i32 %3)
ret void
}
void cprintf(char *string) {}


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

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

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

LLVM IR (-O2):
define void @cprintf(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteString(char const *);
void SerialSendString(const char data[]) { SerialWriteString(data); }


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

x86 assembly (clang, -O2):
<SerialSendString>:
jmp    1030 <SerialWriteString@plt>

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

LLVM IR (-O2):
define void @SerialSendString(i8* %0) {
%2 = tail call i32 @SerialWriteString(i8* %0)
ret void
}
void *ZGenericType_init(void *self) { return self; }


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

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

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

LLVM IR (-O2):
define i8* @ZGenericType_init(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ bar(short *);
int /*<<< orphan*/ foo(unsigned short *);
int main() {
  unsigned short us = 0x8078;
  foo(&us);
  short s = -32648;
  bar(&s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x8078,-0x6(%rbp)
lea    -0x6(%rbp),%rdi
call   1040 <foo@plt>
movw   $0x8078,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x8078,0x6(%rsp)
lea    0x6(%rsp),%rdi
call   1040 <foo@plt>
movw   $0x8078,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
store i32 0, i32* %1
store i16 -32648, i16* %2
%4 = call i32 @foo(i16* %2)
store i16 -32648, i16* %3
%5 = call i32 @bar(i16* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i16
%2 = alloca i16
%3 = bitcast i16* %1 to i8*
store i16 -32648, i16* %1
%4 = call i32 @foo(i16* %1)
%5 = bitcast i16* %2 to i8*
store i16 -32648, i16* %2
%6 = call i32 @bar(i16* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int _mkpath(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/ *);
int mkpathat_np(int dfd, const char *path, mode_t omode) {
  return _mkpath(dfd, path, omode, NULL);
}


x86 assembly (clang, -O0):
<mkpathat_np>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <_mkpath@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkpathat_np>:
xor    %ecx,%ecx
jmp    1030 <_mkpath@plt>

LLVM IR (-O0):
define i32 @mkpathat_np(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @_mkpath(i32 %7, i8* %8, i32 %9, i32* null)
ret i32 %10
}

LLVM IR (-O2):
define i32 @mkpathat_np(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @_mkpath(i32 %0, i8* %1, i32 %2, i32* null)
ret i32 %4
}
/* Variables and functions */
int d23(int);
int d24(int a) { return d23(d23(a)); }


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

x86 assembly (clang, -O2):
<d24>:
push   %rax
call   1030 <d23@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d23@plt>

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

LLVM IR (-O2):
define i32 @d24(i32 %0) {
%2 = tail call i32 @d23(i32 %0)
%3 = tail call i32 @d23(i32 %2)
ret i32 %3
}
int do_386() { return 386; }


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

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

LLVM IR (-O0):
define i32 @do_386() {
ret i32 386
}

LLVM IR (-O2):
define i32 @do_386() {
ret i32 386
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popinteger8array(long int *x, int n) {
  popNarray((char *)x, (unsigned int)(n * 8));
}


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

x86 assembly (clang, -O2):
<popinteger8array>:
shl    $0x3,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popinteger8array(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = bitcast i64* %5 to i8*
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 8
%9 = call i32 @popNarray(i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @popinteger8array(i64* %0, i32 %1) {
%3 = bitcast i64* %0 to i8*
%4 = shl nsw i32 %1, 3
%5 = tail call i32 @popNarray(i8* %3, i32 %4)
ret void
}
int reduzSUM(int *v) {
  int i, ro;
  ro = 0x00000000;
  for (i = 0; i < 5; i++) {
    ro = ro + v[i];
  }
  return (ro);
}


x86 assembly (clang, -O0):
<reduzSUM>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    113f <reduzSUM+0x3f>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <reduzSUM+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduzSUM>:
movdqu 0x4(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @reduzSUM(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = bitcast i32* %3 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %5)
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
float luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(float);
void math_deg(void) {
  float d = luaL_check_number(1);
  lua_pushnumber(d * 180. / 3.14159265358979323846);
}


x86 assembly (clang, -O0):
<math_deg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeac(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_deg>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0xec9(%rip),%xmm0
divsd  0xec9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_deg() {
%1 = alloca float
%2 = call float @luaL_check_number(i32 1)
store float %2, float* %1
%3 = load float, float* %1
%4 = fpext float %3 to double
%5 = fmul double %4, 1.800000e+02
%6 = fdiv double %5, 0x400921FB54442D18
%7 = fptrunc double %6 to float
%8 = call i32 @lua_pushnumber(float %7)
ret void
}

LLVM IR (-O2):
define void @math_deg() {
%1 = tail call float @luaL_check_number(i32 1)
%2 = fpext float %1 to double
%3 = fmul double %2, 1.800000e+02
%4 = fdiv double %3, 0x400921FB54442D18
%5 = fptrunc double %4 to float
%6 = tail call i32 @lua_pushnumber(float %5)
ret void
}
float *get_epa_data(struct grid_info *g) { return 0; }


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

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

LLVM IR (-O0):
%struct.grid_info = type opaque
define float* @get_epa_data(%struct.grid_info* %0) {
%2 = alloca %struct.grid_info*
store %struct.grid_info* %0, %struct.grid_info** %2
ret float* null
}

LLVM IR (-O2):
%struct.grid_info = type opaque
define noalias float* @get_epa_data(%struct.grid_info* nocapture readnone %0) {
ret float* null
}
/* Variables and functions */
int string_array_len(const char *array[]) {
  int i = 0;
  if (array) {
    while (array[i]) {
      ++i;
    }
  }
  return i;
}


x86 assembly (clang, -O0):
<string_array_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <string_array_len+0x45>
jmp    111f <string_array_len+0x1f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1140 <string_array_len+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <string_array_len+0x1f>
jmp    1145 <string_array_len+0x45>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_array_len>:
test   %rdi,%rdi
je     111e <string_array_len+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <string_array_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_array_len(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int strcmp(char *, char *);
int cmpfunc(const void *a, const void *b) {
  return strcmp((char *)a, (char *)b);
}


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

x86 assembly (clang, -O2):
<cmpfunc>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmpfunc(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int main(void) {
  char *path = "/etc/passwd";
  int fd = open(path, O_RDONLY);
  if (fd >= 0)
    close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1161 <main+0x41>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
test   %eax,%eax
js     1141 <main+0x21>
mov    %eax,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/etc/passwd\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %3
%11 = call i32 @close(i32 %10)
br label %12
12: ; preds = %9, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"/etc/passwd\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ intf();
scalar_t__ voidf();
int f(void) {
  if (intf() < 0 || voidf() < 0)
    return 1;
  if (voidf() < 0 || intf() < 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <intf@plt>
cmp    $0x0,%rax
jl     114a <f+0x2a>
mov    $0x0,%al
call   1040 <voidf@plt>
cmp    $0x0,%rax
jge    1156 <f+0x36>
movl   $0x1,-0x4(%rbp)
jmp    118b <f+0x6b>
mov    $0x0,%al
call   1040 <voidf@plt>
cmp    $0x0,%rax
jl     1178 <f+0x58>
mov    $0x0,%al
call   1030 <intf@plt>
cmp    $0x0,%rax
jge    1184 <f+0x64>
movl   $0x1,-0x4(%rbp)
jmp    118b <f+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
xor    %eax,%eax
call   1030 <intf@plt>
mov    $0x1,%ebx
test   %rax,%rax
js     1158 <f+0x38>
xor    %eax,%eax
call   1040 <voidf@plt>
test   %rax,%rax
js     1158 <f+0x38>
xor    %eax,%eax
call   1040 <voidf@plt>
test   %rax,%rax
js     1158 <f+0x38>
xor    %eax,%eax
call   1030 <intf@plt>
mov    %rax,%rbx
shr    $0x3f,%rbx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i64 (...) @intf()
%2 = icmp slt i64 %1, 0
br i1 %2, label %13, label %3
3: ; preds = %0
%4 = tail call i64 (...) @voidf()
%5 = icmp slt i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = tail call i64 (...) @voidf()
%8 = icmp slt i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call i64 (...) @intf()
%11 = lshr i64 %10, 63
%12 = trunc i64 %11 to i32
br label %13
13: ; preds = %9, %6, %0, %3
%14 = phi i32 [ 1, %3 ], [ 1, %0 ], [ 1, %6 ], [ %12, %9 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ defstorage();
int /*<<< orphan*/ nl();
int /*<<< orphan*/ outdec(int);
int dumpzero(int size, int count) {
  if (count <= 0)
    return (0);
  defstorage();
  outdec(size * count);
  nl();
  return (size * count);
}


x86 assembly (clang, -O0):
<dumpzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1154 <dumpzero+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1178 <dumpzero+0x48>
mov    $0x0,%al
call   1040 <defstorage@plt>
mov    -0x8(%rbp),%edi
imul   -0xc(%rbp),%edi
call   1050 <outdec@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpzero>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1155 <dumpzero+0x25>
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <defstorage@plt>
imul   %ebp,%ebx
mov    %ebx,%edi
call   1050 <outdec@plt>
xor    %eax,%eax
call   1030 <nl@plt>
jmp    1157 <dumpzero+0x27>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dumpzero(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* %5
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %19
9: ; preds = %2
%10 = call i32 (...) @defstorage()
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = mul nsw i32 %11, %12
%14 = call i32 @outdec(i32 %13)
%15 = call i32 (...) @nl()
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = mul nsw i32 %16, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %9, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @dumpzero(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 (...) @defstorage()
%6 = mul nsw i32 %1, %0
%7 = tail call i32 @outdec(i32 %6)
%8 = tail call i32 (...) @nl()
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %6, %4 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ puts(char *);
int read(int, char *, int);
void getResponse(char *sendBuf, char *buf, int sockfd) {
  int len = read(sockfd, sendBuf, 32768);
  puts(sendBuf);
  memset(sendBuf, 0, 32768);
  memset(buf, 0, 32768);
}


x86 assembly (clang, -O0):
<getResponse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    $0x8000,%edx
call   1050 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8000,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8000,%edx
call   1040 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getResponse>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
mov    %rbx,%rsi
mov    $0x8000,%edx
call   1050 <read@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8000,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8000,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memset@plt>

LLVM IR (-O0):
define void @getResponse(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @read(i32 %8, i8* %9, i32 32768)
store i32 %10, i32* %7
%11 = load i8*, i8** %4
%12 = call i32 @puts(i8* %11)
%13 = load i8*, i8** %4
%14 = call i32 @memset(i8* %13, i32 0, i32 32768)
%15 = load i8*, i8** %5
%16 = call i32 @memset(i8* %15, i32 0, i32 32768)
ret void
}

LLVM IR (-O2):
define void @getResponse(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @read(i32 %2, i8* %0, i32 32768)
%5 = tail call i32 @puts(i8* dereferenceable(1) %0)
%6 = tail call i32 @memset(i8* %0, i32 0, i32 32768)
%7 = tail call i32 @memset(i8* %1, i32 0, i32 32768)
ret void
}
int test_imm_CFuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xCF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CFuint64_midword_reg>:
test   $0xcf0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CFuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 13565952
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void *ecalloc(size_t nmemb, size_t size) {
  void *retval = calloc(nmemb, size);
  if (retval == NULL) {
    perror("Error in function ecalloc()");
    exit(0);
  }
  return retval;
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <ecalloc+0x3f>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <ecalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Error in function ecalloc()\00"
define i8* @ecalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [28 x i8] c"Error in function ecalloc()\00"
define noalias i8* @ecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
ret i8* %3
}
void foo361() {}


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

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

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

LLVM IR (-O2):
define void @foo361() {
ret void
}
int test_imm_32uint16_reg(unsigned short val) {
  return ((val) & (0x32 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_32uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x32,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_32uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 50
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ getSipHash24(char *, int /*<<< orphan*/, int /*<<< orphan*/);
uint64_t universalHash(char *key, uint64_t index) {
  return getSipHash24(key, index, index);
}


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

x86 assembly (clang, -O2):
<universalHash>:
mov    %esi,%edx
jmp    1030 <getSipHash24@plt>

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

LLVM IR (-O2):
define i32 @universalHash(i8* %0, i32 %1) {
%3 = tail call i32 @getSipHash24(i8* %0, i32 %1, i32 %1)
ret i32 %3
}
/* Variables and functions */
int traverseFolder(char *const *);
int main(int argc, char *const argv[]) {
  int rc;
  if ((rc = traverseFolder(argv + 1)) != 0)
    rc = 1;
  return rc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1030 <traverseFolder@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1146 <main+0x36>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x8(%rsi),%rdi
call   1030 <traverseFolder@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = tail call i32 @traverseFolder(i8** %3)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct ptr_list {
  int dummy;
};
struct instruction_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ concat_ptr_list(struct ptr_list *, struct ptr_list **);
void concat_instruction_list(struct instruction_list *from,
                             struct instruction_list **to) {
  concat_ptr_list((struct ptr_list *)from, (struct ptr_list **)to);
}


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

x86 assembly (clang, -O2):
<concat_instruction_list>:
jmp    1030 <concat_ptr_list@plt>

LLVM IR (-O0):
%struct.instruction_list = type { i32 }
%struct.ptr_list = type { i32 }
define void @concat_instruction_list(%struct.instruction_list* %0, %struct.instruction_list** %1) {
%3 = alloca %struct.instruction_list*
%4 = alloca %struct.instruction_list**
store %struct.instruction_list* %0, %struct.instruction_list** %3
store %struct.instruction_list** %1, %struct.instruction_list*** %4
%5 = load %struct.instruction_list*, %struct.instruction_list** %3
%6 = bitcast %struct.instruction_list* %5 to %struct.ptr_list*
%7 = load %struct.instruction_list**, %struct.instruction_list*** %4
%8 = bitcast %struct.instruction_list** %7 to %struct.ptr_list**
%9 = call i32 @concat_ptr_list(%struct.ptr_list* %6, %struct.ptr_list** %8)
ret void
}

LLVM IR (-O2):
%struct.instruction_list = type { i32 }
%struct.ptr_list = type { i32 }
define void @concat_instruction_list(%struct.instruction_list* %0, %struct.instruction_list** %1) {
%3 = bitcast %struct.instruction_list* %0 to %struct.ptr_list*
%4 = bitcast %struct.instruction_list** %1 to %struct.ptr_list**
%5 = tail call i32 @concat_ptr_list(%struct.ptr_list* %3, %struct.ptr_list** %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printVal(int);
int countOfArray(int *ar) {
  int sizf = sizeof(*ar) / sizeof(int);
  printVal(sizf);
  return sizf;
}


x86 assembly (clang, -O0):
<countOfArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <printVal@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countOfArray>:
push   %rax
mov    $0x1,%edi
call   1030 <printVal@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @countOfArray(i32* nocapture readnone %0) {
%2 = tail call i32 @printVal(i32 1)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ungetc_unlocked(int, int /*<<< orphan*/ *);
int unget(int c, void *file) { return ungetc_unlocked(c, (FILE *)file); }


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

x86 assembly (clang, -O2):
<unget>:
jmp    1030 <ungetc_unlocked@plt>

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

LLVM IR (-O2):
define i32 @unget(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @ungetc_unlocked(i32 %0, i32* %3)
ret i32 %4
}