xunge/DecIR huggingface dataset:
int sa_sat_bool(int a) {
  if (a < 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<sa_sat_bool>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <sa_sat_bool+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <sa_sat_bool+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sa_sat_bool>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @sa_sat_bool(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @sa_sat_bool(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
int compare_int_inc(void const *a, void const *b) {
  int const *pa = a;
  int const *pb = b;
  return *pa - *pb;
}


x86 assembly (clang, -O0):
<compare_int_inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int_inc>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_int_inc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_int_inc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _writefsbase_u64(unsigned long long);
void write_fs_base64(unsigned long long base) { _writefsbase_u64(base); }


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

x86 assembly (clang, -O2):
<write_fs_base64>:
jmp    1030 <_writefsbase_u64@plt>

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

LLVM IR (-O2):
define void @write_fs_base64(i64 %0) {
%2 = tail call i32 @_writefsbase_u64(i64 %0)
ret void
}
int greater(int a, int b) {
  if (a > b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<greater>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1122 <greater+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <greater+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<greater>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @greater(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %11
10: ; preds = %2
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @greater(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(void *);
void LockEnter(void *p) {
  if (p) {
    pthread_mutex_lock(p);
  }
}


x86 assembly (clang, -O0):
<LockEnter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <LockEnter+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LockEnter>:
test   %rdi,%rdi
je     111a <LockEnter+0xa>
jmp    1030 <pthread_mutex_lock@plt>
ret

LLVM IR (-O0):
define void @LockEnter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @pthread_mutex_lock(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @LockEnter(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @pthread_mutex_lock(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int v = 10777216;
  v *= 9777219;
  v &= ((1 << 24) - 1);
  printf("%d\n", v);
  printf("%d\n", 10777216 * 0);
  printf("%d\n", 10777216 / 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa47280,-0x4(%rbp)
imul   $0x953043,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
mov    $0x523940,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1f780,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x523940,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 128896)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5388608)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int f1(int a, int b) {
  printf("int f1 getted:\na = %d, b = %d;\n", a, b);
  printf("returning value = %d;\n", a + b);
  a += 5;
  b += 10;
  return (a + b);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
lea    0xee0(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%r14,%rbx,1),%esi
lea    0xee9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%r14,%rbx,1),%eax
add    $0xf,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"int f1 getted:\0Aa = %d, b = %d;\0A\00"
@.str.1 = [23 x i8] c"returning value = %d;\0A\00"
define i32 @f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 5
store i32 %13, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 10
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
@.str = [32 x i8] c"int f1 getted:\0Aa = %d, b = %d;\0A\00"
@.str.1 = [23 x i8] c"returning value = %d;\0A\00"
define i32 @f1(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = add nsw i32 %1, %0
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = add i32 %4, 15
ret i32 %6
}
/* Variables and functions */
int drand48();
double d_measure(void *ud) {
  double r, s;
  r = *(double *)ud;
  s = (2 * drand48()) - 1;
  return r + (s * 10);
}


x86 assembly (clang, -O0):
<d_measure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <drand48@plt>
shl    $0x1,%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_measure>:
push   %rax
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <drand48@plt>
add    %eax,%eax
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @d_measure(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca double
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
store double %7, double* %3
%8 = call i32 (...) @drand48()
%9 = mul nsw i32 2, %8
%10 = sub nsw i32 %9, 1
%11 = sitofp i32 %10 to double
store double %11, double* %4
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call double @llvm.fmuladd.f64(double %13, double 1.000000e+01, double %12)
ret double %14
}

LLVM IR (-O2):
define double @d_measure(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
%4 = tail call i32 (...) @drand48()
%5 = shl nsw i32 %4, 1
%6 = add nsw i32 %5, -1
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %7, double 1.000000e+01, double %3)
ret double %8
}
void TOSH_adc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @TOSH_adc_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyboard(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(0);
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <keyboard+0x2b>
jmp    1134 <keyboard+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1140 <keyboard+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x1b,%dil
je     1117 <keyboard+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
br label %12
12: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
unsigned long xstrtoull_range(char const *, int, unsigned long, unsigned long);
unsigned long xstrtoul_range(const char *str, int b, unsigned long l,
                             unsigned long u) {
  return xstrtoull_range(str, b, l, u);
}


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

x86 assembly (clang, -O2):
<xstrtoul_range>:
jmp    1030 <xstrtoull_range@plt>

LLVM IR (-O0):
define i64 @xstrtoul_range(i8* %0, i32 %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = call i64 @xstrtoull_range(i8* %9, i32 %10, i64 %11, i64 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @xstrtoul_range(i8* %0, i32 %1, i64 %2, i64 %3) {
%5 = tail call i64 @xstrtoull_range(i8* %0, i32 %1, i64 %2, i64 %3)
ret i64 %5
}
/* Variables and functions */
int DaysInYear(int /*<<< orphan*/);
int /*<<< orphan*/ YearFromTime(int);
int InLeapYear(int t) { return DaysInYear(YearFromTime(t)) == 366; }


x86 assembly (clang, -O0):
<InLeapYear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <YearFromTime@plt>
mov    %eax,%edi
call   1030 <DaysInYear@plt>
cmp    $0x16e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InLeapYear>:
push   %rax
call   1040 <YearFromTime@plt>
mov    %eax,%edi
call   1030 <DaysInYear@plt>
xor    %ecx,%ecx
cmp    $0x16e,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @InLeapYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @YearFromTime(i32 %3)
%5 = call i32 @DaysInYear(i32 %4)
%6 = icmp eq i32 %5, 366
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @InLeapYear(i32 %0) {
%2 = tail call i32 @YearFromTime(i32 %0)
%3 = tail call i32 @DaysInYear(i32 %2)
%4 = icmp eq i32 %3, 366
%5 = zext i1 %4 to i32
ret i32 %5
}
int stringLength(const char string[]) {
  int count = 0;
  while (string[count] != '\0')
    ++count;
  return count;
}


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

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

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

LLVM IR (-O2):
define i32 @stringLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
uint32_t start_cmd_test(char *optarg) { exit(0); }


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

x86 assembly (clang, -O2):
<start_cmd_test>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @start_cmd_test(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
int do_426() { return 426; }


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

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

LLVM IR (-O0):
define i32 @do_426() {
ret i32 426
}

LLVM IR (-O2):
define i32 @do_426() {
ret i32 426
}
int test_imm_F8int16_reg(short val) {
  return ((val) & (-0xF8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F8int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -248
%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_F8int16_reg(i16 signext %0) {
%2 = and i16 %0, -248
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 5, 9);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x5,%ecx
mov    $0x9,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x5,%ecx
mov    $0x9,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 5, i32 9)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 5, i32 9)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
__attribute__((no, noclone)) int f10(void *a, int b, long long c, long long d,
                                     long long e, unsigned char f,
                                     unsigned char *g, int *h, int *i) {
  asm volatile("" : : "r"(a), "r"(b), "r"(c), "r"(d) : "memory");
  asm volatile("" : : "r"(e), "r"(f), "r"(g), "r"(h) : "memory");
  asm volatile("" : : "r"(i) : "memory");
  return 0;
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
mov    %r9b,%al
mov    0x20(%rbp),%r9
mov    0x18(%rbp),%r9
mov    0x10(%rbp),%r9
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %al,-0x29(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rax
mov    -0x29(%rbp),%cl
mov    0x10(%rbp),%rdx
mov    0x18(%rbp),%rsi
mov    0x20(%rbp),%rax
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
mov    0x18(%rsp),%r10
mov    0x8(%rsp),%r11
mov    0x10(%rsp),%rax
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f10(i8* %0, i32 %1, i64 %2, i64 %3, i64 %4, i8 zeroext %5, i8* %6, i32* %7, i32* %8) {
tail call void asm sideeffect "", "r,r,r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 %1, i64 %2, i64 %3)
tail call void asm sideeffect "", "r,r,r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %4, i8 %5, i8* %6, i32* %7)
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %8)
ret i32 0
}
void device_GetDVD(void) {}


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

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

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

LLVM IR (-O2):
define void @device_GetDVD() {
ret void
}
int test_imm_EDuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xED << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EDuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 237
%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_EDuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 237
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float atof(char const *);
float parse_deg_str(const char *str) { return atof(str); }


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

x86 assembly (clang, -O2):
<parse_deg_str>:
jmp    1030 <atof@plt>

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

LLVM IR (-O2):
define float @parse_deg_str(i8* nocapture %0) {
%2 = tail call float @atof(i8* %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test3(void *nil) { printf("every 3 s.\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"every 3 s.\00"
define void @test3(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void panic_handler(unsigned long panicPC, unsigned long panicSSR,
                   unsigned long panicEXPEVT) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<panic_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
jmp    1110 <panic_handler+0x10>

x86 assembly (clang, -O2):
<panic_handler>:
jmp    1100 <panic_handler>

LLVM IR (-O0):
define void @panic_handler(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
br label %7
7: ; preds = %7, %3
br label %7
}

LLVM IR (-O2):
define void @panic_handler(i64 %0, i64 %1, i64 %2) {
br label %4
4: ; preds = %4, %3
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ func(int /*<<< orphan*/, char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    exit(0);
  }
  func(0, argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     1140 <main+0x20>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
xor    %edi,%edi
call   1030 <func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1135 <main+0x15>
mov    0x8(%rsi),%rsi
xor    %edi,%edi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @func(i32 0, i8* %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle18() { kprintf("ISR %d.\n", 18); }


x86 assembly (clang, -O0):
<isrHandle18>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x12,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle18>:
lea    0xee9(%rip),%rdi
mov    $0x12,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle18() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 18)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle18() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 18)
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int strlen(char *);
int tabbed_tag_length(char *tag) {
  char *t;
  t = strchr(tag, '\t');
  if (t != NULL)
    return t - tag;
  else
    return strlen(tag);
}


x86 assembly (clang, -O0):
<tabbed_tag_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x9,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115c <tabbed_tag_length+0x3c>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1168 <tabbed_tag_length+0x48>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabbed_tag_length>:
push   %rbx
mov    %rdi,%rbx
mov    $0x9,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1137 <tabbed_tag_length+0x17>
sub    %ebx,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @tabbed_tag_length(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 9)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
%15 = trunc i64 %14 to i32
store i32 %15, i32* %2
br label %19
16: ; preds = %1
%17 = load i8*, i8** %3
%18 = call i32 @strlen(i8* %17)
store i32 %18, i32* %2
br label %19
19: ; preds = %16, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @tabbed_tag_length(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 9)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
br label %11
9: ; preds = %1
%10 = tail call i32 @strlen(i8* %0)
br label %11
11: ; preds = %9, %4
%12 = phi i32 [ %8, %4 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Zero(void *, int);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  typedef struct {
    char a, b, c;
  } x_t;
  int i;
  x_t x;
  int j;
  i = 33;
  j = 44;
  Zero((void *)&x, sizeof(x_t));
  printf("i is %d, j is %d.\n", i, j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x21,-0x4(%rbp)
movl   $0x2c,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1040 <Zero@plt>
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x5(%rsp),%rdi
mov    $0x3,%esi
call   1040 <Zero@plt>
lea    0xec9(%rip),%rdi
mov    $0x21,%esi
mov    $0x2c,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.x_t = type { i8, i8, i8 }
@.str = [19 x i8] c"i is %d, j is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.x_t
%3 = alloca i32
store i32 33, i32* %1
store i32 44, i32* %3
%4 = bitcast %struct.x_t* %2 to i8*
%5 = call i32 @Zero(i8* %4, i32 3)
%6 = load i32, i32* %1
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
%struct.x_t = type { i8, i8, i8 }
@.str = [19 x i8] c"i is %d, j is %d.\0A\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @Zero(i8* %2, i32 3)
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 33, i32 44)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fopen_s(int /*<<< orphan*/ **, char const *, char const *);
FILE *fileOpen(const char *filename, const char *flag) {
  FILE *fp;
  fopen_s(&fp, filename, flag);
  return fp;
}


x86 assembly (clang, -O0):
<fileOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1030 <fopen_s@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileOpen>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <fopen_s@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32* @fileOpen(i8* %0, i8* %1) {
%3 = alloca i32*
%4 = bitcast i32** %3 to i8*
%5 = call i32 @fopen_s(i32** %3, i8* %0, i8* %1)
%6 = load i32*, i32** %3
ret i32* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ sysctl(int *, int, unsigned int *, size_t *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/);
unsigned int intFromSysctl(int mib0, int mib1) {
  unsigned int result = 0;
  int mib[2];
  mib[0] = mib0;
  mib[1] = mib1;
  size_t length = sizeof(result);
  sysctl(mib, 2, &result, &length, NULL, 0);
  return result;
}


x86 assembly (clang, -O0):
<intFromSysctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movq   $0x4,-0x20(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x2,%esi
lea    -0xc(%rbp),%rdx
lea    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <sysctl@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intFromSysctl>:
sub    $0x18,%rsp
movl   $0x0,0x4(%rsp)
mov    %edi,0x8(%rsp)
mov    %esi,0xc(%rsp)
movq   $0x4,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    $0x2,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <sysctl@plt>
mov    0x4(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @intFromSysctl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x i32]
%7 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%8 = load i32, i32* %3
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 %10, i32* %11
store i64 4, i64* %7
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%13 = call i32 @sysctl(i32* %12, i32 2, i32* %5, i64* %7, i32* null, i32 0)
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @intFromSysctl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca i64
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast [2 x i32]* %4 to i8*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %1, i32* %9
%10 = bitcast i64* %5 to i8*
store i64 4, i64* %5
%11 = call i32 @sysctl(i32* %8, i32 2, i32* %3, i64* %5, i32* null, i32 0)
%12 = load i32, i32* %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_putstr(char *str) {
  int i;
  i = 0;
  if (str) {
    while (str[i++])
      ft_putchar(str[i - 1]);
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116f <ft_putstr+0x5f>
jmp    1133 <ft_putstr+0x23>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116a <ft_putstr+0x5a>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
jmp    1133 <ft_putstr+0x23>
jmp    116f <ft_putstr+0x5f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
test   %rdi,%rdi
je     1143 <ft_putstr+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <ft_putstr+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8 [ %12, %6 ], [ %4, %3 ]
%9 = add nuw i64 %7, 1
%10 = tail call i32 @ft_putchar(i8 signext %8)
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int a = 1, b = 1;
  int a_post, pre_b;
  a_post = a++;
  pre_b = ++b;
  printf("a  a_post   b   pre_b \n");
  printf("%1d %5d %5d %5d\n", a, a_post, b, pre_b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x14(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"a a_post b pre_b \0A\00"
@.str.1 = [17 x i8] c"%1d %5d %5d %5d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
store i32 %6, i32* %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
store i32 %9, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"%1d %5d %5d %5d\0A\00"
@str = [23 x i8] c"a a_post b pre_b \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 1, i32 2, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ KeyboardFunc(unsigned char, int /*<<< orphan*/,
                                int /*<<< orphan*/);
void MenuFunc(int value) { KeyboardFunc((unsigned char)value, 0, 0); }


x86 assembly (clang, -O0):
<MenuFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
movzbl %al,%edi
mov    %edx,%esi
call   1030 <KeyboardFunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MenuFunc>:
movzbl %dil,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <KeyboardFunc@plt>

LLVM IR (-O0):
define void @MenuFunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @KeyboardFunc(i8 zeroext %4, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @MenuFunc(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @KeyboardFunc(i8 zeroext %2, i32 0, i32 0)
ret void
}
void rcu_prepare_kthreads(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @rcu_prepare_kthreads(i32 %0) {
ret void
}
/* Type definitions */
struct ddb_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ddb_list *);
void ddb_list_free(struct ddb_list *list) { free(list); }


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

x86 assembly (clang, -O2):
<ddb_list_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ddb_list = type { i32 }
define void @ddb_list_free(%struct.ddb_list* %0) {
%2 = alloca %struct.ddb_list*
store %struct.ddb_list* %0, %struct.ddb_list** %2
%3 = load %struct.ddb_list*, %struct.ddb_list** %2
%4 = call i32 @free(%struct.ddb_list* %3)
ret void
}

LLVM IR (-O2):
%struct.ddb_list = type { i32 }
define void @ddb_list_free(%struct.ddb_list* nocapture %0) {
%2 = tail call i32 @free(%struct.ddb_list* %0)
ret void
}
/* Variables and functions */
scalar_t__ trunctest(double);
float truncf(float f) { return (float)trunctest((double)f); }


x86 assembly (clang, -O0):
<truncf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <trunctest@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <trunctest@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @truncf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @trunctest(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @truncf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @trunctest(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ TIOCMSET;
int ioctl(int, int /*<<< orphan*/, int *);
int set_serial_lines(int fd, int modem_lines) {
  return ioctl(fd, TIOCMSET, &modem_lines);
}


x86 assembly (clang, -O0):
<set_serial_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_serial_lines>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@TIOCMSET = global i32 0
define i32 @set_serial_lines(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @TIOCMSET
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void inc() {
  int av = 10;
  static int sv = 10;
  av += 5;
  sv += 5;
  printf("av = %d, sv = %d\n", av, sv);
}


x86 assembly (clang, -O0):
<inc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    0x2efa(%rip),%eax
add    $0x5,%eax
mov    %eax,0x2ef1(%rip)
mov    -0x4(%rbp),%esi
mov    0x2ee8(%rip),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc>:
mov    0x2f12(%rip),%edx
add    $0x5,%edx
mov    %edx,0x2f09(%rip)
lea    0xeda(%rip),%rdi
mov    $0xf,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@inc.sv = internal global i32 10
@.str = [18 x i8] c"av = %d, sv = %d\0A\00"
define void @inc() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 5
store i32 %3, i32* %1
%4 = load i32, i32* @inc.sv
%5 = add nsw i32 %4, 5
store i32 %5, i32* @inc.sv
%6 = load i32, i32* %1
%7 = load i32, i32* @inc.sv
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@inc.sv = internal unnamed_addr global i32 10
@.str = [18 x i8] c"av = %d, sv = %d\0A\00"
define void @inc() {
%1 = load i32, i32* @inc.sv
%2 = add nsw i32 %1, 5
store i32 %2, i32* @inc.sv
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 15, i32 %2)
ret void
}
double eccentricity_dot(double tdt) {
  double T;
  double edot;
  T = (tdt - (2433282.42345905)) / (36525.0);
  edot = (-0.00004193 + 2 * (T * (-0.000000126)));
  return (edot);
}


x86 assembly (clang, -O0):
<eccentricity_dot>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf02(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeee(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed5(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xebc(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<eccentricity_dot>:
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
addsd  %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @eccentricity_dot(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fsub double %5, 0x414290813633E7F9
%7 = fdiv double %6, 3.652500e+04
store double %7, double* %3
%8 = load double, double* %3
%9 = fmul double %8, -1.260000e-07
%10 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %9, double -4.193000e-05)
store double %10, double* %4
%11 = load double, double* %4
ret double %11
}

LLVM IR (-O2):
define double @eccentricity_dot(double %0) {
%2 = fadd double %0, 0xC14290813633E7F9
%3 = fdiv double %2, 3.652500e+04
%4 = fmul double %3, -1.260000e-07
%5 = tail call double @llvm.fmuladd.f64(double %4, double 2.000000e+00, double -4.193000e-05)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ WriteSettings();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void Exit(void) {
  int i;
  WriteSettings();
  exit(0);
}


x86 assembly (clang, -O0):
<Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <WriteSettings@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Exit>:
push   %rax
xor    %eax,%eax
call   1030 <WriteSettings@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Exit() {
%1 = alloca i32
%2 = call i32 (...) @WriteSettings()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @Exit() {
%1 = tail call i32 (...) @WriteSettings()
%2 = tail call i32 @exit(i32 0)
unreachable
}