xunge/DecIR huggingface dataset:
/* Variables and functions */
int Sub(unsigned int, unsigned int);
unsigned Select(unsigned a, unsigned b, unsigned c) {
  const int pa_minus_pb = Sub((a >> 8) & 0xff, (b >> 8) & 0xff) +
                          Sub((a >> 0) & 0xff, (b >> 0) & 0xff);
  return (pa_minus_pb <= 0) ? a : b;
}


x86 assembly (clang, -O0):
<Select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x8,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%esi
shr    $0x8,%esi
and    $0xff,%esi
call   1030 <Sub@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x0,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%esi
shr    $0x0,%esi
and    $0xff,%esi
call   1030 <Sub@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jg     117d <Select+0x6d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1183 <Select+0x73>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Select>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%eax
movzbl %ah,%edi
mov    %eax,%ebp
movzbl %bh,%esi
call   1030 <Sub@plt>
mov    %eax,%r14d
movzbl %bpl,%edi
movzbl %bl,%esi
call   1030 <Sub@plt>
add    %r14d,%eax
cmovle %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Select(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = lshr i32 %8, 8
%10 = and i32 %9, 255
%11 = load i32, i32* %5
%12 = lshr i32 %11, 8
%13 = and i32 %12, 255
%14 = call i32 @Sub(i32 %10, i32 %13)
%15 = load i32, i32* %4
%16 = lshr i32 %15, 0
%17 = and i32 %16, 255
%18 = load i32, i32* %5
%19 = lshr i32 %18, 0
%20 = and i32 %19, 255
%21 = call i32 @Sub(i32 %17, i32 %20)
%22 = add nsw i32 %14, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = icmp sle i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %3
%26 = load i32, i32* %4
br label %29
27: ; preds = %3
%28 = load i32, i32* %5
br label %29
29: ; preds = %27, %25
%30 = phi i32 [ %26, %25 ], [ %28, %27 ]
ret i32 %30
}

LLVM IR (-O2):
define i32 @Select(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = lshr i32 %1, 8
%7 = and i32 %6, 255
%8 = tail call i32 @Sub(i32 %5, i32 %7)
%9 = and i32 %0, 255
%10 = and i32 %1, 255
%11 = tail call i32 @Sub(i32 %9, i32 %10)
%12 = add nsw i32 %11, %8
%13 = icmp slt i32 %12, 1
%14 = select i1 %13, i32 %0, i32 %1
ret i32 %14
}
double calc_gamma2(double r_norm2, double v_norm2) {
  if (v_norm2 <= 1e-300)
    return 1;
  double gamma2 = r_norm2 / v_norm2;
  return gamma2;
}


x86 assembly (clang, -O0):
<calc_gamma2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xeea(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1133 <calc_gamma2+0x33>
movsd  0xedf(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114c <calc_gamma2+0x4c>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_gamma2>:
movsd  0xf00(%rip),%xmm2
ucomisd %xmm1,%xmm2
jae    1113 <calc_gamma2+0x13>
divsd  %xmm1,%xmm0
ret
movsd  0xee5(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calc_gamma2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %5
%8 = fcmp ole double %7, 1.000000e-300
br i1 %8, label %9, label %10
9: ; preds = %2
store double 1.000000e+00, double* %3
br label %15
10: ; preds = %2
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fdiv double %11, %12
store double %13, double* %6
%14 = load double, double* %6
store double %14, double* %3
br label %15
15: ; preds = %10, %9
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @calc_gamma2(double %0, double %1) {
%3 = fcmp ugt double %1, 1.000000e-300
%4 = fdiv double %0, %1
%5 = select i1 %3, double %4, double 1.000000e+00
ret double %5
}
/* Variables and functions */
int OCTEON_IS_OCTEON3();
int octeon_has_feature_OCTEON_FEATURE_BCH(void) { return OCTEON_IS_OCTEON3(); }


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

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

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

LLVM IR (-O2):
define i32 @octeon_has_feature_OCTEON_FEATURE_BCH() {
%1 = tail call i32 (...) @OCTEON_IS_OCTEON3()
ret i32 %1
}
void ignore(char *s, ...) {}


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

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

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

LLVM IR (-O2):
define void @ignore(i8* nocapture %0, ...) {
ret void
}
double fabs(double x) {
  if (x < 0)
    return x * -1;
  return x;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112e <fabs+0x2e>
movsd  0xee1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1138 <fabs+0x38>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double %7, -1.000000e+00
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int roadmap_alert_get_category(int);
int roadmap_alert_alertable(int record) {
  int alert_category = roadmap_alert_get_category(record);
  switch (alert_category) {
  case 2:
    return 1;
  case 4:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<roadmap_alert_alertable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <roadmap_alert_get_category@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x2,%eax
je     114b <roadmap_alert_alertable+0x3b>
jmp    113a <roadmap_alert_alertable+0x2a>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     1157 <roadmap_alert_alertable+0x47>
jmp    1163 <roadmap_alert_alertable+0x53>
movl   $0x1,-0x4(%rbp)
jmp    116a <roadmap_alert_alertable+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    116a <roadmap_alert_alertable+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_alert_alertable>:
push   %rax
call   1030 <roadmap_alert_get_category@plt>
add    $0xfffffffe,%eax
xor    %ecx,%ecx
test   $0xfffffffd,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @roadmap_alert_alertable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @roadmap_alert_get_category(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
switch i32 %7, label %10 [
i32 2, label %8
i32 4, label %9
]
8: ; preds = %1
store i32 1, i32* %2
br label %11
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @roadmap_alert_alertable(i32 %0) {
%2 = tail call i32 @roadmap_alert_get_category(i32 %0)
%3 = icmp eq i32 %2, 2
%4 = icmp eq i32 %2, 4
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ errAbort(char *);
void usage() {
  errAbort("errCatchTest - check error catching\n"
           "usage:\n"
           "   errCatchTest password\n"
           "This will abort (but be caught) unless password is 'secret'\n");
}


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

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

LLVM IR (-O0):
@.str = [129 x i8] c"errCatchTest - check error catching\0Ausage:\0A errCatchTest password\0AThis will abort (but be caught) unless password is 'secret'\0A\00"
define void @usage() {
%1 = call i32 @errAbort(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [129 x i8] c"errCatchTest - check error catching\0Ausage:\0A errCatchTest password\0AThis will abort (but be caught) unless password is 'secret'\0A\00"
define void @usage() {
%1 = tail call i32 @errAbort(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
ret void
}
int little_endian_union() {
  union {
    int i;
    char c;
  } temp;
  temp.i = 1;
  return temp.c;
}


x86 assembly (clang, -O0):
<little_endian_union>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @little_endian_union() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 1, i32* %2
%3 = bitcast %union.anon* %1 to i8*
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @little_endian_union() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ is_leap_year_test();
int /*<<< orphan*/ printf(char *);
int main(void) {
  is_leap_year_test();
  printf("All date util tests passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <is_leap_year_test@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"All date util tests passed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @is_leap_year_test()
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"All date util tests passed\00"
define i32 @main() {
%1 = tail call i32 (...) @is_leap_year_test()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
short spack(unsigned char *f) {
  short i;
  i = *f;
  i = i << 8;
  i |= *(f + 1);
  return (i);
}


x86 assembly (clang, -O0):
<spack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
shl    $0x8,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
movswl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spack>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @spack(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
store i16 %6, i16* %3
%7 = load i16, i16* %3
%8 = sext i16 %7 to i32
%9 = shl i32 %8, 8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = load i16, i16* %3
%16 = sext i16 %15 to i32
%17 = or i32 %16, %14
%18 = trunc i32 %17 to i16
store i16 %18, i16* %3
%19 = load i16, i16* %3
ret i16 %19
}

LLVM IR (-O2):
define signext i16 @spack(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
void test3(int size) {
  int arr[] = {1, 2, 3, 4, 5};
  int vla_arr[size];
#pragma clang __debug captured
  { arr[2] = vla_arr[size - 1]; }
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    0xeff(%rip),%eax
mov    %eax,-0x10(%rbp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x28(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x30(%rbp)
lea    -0x20(%rbp),%rdx
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %rax,-0x40(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x50(%rbp),%rdi
call   1180 <__captured_stmt>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)

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

LLVM IR (-O0):
%struct.anon = type { [5 x i32]*, i64, i32*, i32* }
@__const.test3.arr = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define void @test3(i32 %0) {
%2 = alloca i32
%3 = alloca [5 x i32]
%4 = alloca i8*
%5 = alloca i64
%6 = alloca %struct.anon
store i32 %0, i32* %2
%7 = bitcast [5 x i32]* %3 to i8*
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %4
%11 = alloca i32, i64 %9
store i64 %9, i64* %5
%12 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
store [5 x i32]* %3, [5 x i32]** %12
%13 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 1
store i64 %9, i64* %13
%14 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 2
store i32* %11, i32** %14
%15 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 3
store i32* %2, i32** %15
%16 = load i8*, i8** %4
ret void
}
define internal void @__captured_stmt(%struct.anon* %0) {
%2 = alloca %struct.anon*
store %struct.anon* %0, %struct.anon** %2
%3 = load %struct.anon*, %struct.anon** %2
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 2
%7 = load i32*, i32** %6
%8 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 3
%9 = load i32*, i32** %8
%10 = load i32, i32* %9
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %7, i64 %12
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
%16 = load [5 x i32]*, [5 x i32]** %15
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %16, i64 0, i64 2
store i32 %14, i32* %17
ret void
}

LLVM IR (-O2):
define void @test3(i32 %0) {
ret void
}
/* Variables and functions */
int cs_base64_decode(unsigned char const *, int, char *);
int mg_base64_decode(const unsigned char *s, int len, char *dst) {
  return cs_base64_decode(s, len, dst);
}


x86 assembly (clang, -O0):
<mg_base64_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <cs_base64_decode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_base64_decode>:
jmp    1030 <cs_base64_decode@plt>

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

LLVM IR (-O2):
define i32 @mg_base64_decode(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @cs_base64_decode(i8* %0, i32 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cpu_info(char *, unsigned int *, unsigned int *);
scalar_t__ strcmp(char *, char *);
int cpu_has_slowextendedreg(void) {
  char vendor[13];
  unsigned family;
  unsigned model;
  cpu_info(vendor, &family, &model);
  if (strcmp(vendor, "AuthenticAMD") == 0) {
    if (family == 21)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cpu_has_slowextendedreg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x11(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <cpu_info@plt>
lea    -0x11(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    116e <cpu_has_slowextendedreg+0x4e>
cmpl   $0x15,-0x18(%rbp)
jne    1169 <cpu_has_slowextendedreg+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1175 <cpu_has_slowextendedreg+0x55>
jmp    116e <cpu_has_slowextendedreg+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_has_slowextendedreg>:
push   %rbx
sub    $0x20,%rsp
lea    0x13(%rsp),%rbx
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <cpu_info@plt>
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %al
cmpl   $0x15,0x8(%rsp)
sete   %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"AuthenticAMD\00"
define i32 @cpu_has_slowextendedreg() {
%1 = alloca [13 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @cpu_info(i8* %4, i32* %2, i32* %3)
%8 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 21
%12 = select i1 %9, i1 %11, i1 false
%13 = zext i1 %12 to i32
ret i32 %13
}
void vgDestroyImage(VGImage) {}


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

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

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

LLVM IR (-O2):
define void @vgDestroyImage(i32 %0) {
ret void
}
/* Variables and functions */
char *mcxStrNDup(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *mcxStrDup(const char *str) { return mcxStrNDup(str, strlen(str)); }


x86 assembly (clang, -O0):
<mcxStrDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <mcxStrNDup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcxStrDup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <mcxStrNDup@plt>

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

LLVM IR (-O2):
define i8* @mcxStrDup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @mcxStrNDup(i8* %0, i32 %2)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float dds_lookupx(int /*<<< orphan*/);
float dds_lookupf(uint32_t phase) { return dds_lookupx(phase); }


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

x86 assembly (clang, -O2):
<dds_lookupf>:
jmp    1030 <dds_lookupx@plt>

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

LLVM IR (-O2):
define float @dds_lookupf(i32 %0) {
%2 = tail call float @dds_lookupx(i32 %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_nondet_int();
int test_fun(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
             int /*<<< orphan*/);
int main() {
  return test_fun(__VERIFIER_nondet_int(), __VERIFIER_nondet_int(),
                  __VERIFIER_nondet_int(), __VERIFIER_nondet_int());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    %eax,%ecx
call   1040 <test_fun@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <test_fun@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @__VERIFIER_nondet_int()
%3 = call i32 (...) @__VERIFIER_nondet_int()
%4 = call i32 (...) @__VERIFIER_nondet_int()
%5 = call i32 (...) @__VERIFIER_nondet_int()
%6 = call i32 @test_fun(i32 %2, i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
%4 = tail call i32 (...) @__VERIFIER_nondet_int()
%5 = tail call i32 @test_fun(i32 %1, i32 %2, i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ error1(char *, char *);
char *strdup(char *);
char *xstrdup(char *str) {
  char *x = strdup(str);
  if (!x)
    error1("not enough memory; strdup %s failed\n", str);
  return x;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xstrdup+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <error1@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xstrdup+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <error1@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [37 x i8] c"not enough memory; strdup %s failed\0A\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @error1(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [37 x i8] c"not enough memory; strdup %s failed\0A\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error1(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
double f4_sum_pre_double_double_short(double v0, double v1, short v) {
  return v0 + v1 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_double_double_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movswl -0x12(%rbp),%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_double_double_short>:
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_double_double_short(double %0, double %1, i16 signext %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i16
store double %0, double* %4
store double %1, double* %5
store i16 %2, i16* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fadd double %7, %8
%10 = load i16, i16* %6
%11 = sitofp i16 %10 to double
%12 = fadd double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @f4_sum_pre_double_double_short(double %0, double %1, i16 signext %2) {
%4 = fadd double %0, %1
%5 = sitofp i16 %2 to double
%6 = fadd double %4, %5
ret double %6
}
/* Variables and functions */
int opentitan_compliance_main(int, char **);
int main(int argc, char **argv) {
  return opentitan_compliance_main(argc, argv);
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <opentitan_compliance_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @opentitan_compliance_main(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ *tmpfile();
FILE *select_infile(char *infile) {
  if (infile != NULL)
    return fopen(infile, "r");
  return tmpfile();
}


x86 assembly (clang, -O0):
<select_infile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <select_infile+0x30>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
jmp    115b <select_infile+0x3b>
mov    $0x0,%al
call   1030 <tmpfile@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_infile>:
test   %rdi,%rdi
je     1131 <select_infile+0x11>
lea    0xed4(%rip),%rsi
jmp    1040 <fopen@plt>
xor    %eax,%eax
jmp    1030 <tmpfile@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32* @select_infile(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %2
br label %11
9: ; preds = %1
%10 = call i32* (...) @tmpfile()
store i32* %10, i32** %2
br label %11
11: ; preds = %9, %6
%12 = load i32*, i32** %2
ret i32* %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i32* @select_infile(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32* (...) @tmpfile()
br label %7
7: ; preds = %5, %3
%8 = phi i32* [ %4, %3 ], [ %6, %5 ]
ret i32* %8
}
void arch_reset(char mode, const char *cmd) { ; }


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

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

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

LLVM IR (-O2):
define void @arch_reset(i8 signext %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int main(int argc, char *argv[]) {
  int a = 2, b = 7;
  int *p, *q;
  p = &a;
  q = &b;
  printf("%p\n", &b);
  printf("%p\n", *&q);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x7,-0x18(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x7,0x4(%rsp)
lea    0xedd(%rip),%rbx
lea    0x4(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 7, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
ret i32 0
}
/* Variables and functions */
float GeometricSmith(float, float, float);
float Geometric(float a, float NoV, float NoL) {
  return GeometricSmith(a, NoV, NoL);
}


x86 assembly (clang, -O0):
<Geometric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <GeometricSmith@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Geometric>:
jmp    1030 <GeometricSmith@plt>

LLVM IR (-O0):
define float @Geometric(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @GeometricSmith(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @Geometric(float %0, float %1, float %2) {
%4 = tail call float @GeometricSmith(float %0, float %1, float %2)
ret float %4
}
void *add1(void *n) { return (void *)(1 + (int)n); }


x86 assembly (clang, -O0):
<add1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<add1>:
add    $0x1,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i8* @add1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = add nsw i32 1, %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @add1(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = shl i64 %2, 32
%4 = add i64 %3, 4294967296
%5 = ashr exact i64 %4, 32
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("#include <CoreFoundation/CoreFoundation.h>\n");
  printf("\n");
  printf("int main(int argc, char *argv[]) {\n");
  printf("  return CFStringGetLength(CFSTR(\"Hello World!\"));\n");
  printf("}\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xf50(%rip),%rdi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeed(%rip),%rdi
call   1040 <puts@plt>
lea    0xf04(%rip),%rdi
call   1040 <puts@plt>
lea    0xf2b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"#include <CoreFoundation/CoreFoundation.h>\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [36 x i8] c"int main(int argc, char *argv[]) {\0A\00"
@.str.3 = [52 x i8] c" return CFStringGetLength(CFSTR(\22Hello World!\22));\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [43 x i8] c"#include <CoreFoundation/CoreFoundation.h>\00"
@str.5 = [35 x i8] c"int main(int argc, char *argv[]) {\00"
@str.6 = [51 x i8] c" return CFStringGetLength(CFSTR(\22Hello World!\22));\00"
@str.7 = [2 x i8] c"}\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
ret i32 0
}
void TimerOC2FastConfigure(unsigned long ulBase, unsigned long ulOCFast) {
  unsigned long ulTempccmr1 = 0;

  ;

  ;
  ulTempccmr1 = (*((volatile unsigned long *)(ulBase + 0x00000018)));
  ulTempccmr1 &= ~0x00000400;
  ulTempccmr1 |= (ulOCFast << 8);
  (*((volatile unsigned long *)(ulBase + 0x00000018))) = ulTempccmr1;
}


x86 assembly (clang, -O0):
<TimerOC2FastConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xfffffffffffffbff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerOC2FastConfigure>:
mov    $0xfffffffffffffbff,%rax
and    0x18(%rdi),%rax
shl    $0x8,%rsi
or     %rax,%rsi
mov    %rsi,0x18(%rdi)
ret

LLVM IR (-O0):
define void @TimerOC2FastConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = add i64 %6, 24
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, -1025
store i64 %11, i64* %5
%12 = load i64, i64* %4
%13 = shl i64 %12, 8
%14 = load i64, i64* %5
%15 = or i64 %14, %13
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = load i64, i64* %3
%18 = add i64 %17, 24
%19 = inttoptr i64 %18 to i64*
store volatile i64 %16, i64* %19
ret void
}

LLVM IR (-O2):
define void @TimerOC2FastConfigure(i64 %0, i64 %1) {
%3 = add i64 %0, 24
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -1025
%7 = shl i64 %1, 8
%8 = or i64 %6, %7
store volatile i64 %8, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "mkdir", message); }


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

x86 assembly (clang, -O2):
<g_error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [6 x i8] c"mkdir\00"
define void @g_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [6 x i8] c"mkdir\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void gtk_widget_pop_composite_child() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_pop_composite_child() {
ret void
}
void perf_disable_clock(void) { *(volatile unsigned int *)0xF8F00208 = 0; }


x86 assembly (clang, -O0):
<perf_disable_clock>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf8f00208,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_disable_clock>:
mov    $0xf8f00208,%eax
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @perf_disable_clock() {
store volatile i32 0, i32* inttoptr (i64 4176478728 to i32*)
ret void
}

LLVM IR (-O2):
define void @perf_disable_clock() {
store volatile i32 0, i32* inttoptr (i64 4176478728 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "usage: %s [-o <output-file>] <file>\n", name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"usage: %s [-o <output-file>] <file>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"usage: %s [-o <output-file>] <file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned xrop3_208_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S | stk3;
  stk1 = T & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_208_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_208_0_0>:
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
lea    -0x100(%rdi),%eax
and    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_208_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = or i32 %3, -256
%7 = and i32 %5, %6
ret i32 %7
}
/* Variables and functions */
double richesat_val(double);
double rh2vapden(double rh, double press_mbar, double tkelvin) {
  double esat, vapden;
  esat = richesat_val(tkelvin);
  vapden = rh * esat * 18.016 / (tkelvin * 287.04 * 0.01);
  return (vapden);
}


x86 assembly (clang, -O0):
<rh2vapden>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <richesat_val@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xec8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb4(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xe9f(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rh2vapden>:
sub    $0x28,%rsp
movapd %xmm2,(%rsp)
movaps %xmm0,0x10(%rsp)
movapd %xmm2,%xmm0
call   1030 <richesat_val@plt>
unpcklpd (%rsp),%xmm0
movapd 0x10(%rsp),%xmm1
shufpd $0x2,0xec5(%rip),%xmm1
mulpd  %xmm1,%xmm0
mulpd  0xec9(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @rh2vapden(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %6
%10 = call double @richesat_val(double %9)
store double %10, double* %7
%11 = load double, double* %4
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = fmul double %13, 1.801600e+01
%15 = load double, double* %6
%16 = fmul double %15, 2.870400e+02
%17 = fmul double %16, 1.000000e-02
%18 = fdiv double %14, %17
store double %18, double* %8
%19 = load double, double* %8
ret double %19
}

LLVM IR (-O2):
define double @rh2vapden(double %0, double %1, double %2) {
%4 = tail call double @richesat_val(double %2)
%5 = insertelement <2 x double> poison, double %2, i64 1
%6 = insertelement <2 x double> %5, double %4, i64 0
%7 = insertelement <2 x double> <double poison, double 2.870400e+02>, double %0, i64 0
%8 = fmul <2 x double> %6, %7
%9 = fmul <2 x double> %8, <double 1.801600e+01, double 1.000000e-02>
%10 = extractelement <2 x double> %9, i64 0
%11 = extractelement <2 x double> %9, i64 1
%12 = fdiv double %10, %11
ret double %12
}
double sign(double val) {
  if (val > 0)
    return +1.0;
  else if (val < 0)
    return -1.0;
  else
    return 0;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112d <sign+0x2d>
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <sign+0x55>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114d <sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <sign+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmpltsd %xmm1,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
cmpltsd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
andpd  %xmm1,%xmm0
andnpd %xmm3,%xmm1
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sign(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double -1.000000e+00, double* %2
br label %12
11: ; preds = %7
store double 0.000000e+00, double* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @sign(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = select i1 %3, double -1.000000e+00, double 0.000000e+00
%5 = select i1 %2, double 1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void printc(char c) { putchar(c); }


x86 assembly (clang, -O0):
<printc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printc>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printc(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testStringStack();
void runTests() { testStringStack(); }


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

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

LLVM IR (-O0):
define void @runTests() {
%1 = call i32 (...) @testStringStack()
ret void
}

LLVM IR (-O2):
define void @runTests() {
%1 = tail call i32 (...) @testStringStack()
ret void
}