xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ drawStringWithColor(char *, int);
void drawString(char *s) { drawStringWithColor(s, 0xFFFFFF); }


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

x86 assembly (clang, -O2):
<drawString>:
mov    $0xffffff,%esi
jmp    1030 <drawStringWithColor@plt>

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

LLVM IR (-O2):
define void @drawString(i8* %0) {
%2 = tail call i32 @drawStringWithColor(i8* %0, i32 16777215)
ret void
}
int mul5div8(int x) {
  int mul5 = x + (x << 2);
  int mul5_mask = mul5 >> ((sizeof(int) << 3) - 1u);
  int bias = mul5_mask & 7;
  return (mul5 + bias) >> 3;
}


x86 assembly (clang, -O0):
<mul5div8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul5div8>:
lea    (%rdi,%rdi,4),%ecx
mov    %ecx,%eax
sar    $0x1f,%eax
and    $0x7,%eax
add    %ecx,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @mul5div8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = shl i32 %7, 2
%9 = add nsw i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 31
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = and i32 %12, 7
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = ashr i32 %16, 3
ret i32 %17
}

LLVM IR (-O2):
define i32 @mul5div8(i32 %0) {
%2 = mul i32 %0, 5
%3 = icmp slt i32 %2, 0
%4 = select i1 %3, i32 7, i32 0
%5 = add nsw i32 %4, %2
%6 = ashr i32 %5, 3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This file is not indented at all\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
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 = [34 x i8] c"This file is not indented at all\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"This file is not indented at all\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ sigset(int, void *);
void *arm_signal(int sig, void *action) { return (void *)sigset(sig, action); }


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

x86 assembly (clang, -O2):
<arm_signal>:
jmp    1030 <sigset@plt>

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

LLVM IR (-O2):
define i8* @arm_signal(i32 %0, i8* %1) {
%3 = tail call i64 @sigset(i32 %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
char *get_ardrone_ip() { return "192.168.1.1"; }


x86 assembly (clang, -O0):
<get_ardrone_ip>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ardrone_ip>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"192.168.1.1\00"
define i8* @get_ardrone_ip() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"192.168.1.1\00"
define i8* @get_ardrone_ip() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
void loadROM() {}


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

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

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

LLVM IR (-O2):
define void @loadROM() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void I2STxEnable(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = 0x00000001;
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<I2STxEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
movq   $0x1,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    0xc00(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0xc00(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxEnable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
movq   $0x1,0x10(%rbx)
orq    $0x1,0xc00(%rbx)
01
pop    %rbx
ret

LLVM IR (-O0):
define void @I2STxEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074085888
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 16
%9 = inttoptr i64 %8 to i64*
store volatile i64 1, i64* %9
%10 = load i64, i64* %2
%11 = add i64 %10, 3072
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = or i64 %13, 1
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @I2STxEnable(i64 %0) {
%2 = icmp eq i64 %0, 1074085888
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 16
%6 = inttoptr i64 %5 to i64*
store volatile i64 1, i64* %6
%7 = add i64 %0, 3072
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, 1
store volatile i64 %10, i64* %8
ret void
}
/* Type definitions */
typedef void uint64_t;

/* Variables and functions */
void *get_object(void *ptr) {
  uint64_t *pre = ptr;
  return pre + 1;
}


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

x86 assembly (clang, -O2):
<get_object>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @get_object(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr i8, i8* %5, i64 1
ret i8* %6
}

LLVM IR (-O2):
define i8* @get_object(i8* readnone %0) {
%2 = getelementptr i8, i8* %0, i64 1
ret i8* %2
}
int hash(const int key, const int M) {
  long hashCode = 0;
  int tkey = key;
  while (tkey != 0) {
    hashCode += (tkey % 10) * 26;
    tkey /= 10;
  }
  return (int)(hashCode % M);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114d <hash+0x4d>
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
imul   $0x1a,%edx,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
jmp    1118 <hash+0x18>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
cqto
idiv   %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
xor    %eax,%eax
test   %edi,%edi
je     114a <hash+0x4a>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%r8
imul   $0x66666667,%r8,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %r8d,%ecx
sub    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
movslq %edx,%rcx
add    %rcx,%rax
add    $0x9,%r8d
cmp    $0x12,%r8d
ja     1110 <hash+0x10>
movslq %esi,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1162 <hash+0x62>
cqto
idiv   %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %0, %2 ]
%6 = phi i64 [ %10, %4 ], [ 0, %2 ]
%7 = srem i32 %5, 10
%8 = mul nsw i32 %7, 26
%9 = sext i32 %8 to i64
%10 = add nsw i64 %6, %9
%11 = sdiv i32 %5, 10
%12 = add i32 %5, 9
%13 = icmp ult i32 %12, 19
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i64 [ 0, %2 ], [ %10, %4 ]
%16 = sext i32 %1 to i64
%17 = srem i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}
unsigned int estDehorsMap(const int coordonnee,
                          const unsigned int longueurMax) {
  return coordonnee < 0 || coordonnee > longueurMax;
}


x86 assembly (clang, -O0):
<estDehorsMap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1125 <estDehorsMap+0x25>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<estDehorsMap>:
test   %edi,%edi
sets   %al
cmp    %esi,%edi
seta   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @estDehorsMap(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 = icmp slt i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp ugt i32 %8, %9
br label %11
11: ; preds = %7, %2
%12 = phi i1 [ true, %2 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @estDehorsMap(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = icmp ugt i32 %0, %1
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void XDoesBackingStore() {}


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

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

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

LLVM IR (-O2):
define void @XDoesBackingStore() {
ret void
}
/* Type definitions */
typedef scalar_t__ gid_t;

/* Variables and functions */
scalar_t__ atoi(char const *);
int /*<<< orphan*/ usage(char *);
gid_t parse_gid(const char *str) {
  gid_t gid;
  if (!str)
    usage("GID is not set");
  gid = atoi(str);
  if (gid <= 0)
    usage("GID is not a positive number");
  return gid;
}


x86 assembly (clang, -O0):
<parse_gid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1143 <parse_gid+0x23>
lea    0xec2(%rip),%rdi
call   1030 <usage@plt>
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1167 <parse_gid+0x47>
lea    0xead(%rip),%rdi
call   1030 <usage@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_gid>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1135 <parse_gid+0x15>
lea    0xed0(%rip),%rdi
call   1030 <usage@plt>
mov    %rbx,%rdi
call   1040 <atoi@plt>
mov    %rax,%rbx
test   %rax,%rax
jg     1151 <parse_gid+0x31>
lea    0xec3(%rip),%rdi
call   1030 <usage@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"GID is not set\00"
@.str.1 = [29 x i8] c"GID is not a positive number\00"
define i64 @parse_gid(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @usage(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i8*, i8** %2
%10 = call i64 @atoi(i8* %9)
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = icmp sle i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @usage(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
@.str = [15 x i8] c"GID is not set\00"
@.str.1 = [29 x i8] c"GID is not a positive number\00"
define i64 @parse_gid(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @usage(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i64 @atoi(i8* %0)
%7 = icmp slt i64 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @usage(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret i64 %6
}
/* Type definitions */
struct timespec {
  double tv_sec;
  double tv_nsec;
};

/* Variables and functions */
double cake_timer_ts_to_double(struct timespec *ts) {
  return ts->tv_sec + ts->tv_nsec * 1.0e-9;
}


x86 assembly (clang, -O0):
<cake_timer_ts_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xedf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cake_timer_ts_to_double>:
movsd  0x8(%rdi),%xmm0
mulsd  0xef3(%rip),%xmm0
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, double }
define double @cake_timer_ts_to_double(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load double, double* %4
%6 = load %struct.timespec*, %struct.timespec** %2
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%8 = load double, double* %7
%9 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-09, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timespec = type { double, double }
define double @cake_timer_ts_to_double(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load double, double* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%5 = load double, double* %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e-09, double %3)
ret double %6
}
int success() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @success() {
ret i32 0
}
/* Variables and functions */
char *place_commas_in_number_string(char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
char *timlib_dollar_round_string(double amount) {
  char return_string[64];
  sprintf(return_string, "%.0lf", amount);
  return place_commas_in_number_string(return_string);
}


x86 assembly (clang, -O0):
<timlib_dollar_round_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xec3(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <place_commas_in_number_string@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_dollar_round_string>:
push   %rbx
sub    $0x40,%rsp
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <place_commas_in_number_string@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.0lf\00"
define i8* @timlib_dollar_round_string(double %0) {
%2 = alloca double
%3 = alloca [64 x i8]
store double %0, double* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load double, double* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i8* @place_commas_in_number_string(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.0lf\00"
define i8* @timlib_dollar_round_string(double %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %0)
%5 = call i8* @place_commas_in_number_string(i8* %3)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perrordie(char *);
void safe_fputs(char *m, FILE *f) {
  if (fputs(m, f) < 0)
    perrordie("fputs");
}


x86 assembly (clang, -O0):
<safe_fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputs@plt>
cmp    $0x0,%rax
jge    1153 <safe_fputs+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <perrordie@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fputs>:
push   %rax
call   1030 <fputs@plt>
test   %rax,%rax
js     112d <safe_fputs+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <perrordie@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"fputs\00"
define void @safe_fputs(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 = call i64 @fputs(i8* %5, i32* %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @perrordie(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"fputs\00"
define void @safe_fputs(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fputs(i8* %0, i32* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perrordie(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void lyyfree(void *ptr) { free((char *)ptr); }


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

LLVM IR (-O0):
define void @lyyfree(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 @lyyfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int sem_init(int /*<<< orphan*/ *, int, unsigned int);
__attribute__((weak)) int __real_sem_init(sem_t *sem, int pshared,
                                          unsigned value) {
  return sem_init(sem, pshared, value);
}


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

x86 assembly (clang, -O2):
<__real_sem_init>:
jmp    1030 <sem_init@plt>

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

LLVM IR (-O2):
define weak i32 @__real_sem_init(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @sem_init(i32* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
uint64_t timeval_to_usec(const struct timeval *tv) {
  return ((int64_t)tv->tv_sec) * 1000000 + tv->tv_usec;
}


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

x86 assembly (clang, -O2):
<timeval_to_usec>:
movabs $0xf424000000000,%rax
imul   0x8(%rdi),%rax
sar    $0x20,%rax
add    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @timeval_to_usec(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = sext i32 %7 to i64
%9 = load %struct.timeval*, %struct.timeval** %2
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%11 = load i64, i64* %10
%12 = add nsw i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @timeval_to_usec(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = mul i64 %3, 4294967296000000
%5 = ashr exact i64 %4, 32
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ lf();
int /*<<< orphan*/ printI(char const *, int);
void printIN(const char *s, int i) {
  printI(s, i);
  lf();
}


x86 assembly (clang, -O0):
<printIN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <printI@plt>
mov    $0x0,%al
call   1040 <lf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIN>:
push   %rax
call   1030 <printI@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <lf@plt>

LLVM IR (-O0):
define void @printIN(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 = call i32 @printI(i8* %5, i32 %6)
%8 = call i32 (...) @lf()
ret void
}

LLVM IR (-O2):
define void @printIN(i8* %0, i32 %1) {
%3 = tail call i32 @printI(i8* %0, i32 %1)
%4 = tail call i32 (...) @lf()
ret void
}
void plot(int x, int y, unsigned char *image, int pitch) {
  image[x + y * pitch] ^= 255;
}


x86 assembly (clang, -O0):
<plot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
xor    $0xff,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<plot>:
imul   %ecx,%esi
add    %edi,%esi
movslq %esi,%rax
notb   (%rdx,%rax,1)
ret

LLVM IR (-O0):
define void @plot(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %8
%13 = mul nsw i32 %11, %12
%14 = add nsw i32 %10, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %9, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = xor i32 %18, 255
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
ret void
}

LLVM IR (-O2):
define void @plot(i32 %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = mul nsw i32 %3, %1
%6 = add nsw i32 %5, %0
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
%9 = load i8, i8* %8
%10 = xor i8 %9, -1
store i8 %10, i8* %8
ret void
}
/* Variables and functions */
int *init_rng(int, int, int, int);
int *finit_rng(int *gennum, int *total_gen, int *seed, int *length) {
  return init_rng(*gennum, *total_gen, *seed, *length);
}


x86 assembly (clang, -O0):
<finit_rng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
call   1030 <init_rng@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finit_rng>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
jmp    1030 <init_rng@plt>

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

LLVM IR (-O2):
define i32* @finit_rng(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = tail call i32* @init_rng(i32 %5, i32 %6, i32 %7, i32 %8)
ret i32* %9
}
int dummy_readpixel(int x __attribute__((unused)),
                    int y __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<dummy_readpixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dummy_readpixel(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LoiterCommandHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void LoiterCommandUpdated() { UAVObjUpdated(LoiterCommandHandle()); }


x86 assembly (clang, -O0):
<LoiterCommandUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LoiterCommandHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoiterCommandUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <LoiterCommandHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @LoiterCommandUpdated() {
%1 = call i32 (...) @LoiterCommandHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @LoiterCommandUpdated() {
%1 = tail call i32 (...) @LoiterCommandHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
int bz_config_ok(void) {
  if (sizeof(int) != 4)
    return 0;
  if (sizeof(short) != 2)
    return 0;
  if (sizeof(char) != 1)
    return 0;
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @bz_config_ok() {
ret i32 1
}

LLVM IR (-O2):
define i32 @bz_config_ok() {
ret i32 1
}
int foo(int b, int c, int d) {
  static __thread int a = 1;
  a += b;
  a -= c;
  a += d;
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0x2ea2(%rip),%rdi
call   1030 <__tls_get_addr@plt>
mov    -0x10(%rbp),%edx
mov    0x0(%rax),%ecx
add    %edx,%ecx
mov    %ecx,0x0(%rax)
mov    -0x8(%rbp),%edx
mov    0x0(%rax),%ecx
sub    %edx,%ecx
mov    %ecx,0x0(%rax)
mov    -0xc(%rbp),%edx
mov    0x0(%rax),%ecx
add    %edx,%ecx
mov    %ecx,0x0(%rax)
mov    0x0(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0x2eae(%rip),%rdi
call   1030 <__tls_get_addr@plt>
sub    %ebp,%ebx
add    %r14d,%ebx
add    0x0(%rax),%ebx
mov    %ebx,0x0(%rax)
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@foo.a = internal thread_local global i32 1
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* @foo.a
%9 = add nsw i32 %8, %7
store i32 %9, i32* @foo.a
%10 = load i32, i32* %5
%11 = load i32, i32* @foo.a
%12 = sub nsw i32 %11, %10
store i32 %12, i32* @foo.a
%13 = load i32, i32* %6
%14 = load i32, i32* @foo.a
%15 = add nsw i32 %14, %13
store i32 %15, i32* @foo.a
%16 = load i32, i32* @foo.a
ret i32 %16
}

LLVM IR (-O2):
@foo.a = internal thread_local unnamed_addr global i32 1
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @foo.a
%5 = sub i32 %0, %1
%6 = add i32 %5, %2
%7 = add i32 %6, %4
store i32 %7, i32* @foo.a
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: macfanctld [-f]\n");
  printf("  -f  run in foregound\n");
  exit(-1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"usage: macfanctld [-f]\0A\00"
@.str.1 = [24 x i8] c" -f run in foregound\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"usage: macfanctld [-f]\00"
@str.2 = [23 x i8] c" -f run in foregound\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int find_next_frame(int *physical_memory, int *num_free_frames, int num_frames,
                    int *prev_free) {
  if (*num_free_frames == 0) {
    return -1;
  }
  do {
    *prev_free = (*prev_free + 1) % num_frames;
  } while (physical_memory[*prev_free] == 1);
  return *prev_free;
}


x86 assembly (clang, -O0):
<find_next_frame>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    112c <find_next_frame+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <find_next_frame+0x62>
jmp    1131 <find_next_frame+0x31>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltd
idivl  -0x1c(%rbp)
mov    -0x28(%rbp),%rax
mov    %edx,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq (%rcx),%rcx
cmpl   $0x1,(%rax,%rcx,4)
je     1131 <find_next_frame+0x31>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_next_frame>:
cmpl   $0x0,(%rsi)
je     1127 <find_next_frame+0x27>
mov    %edx,%r8d
mov    (%rcx),%edx
nopw   0x0(%rax,%rax,1)
add    $0x1,%edx
mov    %edx,%eax
cltd
idiv   %r8d
mov    %edx,(%rcx)
movslq %edx,%rax
cmpl   $0x1,(%rdi,%rax,4)
je     1110 <find_next_frame+0x10>
mov    %edx,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @find_next_frame(i32* %0, i32* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32* %3, i32** %9
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %4
store i32 -1, i32* %5
br label %33
14: ; preds = %4
br label %15
15: ; preds = %22, %14
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1
%19 = load i32, i32* %8
%20 = srem i32 %18, %19
%21 = load i32*, i32** %9
store i32 %20, i32* %21
br label %22
22: ; preds = %15
%23 = load i32*, i32** %6
%24 = load i32*, i32** %9
%25 = load i32, i32* %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %23, i64 %26
%28 = load i32, i32* %27
%29 = icmp eq i32 %28, 1
br i1 %29, label %15, label %30
30: ; preds = %22
%31 = load i32*, i32** %9
%32 = load i32, i32* %31
store i32 %32, i32* %5
br label %33
33: ; preds = %30, %13
%34 = load i32, i32* %5
ret i32 %34
}

LLVM IR (-O2):
define i32 @find_next_frame(i32* nocapture %0, i32* nocapture %1, i32 %2, i32* nocapture %3) {
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %4
%8 = load i32, i32* %3
br label %9
9: ; preds = %7, %9
%10 = phi i32 [ %8, %7 ], [ %12, %9 ]
%11 = add nsw i32 %10, 1
%12 = srem i32 %11, %2
store i32 %12, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 1
br i1 %16, label %9, label %17
17: ; preds = %9, %4
%18 = phi i32 [ -1, %4 ], [ %12, %9 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ fatalf(char *, int);
int get_level(char *s) {
  int i = 0;
  while (s[i] == ' ')
    ++i;
  if (i > 30)
    fatalf("MAXDEP = %d not enough", 30);
  return i;
}


x86 assembly (clang, -O0):
<get_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1146 <get_level+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <get_level+0x13>
cmpl   $0x1e,-0xc(%rbp)
jle    1161 <get_level+0x51>
lea    0xea9(%rip),%rdi
mov    $0x1e,%esi
call   1030 <fatalf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_level>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
cmpb   $0x20,(%rdi)
lea    0x1(%rdi),%rdi
je     1120 <get_level+0x10>
cmp    $0x1f,%ebx
jb     1142 <get_level+0x32>
lea    0xec8(%rip),%rdi
mov    $0x1e,%esi
call   1030 <fatalf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"MAXDEP = %d not enough\00"
define i32 @get_level(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 30
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @fatalf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 30)
br label %20
20: ; preds = %18, %15
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [23 x i8] c"MAXDEP = %d not enough\00"
define i32 @get_level(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 32
%7 = add nuw i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = icmp ugt i32 %9, 30
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @fatalf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 30)
br label %13
13: ; preds = %11, %8
ret i32 %9
}
int newgap(int gap) {
  gap = (gap * 10) / 13;
  if (gap == 9 || gap == 10)
    gap = 11;
  if (gap < 1)
    gap = 1;
  return gap;
}


x86 assembly (clang, -O0):
<newgap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xa,-0x4(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
je     112a <newgap+0x2a>
cmpl   $0xa,-0x4(%rbp)
jne    1131 <newgap+0x31>
movl   $0xb,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1142 <newgap+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<newgap>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
add    $0xffffff8b,%eax
mov    $0xb,%ecx
cmp    $0x1a,%eax
jb     112b <newgap+0x2b>
lea    (%rdi,%rdi,4),%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x22,%rcx
add    %eax,%ecx
test   %ecx,%ecx
mov    $0x1,%eax
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @newgap(i32 %0) {
%2 = mul nsw i32 %0, 10
%3 = sdiv i32 %2, 13
%4 = add i32 %2, -117
%5 = icmp ult i32 %4, 26
%6 = select i1 %5, i32 11, i32 %3
%7 = icmp sgt i32 %6, 1
%8 = select i1 %7, i32 %6, i32 1
ret i32 %8
}
int aa_pro_ctr_a14(int chan, unsigned char *buf, int len) {
  hu_log(6, "hu_aap", __func__, "!!!!!!!!");
  return (-1);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x6,%edi
lea    0xed2(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xeda(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a14>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a14 = [15 x i8] c"aa_pro_ctr_a14\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a14(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a14, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a14 = [15 x i8] c"aa_pro_ctr_a14\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a14(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a14, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
scalar_t__ isDigit(char const);
int aToi(const char *str) {
  int uNumber = 0;
  while (isDigit(*str))
    uNumber = 10 * uNumber + (*str++ - '0');
  return uNumber;
}


x86 assembly (clang, -O0):
<aToi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isDigit@plt>
cmp    $0x0,%rax
je     115c <aToi+0x4c>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <aToi+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aToi>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <isDigit@plt>
test   %rax,%rax
je     1153 <aToi+0x43>
add    $0x1,%rbx
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    (%r14,%r14,4),%eax
movsbl -0x1(%rbx),%ecx
lea    (%rcx,%rax,2),%r14d
add    $0xffffffd0,%r14d
movsbl (%rbx),%edi
call   1030 <isDigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <aToi+0x20>
jmp    1156 <aToi+0x46>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @aToi(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 = load i8, i8* %5
%7 = call i64 @isDigit(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load i32, i32* %3
%11 = mul nsw i32 10, %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 48
%17 = add nsw i32 %11, %16
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @aToi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isDigit(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %13, %5 ], [ 0, %1 ]
%7 = phi i8* [ %9, %5 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 10
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = add i32 %8, -48
%13 = add i32 %12, %11
%14 = load i8, i8* %9
%15 = tail call i64 @isDigit(i8 signext %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
float _randf() { return ((float)rand()) / (RAND_MAX + 1.0); }


x86 assembly (clang, -O0):
<_randf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed4(%rip),%xmm1
mov    0x2eb5(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_randf>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xed0(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define float @_randf() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = fpext float %2 to double
%4 = load double, double* @RAND_MAX
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %3, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define float @_randf() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = fpext float %2 to double
%4 = load double, double* @RAND_MAX
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %3, %5
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ log_assert(char const *, char const *, unsigned int,
                              char const *, char *);
__attribute__((noreturn)) void log_assert_failed(const char *text,
                                                 const char *file,
                                                 unsigned int line,
                                                 const char *func) {
  log_assert(text, file, line, func,
             "Assertion '%s' failed at %s:%u, function %s(). Aborting.");
}


x86 assembly (clang, -O0):
<log_assert_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xec3(%rip),%r8
call   1030 <log_assert@plt>

x86 assembly (clang, -O2):
<log_assert_failed>:
push   %rax
lea    0xee8(%rip),%r8
call   1030 <log_assert@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"Assertion '%s' failed at %s:%u, function %s(). Aborting.\00"
define void @log_assert_failed(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @log_assert(i8* %9, i8* %10, i32 %11, i8* %12, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [57 x i8] c"Assertion '%s' failed at %s:%u, function %s(). Aborting.\00"
define void @log_assert_failed(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @log_assert(i8* %0, i8* %1, i32 %2, i8* %3, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void f2(int *x) { free(x); }


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

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

LLVM IR (-O2):
define void @f2(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}