xunge/DecIR huggingface dataset:
void chomp_newline(char *s) {
  while (*s && *s != '\n' && *s != '\r') {
    s++;
  }
  *s = 0;
}


x86 assembly (clang, -O0):
<chomp_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1142 <chomp_newline+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1142 <chomp_newline+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <chomp_newline+0x52>
jmp    1163 <chomp_newline+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <chomp_newline+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp_newline>:
mov    $0x2401,%eax
jmp    1114 <chomp_newline+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0xd,%rcx
ja     1110 <chomp_newline+0x10>
bt     %rcx,%rax
jae    1110 <chomp_newline+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @chomp_newline(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
i8 13, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
store i8 0, i8* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash_bucket(const char *str) {
  uint32_t n = 0;
  while (*str)
    n += (uint32_t)*str++;
  return n % 1031;
}


x86 assembly (clang, -O0):
<hash_bucket>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1139 <hash_bucket+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_bucket+0xf>
mov    -0xc(%rbp),%eax
mov    $0x407,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_bucket>:
mov    (%rdi),%al
test   %al,%al
je     1140 <hash_bucket+0x40>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_bucket+0x10>
movslq %ecx,%rax
imul   $0x7f218557,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x29,%rcx
add    %edx,%ecx
imul   $0x407,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_bucket(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = add nsw i32 %6, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = srem i32 %10, 1031
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 0, %1 ], [ %14, %13 ]
ret i32 %16
}
int test_imm_36int64_lowword_mem(long long *val) {
  return ((*val) & (0x36 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_36int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 54
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_36int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 54
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int access(const char *pathname, int mode) {
  ;
  return 0;
}


x86 assembly (clang, -O0):
<access>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @access(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
double mp_bswap_double(double);
char *mp_store_double(char *data, double val) {
  *(double *)(data) = mp_bswap_double(val);
  return data + sizeof(double);
}


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

x86 assembly (clang, -O2):
<mp_store_double>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mp_bswap_double@plt>
movsd  %xmm0,(%rbx)
add    $0x8,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mp_store_double(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call double @mp_bswap_double(double %5)
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
store double %6, double* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 8
ret i8* %10
}

LLVM IR (-O2):
define i8* @mp_store_double(i8* writeonly %0, double %1) {
%3 = tail call double @mp_bswap_double(double %1)
%4 = bitcast i8* %0 to double*
store double %3, double* %4
%5 = getelementptr inbounds i8, i8* %0, i64 8
ret i8* %5
}
void gpmi_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @gpmi_iomux_config() {
ret void
}
/* Variables and functions */
scalar_t__ expm1(double);
double log1p(scalar_t__);
double logSumExp2(double a, double b) {
  return (a > b) ? (a + log1p((expm1((b - a)) + 1)))
                 : (b + log1p((expm1((a - b)) + 1)));
}


x86 assembly (clang, -O0):
<logSumExp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    117d <logSumExp2+0x5d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <expm1@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11b3 <logSumExp2+0x93>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <expm1@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logSumExp2>:
push   %rax
movapd %xmm0,%xmm4
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm1,%xmm3
subsd  %xmm0,%xmm3
movapd %xmm1,%xmm0
cmpltsd %xmm4,%xmm0
andpd  %xmm0,%xmm3
andnpd %xmm2,%xmm0
orpd   %xmm3,%xmm0
maxsd  %xmm1,%xmm4
movsd  %xmm4,(%rsp)
call   1030 <expm1@plt>
lea    0x1(%rax),%rdi
call   1040 <log1p@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @logSumExp2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fsub double %10, %11
%13 = call i64 @expm1(double %12)
%14 = add nsw i64 %13, 1
%15 = call double @log1p(i64 %14)
%16 = fadd double %9, %15
br label %26
17: ; preds = %2
%18 = load double, double* %4
%19 = load double, double* %3
%20 = load double, double* %4
%21 = fsub double %19, %20
%22 = call i64 @expm1(double %21)
%23 = add nsw i64 %22, 1
%24 = call double @log1p(i64 %23)
%25 = fadd double %18, %24
br label %26
26: ; preds = %17, %8
%27 = phi double [ %16, %8 ], [ %25, %17 ]
ret double %27
}

LLVM IR (-O2):
define double @logSumExp2(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = fsub double %0, %1
%5 = fsub double %1, %0
%6 = select i1 %3, double %5, double %4
%7 = select i1 %3, double %0, double %1
%8 = tail call i64 @expm1(double %6)
%9 = add nsw i64 %8, 1
%10 = tail call double @log1p(i64 %9)
%11 = fadd double %10, %7
ret double %11
}
int main(void) {
  static int b = 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@main.b = internal global i32 2
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ scan_passwd();
void main(int argc, char **argv) {
  scan_passwd();
  exit(0);
}


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

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

LLVM IR (-O0):
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @scan_passwd()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @scan_passwd()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double carmen_get_time() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return tv.tv_sec + 1e-6 * tv.tv_usec;
}


x86 assembly (clang, -O0):
<carmen_get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xecb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @carmen_get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %7, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @carmen_get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
/* Type definitions */
typedef char *wchar_t;

/* Variables and functions */
signed short _iodbcdm_sqlerror() { wchar_t _sqlState[6] = {L"\0"}; }


x86 assembly (clang, -O0):
<_iodbcdm_sqlerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
lea    0xed1(%rip),%rax
mov    %rax,-0x40(%rbp)
movswl -0x2(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i32] zeroinitializer
define signext i16 @_iodbcdm_sqlerror() {
%1 = alloca i16
%2 = alloca [6 x i8*]
%3 = bitcast [6 x i8*]* %2 to i8*
%4 = bitcast i8* %3 to [6 x i8*]*
%5 = getelementptr inbounds [6 x i8*], [6 x i8*]* %4, i32 0, i32 0
store i8* bitcast ([2 x i32]* @.str to i8*), i8** %5
%6 = load i16, i16* %1
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @_iodbcdm_sqlerror() {
ret i16 undef
}
int bcmp(b1, b2, length)
unsigned char *b1;
unsigned char *b2;
int length;
{
  if (length == 0)
    return 0;
  return memcmp(b1, b2, length);
}


x86 assembly (clang, -O0):
<bcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1139 <bcmp+0x29>
movl   $0x0,-0x4(%rbp)
jmp    114d <bcmp+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rdx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcmp>:
test   %edx,%edx
je     111c <bcmp+0xc>
movslq %edx,%rdx
jmp    1030 <memcmp@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @bcmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %6)
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ %7, %5 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ newstr(char *);
void insert_empty_line() { newstr("\n"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @insert_empty_line() {
%1 = call i32 @newstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @insert_empty_line() {
%1 = tail call i32 @newstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *julian_display_hhmm(double);
char *julian_get_hhmm_string(double current) {
  return julian_display_hhmm(current);
}


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

x86 assembly (clang, -O2):
<julian_get_hhmm_string>:
jmp    1030 <julian_display_hhmm@plt>

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

LLVM IR (-O2):
define i8* @julian_get_hhmm_string(double %0) {
%2 = tail call i8* @julian_display_hhmm(double %0)
ret i8* %2
}
/* Variables and functions */
int first_larger_than_neighbours(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int firstSequence[] = {1, 3, 4, 5, 1, 0, 5};
  int value = first_larger_than_neighbours(firstSequence);
  printf("%d", value);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <first_larger_than_neighbours@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <first_larger_than_neighbours@plt>
lea    0xed2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.firstSequence = [7 x i32] [i32 1, i32 3, i32 4, i32 5, i32 1, i32 0, i32 5]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [7 x i32]* %2 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%6 = call i32 @first_larger_than_neighbours(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%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):
@__const.main.firstSequence = [7 x i32] [i32 1, i32 3, i32 4, i32 5, i32 1, i32 0, i32 5]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @first_larger_than_neighbours(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Dalloc(float **, long);
void dev_alloc_n(int na, long n, float *a[]) {
  for (int i = 0; i < na; ++i)
    Dalloc(&a[i], n);
}


x86 assembly (clang, -O0):
<dev_alloc_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115c <dev_alloc_n+0x4c>
mov    -0x18(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Dalloc@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <dev_alloc_n+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_alloc_n>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1145 <dev_alloc_n+0x35>
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Dalloc@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <dev_alloc_n+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @dev_alloc_n(i32 %0, i64 %1, float** %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %12, %8 ]
%10 = getelementptr inbounds float*, float** %2, i64 %9
%11 = tail call i32 @Dalloc(float** %10, i64 %1)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %7, label %8
}
int square(x)
int x;
{ return x * x; }


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

x86 assembly (clang, -O2):
<square>:
mov    %edi,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @square(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
char *ascii_convert(char strChar) { return (int)strChar; }


x86 assembly (clang, -O0):
<ascii_convert>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_convert>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i8* @ascii_convert(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @ascii_convert(i8 signext %0) {
%2 = sext i8 %0 to i64
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void ComparatorIntClear(unsigned long ulBase, unsigned long ulComp) {
  DEBUG_ASSERT(ulBase == 0x4003C000);
  DEBUG_ASSERT(ulComp < 3);
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = 1 << ulComp;
}


x86 assembly (clang, -O0):
<ComparatorIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x4003c000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x3,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorIntClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x4003c000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x3,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ComparatorIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1073987584
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = icmp ult i64 %9, 3
%11 = zext i1 %10 to i32
%12 = call i32 @DEBUG_ASSERT(i32 %11)
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = shl i32 1, %14
%16 = sext i32 %15 to i64
%17 = load i64, i64* %3
%18 = add i64 %17, 0
%19 = inttoptr i64 %18 to i64*
store volatile i64 %16, i64* %19
ret void
}

LLVM IR (-O2):
define void @ComparatorIntClear(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1073987584
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = icmp ult i64 %1, 3
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = trunc i64 %1 to i32
%10 = shl nuw i32 1, %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %0 to i64*
store volatile i64 %11, i64* %12
ret void
}
void rop3_93_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_93_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_93_1_0>:
mov    %esi,%eax
not    %al
or     %al,%dl
mov    (%rdi),%cl
and    %cl,%dl
not    %dl
and    %sil,%cl
and    %al,%dl
or     %cl,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_93_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = trunc i32 %43 to i8
%45 = load i8*, i8** %4
store i8 %44, i8* %45
ret void
}

LLVM IR (-O2):
define void @rop3_93_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = or i8 %4, %2
%6 = load i8, i8* %0
%7 = and i8 %6, %5
%8 = xor i8 %7, -1
%9 = and i8 %6, %1
%10 = and i8 %8, %4
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int clock();
void delay2(unsigned long *d_o, unsigned long delay, unsigned long tid) {
  int start, ticks;
  start = clock();
  ticks = 0;
  while (ticks < delay)
    ticks = clock() - start;
  d_o[0] = tid;
  return;
}


x86 assembly (clang, -O0):
<delay2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movslq -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1155 <delay2+0x45>
mov    $0x0,%al
call   1030 <clock@plt>
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1135 <delay2+0x25>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <clock@plt>
test   %rbx,%rbx
je     1140 <delay2+0x30>
mov    %eax,%ebp
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <clock@plt>
sub    %ebp,%eax
cltq
cmp    %rbx,%rax
jb     1130 <delay2+0x20>
mov    %r14,(%r15)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @delay2(i64* nocapture writeonly %0, i64 %1, i64 %2) {
%4 = tail call i32 (...) @clock()
%5 = icmp eq i64 %1, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = tail call i32 (...) @clock()
%8 = sub nsw i32 %7, %4
%9 = sext i32 %8 to i64
%10 = icmp ult i64 %9, %1
br i1 %10, label %6, label %11
11: ; preds = %6, %3
store i64 %2, i64* %0
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int a = INT_MAX;
  printf("%d %d\n", a, a + 1);
  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    0x2ebb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x1(%rsi),%edx
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@INT_MAX = global i32 0
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @INT_MAX
%4 = add nsw i32 %3, 1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int calcCRC8(unsigned char *, int);
int UpdateRamCrc(unsigned char *p_RamData) {
  int res;
  res = calcCRC8(p_RamData, 16 - 1);
  p_RamData[16 - 1] = res;
  return (res);
}


x86 assembly (clang, -O0):
<UpdateRamCrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xf,%esi
call   1030 <calcCRC8@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xf(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpdateRamCrc>:
push   %rbx
mov    %rdi,%rbx
mov    $0xf,%esi
call   1030 <calcCRC8@plt>
mov    %al,0xf(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @UpdateRamCrc(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @calcCRC8(i8* %4, i32 15)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 15
store i8 %7, i8* %9
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @UpdateRamCrc(i8* %0) {
%2 = tail call i32 @calcCRC8(i8* %0, i32 15)
%3 = trunc i32 %2 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 15
store i8 %3, i8* %4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double r;
  scanf("%lf", &r);
  printf("VOLUME = %.3lf\n", 4 * 3.14159 * r * r * r / 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xec1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xea7(%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    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0xec3(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
divsd  0xeb7(%rip),%xmm1
cvttsd2si %xmm1,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"VOLUME = %.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = fmul double 0x402921F9F01B866E, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fdiv double %9, 3.000000e+00
%11 = fptosi double %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"VOLUME = %.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 0x402921F9F01B866E
%6 = fmul double %4, %5
%7 = fmul double %4, %6
%8 = fdiv double %7, 3.000000e+00
%9 = fptosi double %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
void rdp_rdp_process_general_caps(struct rdp_rdp *self, struct stream *s) {}


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

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

LLVM IR (-O0):
%struct.rdp_rdp = type opaque
%struct.stream = type opaque
define void @rdp_rdp_process_general_caps(%struct.rdp_rdp* %0, %struct.stream* %1) {
%3 = alloca %struct.rdp_rdp*
%4 = alloca %struct.stream*
store %struct.rdp_rdp* %0, %struct.rdp_rdp** %3
store %struct.stream* %1, %struct.stream** %4
ret void
}

LLVM IR (-O2):
%struct.rdp_rdp = type opaque
%struct.stream = type opaque
define void @rdp_rdp_process_general_caps(%struct.rdp_rdp* nocapture %0, %struct.stream* nocapture %1) {
ret void
}
/* Variables and functions */
void stub1(int, double);
void testClosureIDrV(void (*closure)(int, double), int a1, double a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureIDrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112d <testClosureIDrV+0x2d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureIDrV>:
test   %rdi,%rdi
je     110c <testClosureIDrV+0xc>
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureIDrV(void (i32, double)* %0, i32 %1, double %2) {
%4 = icmp eq void (i32, double)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i32 %1, double %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void err_dsh_cmd_send() {
  fprintf(stderr, "error: dsh_cmd_send function call failed\n");
}


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

x86 assembly (clang, -O2):
<err_dsh_cmd_send>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"error: dsh_cmd_send function call failed\0A\00"
define void @err_dsh_cmd_send() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"error: dsh_cmd_send function call failed\0A\00"
define void @err_dsh_cmd_send() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char const *);
void do_bail_out(const char *msg) {
  if (!msg)
    msg = "";
  printf("Bail out!%s%s\n", msg[0] ? " " : "", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<do_bail_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1142 <do_bail_out+0x22>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
lea    0xebe(%rip),%rsi
lea    0xeb8(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
mov    -0x8(%rbp),%rdx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<do_bail_out>:
push   %rax
mov    %rdi,%rdx
test   %rdi,%rdi
lea    0xee0(%rip),%rax
cmove  %rax,%rdx
cmpb   $0x0,(%rdx)
lea    0xed3(%rip),%rsi
cmove  %rax,%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [15 x i8] c"Bail out!%s%s\0A\00"
@.str.2 = [2 x i8] c" \00"
@EXIT_FAILURE = global i32 0
define void @do_bail_out(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%14 = load i8*, i8** %2
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %14)
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [15 x i8] c"Bail out!%s%s\0A\00"
@.str.2 = [2 x i8] c" \00"
@EXIT_FAILURE = global i32 0
define void @do_bail_out(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %3)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
}
void av_opt_eval_q() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_eval_q() {
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *);
void error(void) {
  switch (getchar()) {
  case '+':
  case '-':
  case '.':
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    error();
    return;
  case '\n':
    printf("Rejected by method 1\n");
    return;
  }
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
sub    $0xa,%eax
je     1195 <error+0x65>
jmp    1152 <error+0x22>
mov    -0x4(%rbp),%eax
sub    $0x2b,%eax
je     118b <error+0x5b>
jmp    1163 <error+0x33>
mov    -0x4(%rbp),%eax
add    $0xffffffd3,%eax
sub    $0x2,%eax
jb     118b <error+0x5b>
jmp    1177 <error+0x47>
mov    -0x4(%rbp),%eax
add    $0xffffffd0,%eax
sub    $0x9,%eax
ja     11a1 <error+0x71>
jmp    118b <error+0x5b>
call   1030 <error@plt>
jmp    11a1 <error+0x71>
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
lea    -0x30(%rax),%ecx
cmp    $0xa,%ecx
jb     1130 <error+0x10>
lea    -0x2d(%rax),%ecx
cmp    $0x2,%ecx
jb     1130 <error+0x10>
cmp    $0x2b,%eax
je     1130 <error+0x10>
cmp    $0xa,%eax
jne    115e <error+0x3e>
lea    0xea8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Rejected by method 1\0A\00"
define void @error() {
%1 = call i32 (...) @getchar()
switch i32 %1, label %5 [
i32 43, label %2
i32 45, label %2
i32 46, label %2
i32 48, label %2
i32 49, label %2
i32 50, label %2
i32 51, label %2
i32 52, label %2
i32 53, label %2
i32 54, label %2
i32 55, label %2
i32 56, label %2
i32 57, label %2
i32 10, label %3
]
2: ; preds = %0, %0, %0, %0, %0, %0, %0, %0, %0, %0, %0, %0, %0
br label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %2, %3, %0
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Rejected by method 1\00"
define void @error() {
br label %1
1: ; preds = %3, %0
%2 = tail call i32 (...) @getchar()
switch i32 %2, label %6 [
i32 43, label %3
i32 45, label %3
i32 46, label %3
i32 48, label %3
i32 49, label %3
i32 50, label %3
i32 51, label %3
i32 52, label %3
i32 53, label %3
i32 54, label %3
i32 55, label %3
i32 56, label %3
i32 57, label %3
i32 10, label %4
]
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
br label %1
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  int iterations;
  i = 0;
  assume(iterations > 0);
  while (i < iterations) {
    i = i + 1;
  }
  assert(i == iterations);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <main+0x41>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x27>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGE_SIZE;
int /*<<< orphan*/ _SC_PHYS_PAGES;
size_t sysconf(int /*<<< orphan*/);
size_t memory() {
  size_t p, sz;
  p = sysconf(_SC_PHYS_PAGES);
  sz = sysconf(_SC_PAGE_SIZE);
  return p * sz;
}


x86 assembly (clang, -O0):
<memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,-0x8(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,%rbx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
imul   %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_SC_PHYS_PAGES = global i32 0
@_SC_PAGE_SIZE = global i32 0
define i64 @memory() {
%1 = alloca i64
%2 = alloca i64
%3 = load i32, i32* @_SC_PHYS_PAGES
%4 = call i64 @sysconf(i32 %3)
store i64 %4, i64* %1
%5 = load i32, i32* @_SC_PAGE_SIZE
%6 = call i64 @sysconf(i32 %5)
store i64 %6, i64* %2
%7 = load i64, i64* %1
%8 = load i64, i64* %2
%9 = mul i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
@_SC_PHYS_PAGES = global i32 0
@_SC_PAGE_SIZE = global i32 0
define i64 @memory() {
%1 = load i32, i32* @_SC_PHYS_PAGES
%2 = tail call i64 @sysconf(i32 %1)
%3 = load i32, i32* @_SC_PAGE_SIZE
%4 = tail call i64 @sysconf(i32 %3)
%5 = mul i64 %4, %2
ret i64 %5
}