xunge/DecIR huggingface dataset:
char *fgaj_clear(int c) { return c ? "[0;0m" : ""; }


x86 assembly (clang, -O0):
<fgaj_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef5(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgaj_clear>:
test   %edi,%edi
lea    0xefd(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[0;0m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @fgaj_clear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[0;0m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @fgaj_clear(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
int kaen_panel_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kaen_panel_init() {
ret i32 0
}
funcs() {
  if (_Generic((0, funcs), int (*)() : 0, char (*)() : 1) != 0)
    abort();
}


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

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

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

LLVM IR (-O2):
define i32 @funcs() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int _system(const char *s) {
  if (s == NULL) {
    return 0;
  } else {
    errno = EINVAL;
    return -1;
  }
}


x86 assembly (clang, -O0):
<_system>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <_system+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1138 <_system+0x38>
mov    0x2eb2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb1(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_system>:
test   %rdi,%rdi
je     111d <_system+0x1d>
mov    0x2ecc(%rip),%rax
mov    (%rax),%eax
mov    0x2ecb(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_system(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %9
7: ; preds = %1
%8 = load i32, i32* @EINVAL
store i32 %8, i32* @errno
store i32 -1, i32* %2
br label %9
9: ; preds = %7, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_system(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ -1, %3 ], [ 0, %1 ]
ret i32 %6
}
unsigned long long bswap64(unsigned long long x) {
  return ((x << 56) & 0xff00000000000000UL) |
         ((x << 40) & 0x00ff000000000000UL) |
         ((x << 24) & 0x0000ff0000000000UL) |
         ((x << 8) & 0x000000ff00000000UL) | ((x >> 8) & 0x00000000ff000000UL) |
         ((x >> 24) & 0x0000000000ff0000UL) |
         ((x >> 40) & 0x000000000000ff00UL) |
         ((x >> 56) & 0x00000000000000ffUL);
}


x86 assembly (clang, -O0):
<bswap64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x38,%rax
movabs $0xff00000000000000,%rcx
and    %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x28,%rcx
movabs $0xff000000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x18,%rcx
movabs $0xff0000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x8,%rcx
movabs $0xff00000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x8,%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x18,%rcx
and    $0xff0000,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x28,%rcx
and    $0xff00,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x38,%rcx
and    $0xff,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @bswap64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 56
%5 = and i64 %4, -72057594037927936
%6 = load i64, i64* %2
%7 = shl i64 %6, 40
%8 = and i64 %7, 71776119061217280
%9 = or i64 %5, %8
%10 = load i64, i64* %2
%11 = shl i64 %10, 24
%12 = and i64 %11, 280375465082880
%13 = or i64 %9, %12
%14 = load i64, i64* %2
%15 = shl i64 %14, 8
%16 = and i64 %15, 1095216660480
%17 = or i64 %13, %16
%18 = load i64, i64* %2
%19 = lshr i64 %18, 8
%20 = and i64 %19, 4278190080
%21 = or i64 %17, %20
%22 = load i64, i64* %2
%23 = lshr i64 %22, 24
%24 = and i64 %23, 16711680
%25 = or i64 %21, %24
%26 = load i64, i64* %2
%27 = lshr i64 %26, 40
%28 = and i64 %27, 65280
%29 = or i64 %25, %28
%30 = load i64, i64* %2
%31 = lshr i64 %30, 56
%32 = and i64 %31, 255
%33 = or i64 %29, %32
ret i64 %33
}

LLVM IR (-O2):
define i64 @bswap64(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
int aft_gsm_get_sim_no(int reg) {
  reg &= (0x7 << 5);
  return (reg >> 5);
}


x86 assembly (clang, -O0):
<aft_gsm_get_sim_no>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xe0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aft_gsm_get_sim_no>:
mov    %edi,%eax
shr    $0x5,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @aft_gsm_get_sim_no(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 224
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 5
ret i32 %6
}

LLVM IR (-O2):
define i32 @aft_gsm_get_sim_no(i32 %0) {
%2 = lshr i32 %0, 5
%3 = and i32 %2, 7
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Periodic_XZ(double *, int, int, int, int, int);
int /*<<< orphan*/ Periodic_YZ(double *, int, int, int, int, int);
void facevals_2D_BC_1(double *phi_fv, int nX, int nY, double delta_x) {
  Periodic_XZ(phi_fv + nX * nY, nX, nY, 1, 1, (nY - 3));
  Periodic_YZ(phi_fv, nX, nY, 1, 1, (nX - 3));
}


x86 assembly (clang, -O0):
<facevals_2D_BC_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%r9d
sub    $0x3,%r9d
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1040 <Periodic_XZ@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%r9d
sub    $0x3,%r9d
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <Periodic_YZ@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<facevals_2D_BC_1>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
mov    %edx,%eax
imul   %esi,%eax
cltq
lea    (%rdi,%rax,8),%rdi
lea    -0x3(%r14),%r9d
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1040 <Periodic_XZ@plt>
lea    -0x3(%rbx),%r9d
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <Periodic_YZ@plt>

LLVM IR (-O0):
define void @facevals_2D_BC_1(double* %0, i32 %1, i32 %2, double %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store double* %0, double** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double %3, double* %8
%9 = load double*, double** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = mul nsw i32 %10, %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %9, i64 %13
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %7
%18 = sub nsw i32 %17, 3
%19 = call i32 @Periodic_XZ(double* %14, i32 %15, i32 %16, i32 1, i32 1, i32 %18)
%20 = load double*, double** %5
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = sub nsw i32 %23, 3
%25 = call i32 @Periodic_YZ(double* %20, i32 %21, i32 %22, i32 1, i32 1, i32 %24)
ret void
}

LLVM IR (-O2):
define void @facevals_2D_BC_1(double* %0, i32 %1, i32 %2, double %3) {
%5 = mul nsw i32 %2, %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds double, double* %0, i64 %6
%8 = add nsw i32 %2, -3
%9 = tail call i32 @Periodic_XZ(double* %7, i32 %1, i32 %2, i32 1, i32 1, i32 %8)
%10 = add nsw i32 %1, -3
%11 = tail call i32 @Periodic_YZ(double* %0, i32 %1, i32 %2, i32 1, i32 1, i32 %10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpgt_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i __attribute__((no, unused)) test(__m128i s1, __m128i s2) {
  return _mm_cmpgt_epi32(s1, s2);
}


x86 assembly (clang, -O0):
<test>:
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 <_mm_cmpgt_epi32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_cmpgt_epi32@plt>

LLVM IR (-O0):
define i32 @test(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 @_mm_cmpgt_epi32(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpgt_epi32(i32 %0, i32 %1)
ret i32 %3
}
void ecm_sfe_multicast_ipv6_exit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ecm_sfe_multicast_ipv6_exit() {
ret void
}
int y2k(int y) { return ((y < 70) ? 2000 : 1900) + y; }


x86 assembly (clang, -O0):
<y2k>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x76c,%eax
mov    $0x7d0,%ecx
cmp    $0x46,%edx
cmovl  %ecx,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<y2k>:
lea    0x76c(%rdi),%ecx
lea    0x7d0(%rdi),%eax
cmp    $0x46,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @y2k(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 70
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 2000, i32 1900
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @y2k(i32 %0) {
%2 = icmp slt i32 %0, 70
%3 = select i1 %2, i32 2000, i32 1900
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double A, R, n = 3.14159;
  scanf("%lf", &R);
  A = n * (R * R);
  printf("A=%.4lf\n", A);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xec5(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xebf(%rip),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"A=%.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 3.141590e+00, double* %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = load double, double* %4
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = fmul double %6, %9
store double %10, double* %2
%11 = load double, double* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"A=%.4lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, %4
%6 = fmul double %5, 3.141590e+00
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}
int dummy(int arg) { return arg; }


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

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

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

LLVM IR (-O2):
define i32 @dummy(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void underline(char *string) {
  puts(string);
  while (*string) {
    putchar('=');
    *string++;
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<underline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <underline+0x3d>
mov    $0x3d,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1135 <underline+0x15>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<underline>:
push   %rbx
mov    %rdi,%rbx
call   1040 <puts@plt>
cmpb   $0x0,(%rbx)
je     1153 <underline+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x3d,%edi
call   1030 <putchar@plt>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1140 <underline+0x20>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @underline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %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 = call i32 @putchar(i8 signext 61)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
br label %5
14: ; preds = %5
%15 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @underline(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %8, %5 ], [ %0, %1 ]
%7 = tail call i32 @putchar(i8 signext 61)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = tail call i32 @putchar(i8 signext 10)
ret void
}
void byte_swap4(void *ptr_) {
  unsigned char *ptr = (unsigned char *)ptr_;
  char tmp0 = ptr[0];
  char tmp1 = ptr[1];
  ptr[0] = ptr[3];
  ptr[1] = ptr[2];
  ptr[2] = tmp1;
  ptr[3] = tmp0;
}


x86 assembly (clang, -O0):
<byte_swap4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x12(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_swap4>:
mov    (%rdi),%al
mov    0x1(%rdi),%cl
mov    0x3(%rdi),%dl
mov    %dl,(%rdi)
mov    0x2(%rdi),%dl
mov    %dl,0x1(%rdi)
mov    %cl,0x2(%rdi)
mov    %al,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @byte_swap4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = load i8, i8* %5
store i8 %6, i8* %0
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %3
store i8 %4, i8* %7
store i8 %2, i8* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *const, int);
int strlen(char const *const);
void serial_string(uint8_t **const ptr, const char *const str) {
  int len = strlen(str) + 1;
  memcpy(*ptr, str, len);
  *ptr += len;
}


x86 assembly (clang, -O0):
<serial_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_string>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%r15d
lea    0x1(%r15),%edx
mov    (%rbx),%rdi
mov    %r14,%rsi
call   1040 <memcpy@plt>
mov    (%rbx),%rax
movslq %r15d,%rcx
lea    (%rax,%rcx,4),%rax
add    $0x4,%rax
mov    %rax,(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @serial_string(i32** %0, i8* %1) {
%3 = alloca i32**
%4 = alloca i8*
%5 = alloca i32
store i32** %0, i32*** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32**, i32*** %3
%10 = load i32*, i32** %9
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = call i32 @memcpy(i32* %10, i8* %11, i32 %12)
%14 = load i32, i32* %5
%15 = load i32**, i32*** %3
%16 = load i32*, i32** %15
%17 = sext i32 %14 to i64
%18 = getelementptr inbounds i32, i32* %16, i64 %17
store i32* %18, i32** %15
ret void
}

LLVM IR (-O2):
define void @serial_string(i32** nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = add nsw i32 %3, 1
%5 = load i32*, i32** %0
%6 = tail call i32 @memcpy(i32* %5, i8* %1, i32 %4)
%7 = load i32*, i32** %0
%8 = sext i32 %4 to i64
%9 = getelementptr inbounds i32, i32* %7, i64 %8
store i32* %9, i32** %0
ret void
}
void checkMemoryLeaks() {}


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

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

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

LLVM IR (-O2):
define void @checkMemoryLeaks() {
ret void
}
int test_imm_30uint32_mem(unsigned int *val) {
  return ((*val) & (0x30 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_30uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 48
%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_30uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 48
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int NSS_STATUS_SUCCESS;
enum nss_status _nss_noenum_endspent(void) { return NSS_STATUS_SUCCESS; }


x86 assembly (clang, -O0):
<_nss_noenum_endspent>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_noenum_endspent>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_noenum_endspent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}

LLVM IR (-O2):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_noenum_endspent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}
/* Variables and functions */
char *gettext(char *);
int /*<<< orphan*/ log_err(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
void complain(char *message, int lineno, char *file) {
  char buff[256];
  sprintf(buff, gettext("%s at line %d of %%s"), message, lineno);
  log_err(buff, file);
}


x86 assembly (clang, -O0):
<complain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x120(%rbp),%rax
mov    %rax,-0x128(%rbp)
lea    0xea5(%rip),%rdi
call   1030 <gettext@plt>
mov    -0x128(%rbp),%rdi
mov    %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
call   1040 <sprintf@plt>
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <log_err@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<complain>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xeb4(%rip),%rdi
call   1030 <gettext@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1040 <sprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <log_err@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s at line %d of %%s\00"
define void @complain(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [256 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%9 = call i8* @gettext(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @sprintf(i8* %8, i8* %9, i8* %10, i32 %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%14 = load i8*, i8** %6
%15 = call i32 @log_err(i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s at line %d of %%s\00"
define void @complain(i8* %0, i32 %1, i8* %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = tail call i8* @gettext(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) %6, i8* %0, i32 %1)
%8 = call i32 @log_err(i8* %5, i8* %2)
ret void
}
void RTStrCalcUtf16LenEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrCalcUtf16LenEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void *sbrk(intptr_t increment) {
  _exit(-1);
  return NULL;
}


x86 assembly (clang, -O0):
<sbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<sbrk>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i8* @sbrk(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define noalias i8* @sbrk(i64 %0) {
%2 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int num = 90674, aux;
  printf("O numero eh: %d\n", num);
  aux = num / 100;
  printf("Dividimos o numero por 100 e resulta em: %d\n", aux);
  aux = aux % 10;
  printf("O resto da divisao do numero acima por 10 eh igual a: %d\n", aux);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x16232,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x16232,%esi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x38a,%esi
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
mov    $0x6,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"O numero eh: %d\0A\00"
@.str.1 = [45 x i8] c"Dividimos o numero por 100 e resulta em: %d\0A\00"
@.str.2 = [58 x i8] c"O resto da divisao do numero acima por 10 eh igual a: %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 90674, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
%6 = sdiv i32 %5, 100
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = srem i32 %9, 10
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"O numero eh: %d\0A\00"
@.str.1 = [45 x i8] c"Dividimos o numero por 100 e resulta em: %d\0A\00"
@.str.2 = [58 x i8] c"O resto da divisao do numero acima por 10 eh igual a: %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 90674)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i32 906)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int bar(void) { foo(42); }


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

x86 assembly (clang, -O2):
<bar>:
mov    $0x2a,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i32
%2 = call i32 @foo(i32 42)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 @foo(i32 42)
ret i32 undef
}
void babylonian_spiral(int n_steps, int *x, int *y) { return; }


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

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

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

LLVM IR (-O2):
define void @babylonian_spiral(i32 %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
void gtk_window_set_icon_from_file() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_icon_from_file() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eventfd_write(int, int);
void efd_write(int fd) { eventfd_write(fd, 1); }


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

x86 assembly (clang, -O2):
<efd_write>:
mov    $0x1,%esi
jmp    1030 <eventfd_write@plt>

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

LLVM IR (-O2):
define void @efd_write(i32 %0) {
%2 = tail call i32 @eventfd_write(i32 %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPSSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void GPSSettingsUpdated() { UAVObjUpdated(GPSSettingsHandle()); }


x86 assembly (clang, -O0):
<GPSSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GPSSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjUpdated@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @GPSSettingsUpdated() {
%1 = call i32 (...) @GPSSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSSettingsUpdated() {
%1 = tail call i32 (...) @GPSSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FP_OP_MEM(int);
int /*<<< orphan*/ addbyte(int);
void FP_OP_IL(int op) {
  addbyte(0xf2);
  addbyte(0x0f);
  addbyte(0x2a);
  addbyte(0xc8);
  FP_OP_MEM(op);
}


x86 assembly (clang, -O0):
<FP_OP_IL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xf2,%edi
call   1040 <addbyte@plt>
mov    $0xf,%edi
call   1040 <addbyte@plt>
mov    $0x2a,%edi
call   1040 <addbyte@plt>
mov    $0xc8,%edi
call   1040 <addbyte@plt>
mov    -0x4(%rbp),%edi
call   1030 <FP_OP_MEM@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FP_OP_IL>:
push   %rbx
mov    %edi,%ebx
mov    $0xf2,%edi
call   1040 <addbyte@plt>
mov    $0xf,%edi
call   1040 <addbyte@plt>
mov    $0x2a,%edi
call   1040 <addbyte@plt>
mov    $0xc8,%edi
call   1040 <addbyte@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <FP_OP_MEM@plt>

LLVM IR (-O0):
define void @FP_OP_IL(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @addbyte(i32 242)
%4 = call i32 @addbyte(i32 15)
%5 = call i32 @addbyte(i32 42)
%6 = call i32 @addbyte(i32 200)
%7 = load i32, i32* %2
%8 = call i32 @FP_OP_MEM(i32 %7)
ret void
}

LLVM IR (-O2):
define void @FP_OP_IL(i32 %0) {
%2 = tail call i32 @addbyte(i32 242)
%3 = tail call i32 @addbyte(i32 15)
%4 = tail call i32 @addbyte(i32 42)
%5 = tail call i32 @addbyte(i32 200)
%6 = tail call i32 @FP_OP_MEM(i32 %0)
ret void
}
void intif_parse_Itembound_ack(int fd) {}


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

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

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

LLVM IR (-O2):
define void @intif_parse_Itembound_ack(i32 %0) {
ret void
}
/* Variables and functions */
float fasterlog(float);
float fasterdigamma(float x) {
  float onepx = 1.0f + x;
  return -1.0f / x - 1.0f / (2 * onepx) + fasterlog(onepx);
}


x86 assembly (clang, -O0):
<fasterdigamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed1(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
movss  0xec0(%rip),%xmm2
mulss  -0x8(%rbp),%xmm2
movss  0xeaf(%rip),%xmm1
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fasterlog@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fasterdigamma>:
sub    $0x18,%rsp
movss  0xee4(%rip),%xmm1
addss  %xmm0,%xmm1
movaps %xmm1,%xmm2
addss  %xmm1,%xmm2
unpcklps %xmm2,%xmm0
movaps 0xedf(%rip),%xmm2
divps  %xmm0,%xmm2
movaps %xmm2,%xmm0
shufps $0x55,%xmm2,%xmm0
subss  %xmm0,%xmm2
movaps %xmm2,(%rsp)
movaps %xmm1,%xmm0
call   1030 <fasterlog@plt>
addss  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @fasterdigamma(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fadd float 1.000000e+00, %4
store float %5, float* %3
%6 = load float, float* %2
%7 = fdiv float -1.000000e+00, %6
%8 = load float, float* %3
%9 = fmul float 2.000000e+00, %8
%10 = fdiv float 1.000000e+00, %9
%11 = fsub float %7, %10
%12 = load float, float* %3
%13 = call float @fasterlog(float %12)
%14 = fadd float %11, %13
ret float %14
}

LLVM IR (-O2):
define float @fasterdigamma(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fmul float %2, 2.000000e+00
%4 = insertelement <2 x float> poison, float %0, i64 0
%5 = insertelement <2 x float> %4, float %3, i64 1
%6 = fdiv <2 x float> <float -1.000000e+00, float 1.000000e+00>, %5
%7 = shufflevector <2 x float> %6, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%8 = fsub <2 x float> %6, %7
%9 = extractelement <2 x float> %8, i64 0
%10 = tail call float @fasterlog(float %2)
%11 = fadd float %9, %10
ret float %11
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int Command_IsDir(char *command) { return strcmp(command, "dir") == 0; }


x86 assembly (clang, -O0):
<Command_IsDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Command_IsDir>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"dir\00"
define i32 @Command_IsDir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"dir\00"
define i32 @Command_IsDir(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int abs(int);
int /*<<< orphan*/ check(int *);
int main(void) {
  int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int i;
  for (i = -5; i < 0; i++)
    a[abs(i - 10) - 11] = 0;
  check(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xfffffffb,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    118b <main+0x5b>
mov    -0x34(%rbp),%edi
sub    $0xa,%edi
call   1030 <abs@plt>
sub    $0xb,%eax
cltq
movl   $0x0,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    115b <main+0x2b>
lea    -0x30(%rbp),%rdi
call   1050 <check@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    0xef9(%rip),%rax
mov    %rax,0x20(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <check@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
store i32 -5, i32* %3
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 10
%11 = call i32 @abs(i32 %10)
%12 = sub nsw i32 %11, 11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%20 = call i32 @check(i32* %19)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @check(i32* %3)
ret i32 0
}
__attribute__((__no__)) void
do_nothing_big_hole_assigned_copy(struct test_big_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_big_hole_assigned_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_big_hole_assigned_copy+0x1b>
jmp    1120 <do_nothing_big_hole_assigned_copy+0x20>
jmp    1120 <do_nothing_big_hole_assigned_copy+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_big_hole = type opaque
define void @do_nothing_big_hole_assigned_copy(%struct.test_big_hole* %0) {
%2 = alloca %struct.test_big_hole*
store %struct.test_big_hole* %0, %struct.test_big_hole** %2
%3 = load %struct.test_big_hole*, %struct.test_big_hole** %2
%4 = ptrtoint %struct.test_big_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_big_hole = type opaque
define void @do_nothing_big_hole_assigned_copy(%struct.test_big_hole* nocapture %0) {
ret void
}
/* Variables and functions */
int u16_mbtouc_aux(unsigned int *, unsigned short const *, size_t);
int u16_mbtouc(unsigned int *puc, const unsigned short *s, size_t n) {
  unsigned short c = *s;
  if (c < 0xd800 || c >= 0xe000) {
    *puc = c;
    return 1;
  } else
    return u16_mbtouc_aux(puc, s, n);
}


x86 assembly (clang, -O0):
<u16_mbtouc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x22(%rbp)
movzwl -0x22(%rbp),%eax
cmp    $0xd800,%eax
jl     114d <u16_mbtouc+0x3d>
movzwl -0x22(%rbp),%eax
cmp    $0xe000,%eax
jl     1163 <u16_mbtouc+0x53>
movzwl -0x22(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1177 <u16_mbtouc+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <u16_mbtouc_aux@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u16_mbtouc>:
movzwl (%rsi),%eax
lea    0x2000(%rax),%ecx
movzwl %cx,%ecx
cmp    $0xf7ff,%ecx
ja     112c <u16_mbtouc+0x1c>
mov    %eax,(%rdi)
mov    $0x1,%eax
ret
jmp    1030 <u16_mbtouc_aux@plt>

LLVM IR (-O0):
define i32 @u16_mbtouc(i32* %0, i16* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i16*
%7 = alloca i64
%8 = alloca i16
store i32* %0, i32** %5
store i16* %1, i16** %6
store i64 %2, i64* %7
%9 = load i16*, i16** %6
%10 = load i16, i16* %9
store i16 %10, i16* %8
%11 = load i16, i16* %8
%12 = zext i16 %11 to i32
%13 = icmp slt i32 %12, 55296
br i1 %13, label %18, label %14
14: ; preds = %3
%15 = load i16, i16* %8
%16 = zext i16 %15 to i32
%17 = icmp sge i32 %16, 57344
br i1 %17, label %18, label %22
18: ; preds = %14, %3
%19 = load i16, i16* %8
%20 = zext i16 %19 to i32
%21 = load i32*, i32** %5
store i32 %20, i32* %21
store i32 1, i32* %4
br label %27
22: ; preds = %14
%23 = load i32*, i32** %5
%24 = load i16*, i16** %6
%25 = load i64, i64* %7
%26 = call i32 @u16_mbtouc_aux(i32* %23, i16* %24, i64 %25)
store i32 %26, i32* %4
br label %27
27: ; preds = %22, %18
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @u16_mbtouc(i32* %0, i16* %1, i64 %2) {
%4 = load i16, i16* %1
%5 = add i16 %4, 8192
%6 = icmp ult i16 %5, -2048
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = zext i16 %4 to i32
store i32 %8, i32* %0
br label %11
9: ; preds = %3
%10 = tail call i32 @u16_mbtouc_aux(i32* %0, i16* %1, i64 %2)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ 1, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_srai_pi16(int /*<<< orphan*/, int);
__m64 test_mm_srai_pi16(__m64 a) { return _mm_srai_pi16(a, 3); }


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

x86 assembly (clang, -O2):
<test_mm_srai_pi16>:
mov    $0x3,%esi
jmp    1030 <_mm_srai_pi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srai_pi16(i32 %0) {
%2 = tail call i32 @_mm_srai_pi16(i32 %0, i32 3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void set_white_colour(void) { printf("\033[1;37m"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[1;37m\00"
define void @set_white_colour() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[1;37m\00"
define void @set_white_colour() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int check_prime(int num) {
  int i, d;
  d = 1;
  for (i = 2; i <= (num / 2); i++) {
    if (num % i == 0) {
      d = 0;
      break;
    }
  }
  if (num == 1)
    d = 0;
  return d;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1162 <check_prime+0x62>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    114f <check_prime+0x4f>
movl   $0x0,-0xc(%rbp)
jmp    1162 <check_prime+0x62>
jmp    1154 <check_prime+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <check_prime+0x15>
cmpl   $0x1,-0x4(%rbp)
jne    1173 <check_prime+0x73>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x1,%r8d
cmp    $0x4,%edi
jl     113c <check_prime+0x3c>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1139 <check_prime+0x39>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <check_prime+0x20>
jmp    113c <check_prime+0x3c>
xor    %r8d,%r8d
xor    %eax,%eax
cmp    $0x1,%edi
cmovne %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %8, %1
%13 = phi i32 [ 1, %1 ], [ 0, %8 ], [ 1, %5 ]
%14 = icmp eq i32 %0, 1
%15 = select i1 %14, i32 0, i32 %13
ret i32 %15
}