xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ decodeFirstByte(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ decodeFourthByte(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ decodeSecondByte(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ decodeThirdByte(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void decode(uint8_t *src, uint32_t *dest) {
  decodeFirstByte(src, dest);
  decodeSecondByte(src, dest);
  decodeThirdByte(src, dest);
  decodeFourthByte(src, dest);
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <decodeFirstByte@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <decodeSecondByte@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <decodeThirdByte@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <decodeFourthByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <decodeFirstByte@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <decodeSecondByte@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <decodeThirdByte@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <decodeFourthByte@plt>

LLVM IR (-O0):
define void @decode(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 @decodeFirstByte(i32* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @decodeSecondByte(i32* %8, i32* %9)
%11 = load i32*, i32** %3
%12 = load i32*, i32** %4
%13 = call i32 @decodeThirdByte(i32* %11, i32* %12)
%14 = load i32*, i32** %3
%15 = load i32*, i32** %4
%16 = call i32 @decodeFourthByte(i32* %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @decode(i32* %0, i32* %1) {
%3 = tail call i32 @decodeFirstByte(i32* %0, i32* %1)
%4 = tail call i32 @decodeSecondByte(i32* %0, i32* %1)
%5 = tail call i32 @decodeThirdByte(i32* %0, i32* %1)
%6 = tail call i32 @decodeFourthByte(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
scalar_t__ puts(int /*<<< orphan*/);
int main(int argc, char **argv) {
  argv += argc + 1;
  while (*argv && puts(*(argv++)) >= 0)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x11(%rbp)
je     1174 <main+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <puts@plt>
cmp    $0x0,%rax
setge  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1184 <main+0x74>
jmp    1189 <main+0x79>
jmp    113e <main+0x2e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movslq %edi,%rax
lea    (%rsi,%rax,8),%rbx
add    $0x8,%rbx
nopl   0x0(%rax)
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1136 <main+0x26>
add    $0x8,%rbx
call   1030 <puts@plt>
test   %rax,%rax
jns    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8*, i8** %1, i64 %4
br label %6
6: ; preds = %10, %2
%7 = phi i8** [ %5, %2 ], [ %11, %10 ]
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %16, label %10
10: ; preds = %6
%11 = getelementptr inbounds i8*, i8** %7, i64 1
%12 = ptrtoint i8* %8 to i64
%13 = trunc i64 %12 to i32
%14 = tail call i64 @puts(i32 %13)
%15 = icmp sgt i64 %14, -1
br i1 %15, label %6, label %16
16: ; preds = %6, %10
ret i32 0
}
double dayangle(int day) { return 2.0 * 3.1415926 * (double)(day - 1) / 365.0; }


x86 assembly (clang, -O0):
<dayangle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeef(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xedb(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dayangle>:
add    $0xffffffff,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
divsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @dayangle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sitofp i32 %4 to double
%6 = fmul double 0x401921FB4D12D84A, %5
%7 = fdiv double %6, 3.650000e+02
ret double %7
}

LLVM IR (-O2):
define double @dayangle(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x401921FB4D12D84A
%5 = fdiv double %4, 3.650000e+02
ret double %5
}
void sti() { __asm volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @sti() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int funcLenDbl(const double *pdD) {
  int iDigits = 0;
  double dD = *pdD;
  while (dD >= 1) {
    iDigits++;
    dD /= 10;
  }
  return iDigits;
}


x86 assembly (clang, -O0):
<funcLenDbl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xed7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1157 <funcLenDbl+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    111c <funcLenDbl+0x1c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcLenDbl>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd 0xef2(%rip),%xmm0
jb     113d <funcLenDbl+0x3d>
xor    %eax,%eax
movsd  0xeee(%rip),%xmm1
movsd  0xede(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%eax
divsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jae    1130 <funcLenDbl+0x30>
ret

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

LLVM IR (-O2):
define i32 @funcLenDbl(double* nocapture %0) {
%2 = load double, double* %0
%3 = fcmp ult double %2, 1.000000e+00
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi double [ %8, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = fdiv double %5, 1.000000e+01
%9 = fcmp ult double %8, 1.000000e+00
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %11
}
void ufshpb_reset(struct ufs_hba *hba) {}


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

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

LLVM IR (-O0):
%struct.ufs_hba = type opaque
define void @ufshpb_reset(%struct.ufs_hba* %0) {
%2 = alloca %struct.ufs_hba*
store %struct.ufs_hba* %0, %struct.ufs_hba** %2
ret void
}

LLVM IR (-O2):
%struct.ufs_hba = type opaque
define void @ufshpb_reset(%struct.ufs_hba* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ searchn(int);
void searchnext() { searchn(1); }


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

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

LLVM IR (-O0):
define void @searchnext() {
%1 = call i32 @searchn(i32 1)
ret void
}

LLVM IR (-O2):
define void @searchnext() {
%1 = tail call i32 @searchn(i32 1)
ret void
}
void PKCS7_SIGN_ENVELOPE_free(void) {}


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

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

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

LLVM IR (-O2):
define void @PKCS7_SIGN_ENVELOPE_free() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ be16toh(int /*<<< orphan*/);
uint16_t unaligned_read_be16(const void *_u) {
  const struct __attribute__((packed, may_alias)) { uint16_t x; } *u = _u;
  return be16toh(u->x);
}


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

x86 assembly (clang, -O2):
<unaligned_read_be16>:
mov    (%rdi),%edi
jmp    1030 <be16toh@plt>

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @unaligned_read_be16(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.anon*
store %struct.anon* %5, %struct.anon** %3
%6 = load %struct.anon*, %struct.anon** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @be16toh(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @unaligned_read_be16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @be16toh(i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ LittleEndianReadU16(int /*<<< orphan*/ const *);
int16_t LittleEndianReadS16(const uint8_t *bytes) {
  union {
    int16_t s16;
    uint16_t u16;
  } u;
  u.u16 = LittleEndianReadU16(bytes);
  return u.s16;
}


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

x86 assembly (clang, -O2):
<LittleEndianReadS16>:
jmp    1030 <LittleEndianReadU16@plt>

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @LittleEndianReadS16(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @LittleEndianReadU16(i32* %4)
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to i32*
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @LittleEndianReadS16(i32* %0) {
%2 = tail call i32 @LittleEndianReadU16(i32* %0)
ret i32 %2
}
void VMR3AtErrorRegister(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3AtErrorRegister() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TimerDisable(int, int);
void wave_cap32_stop(void) { TimerDisable(0x40030000, 0x000000ff); }


x86 assembly (clang, -O0):
<wave_cap32_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40030000,%edi
mov    $0xff,%esi
call   1030 <TimerDisable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_cap32_stop>:
mov    $0x40030000,%edi
mov    $0xff,%esi
jmp    1030 <TimerDisable@plt>

LLVM IR (-O0):
define void @wave_cap32_stop() {
%1 = call i32 @TimerDisable(i32 1073938432, i32 255)
ret void
}

LLVM IR (-O2):
define void @wave_cap32_stop() {
%1 = tail call i32 @TimerDisable(i32 1073938432, i32 255)
ret void
}
int mm_cache_destroy(struct mmcache *mmz) {
error_ret:
  return -1;
}


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

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

LLVM IR (-O0):
%struct.mmcache = type opaque
define i32 @mm_cache_destroy(%struct.mmcache* %0) {
%2 = alloca %struct.mmcache*
store %struct.mmcache* %0, %struct.mmcache** %2
br label %3
3: ; preds = %1
ret i32 -1
}

LLVM IR (-O2):
%struct.mmcache = type opaque
define i32 @mm_cache_destroy(%struct.mmcache* nocapture readnone %0) {
ret i32 -1
}
int is_bigendian(void) {
  union {
    long l;
    char c[sizeof(long)];
  } u;
  u.l = 1;
  return (u.c[sizeof(long) - 1] == 1);
}


x86 assembly (clang, -O0):
<is_bigendian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i64 }
define i32 @is_bigendian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i64*
store i64 1, i64* %2
%3 = bitcast %union.anon* %1 to [8 x i8]*
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 7
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_bigendian() {
ret i32 0
}
_Bool isActive(const int value) { return value == 0; }


x86 assembly (clang, -O0):
<isActive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isActive>:
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define zeroext i1 @isActive(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @isActive(i32 %0) {
%2 = icmp eq i32 %0, 0
ret i1 %2
}
int compare_ints(const void *pa, const void *pb,
                 void *param __attribute__((__unused__))) {
  const int *a = pa;
  const int *b = pb;
  if (*a < *b)
    return -1;
  else if (*a > *b)
    return +1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    -0x30(%rbp),%rcx
cmp    (%rcx),%eax
jge    113e <compare_ints+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <compare_ints+0x63>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    -0x30(%rbp),%rcx
cmp    (%rcx),%eax
jle    115c <compare_ints+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <compare_ints+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ints>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_ints(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp slt i32 %6, %7
%9 = icmp sgt i32 %6, %7
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 -1, i32 %10
ret i32 %11
}
/* Variables and functions */
int strncmp(char const *, char const *, int);
int fts3StrCompare(const void *pKey1, int n1, const void *pKey2, int n2) {
  if (n1 != n2)
    return 1;
  return strncmp((const char *)pKey1, (const char *)pKey2, n1);
}


x86 assembly (clang, -O0):
<fts3StrCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     113e <fts3StrCompare+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1151 <fts3StrCompare+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts3StrCompare>:
cmp    %ecx,%esi
jne    1120 <fts3StrCompare+0x10>
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <strncmp@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @fts3StrCompare(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @strncmp(i8* %0, i8* %2, i32 %1)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ 1, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ monthlyClimate2(int, double *, double *, char **, int, int,
                                   int);
void monthlyClimate2_R(int *nSites, double latitudes[], double longitudes[],
                       char *siteDirs[], int *yearLow, int *yearHigh,
                       int *type) {
  monthlyClimate2(*nSites, latitudes, longitudes, siteDirs, *yearLow, *yearHigh,
                  *type);
}


x86 assembly (clang, -O0):
<monthlyClimate2_R>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%rax
mov    (%rax),%r9d
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1030 <monthlyClimate2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monthlyClimate2_R>:
push   %rax
mov    0x10(%rsp),%rax
mov    (%rdi),%edi
mov    (%r8),%r8d
mov    (%r9),%r9d
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1030 <monthlyClimate2@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @monthlyClimate2_R(i32* nocapture %0, double* %1, double* %2, i8** %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture %6) {
%8 = load i32, i32* %0
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = tail call i32 @monthlyClimate2(i32 %8, double* %1, double* %2, i8** %3, i32 %9, i32 %10, i32 %11)
ret void
}
void diff_abs(float *a, float *b) {
  float tmpa = *a;
  *a = *a - *b;
  *b = *b - tmpa;
}


x86 assembly (clang, -O0):
<diff_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
subss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_abs>:
movss  (%rdi),%xmm0
movaps %xmm0,%xmm1
subss  (%rsi),%xmm1
movss  %xmm1,(%rdi)
movss  (%rsi),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @diff_abs(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float, float* %6
store float %7, float* %5
%8 = load float*, float** %3
%9 = load float, float* %8
%10 = load float*, float** %4
%11 = load float, float* %10
%12 = fsub float %9, %11
%13 = load float*, float** %3
store float %12, float* %13
%14 = load float*, float** %4
%15 = load float, float* %14
%16 = load float, float* %5
%17 = fsub float %15, %16
%18 = load float*, float** %4
store float %17, float* %18
ret void
}

LLVM IR (-O2):
define void @diff_abs(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fsub float %3, %4
store float %5, float* %0
%6 = load float, float* %1
%7 = fsub float %6, %3
store float %7, float* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BlinkC__Leds__led0Toggle();
void BlinkC__Timer0__fired(void) {
  ;
  BlinkC__Leds__led0Toggle();
}


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

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

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

LLVM IR (-O2):
define void @BlinkC__Timer0__fired() {
%1 = tail call i32 (...) @BlinkC__Leds__led0Toggle()
ret void
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ die(char *);
scalar_t__ lseek(int, scalar_t__, int /*<<< orphan*/);
void myseek(int fd, off_t pos) {
  off_t ret = lseek(fd, pos, SEEK_SET);
  if (ret != pos) {
    die("Cannot seek! \n");
  }
}


x86 assembly (clang, -O0):
<myseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1162 <myseek+0x42>
lea    0xea3(%rip),%rdi
call   1040 <die@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myseek>:
push   %rbx
mov    %rsi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
cmp    %rbx,%rax
jne    1139 <myseek+0x19>
pop    %rbx
ret
lea    0xec0(%rip),%rdi
pop    %rbx
jmp    1040 <die@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [15 x i8] c"Cannot seek! \0A\00"
define void @myseek(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = load i64, i64* %4
%8 = load i32, i32* @SEEK_SET
%9 = call i64 @lseek(i32 %6, i64 %7, i32 %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = load i64, i64* %4
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [15 x i8] c"Cannot seek! \0A\00"
define void @myseek(i32 %0, i64 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i64 @lseek(i32 %0, i64 %1, i32 %3)
%5 = icmp eq i64 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("This program was not built with Unicall available\n");
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"This program was not built with Unicall available\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [50 x i8] c"This program was not built with Unicall available\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double my_abs(double x) { return (x < 0) ? -x : x; }


x86 assembly (clang, -O0):
<my_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <my_abs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <my_abs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @my_abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int cairo_code_draw_casGLabel_get_width() { return 7; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casGLabel_get_width() {
ret i32 7
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casGLabel_get_width() {
ret i32 7
}
/* Variables and functions */
scalar_t__ next_lex_perm(int *, int);
void perm1(int *x, int n, int callback(int *, int)) {
  do {
    if (callback)
      callback(x, n);
  } while (next_lex_perm(x, n));
}


x86 assembly (clang, -O0):
<perm1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     113b <perm1+0x2b>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   *%rax
jmp    1140 <perm1+0x30>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <next_lex_perm@plt>
cmp    $0x0,%rax
jne    1123 <perm1+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perm1>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
jmp    112f <perm1+0x1f>
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <next_lex_perm@plt>
test   %rax,%rax
je     113e <perm1+0x2e>
test   %r14,%r14
je     1120 <perm1+0x10>
mov    %rbx,%rdi
mov    %ebp,%esi
call   *%r14
jmp    1120 <perm1+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @perm1(i32* %0, i32 %1, i32 (i32*, i32)* %2) {
%4 = icmp eq i32 (i32*, i32)* %2, null
br label %5
5: ; preds = %8, %3
br i1 %4, label %8, label %6
6: ; preds = %5
%7 = tail call i32 %2(i32* %0, i32 %1)
br label %8
8: ; preds = %5, %6
%9 = tail call i64 @next_lex_perm(i32* %0, i32 %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %8
ret void
}
/* Variables and functions */
int filesender_main(int, char **);
int main(int argc, char *argv[]) { return filesender_main(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @filesender_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *);
void *smalloc(size_t size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr == NULL) {
    printf("Error: Cannot allocate memory\n");
    exit(EXIT_FAILURE);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <smalloc+0x3e>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <smalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error: Cannot allocate memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @smalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [30 x i8] c"Error: Cannot allocate memory\00"
define noalias i8* @smalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
void string_free(void *a) {}


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

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

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

LLVM IR (-O2):
define void @string_free(i8* nocapture %0) {
ret void
}
void init_fm_pawn(int fm[][2]) {
  int i;
  for (i = 0; i < 5; i++) {
    fm[i][0] = -1;
    fm[i][1] = -1;
  }
}


x86 assembly (clang, -O0):
<init_fm_pawn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1146 <init_fm_pawn+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,0x4(%rax,%rcx,8)
ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_fm_pawn+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_fm_pawn>:
pcmpeqd %xmm0,%xmm0
movdqu %xmm0,0x10(%rdi)
movdqu %xmm0,(%rdi)
movq   $0xffffffffffffffff,0x20(%rdi)
ff
ret

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

LLVM IR (-O2):
define void @init_fm_pawn([2 x i32]* nocapture writeonly %0) {
%2 = bitcast [2 x i32]* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vt100_EscSeq(int, unsigned char *, long long);
void vt100_SGR(int n) { vt100_EscSeq(n, (unsigned char *)"m", (long long)2); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x2,%edx
call   1030 <vt100_EscSeq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <vt100_EscSeq@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"m\00"
define void @vt100_SGR(i32 %0) {
%2 = tail call i32 @vt100_EscSeq(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 5;
  int b = 6;
  a += b;
  printf("%d", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int c;
  printf("\tCharacter  Code\n"
         "\t===============\n");
  for (c = 32; c < 127; c++)
    printf("\t  %c     %4d\n", c, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x20,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jge    1160 <main+0x50>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
mov    $0x20,%ebx
lea    0xec4(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x7f,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\09Character Code\0A\09===============\0A\00"
@.str.1 = [15 x i8] c"\09 %c %4d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 32, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 127
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"\09 %c %4d\0A\00"
@str = [34 x i8] c"\09Character Code\0A\09===============\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 32, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 127
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 0
}
int compare(const void *arg1, const void *arg2) {
  double dVal1 = *(double *)arg1;
  double dVal2 = *(double *)arg2;
  if (dVal1 == dVal2)
    return (0);
  if (dVal1 > dVal2)
    return (1);
  return (-1);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1148 <compare+0x48>
jp     1148 <compare+0x48>
movl   $0x0,-0x4(%rbp)
jmp    116b <compare+0x6b>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1164 <compare+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <compare+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
xor    %ecx,%ecx
ucomisd (%rsi),%xmm0
seta   %cl
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp oeq double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 0, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp ogt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 -1, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp oeq double %4, %6
%8 = fcmp ogt double %4, %6
%9 = select i1 %8, i32 1, i32 -1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
int voltPackageProcess(unsigned char *inbuf, unsigned char *voltCPU,
                       unsigned char *voltMotor) {
  int i = 0;
  *voltCPU = *(inbuf + i++);
  *voltMotor = *(inbuf + i++);
  return (i);
}


x86 assembly (clang, -O0):
<voltPackageProcess>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<voltPackageProcess>:
mov    (%rdi),%al
mov    %al,(%rsi)
mov    0x1(%rdi),%al
mov    %al,(%rdx)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @voltPackageProcess(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 0, i32* %7
%8 = load i8*, i8** %4
%9 = load i32, i32* %7
%10 = add nsw i32 %9, 1
store i32 %10, i32* %7
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = load i8*, i8** %5
store i8 %13, i8* %14
%15 = load i8*, i8** %4
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
store i32 %17, i32* %7
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
%20 = load i8, i8* %19
%21 = load i8*, i8** %6
store i8 %20, i8* %21
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @voltPackageProcess(i8* nocapture %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = load i8, i8* %0
store i8 %4, i8* %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
store i8 %6, i8* %2
ret i32 2
}
int install_startup(const char *self) { return (~0); }


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

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

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

LLVM IR (-O2):
define i32 @install_startup(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int leeNumero() {
  int control = -1;
  while (control < 0) {
    scanf("%d", &control);
    if (control < 0)
      printf("Número negativo, vuelva a introducirlo:");
  }
  return (control);
}


x86 assembly (clang, -O0):
<leeNumero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1164 <leeNumero+0x44>
lea    0xec0(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
jge    115f <leeNumero+0x3f>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <leeNumero+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leeNumero>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xec8(%rip),%r14
lea    0xc(%rsp),%rbx
lea    0xebf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jns    1173 <leeNumero+0x53>
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
js     1150 <leeNumero+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [41 x i8] c"N\C3\BAmero negativo, vuelva a introducirlo:\00"
define i32 @leeNumero() {
%1 = alloca i32
store i32 -1, i32* %1
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %5
br label %2
12: ; preds = %2
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [41 x i8] c"N\C3\BAmero negativo, vuelva a introducirlo:\00"
define i32 @leeNumero() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
br label %3
3: ; preds = %0, %7
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 0
br i1 %10, label %3, label %11
11: ; preds = %3, %7
%12 = phi i32 [ %9, %7 ], [ %5, %3 ]
ret i32 %12
}