xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int a, i, g, c;
  scanf("%d", &a);
  g = 0;
  i = 1;
  while (c >= 1) {
    c = (a % (10 * i)) % i;
    i = i * 10;
  }
  if (c = 7)
    g = g + 1;
  printf("%d", g);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     1176 <main+0x56>
mov    -0x8(%rbp),%eax
imul   $0xa,-0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x2d>
movl   $0x7,-0x14(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    118c <main+0x6c>
jmp    1195 <main+0x75>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
int is_call(unsigned int inst) { return inst << 4 >> 28 == 0xb; }


x86 assembly (clang, -O0):
<is_call>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
shr    $0x1c,%eax
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_call>:
and    $0xf000000,%edi
xor    %eax,%eax
cmp    $0xb000000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_call(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 4
%5 = lshr i32 %4, 28
%6 = icmp eq i32 %5, 11
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_call(i32 %0) {
%2 = and i32 %0, 251658240
%3 = icmp eq i32 %2, 184549376
%4 = zext i1 %3 to i32
ret i32 %4
}
void charDescend(void *a, void *b) {
  char *first = (char *)a;
  char *second = (char *)b;
  char tmp = 0;
  if (*first < *second) {
    tmp = *first;
    *first = *second;
    *second = tmp;
  }
}


x86 assembly (clang, -O0):
<charDescend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movb   $0x0,-0x21(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    1154 <charDescend+0x54>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x21(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<charDescend>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jge    110c <charDescend+0xc>
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @charDescend(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i8 %4, i8* %0
store i8 %3, i8* %1
br label %7
7: ; preds = %6, %2
ret void
}
/* Variables and functions */
unsigned int __builtin_divweu(unsigned int, unsigned int);
unsigned int div_weu(unsigned int a, unsigned int b) {
  return __builtin_divweu(a, b);
}


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

x86 assembly (clang, -O2):
<div_weu>:
jmp    1030 <__builtin_divweu@plt>

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

LLVM IR (-O2):
define i32 @div_weu(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_divweu(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int __simc(int, int, int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int simc_ioctl(int fd, int request, void *arg) {
  return __simc(31, fd, request, (int)arg, 0, 0);
}


x86 assembly (clang, -O0):
<simc_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1f,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <__simc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simc_ioctl>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1f,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <__simc@plt>

LLVM IR (-O0):
define i32 @simc_ioctl(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* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @__simc(i32 31, i32 %7, i32 %8, i32 %10, i32 0, i32 0)
ret i32 %11
}

LLVM IR (-O2):
define i32 @simc_ioctl(i32 %0, i32 %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @__simc(i32 31, i32 %0, i32 %1, i32 %5, i32 0, i32 0)
ret i32 %6
}
double dbl_min2(double a, double b) { return (a <= b) ? a : b; }


x86 assembly (clang, -O0):
<dbl_min2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1131 <dbl_min2+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <dbl_min2+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_min2>:
movapd %xmm0,%xmm2
cmplesd %xmm1,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dbl_min2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ole double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @dbl_min2(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_print_xyz_bulk() { printf("Not implemented yet...\n"); }


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"Not implemented yet...\00"
define void @test_print_xyz_bulk() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
scalar_t__ pipe(int *);
void pipe_or_die(int fds[2]) {
  if (pipe(fds) != 0) {
    err(1, "pipe(2) failed");
  }
}


x86 assembly (clang, -O0):
<pipe_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pipe@plt>
cmp    $0x0,%rax
je     1150 <pipe_or_die+0x30>
mov    $0x1,%edi
lea    0xeb5(%rip),%rsi
call   1040 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe_or_die>:
push   %rax
call   1030 <pipe@plt>
test   %rax,%rax
je     113d <pipe_or_die+0x1d>
lea    0xece(%rip),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1040 <err@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"pipe(2) failed\00"
define void @pipe_or_die(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pipe(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @err(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"pipe(2) failed\00"
define void @pipe_or_die(i32* %0) {
%2 = tail call i64 @pipe(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void iface1_ver1_func1(void) { printf("A - version 1 func1\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"A - version 1 func1\00"
define void @iface1_ver1_func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
double sum_double_array(double *pdValarray) {
  return pdValarray[0] + pdValarray[1] + pdValarray[2];
}


x86 assembly (clang, -O0):
<sum_double_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_double_array>:
movsd  (%rdi),%xmm0
addsd  0x8(%rdi),%xmm0
addsd  0x10(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @sum_double_array(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = fadd double %5, %8
%10 = load double*, double** %2
%11 = getelementptr inbounds double, double* %10, i64 2
%12 = load double, double* %11
%13 = fadd double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @sum_double_array(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fadd double %2, %4
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = fadd double %5, %7
ret double %8
}
/* Variables and functions */
int cm_delete_entry(char *, char *, char *, char *);
int delshadow(char *user) {
  int i;
  if ((i = cm_delete_entry(user, "%[^:]:%*[^:]:%*d:%*d:%*d:%*d:%*d:%*d:%*d",
                           "/etc/shadow", "/etc/.shadow.cm")) != 0) {
    return i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<delshadow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xefb(%rip),%rdx
lea    0xf00(%rip),%rcx
call   1030 <cm_delete_entry@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1151 <delshadow+0x41>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <delshadow+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delshadow>:
lea    0xee9(%rip),%rsi
lea    0xf0b(%rip),%rdx
lea    0xf10(%rip),%rcx
jmp    1030 <cm_delete_entry@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"%[^:]:%*[^:]:%*d:%*d:%*d:%*d:%*d:%*d:%*d\00"
@.str.1 = [12 x i8] c"/etc/shadow\00"
@.str.2 = [16 x i8] c"/etc/.shadow.cm\00"
define i32 @delshadow(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @cm_delete_entry(i8* %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
store i32 %6, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [41 x i8] c"%[^:]:%*[^:]:%*d:%*d:%*d:%*d:%*d:%*d:%*d\00"
@.str.1 = [12 x i8] c"/etc/shadow\00"
@.str.2 = [16 x i8] c"/etc/.shadow.cm\00"
define i32 @delshadow(i8* %0) {
%2 = tail call i32 @cm_delete_entry(i8* %0, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 %2
}
void CFGMR3ValidateConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3ValidateConfig() {
ret void
}
int kelvinToCelcius(unsigned int kelvin) { return kelvin - 273; }


x86 assembly (clang, -O0):
<kelvinToCelcius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x111,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kelvinToCelcius>:
lea    -0x111(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @kelvinToCelcius(i32 %0) {
%2 = add i32 %0, -273
ret i32 %2
}
long long longlong_ignoring_longlong(long long x, long long y) { return x; }


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

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

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

LLVM IR (-O2):
define i64 @longlong_ignoring_longlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int strcmp(char *, char *);
int pstrcmp(char **p, char **q) { return strcmp(*p, *q); }


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

x86 assembly (clang, -O2):
<pstrcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @pstrcmp(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** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 @strcmp(i8* %6, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @pstrcmp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
int test_imm_C0uint16_reg(unsigned short val) {
  return ((val) & (0xC0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C0uint16_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, 192
%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_C0uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 192
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  volatile int x = 1;
  if (x != 1) {
    printf("hello world\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x1,%eax
je     113e <main+0x2e>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
je     112e <main+0x1e>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
char *fcitx_utf8_get_char(char const *, int *);
__attribute__((visibility("default"))) size_t fcitx_utf8_strlen(const char *s) {
  unsigned int l = 0;
  while (*s) {
    int chr;
    s = fcitx_utf8_get_char(s, &chr);
    l++;
  }
  return l;
}


x86 assembly (clang, -O0):
<fcitx_utf8_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <fcitx_utf8_strlen+0x3f>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <fcitx_utf8_get_char@plt>
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <fcitx_utf8_strlen+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcitx_utf8_strlen>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
cmpb   $0x0,(%rdi)
je     1145 <fcitx_utf8_strlen+0x35>
mov    %rdi,%rax
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <fcitx_utf8_get_char@plt>
add    $0x1,%ebx
cmpb   $0x0,(%rax)
jne    1130 <fcitx_utf8_strlen+0x20>
mov    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fcitx_utf8_strlen(i8* %0) {
%2 = alloca i32
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %1
%6 = bitcast i32* %2 to i8*
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ 0, %5 ], [ %11, %7 ]
%9 = phi i8* [ %0, %5 ], [ %10, %7 ]
%10 = call i8* @fcitx_utf8_get_char(i8* %9, i32* %2)
%11 = add i32 %8, 1
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7
%15 = zext i32 %11 to i64
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 0, %1 ], [ %15, %14 ]
ret i64 %17
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rand();
uint32_t t1RNG(uint32_t range) { return rand() % range; }


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

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

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

LLVM IR (-O2):
define i32 @t1RNG(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int get_rounding_mode();
int __fegetround(void) { return get_rounding_mode(); }


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

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

LLVM IR (-O0):
define i32 @__fegetround() {
%1 = call i32 (...) @get_rounding_mode()
ret i32 %1
}

LLVM IR (-O2):
define i32 @__fegetround() {
%1 = tail call i32 (...) @get_rounding_mode()
ret i32 %1
}
/* Variables and functions */
scalar_t__ create_socketpair(int *);
int main(int argc, char *argv[]) {
  int fd[2];
  if (create_socketpair(fd) < 0)
    return -1;
  return 0;
}


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)
lea    -0x18(%rbp),%rdi
call   1030 <create_socketpair@plt>
cmp    $0x0,%rax
jge    1145 <main+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <main+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <create_socketpair@plt>
sar    $0x3f,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = call i64 @create_socketpair(i32* %5)
%7 = ashr i64 %6, 63
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double _int_f_rand(void) { return (rand() / (double)RAND_MAX); }


x86 assembly (clang, -O0):
<_int_f_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_int_f_rand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @_int_f_rand() {
%1 = call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @_int_f_rand() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
int feelings_reload(int reload) {}


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

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

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

LLVM IR (-O2):
define i32 @feelings_reload(i32 %0) {
ret i32 undef
}
/* Variables and functions */
double __nv_dmul_rz(double, double);
double __dmul_rz(double __a, double __b) { return __nv_dmul_rz(__a, __b); }


x86 assembly (clang, -O0):
<__dmul_rz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__nv_dmul_rz@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dmul_rz>:
jmp    1030 <__nv_dmul_rz@plt>

LLVM IR (-O0):
define double @__dmul_rz(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__nv_dmul_rz(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__dmul_rz(double %0, double %1) {
%3 = tail call double @__nv_dmul_rz(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_NoReturnTypeSpecifiedForForeignHandler(long p_position) {
  _Error(p_position, "Foreign handlers must specify a return type");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"Foreign handlers must specify a return type\00"
define void @Error_NoReturnTypeSpecifiedForForeignHandler(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Foreign handlers must specify a return type\00"
define void @Error_NoReturnTypeSpecifiedForForeignHandler(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
void gtk_menu_tool_button_set_menu() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_tool_button_set_menu() {
ret void
}
int str_len(char *str) {
  int len;
  len = 0;
  while (str[len])
    len++;
  return (len);
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <str_len+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, char *);
char *yyBEGIN(char *);
int /*<<< orphan*/ yyEND(char const *);
void s_segment(int s) {
  do {
    const char *yytag = yyBEGIN("LI");
    print("segment %s", &"text\0bss\0.data\0lit\0.sym\0."[5 * s - 5]);
    yyEND(yytag);
  } while (0);
}


x86 assembly (clang, -O0):
<s_segment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1050 <yyBEGIN@plt>
mov    %rax,-0x10(%rbp)
imul   $0x5,-0x4(%rbp),%eax
sub    $0x5,%eax
cltq
lea    0xeb3(%rip),%rsi
add    %rax,%rsi
lea    0xe9e(%rip),%rdi
call   1040 <print@plt>
mov    -0x10(%rbp),%rdi
call   1030 <yyEND@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_segment>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xec3(%rip),%rdi
call   1050 <yyBEGIN@plt>
mov    %rax,%r14
lea    (%rbx,%rbx,4),%eax
cltq
lea    0xebd(%rip),%rcx
lea    (%rax,%rcx,1),%rsi
add    $0xfffffffffffffffb,%rsi
lea    0xea3(%rip),%rdi
call   1040 <print@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <yyEND@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"LI\00"
@.str.1 = [11 x i8] c"segment %s\00"
@.str.2 = [26 x i8] c"text\00bss\00.data\00lit\00.sym\00.\00"
define void @s_segment(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
br label %4
4: ; preds = %1
%5 = call i8* @yyBEGIN(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i32, i32* %2
%7 = mul nsw i32 5, %6
%8 = sub nsw i32 %7, 5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [26 x i8], [26 x i8]* @.str.2, i64 0, i64 %9
%11 = call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @yyEND(i8* %12)
br label %14
14: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"LI\00"
@.str.1 = [11 x i8] c"segment %s\00"
@.str.2 = [26 x i8] c"text\00bss\00.data\00lit\00.sym\00.\00"
define void @s_segment(i32 %0) {
%2 = tail call i8* @yyBEGIN(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = mul nsw i32 %0, 5
%4 = add nsw i32 %3, -5
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [26 x i8], [26 x i8]* @.str.2, i64 0, i64 %5
%7 = tail call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = tail call i32 @yyEND(i8* %2)
ret void
}
/* Type definitions */
struct card {
  int dummy;
};

/* Variables and functions */
int cmp_int_arr(int *, int *, int);
int /*<<< orphan*/ get_set_cmp_point(struct card *, int *);
int cmp_set(struct card *c1, struct card *c2) {
  int point1[3];
  int point2[3];
  get_set_cmp_point(c1, point1);
  get_set_cmp_point(c2, point2);
  return cmp_int_arr(point1, point2, 3);
}


x86 assembly (clang, -O0):
<cmp_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <get_set_cmp_point@plt>
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <get_set_cmp_point@plt>
lea    -0x1c(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x3,%edx
call   1030 <cmp_int_arr@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_set>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
lea    0x14(%rsp),%r14
mov    %r14,%rsi
call   1040 <get_set_cmp_point@plt>
lea    0x8(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <get_set_cmp_point@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x3,%edx
call   1030 <cmp_int_arr@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.card = type { i32 }
define i32 @cmp_set(%struct.card* %0, %struct.card* %1) {
%3 = alloca %struct.card*
%4 = alloca %struct.card*
%5 = alloca [3 x i32]
%6 = alloca [3 x i32]
store %struct.card* %0, %struct.card** %3
store %struct.card* %1, %struct.card** %4
%7 = load %struct.card*, %struct.card** %3
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%9 = call i32 @get_set_cmp_point(%struct.card* %7, i32* %8)
%10 = load %struct.card*, %struct.card** %4
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%12 = call i32 @get_set_cmp_point(%struct.card* %10, i32* %11)
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%15 = call i32 @cmp_int_arr(i32* %13, i32* %14, i32 3)
ret i32 %15
}

LLVM IR (-O2):
%struct.card = type { i32 }
define i32 @cmp_set(%struct.card* %0, %struct.card* %1) {
%3 = alloca [3 x i32]
%4 = alloca [3 x i32]
%5 = bitcast [3 x i32]* %3 to i8*
%6 = bitcast [3 x i32]* %4 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%8 = call i32 @get_set_cmp_point(%struct.card* %0, i32* %7)
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%10 = call i32 @get_set_cmp_point(%struct.card* %1, i32* %9)
%11 = call i32 @cmp_int_arr(i32* %7, i32* %9, i32 3)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ mfs_init_fs(int, char *, int);
void mfs_init_genimage(int numbytes, char *address, int init_type) {
  mfs_init_fs(numbytes - 4, address + 4, init_type);
}


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

x86 assembly (clang, -O2):
<mfs_init_genimage>:
add    $0xfffffffc,%edi
add    $0x4,%rsi
jmp    1030 <mfs_init_fs@plt>

LLVM IR (-O0):
define void @mfs_init_genimage(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 = sub nsw i32 %7, 4
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 4
%11 = load i32, i32* %6
%12 = call i32 @mfs_init_fs(i32 %8, i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @mfs_init_genimage(i32 %0, i8* %1, i32 %2) {
%4 = add nsw i32 %0, -4
%5 = getelementptr inbounds i8, i8* %1, i64 4
%6 = tail call i32 @mfs_init_fs(i32 %4, i8* %5, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_something();
int /*<<< orphan*/ do_something_else();
int init_foobar(void) {
  do_something();
  do_something_else();
  return 0;
}


x86 assembly (clang, -O0):
<init_foobar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <do_something@plt>
mov    $0x0,%al
call   1040 <do_something_else@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_foobar>:
push   %rax
xor    %eax,%eax
call   1030 <do_something@plt>
xor    %eax,%eax
call   1040 <do_something_else@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @init_foobar() {
%1 = call i32 (...) @do_something()
%2 = call i32 (...) @do_something_else()
ret i32 0
}

LLVM IR (-O2):
define i32 @init_foobar() {
%1 = tail call i32 (...) @do_something()
%2 = tail call i32 (...) @do_something_else()
ret i32 0
}
int security_file_lock(struct file *file, unsigned int cmd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define i32 @security_file_lock(%struct.file* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct itimerval {
  int dummy;
};
typedef enum __itimer_which { ____Placeholder___itimer_which } __itimer_which;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __getitimer(enum __itimer_which which, struct itimerval *value) {
  if (value == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__getitimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <__getitimer+0x34>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <__getitimer+0x49>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getitimer>:
push   %rax
test   %rsi,%rsi
jne    111f <__getitimer+0xf>
mov    0x2ebb(%rip),%rax
jmp    1126 <__getitimer+0x16>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.itimerval = type { i32 }
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__getitimer(i32 %0, %struct.itimerval* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.itimerval*
store i32 %0, i32* %4
store %struct.itimerval* %1, %struct.itimerval** %5
%6 = load %struct.itimerval*, %struct.itimerval** %5
%7 = icmp eq %struct.itimerval* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EINVAL
%10 = call i32 @__set_errno(i32 %9)
store i32 -1, i32* %3
br label %14
11: ; preds = %2
%12 = load i32, i32* @ENOSYS
%13 = call i32 @__set_errno(i32 %12)
store i32 -1, i32* %3
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.itimerval = type { i32 }
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__getitimer(i32 %0, %struct.itimerval* readnone %1) {
%3 = icmp eq %struct.itimerval* %1, null
%4 = load i32, i32* @EINVAL
%5 = load i32, i32* @ENOSYS
%6 = select i1 %3, i32 %4, i32 %5
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
/* Variables and functions */
double ntob64(char *);
double amf_decode_num(char *data) {
  double n = ntob64(data);
  return n;
}


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

x86 assembly (clang, -O2):
<amf_decode_num>:
jmp    1030 <ntob64@plt>

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

LLVM IR (-O2):
define double @amf_decode_num(i8* %0) {
%2 = tail call double @ntob64(i8* %0)
ret double %2
}
void i2s_ASN1_ENUMERATED_TABLE(void) {}


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

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

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

LLVM IR (-O2):
define void @i2s_ASN1_ENUMERATED_TABLE() {
ret void
}
void ARGBExtractAlphaRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBExtractAlphaRow_NEON() {
ret void
}
/* Variables and functions */
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int S_IXGRP;
int S_IXOTH;
int S_IXUSR;
int mkdir(char *, int);
int mfm_mkdir(char *name) {
  return mkdir(name, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH |
                         S_IXOTH);
}


x86 assembly (clang, -O0):
<mfm_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
mov    0x2ea7(%rip),%rax
or     (%rax),%esi
mov    0x2e7e(%rip),%rax
or     (%rax),%esi
mov    0x2e85(%rip),%rax
or     (%rax),%esi
mov    0x2e64(%rip),%rax
or     (%rax),%esi
mov    0x2e8b(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfm_mkdir>:
mov    0x2e99(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2eb7(%rip),%rax
or     (%rax),%esi
mov    0x2e8e(%rip),%rax
or     (%rax),%esi
mov    0x2e95(%rip),%rax
or     (%rax),%esi
mov    0x2e74(%rip),%rax
or     (%rax),%esi
mov    0x2e9b(%rip),%rax
or     (%rax),%esi
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
@S_IRGRP = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
define i32 @mfm_mkdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IRUSR
%5 = load i32, i32* @S_IWUSR
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IXUSR
%8 = or i32 %6, %7
%9 = load i32, i32* @S_IRGRP
%10 = or i32 %8, %9
%11 = load i32, i32* @S_IXGRP
%12 = or i32 %10, %11
%13 = load i32, i32* @S_IROTH
%14 = or i32 %12, %13
%15 = load i32, i32* @S_IXOTH
%16 = or i32 %14, %15
%17 = call i32 @mkdir(i8* %3, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
@S_IRGRP = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
define i32 @mfm_mkdir(i8* nocapture %0) {
%2 = load i32, i32* @S_IRUSR
%3 = load i32, i32* @S_IWUSR
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IXUSR
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IRGRP
%8 = or i32 %6, %7
%9 = load i32, i32* @S_IXGRP
%10 = or i32 %8, %9
%11 = load i32, i32* @S_IROTH
%12 = or i32 %10, %11
%13 = load i32, i32* @S_IXOTH
%14 = or i32 %12, %13
%15 = tail call i32 @mkdir(i8* %0, i32 %14)
ret i32 %15
}
int is_bufzero(const void *a, int sz) {
  const char *p = a;
  int i;
  for (i = 0; i < sz; i++, p++)
    if (*p)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_bufzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115e <is_bufzero+0x5e>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     113f <is_bufzero+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1165 <is_bufzero+0x65>
jmp    1144 <is_bufzero+0x44>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111a <is_bufzero+0x1a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bufzero>:
mov    $0x1,%eax
test   %esi,%esi
jle    111e <is_bufzero+0x1e>
mov    %esi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpb   $0x0,(%rdi,%rdx,1)
jne    111f <is_bufzero+0x1f>
add    $0x1,%rdx
cmp    %edx,%ecx
jne    1110 <is_bufzero+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_bufzero(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %9
%5 = phi i32 [ %10, %9 ], [ 0, %2 ]
%6 = phi i8* [ %11, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = add nuw nsw i32 %5, 1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i32 %10, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %2
%14 = phi i32 [ 1, %2 ], [ 1, %9 ], [ 0, %4 ]
ret i32 %14
}