xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ out_char(char const, int, char **, size_t, unsigned int *);
void out_str(const char *str, int is_sprintf, char **output_buf_p,
             size_t max_char, unsigned int *num_parsed_p) {
  while (*str) {
    out_char(*str, is_sprintf, output_buf_p, max_char, num_parsed_p);
    ++str;
  }
}


x86 assembly (clang, -O0):
<out_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1166 <out_str+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
movsbl %al,%edi
call   1030 <out_char@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112b <out_str+0x1b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_str>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     114e <out_str+0x3e>
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
movsbl %al,%edi
mov    %ebp,%esi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <out_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <out_str+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @out_str(i8* nocapture %0, i32 %1, i8** %2, i64 %3, i32* %4) {
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %5, %8
%9 = phi i8 [ %13, %8 ], [ %6, %5 ]
%10 = phi i8* [ %12, %8 ], [ %0, %5 ]
%11 = tail call i32 @out_char(i8 signext %9, i32 %1, i8** %2, i64 %3, i32* %4)
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %8
15: ; preds = %8, %5
ret void
}
/* Variables and functions */
double LSKeyframeAnimationFunctionEaseOutBounce(double, int /*<<< orphan*/,
                                                double, double);
double LSKeyframeAnimationFunctionEaseInBounce(double t, double b, double c,
                                               double d) {
  return c - LSKeyframeAnimationFunctionEaseOutBounce(d - t, 0, c, d) + b;
}


x86 assembly (clang, -O0):
<LSKeyframeAnimationFunctionEaseInBounce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
xor    %edi,%edi
call   1030 <LSKeyframeAnimationFunctionEaseOutBounce@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LSKeyframeAnimationFunctionEaseInBounce>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
movapd %xmm3,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
xor    %edi,%edi
movaps %xmm2,%xmm1
movapd %xmm3,%xmm2
call   1030 <LSKeyframeAnimationFunctionEaseOutBounce@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @LSKeyframeAnimationFunctionEaseInBounce(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = load double, double* %7
%14 = load double, double* %8
%15 = call double @LSKeyframeAnimationFunctionEaseOutBounce(double %12, i32 0, double %13, double %14)
%16 = fsub double %9, %15
%17 = load double, double* %6
%18 = fadd double %16, %17
ret double %18
}

LLVM IR (-O2):
define double @LSKeyframeAnimationFunctionEaseInBounce(double %0, double %1, double %2, double %3) {
%5 = fsub double %3, %0
%6 = tail call double @LSKeyframeAnimationFunctionEaseOutBounce(double %5, i32 0, double %2, double %3)
%7 = fsub double %2, %6
%8 = fadd double %7, %1
ret double %8
}
/* Variables and functions */
unsigned int __VERIFIER_nondet_U32();
unsigned int ecrobot_get_battery_voltage(void) {
  unsigned int tmp;
  {
    tmp = __VERIFIER_nondet_U32();
    return (tmp);
  }
}


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

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

LLVM IR (-O0):
define i32 @ecrobot_get_battery_voltage() {
%1 = alloca i32
%2 = call i32 (...) @__VERIFIER_nondet_U32()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @ecrobot_get_battery_voltage() {
%1 = tail call i32 (...) @__VERIFIER_nondet_U32()
ret i32 %1
}
double TajimasTheta(double combs, long long int diffs) {
  return diffs / (double)combs;
}


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

x86 assembly (clang, -O2):
<TajimasTheta>:
cvtsi2sd %rdi,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @TajimasTheta(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load double, double* %3
%8 = fdiv double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @TajimasTheta(double %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = fdiv double %3, %0
ret double %4
}
/* Variables and functions */
scalar_t__ inCheck();
int noMovesScore(int ply) {
  if (inCheck()) {
    return -10000 + ply / 2 + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<noMovesScore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <inCheck@plt>
cmp    $0x0,%rax
je     1147 <noMovesScore+0x37>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0xffffd8f0,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114e <noMovesScore+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noMovesScore>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <inCheck@plt>
test   %rax,%rax
je     1132 <noMovesScore+0x22>
mov    %ebp,%ebx
shr    $0x1f,%ebx
add    %ebp,%ebx
sar    %ebx
add    $0xffffd8f1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @noMovesScore(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @inCheck()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sdiv i32 %7, 2
%9 = add nsw i32 -10000, %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @noMovesScore(i32 %0) {
%2 = tail call i64 (...) @inCheck()
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = sdiv i32 %0, 2
%6 = add nsw i32 %5, -9999
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ __stpcpy(char *, char const *);
char *strcpy(char *dest, const char *src) {
  __stpcpy(dest, src);
  return dest;
}


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

x86 assembly (clang, -O2):
<strcpy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__stpcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* %1) {
%3 = tail call i32 @__stpcpy(i8* %0, i8* %1)
ret i8* %0
}
int test_imm_D3int8_reg(signed char val) {
  return ((val) & (-0xD3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D3int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff2d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_D3int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -211
%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_D3int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -211
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_02uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x02 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_02uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 131072
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__typeof__(isalnum(1)) test_isalnum_7(void) { return isalnum(1); }


x86 assembly (clang, -O0):
<test_isalnum_7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <isalnum@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isalnum_7>:
mov    $0x1,%edi
jmp    1030 <isalnum@plt>

LLVM IR (-O0):
define i32 @test_isalnum_7() {
%1 = call i32 @isalnum(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_isalnum_7() {
%1 = tail call i32 @isalnum(i32 1)
ret i32 %1
}
void test___atomic_fetch_nand_1(short *mem) { __atomic_fetch_nand(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_fetch_nand_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x28(%rbp)
and    %esi,%edx
mov    %edx,-0x24(%rbp)
not    %edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    1162 <test___atomic_fetch_nand_1+0x62>
jmp    1125 <test___atomic_fetch_nand_1+0x25>
mov    -0x1a(%rbp),%ax
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_fetch_nand_1>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
not    %ecx
or     $0xfffe,%ecx
lock cmpxchg %cx,(%rdi)
jne    1110 <test___atomic_fetch_nand_1+0x10>
ret

LLVM IR (-O0):
define void @test___atomic_fetch_nand_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
store i16 1, i16* %3
%6 = load i16, i16* %3
%7 = atomicrmw nand i16* %5, i16 %6 acq_rel
store i16 %7, i16* %4
%8 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_fetch_nand_1(i16* nocapture %0) {
%2 = atomicrmw nand i16* %0, i16 1 acq_rel
ret void
}
int is_link(const char *link, const int length) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_link(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("\E[1;11mUsage:\E[0;11m main -c COUNT--path FILE [--min][--max][-j "
         "count]\n         --min for minimum delimiter (0 by default)\n        "
         " --max for maximum delimiter (INT_MAX by default)\n         -j COUNT "
         "for COUNT threads (1 by default)\n         --path FILE\n         -c "
         "COUNT to read COUNT integers from file\n");
}


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

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

LLVM IR (-O0):
@.str = [305 x i8] c"\1B[1;11mUsage:\1B[0;11m main -c COUNT--path FILE [--min][--max][-j count]\0A --min for minimum delimiter (0 by default)\0A --max for maximum delimiter (INT_MAX by default)\0A -j COUNT for COUNT threads (1 by default)\0A --path FILE\0A -c COUNT to read COUNT integers from file\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([305 x i8], [305 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [304 x i8] c"\1B[1;11mUsage:\1B[0;11m main -c COUNT--path FILE [--min][--max][-j count]\0A --min for minimum delimiter (0 by default)\0A --max for maximum delimiter (INT_MAX by default)\0A -j COUNT for COUNT threads (1 by default)\0A --path FILE\0A -c COUNT to read COUNT integers from file\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([304 x i8], [304 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_has_fromds(__le16 fc) { return (fc & cpu_to_le16(0x0200)) != 0; }


x86 assembly (clang, -O0):
<ieee80211_has_fromds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x200,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_has_fromds>:
push   %rbx
mov    %edi,%ebx
mov    $0x200,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ieee80211_has_fromds(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 512)
%5 = and i32 %3, %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ieee80211_has_fromds(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 512)
%3 = and i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct rng_state {
  int dummy;
};
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ floor(int /*<<< orphan*/);
int /*<<< orphan*/ rng_between(struct rng_state *, scalar_t__, scalar_t__);
int32_t rng_range(struct rng_state *st, int32_t min, int32_t max) {
  return floor(rng_between(st, min, max + 1));
}


x86 assembly (clang, -O0):
<rng_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1030 <rng_between@plt>
mov    %eax,%edi
call   1040 <floor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_range>:
push   %rax
add    $0x1,%rdx
call   1030 <rng_between@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <floor@plt>

LLVM IR (-O0):
%struct.rng_state = type { i32 }
define i64 @rng_range(%struct.rng_state* %0, i64 %1, i64 %2) {
%4 = alloca %struct.rng_state*
%5 = alloca i64
%6 = alloca i64
store %struct.rng_state* %0, %struct.rng_state** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load %struct.rng_state*, %struct.rng_state** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = add nsw i64 %9, 1
%11 = call i32 @rng_between(%struct.rng_state* %7, i64 %8, i64 %10)
%12 = call i64 @floor(i32 %11)
ret i64 %12
}

LLVM IR (-O2):
%struct.rng_state = type { i32 }
define i64 @rng_range(%struct.rng_state* %0, i64 %1, i64 %2) {
%4 = add nsw i64 %2, 1
%5 = tail call i32 @rng_between(%struct.rng_state* %0, i64 %1, i64 %4)
%6 = tail call i64 @floor(i32 %5)
ret i64 %6
}
int func3_in_obj(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func3_in_obj() {
ret i32 0
}
/* Type definitions */
struct ibv_context {
  int dummy;
};

/* Variables and functions */
int _close_device(struct ibv_context *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
int ibv_close_device(struct ibv_context *context) {
  dmtcp_plugin_disable_ckpt();
  int rslt = _close_device(context);
  dmtcp_plugin_enable_ckpt();
  return rslt;
}


x86 assembly (clang, -O0):
<ibv_close_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
call   1040 <_close_device@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_close_device>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
call   1040 <_close_device@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ibv_context = type { i32 }
define i32 @ibv_close_device(%struct.ibv_context* %0) {
%2 = alloca %struct.ibv_context*
%3 = alloca i32
store %struct.ibv_context* %0, %struct.ibv_context** %2
%4 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%5 = load %struct.ibv_context*, %struct.ibv_context** %2
%6 = call i32 @_close_device(%struct.ibv_context* %5)
store i32 %6, i32* %3
%7 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.ibv_context = type { i32 }
define i32 @ibv_close_device(%struct.ibv_context* %0) {
%2 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%3 = tail call i32 @_close_device(%struct.ibv_context* %0)
%4 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ strchr(char *, int /*<<< orphan*/);
wchar_t *wcschr(const wchar_t *s, wchar_t c) {
  return (wchar_t *)strchr((char *)s, c);
}


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

x86 assembly (clang, -O2):
<wcschr>:
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i32* @wcschr(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 = bitcast i32* %5 to i8*
%7 = load i32, i32* %4
%8 = call i64 @strchr(i8* %6, i32 %7)
%9 = inttoptr i64 %8 to i32*
ret i32* %9
}

LLVM IR (-O2):
define i32* @wcschr(i32* %0, i32 %1) {
%3 = bitcast i32* %0 to i8*
%4 = tail call i64 @strchr(i8* %3, i32 %1)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int ispunct(int);
int punct(int c) { return ispunct(c); }


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

x86 assembly (clang, -O2):
<punct>:
jmp    1030 <ispunct@plt>

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

LLVM IR (-O2):
define i32 @punct(i32 %0) {
%2 = tail call i32 @ispunct(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *strdup(char *);
void copystrings(char **sa, char **sb, int n) {
  int i;
  for (i = 0; i < n; ++i) {
    sb[i] = strdup(sa[i]);
  }
}


x86 assembly (clang, -O0):
<copystrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1164 <copystrings+0x54>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strdup@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <copystrings+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copystrings>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1146 <copystrings+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <strdup@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <copystrings+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @copystrings(i8** nocapture %0, i8** nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i8* @strdup(i8* %10)
%12 = getelementptr inbounds i8*, i8** %1, i64 %8
store i8* %11, i8** %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t B_SWAP32(uint32_t l) {
  return ((l >> 8) & 0xff00) | ((l & 0xff00) << 8) | (l << 24) | (l >> 24);
}


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

x86 assembly (clang, -O2):
<B_SWAP32>:
mov    %edi,%eax
and    $0xffffff,%eax
bswap  %eax
sar    $0x18,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @B_SWAP32(i32 %0) {
%2 = and i32 %0, 16777215
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = ashr i32 %0, 24
%5 = or i32 %3, %4
ret i32 %5
}
float f10(float x) {
  float tmp1 = 7.5f;
  float tmp2 = __builtin_copysignf(2.0f, x);
  float tmp3 = tmp2 * 24.0f;
  return tmp1 * tmp2;
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xeee(%rip),%xmm1
pand   %xmm1,%xmm0
movaps 0xef3(%rip),%xmm1
por    %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xec2(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
andps  0xef9(%rip),%xmm0
orps   0xf02(%rip),%xmm0
mulss  0xf0a(%rip),%xmm0
ret

LLVM IR (-O0):
define float @f10(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %2
store float 7.500000e+00, float* %3
%6 = load float, float* %2
%7 = call float @llvm.copysign.f32(float 2.000000e+00, float %6)
store float %7, float* %4
%8 = load float, float* %4
%9 = fmul float %8, 2.400000e+01
store float %9, float* %5
%10 = load float, float* %3
%11 = load float, float* %4
%12 = fmul float %10, %11
ret float %12
}

LLVM IR (-O2):
define float @f10(float %0) {
%2 = tail call float @llvm.copysign.f32(float 2.000000e+00, float %0)
%3 = fmul float %2, 7.500000e+00
ret float %3
}
int __ocl_all_char(char src) { return (src >> (8 - 1)) & 0x1; }


x86 assembly (clang, -O0):
<__ocl_all_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x7,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_all_char>:
shr    $0x7,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @__ocl_all_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = ashr i32 %4, 7
%6 = and i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @__ocl_all_char(i8 signext %0) {
%2 = lshr i8 %0, 7
%3 = zext i8 %2 to i32
ret i32 %3
}
_Complex double test_casin(_Complex double x) { return __builtin_casin(x); }


x86 assembly (clang, -O0):
<test_casin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <casin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_casin>:
jmp    1030 <casin@plt>

LLVM IR (-O0):
define { double, double } @test_casin(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %9, double* %12
store double %11, double* %13
%14 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%17 = load double, double* %16
%18 = call { double, double } @casin(double %15, double %17)
%19 = extractvalue { double, double } %18, 0
%20 = extractvalue { double, double } %18, 1
%21 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%22 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %19, double* %21
store double %20, double* %22
%23 = load { double, double }, { double, double }* %3
ret { double, double } %23
}

LLVM IR (-O2):
define { double, double } @test_casin(double %0, double %1) {
%3 = tail call { double, double } @casin(double %0, double %1)
ret { double, double } %3
}
int main() {
  if (sizeof(long) == 4) {
    union {
      double d;
      unsigned long l[2];
    } x;
    x.d = 2.;
    if (x.l[0] == 0 && x.l[1] == (1UL << 30))
      printf("1\n");
    else if (x.l[1] == 0 && x.l[0] == (1UL << 30))
      printf("0\n");
    else
      printf("NOT IEEE (32 bit)\n");
  } else {
    union {
      double d;
      unsigned long l;
    } x;
    x.d = 2.;
    if (x.l == ((unsigned long)1) << 62)
      printf("-\n");
    else
      printf("NOT IEEE (64 bit)\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movabs $0x4000000000000000,%rax
cmp    %rax,-0x10(%rbp)
jne    1153 <main+0x43>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1161 <main+0x51>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { double }
@.str = [3 x i8] c"-\0A\00"
@.str.1 = [19 x i8] c"NOT IEEE (64 bit)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = bitcast %union.anon* %2 to double*
store double 2.000000e+00, double* %3
%4 = bitcast %union.anon* %2 to i64*
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 4611686018427387904
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"-\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void ext4bf_exit_xattr(void) {}


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

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

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

LLVM IR (-O2):
define void @ext4bf_exit_xattr() {
ret void
}
char *append_to_ptr(char *ptr, char *str) {
  while (*str > 0) {
    *ptr = *str;
    ptr++;
    str++;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<append_to_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jle    1145 <append_to_ptr+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <append_to_ptr+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_to_ptr>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
jle    1121 <append_to_ptr+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jg     1110 <append_to_ptr+0x10>
ret

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

LLVM IR (-O2):
define i8* @append_to_ptr(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp sgt i8 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp sgt i8 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
ret i8* %14
}
void *find_start(void) { __asm__("movq %rsp, %rax"); }


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

x86 assembly (clang, -O2):
<find_start>:
mov    %rsp,%rax
ret

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

LLVM IR (-O2):
define i8* @find_start() {
tail call void asm sideeffect "movq %rsp, %rax", "~{dirflag},~{fpsr},~{flags}"()
ret i8* undef
}
int d_blg_rm2(double a1, double *a2) {
  return !(__builtin_islessgreater(a1, *a2));
}


x86 assembly (clang, -O0):
<d_blg_rm2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blg_rm2>:
xor    %eax,%eax
ucomisd (%rdi),%xmm0
sete   %al
ret

LLVM IR (-O0):
define i32 @d_blg_rm2(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 = load double, double* %6
%8 = fcmp one double %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_blg_rm2(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp ueq double %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fsize(int /*<<< orphan*/ *);
int sizeOfFile(long desc) {
  FILE *fd = (FILE *)desc;
  return fsize(fd);
}


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

x86 assembly (clang, -O2):
<sizeOfFile>:
jmp    1030 <fsize@plt>

LLVM IR (-O0):
define i32 @sizeOfFile(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fsize(i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sizeOfFile(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = tail call i32 @fsize(i32* %2)
ret i32 %3
}
/* Variables and functions */
char *strrchr(char const *, char);
char *get_filename_ext(const char *filename) {
  char *dot = strrchr(filename, '.');
  if (!dot || dot == filename)
    return "";
  return dot + 1;
}


x86 assembly (clang, -O0):
<get_filename_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <get_filename_ext+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1157 <get_filename_ext+0x47>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <get_filename_ext+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename_ext>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
cmp    %rbx,%rax
lea    0xed4(%rip),%rdx
cmove  %rdx,%rcx
test   %rax,%rax
cmove  %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_filename_ext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %2
br label %17
17: ; preds = %14, %13
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_filename_ext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %2, %0
%5 = or i1 %3, %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6
ret i8* %7
}
int isGreater(int x, int y) {
  int result = !((x + ~y) >> 31);
  x = x >> 31;
  y = y >> 31;
  return (!x & y) | (result & (!x | y));
}


x86 assembly (clang, -O0):
<isGreater>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
sar    $0x1f,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
and    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
cmpl   $0x0,-0x4(%rbp)
setne  %dl
xor    $0xff,%dl
and    $0x1,%dl
movzbl %dl,%edx
or     -0x8(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isGreater>:
xor    %eax,%eax
cmp    %edi,%esi
setl   %al
sar    $0x1f,%esi
not    %edi
shr    $0x1f,%edi
mov    %esi,%ecx
and    %edi,%ecx
or     %esi,%edi
and    %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isGreater(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = add nsw i32 %6, %8
%10 = ashr i32 %9, 31
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = ashr i32 %14, 31
store i32 %15, i32* %3
%16 = load i32, i32* %4
%17 = ashr i32 %16, 31
store i32 %17, i32* %4
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
%22 = load i32, i32* %4
%23 = and i32 %21, %22
%24 = load i32, i32* %5
%25 = load i32, i32* %3
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
%29 = load i32, i32* %4
%30 = or i32 %28, %29
%31 = and i32 %24, %30
%32 = or i32 %23, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @isGreater(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = zext i1 %3 to i32
%5 = ashr i32 %1, 31
%6 = xor i32 %0, -1
%7 = lshr i32 %6, 31
%8 = and i32 %5, %7
%9 = or i32 %5, %7
%10 = and i32 %9, %4
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, double);
void printfifo(double *fifo, unsigned int lenlista) {
  unsigned int i;
  for (i = 0; i < lenlista; i++) {
    printf("[%d]: %g\n", i, fifo[i]);
  }
}


x86 assembly (clang, -O0):
<printfifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    115b <printfifo+0x4b>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printfifo+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printfifo>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1149 <printfifo+0x39>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printfifo+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"[%d]: %g\0A\00"
define void @printfifo(double* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10, double %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
void GetDateTime2(time_t sec) {
  printf("GetDateTime2:\t");
  struct tm *dateTime = localtime(&sec);
  printf("%s", asctime(dateTime));
}


x86 assembly (clang, -O0):
<GetDateTime2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <asctime@plt>
mov    %rax,%rsi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDateTime2>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rdi
call   1040 <asctime@plt>
lea    0xeb3(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [15 x i8] c"GetDateTime2:\09\00"
@.str.1 = [3 x i8] c"%s\00"
define void @GetDateTime2(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
store i32 %0, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %5, %struct.tm** %3
%6 = load %struct.tm*, %struct.tm** %3
%7 = call i8* @asctime(%struct.tm* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [15 x i8] c"GetDateTime2:\09\00"
@.str.1 = [3 x i8] c"%s\00"
define void @GetDateTime2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call %struct.tm* @localtime(i32* %2)
%5 = call i8* @asctime(%struct.tm* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_flags(int, int);
void set_c(int c) { set_flags(0x0001, c ? 0x0001 : 0); }


x86 assembly (clang, -O0):
<set_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %esi,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
mov    $0x1,%edi
call   1030 <set_flags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_c>:
xor    %esi,%esi
test   %edi,%edi
setne  %sil
mov    $0x1,%edi
jmp    1030 <set_flags@plt>

LLVM IR (-O0):
define void @set_c(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, i32 1, i32 0
%7 = call i32 @set_flags(i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @set_c(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @set_flags(i32 1, i32 %3)
ret void
}
/* Variables and functions */
long rand();
long random_long(void) {
  long r1, r2;
  r1 = rand();
  r2 = rand();
  return r1 | (r2 << 32);
}


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

x86 assembly (clang, -O2):
<random_long>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x20,%rax
or     %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @random_long() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @rand()
store i64 %3, i64* %1
%4 = call i64 (...) @rand()
store i64 %4, i64* %2
%5 = load i64, i64* %1
%6 = load i64, i64* %2
%7 = shl i64 %6, 32
%8 = or i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @random_long() {
%1 = tail call i64 (...) @rand()
%2 = tail call i64 (...) @rand()
%3 = shl i64 %2, 32
%4 = or i64 %3, %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc10(void) {
  printf("Executing exitfunc"
         "10"
         ".\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc10>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc10.\0A\00"
define void @exitfunc10() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc10.\00"
define void @exitfunc10() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}