xunge/DecIR huggingface dataset:
/* Variables and functions */
int isnan(float);
int chpl_macro_float_isnan(float x) { return isnan(x); }


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

x86 assembly (clang, -O2):
<chpl_macro_float_isnan>:
jmp    1030 <isnan@plt>

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

LLVM IR (-O2):
define i32 @chpl_macro_float_isnan(float %0) {
%2 = tail call i32 @isnan(float %0)
ret i32 %2
}
double factorial(double x) {
  int i;
  double fact = 1;
  for (i = 2; i <= x; i++) {
    fact *= i;
  }
  return fact;
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x2,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     114e <factorial+0x4e>
cvtsi2sdl -0xc(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <factorial+0x1d>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
ucomisd 0xf00(%rip),%xmm0
jae    1113 <factorial+0x13>
movsd  0xeee(%rip),%xmm0
ret
movapd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
movsd  0xee1(%rip),%xmm2
mov    $0x3,%eax
nopl   0x0(%rax)
mulsd  %xmm2,%xmm0
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
add    $0x1,%eax
ucomisd %xmm2,%xmm1
jae    1130 <factorial+0x30>
ret

LLVM IR (-O0):
define double @factorial(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
store double 1.000000e+00, double* %4
store i32 2, i32* %3
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load double, double* %2
%9 = fcmp ole double %7, %8
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = load double, double* %4
%14 = fmul double %13, %12
store double %14, double* %4
br label %15
15: ; preds = %10
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load double, double* %4
ret double %19
}

LLVM IR (-O2):
define double @factorial(double %0) {
%2 = fcmp ult double %0, 2.000000e+00
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi double [ %9, %3 ], [ 2.000000e+00, %1 ]
%5 = phi double [ %7, %3 ], [ 1.000000e+00, %1 ]
%6 = phi i32 [ %8, %3 ], [ 2, %1 ]
%7 = fmul double %5, %4
%8 = add nuw nsw i32 %6, 1
%9 = sitofp i32 %8 to double
%10 = fcmp ugt double %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi double [ 1.000000e+00, %1 ], [ %7, %3 ]
ret double %12
}
int _is_whitespace(char c) {
  if (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     113e <_is_whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     113e <_is_whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     113e <_is_whitespace+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    114a <_is_whitespace+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <_is_whitespace+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_whitespace>:
cmp    $0x20,%dil
ja     1120 <_is_whitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    1120 <_is_whitespace+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Joint_ReleaseString(const char *str) { free((void *)str); }


x86 assembly (clang, -O0):
<Joint_ReleaseString>:
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):
<Joint_ReleaseString>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @Joint_ReleaseString(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
void unsafe_pos_bw(char **pos, const size_t size) { *pos -= size; }


x86 assembly (clang, -O0):
<unsafe_pos_bw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
xor    %edx,%edx
sub    %rsi,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @unsafe_pos_bw(i8** %0, i64 %1) {
%3 = alloca i8**
%4 = alloca i64
store i8** %0, i8*** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = sub i64 0, %5
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %6
ret void
}

LLVM IR (-O2):
define void @unsafe_pos_bw(i8** nocapture %0, i64 %1) {
%3 = load i8*, i8** %0
%4 = sub i64 0, %1
%5 = getelementptr inbounds i8, i8* %3, i64 %4
store i8* %5, i8** %0
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ width;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
int get_XCreateWindowEvent_width(void *_p) {
  return (int)((XCreateWindowEvent *)_p)->width;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XCreateWindowEvent_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XCreateWindowEvent_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
long long abs_1(long long i) { return (i > 0) ? -i : i; }


x86 assembly (clang, -O0):
<abs_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1122 <abs_1+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <abs_1+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @abs_1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @abs_1(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 false)
%3 = sub i64 0, %2
ret i64 %3
}
int setbits(int x, unsigned int p, unsigned int n, int y) {
  int a;
  int b;
  a = x & ~(~(~0 << n) << (p - n + 1));
  b = (y & ~(~0 << n)) << (p - n + 1);
  x = a | b;
  return x;
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
mov    %eax,%edx
shl    %cl,%edx
not    %edx
and    %edi,%edx
and    %r8d,%eax
shl    %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = shl i32 -1, %12
%14 = xor i32 %13, -1
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = sub i32 %15, %16
%18 = add i32 %17, 1
%19 = shl i32 %14, %18
%20 = xor i32 %19, -1
%21 = and i32 %11, %20
store i32 %21, i32* %9
%22 = load i32, i32* %8
%23 = load i32, i32* %7
%24 = shl i32 -1, %23
%25 = xor i32 %24, -1
%26 = and i32 %22, %25
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = sub i32 %27, %28
%30 = add i32 %29, 1
%31 = shl i32 %26, %30
store i32 %31, i32* %10
%32 = load i32, i32* %9
%33 = load i32, i32* %10
%34 = or i32 %32, %33
store i32 %34, i32* %5
%35 = load i32, i32* %5
ret i32 %35
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = sub i32 %1, %2
%8 = add i32 %7, 1
%9 = shl i32 %6, %8
%10 = xor i32 %9, -1
%11 = and i32 %10, %0
%12 = and i32 %6, %3
%13 = shl i32 %12, %8
%14 = or i32 %11, %13
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ NOROM_CPUbasepriGet();
uint32_t IntPriorityMaskGet(void) { return (NOROM_CPUbasepriGet()); }


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

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

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

LLVM IR (-O2):
define i32 @IntPriorityMaskGet() {
%1 = tail call i32 (...) @NOROM_CPUbasepriGet()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ cf_evaluate_test();
int /*<<< orphan*/ cf_expand_sqrt_continued_fraction_test();
int /*<<< orphan*/ cf_sqrt_steps_identical_test();
int /*<<< orphan*/ printf(char *);
int main(void) {
  cf_expand_sqrt_continued_fraction_test();
  cf_sqrt_steps_identical_test();
  cf_evaluate_test();
  printf("All continued fraction 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   1060 <cf_expand_sqrt_continued_fraction_test@plt>
mov    $0x0,%al
call   1030 <cf_sqrt_steps_identical_test@plt>
mov    $0x0,%al
call   1040 <cf_evaluate_test@plt>
lea    0xe95(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <cf_expand_sqrt_continued_fraction_test@plt>
xor    %eax,%eax
call   1030 <cf_sqrt_steps_identical_test@plt>
xor    %eax,%eax
call   1050 <cf_evaluate_test@plt>
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"All continued fraction tests passed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @cf_expand_sqrt_continued_fraction_test()
%3 = call i32 (...) @cf_sqrt_steps_identical_test()
%4 = call i32 (...) @cf_evaluate_test()
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [36 x i8] c"All continued fraction tests passed\00"
define i32 @main() {
%1 = tail call i32 (...) @cf_expand_sqrt_continued_fraction_test()
%2 = tail call i32 (...) @cf_sqrt_steps_identical_test()
%3 = tail call i32 (...) @cf_evaluate_test()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ parent_index(int);
bool has_parent(int size, int index) { return parent_index(index) >= 0; }


x86 assembly (clang, -O0):
<has_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <parent_index@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_parent>:
push   %rax
mov    %esi,%edi
call   1030 <parent_index@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @has_parent(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i64 @parent_index(i32 %5)
%7 = icmp sge i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @has_parent(i32 %0, i32 %1) {
%3 = tail call i64 @parent_index(i32 %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ gf_alog(scalar_t__);
scalar_t__ gf_log(scalar_t__);
uint8_t gf_mulinv(uint8_t x) { return (x) ? gf_alog(255 - gf_log(x)) : 0; }


x86 assembly (clang, -O0):
<gf_mulinv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <gf_mulinv+0x36>
mov    -0x8(%rbp),%rdi
call   1040 <gf_log@plt>
mov    $0xff,%edi
sub    %rax,%rdi
call   1030 <gf_alog@plt>
mov    %rax,-0x10(%rbp)
jmp    1161 <gf_mulinv+0x41>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1161 <gf_mulinv+0x41>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_mulinv>:
test   %rdi,%rdi
je     1139 <gf_mulinv+0x19>
push   %rax
call   1040 <gf_log@plt>
mov    $0xff,%edi
sub    %rax,%rdi
pop    %rax
jmp    1030 <gf_alog@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @gf_mulinv(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i64, i64* %2
%7 = call i64 @gf_log(i64 %6)
%8 = sub nsw i64 255, %7
%9 = call i64 @gf_alog(i64 %8)
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %5
%12 = phi i64 [ %9, %5 ], [ 0, %10 ]
ret i64 %12
}

LLVM IR (-O2):
define i64 @gf_mulinv(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @gf_log(i64 %0)
%5 = sub nsw i64 255, %4
%6 = tail call i64 @gf_alog(i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i64 [ %6, %3 ], [ 0, %1 ]
ret i64 %8
}
/* Variables and functions */
int sub(int, int);
int __attribute__((no)) foo(int a, int b) {
  if (a > b)
    return sub(a, b);
  else
    return sub(b, a);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113d <foo+0x2d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <sub@plt>
mov    %eax,-0x4(%rbp)
jmp    114b <foo+0x3b>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <sub@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
cmp    %esi,%edi
jle    111d <foo+0xd>
mov    %eax,%edi
jmp    1030 <sub@plt>
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <sub@plt>

LLVM IR (-O0):
define i32 @foo(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 %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 @sub(i32 %10, i32 %11)
store i32 %12, i32* %3
br label %17
13: ; preds = %2
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = call i32 @sub(i32 %14, i32 %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @sub(i32 %0, i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @sub(i32 %1, i32 %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
int pfib(int n) {
  if (n < 2) {
    return n;
  } else {
    return pfib(n - 1) + pfib(n - 2);
  }
}


x86 assembly (clang, -O0):
<pfib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <pfib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <pfib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <pfib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <pfib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <pfib+0x10>
mov    %ebx,%ecx
jmp    1144 <pfib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <pfib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <pfib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pfib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %16
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = call i32 @pfib(i32 %10)
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 2
%14 = call i32 @pfib(i32 %13)
%15 = add nsw i32 %11, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %8, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @pfib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @pfib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *texto;
  texto = malloc(31);
  scanf("%s30", texto);
  printf("%s", texto);
  free(texto);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1f,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1f,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
mov    %rax,%rsi
call   1060 <scanf@plt>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s30\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(31) i8* @malloc(i32 31)
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sweep_define_parameters_numerically(int nq, int nv, int np, int *pars) {
  int fail = 0;
  int nqvp[3];
  double *c;
  nqvp[0] = nq;
  nqvp[1] = nv;
  nqvp[2] = np;
  fail = _ada_use_c2phc(610, nqvp, pars, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_define_parameters_numerically>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    $0x262,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_define_parameters_numerically>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x262,%edi
mov    %rcx,%rdx
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_define_parameters_numerically(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca [3 x i32]
%11 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
store i32 0, i32* %9
%12 = load i32, i32* %5
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
store i32 %12, i32* %13
%14 = load i32, i32* %6
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 2
store i32 %16, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%19 = load i32*, i32** %8
%20 = load double*, double** %11
%21 = call i32 @_ada_use_c2phc(i32 610, i32* %18, i32* %19, double* %20)
store i32 %21, i32* %9
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @sweep_define_parameters_numerically(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 %0, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %1, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %2, i32* %9
%10 = call i32 @_ada_use_c2phc(i32 610, i32* %7, i32* %3, double* undef)
ret i32 %10
}
/* Variables and functions */
double M_PI;
double tan(double);
double cot(double radian) { return tan(M_PI * 0.5 - radian); }


x86 assembly (clang, -O0):
<cot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ec4(%rip),%rax
movsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xeb4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <tan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cot>:
mov    0x2ed1(%rip),%rax
movsd  (%rax),%xmm1
mulsd  0xedd(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <tan@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @cot(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @M_PI
%4 = load double, double* %2
%5 = fneg double %4
%6 = call double @llvm.fmuladd.f64(double %3, double 5.000000e-01, double %5)
%7 = call double @tan(double %6)
ret double %7
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @cot(double %0) {
%2 = load double, double* @M_PI
%3 = fneg double %0
%4 = tail call double @llvm.fmuladd.f64(double %2, double 5.000000e-01, double %3)
%5 = tail call double @tan(double %4)
ret double %5
}
int isalpha(int c) {
  if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     111b <isalpha+0x1b>
cmpl   $0x5a,-0x8(%rbp)
jle    112f <isalpha+0x2f>
cmpl   $0x61,-0x8(%rbp)
jl     113b <isalpha+0x3b>
cmpl   $0x7a,-0x8(%rbp)
jg     113b <isalpha+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <isalpha+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %15, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 97
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 122
br i1 %14, label %15, label %16
15: ; preds = %12, %6
store i32 1, i32* %2
br label %17
16: ; preds = %12, %9
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ remove(char *);
FILE *sfd_compile(FILE *in, char *name) {
  FILE *out;
  remove(name);
  out = fopen(name, "w");
  fclose(in);
  return out;
}


x86 assembly (clang, -O0):
<sfd_compile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <remove@plt>
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfd_compile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <remove@plt>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define noalias i32* @sfd_compile(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @remove(i8* %1)
%4 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fclose(i32* %0)
ret i32* %4
}
void do_state_12(char c, int *state, char *word, int *length) {
  word[(*length)++] = c;
  if (c == '\\') {
    *state = 15;
  } else {
    *state = 13;
  }
}


x86 assembly (clang, -O0):
<do_state_12>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movsbl -0x1(%rbp),%eax
cmp    $0x5c,%eax
jne    114c <do_state_12+0x4c>
mov    -0x10(%rbp),%rax
movl   $0xf,(%rax)
jmp    1156 <do_state_12+0x56>
mov    -0x10(%rbp),%rax
movl   $0xd,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_state_12>:
movslq (%rcx),%r8
lea    0x1(%r8),%eax
mov    %eax,(%rcx)
mov    %dil,(%rdx,%r8,1)
xor    %eax,%eax
cmp    $0x5c,%dil
sete   %al
add    %eax,%eax
add    $0xd,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @do_state_12(i8 signext %0, i32* nocapture writeonly %1, i8* nocapture writeonly %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
store i8 %0, i8* %8
%9 = icmp eq i8 %0, 92
%10 = select i1 %9, i32 15, i32 13
store i32 %10, i32* %1
ret void
}
void TEST_ResetEnter() {
  printf("<<%s>> \r\n", __FUNCTION__);
  return;
}


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

x86 assembly (clang, -O2):
<TEST_ResetEnter>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"<<%s>> \0D\0A\00"
@__FUNCTION__.TEST_ResetEnter = [16 x i8] c"TEST_ResetEnter\00"
define void @TEST_ResetEnter() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.TEST_ResetEnter, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"<<%s>> \0D\0A\00"
@__FUNCTION__.TEST_ResetEnter = [16 x i8] c"TEST_ResetEnter\00"
define void @TEST_ResetEnter() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.TEST_ResetEnter, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_info(unsigned int *, int, char *);
void swi_handler(unsigned int *context) { dump_info(context, 4, "SWI"); }


x86 assembly (clang, -O0):
<swi_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
lea    0xed4(%rip),%rdx
call   1030 <dump_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swi_handler>:
lea    0xee9(%rip),%rdx
mov    $0x4,%esi
jmp    1030 <dump_info@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"SWI\00"
define void @swi_handler(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @dump_info(i32* %3, i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"SWI\00"
define void @swi_handler(i32* %0) {
%2 = tail call i32 @dump_info(i32* %0, i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void XcmsFreeCCC() {}


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

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

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

LLVM IR (-O2):
define void @XcmsFreeCCC() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help() {
  fprintf(stderr, "cond - Console Daemon\n");
  fprintf(stderr, "usage: cond [-h] -- command args...\n");
  fprintf(stderr, "'command args' is the command that is to be spawned on"
                  "ptys when first accessed.\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeee(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeff(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"cond - Console Daemon\0A\00"
@.str.1 = [37 x i8] c"usage: cond [-h] -- command args...\0A\00"
@.str.2 = [81 x i8] c"'command args' is the command that is to be spawned onptys when first accessed.\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"cond - Console Daemon\0A\00"
@.str.1 = [37 x i8] c"usage: cond [-h] -- command args...\0A\00"
@.str.2 = [81 x i8] c"'command args' is the command that is to be spawned onptys when first accessed.\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *runner(void *arg __attribute__((unused))) {
  while (1)
    sleep(1);
  return NULL;
}


x86 assembly (clang, -O0):
<runner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    111c <runner+0xc>

x86 assembly (clang, -O2):
<runner>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <runner+0x10>

LLVM IR (-O0):
define i8* @runner(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define noalias i8* @runner(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 1)
br label %2
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
scalar_t__ SSIZE_MAX;
size_t off_to_size(off_t off_bytes) {
  if (off_bytes > SSIZE_MAX)
    return SSIZE_MAX;
  return off_bytes;
}


x86 assembly (clang, -O0):
<off_to_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ed5(%rip),%rcx
cmp    (%rcx),%rax
jle    112f <off_to_size+0x2f>
mov    0x2ec5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <off_to_size+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<off_to_size>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
cmp    %rdi,%rax
cmovge %rdi,%rax
ret

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

LLVM IR (-O2):
@SSIZE_MAX = global i64 0
define i64 @off_to_size(i64 %0) {
%2 = load i64, i64* @SSIZE_MAX
%3 = icmp slt i64 %2, %0
%4 = select i1 %3, i64 %2, i64 %0
ret i64 %4
}
/* Variables and functions */
int strlen(char *string) {
  int i = 0;
  while (*string++) {
    i++;
  };
  return i;
}


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

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int lowest(int);
int exported_two(int par) { return lowest(par) - 4711; }


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

x86 assembly (clang, -O2):
<exported_two>:
push   %rax
call   1030 <lowest@plt>
add    $0xffffed99,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @exported_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lowest(i32 %3)
%5 = sub nsw i32 %4, 4711
ret i32 %5
}

LLVM IR (-O2):
define i32 @exported_two(i32 %0) {
%2 = tail call i32 @lowest(i32 %0)
%3 = add nsw i32 %2, -4711
ret i32 %3
}
void ASN1_INTEGER_get(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_INTEGER_get() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
scalar_t__ xmalloc(int);
char *strdupdelim(const char *beg, const char *end) {
  char *res = (char *)xmalloc(end - beg + 1);
  memcpy(res, beg, end - beg);
  res[end - beg] = '\0';
  return res;
}


x86 assembly (clang, -O0):
<strdupdelim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1030 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdupdelim>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
sub    %rdi,%rbx
lea    0x1(%rbx),%edi
call   1030 <xmalloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
movb   $0x0,(%r15,%rbx,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdupdelim(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = add nsw i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i64 @xmalloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = load i8*, i8** %3
%19 = ptrtoint i8* %17 to i64
%20 = ptrtoint i8* %18 to i64
%21 = sub i64 %19, %20
%22 = trunc i64 %21 to i32
%23 = call i32 @memcpy(i8* %15, i8* %16, i32 %22)
%24 = load i8*, i8** %5
%25 = load i8*, i8** %4
%26 = load i8*, i8** %3
%27 = ptrtoint i8* %25 to i64
%28 = ptrtoint i8* %26 to i64
%29 = sub i64 %27, %28
%30 = getelementptr inbounds i8, i8* %24, i64 %29
store i8 0, i8* %30
%31 = load i8*, i8** %5
ret i8* %31
}

LLVM IR (-O2):
define i8* @strdupdelim(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = add i32 %6, 1
%8 = tail call i64 @xmalloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @memcpy(i8* %9, i8* %0, i32 %6)
%11 = getelementptr inbounds i8, i8* %9, i64 %5
store i8 0, i8* %11
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM1_TRG_COM_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TIM1_TRG_COM_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM1_TRG_COM_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRD7_set(void) { return U_WMRCORENONE_set("U_WMRD7"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRD7\00"
define i8* @U_WMRD7_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRD7\00"
define i8* @U_WMRD7_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ _is_space(char const);
char _is_stop(const char s) {
  if ((s > 0) && (s < ' ') && !_is_space(s)) {
    return '\n';
  }
  return 0;
}


x86 assembly (clang, -O0):
<_is_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jle    1153 <_is_stop+0x43>
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jge    1153 <_is_stop+0x43>
movsbl -0x2(%rbp),%edi
call   1030 <_is_space@plt>
cmp    $0x0,%eax
jne    1153 <_is_stop+0x43>
movb   $0xa,-0x1(%rbp)
jmp    1157 <_is_stop+0x47>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_stop>:
lea    -0x1(%rdi),%eax
cmp    $0x1e,%al
ja     112a <_is_stop+0x1a>
push   %rax
movsbl %dil,%edi
call   1030 <_is_space@plt>
test   %eax,%eax
lea    0x8(%rsp),%rsp
je     112d <_is_stop+0x1d>
xor    %eax,%eax
ret
mov    $0xa,%al
ret

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

LLVM IR (-O2):
define signext i8 @_is_stop(i8 signext %0) {
%2 = add i8 %0, -1
%3 = icmp ult i8 %2, 31
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @_is_space(i8 signext %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4, %1
br label %8
8: ; preds = %4, %7
%9 = phi i8 [ 0, %7 ], [ 10, %4 ]
ret i8 %9
}
__attribute__((swiftcall)) void
indirect_result_1(__attribute__((swift_indirect_result)) int *arg0,
                  __attribute__((swift_indirect_result)) float *arg1) {}


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

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

LLVM IR (-O0):
define swiftcc void @indirect_result_1(i32* noalias sret(i32*) align 4 dereferenceable(4) %0, float* noalias align 4 dereferenceable(4) %1) {
%3 = alloca i32*
%4 = alloca float*
store i32* %0, i32** %3
store float* %1, float** %4
ret void
}

LLVM IR (-O2):
define swiftcc void @indirect_result_1(i32* noalias nocapture sret(i32*) align 4 dereferenceable(4) %0, float* noalias nocapture align 4 dereferenceable(4) %1) {
ret void
}
void dcache_invalidate_all(void) {}


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

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

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

LLVM IR (-O2):
define void @dcache_invalidate_all() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushreal16array_(void *x, unsigned int *n) {
  pushNarray((char *)x, (*n * 16));
}


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

x86 assembly (clang, -O2):
<pushreal16array_>:
mov    (%rsi),%esi
shl    $0x4,%esi
jmp    1030 <pushNarray@plt>

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

LLVM IR (-O2):
define void @pushreal16array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 4
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
void xTickISR(void) {}


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

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

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

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