xunge/DecIR huggingface dataset:
char __attribute__((regparm(1)))
invertcase_transform(unsigned int c, void *data) {
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';
  else if (c >= 'A' && c <= 'Z')
    return c - 'A' + 'a';
  else
    return c;
}


x86 assembly (clang, -O0):
<invertcase_transform>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x61,-0x8(%rbp)
jb     1130 <invertcase_transform+0x30>
cmpl   $0x7a,-0x8(%rbp)
ja     1130 <invertcase_transform+0x30>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    115b <invertcase_transform+0x5b>
cmpl   $0x41,-0x8(%rbp)
jb     1155 <invertcase_transform+0x55>
cmpl   $0x5a,-0x8(%rbp)
ja     1155 <invertcase_transform+0x55>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    115b <invertcase_transform+0x5b>
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invertcase_transform>:
mov    %edi,%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%ecx
ja     110e <invertcase_transform+0xe>
add    $0xffffffe0,%eax
ret
lea    -0x41(%rax),%ecx
lea    0x20(%rax),%edx
cmp    $0x1a,%ecx
cmovae %eax,%edx
mov    %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @invertcase_transform(i32 %0, i8* %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = icmp uge i32 %6, 97
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp ule i32 %9, 122
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %4
%13 = sub i32 %12, 97
%14 = add i32 %13, 65
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
br label %30
16: ; preds = %8, %2
%17 = load i32, i32* %4
%18 = icmp uge i32 %17, 65
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load i32, i32* %4
%21 = icmp ule i32 %20, 90
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i32, i32* %4
%24 = sub i32 %23, 65
%25 = add i32 %24, 97
%26 = trunc i32 %25 to i8
store i8 %26, i8* %3
br label %30
27: ; preds = %19, %16
%28 = load i32, i32* %4
%29 = trunc i32 %28 to i8
store i8 %29, i8* %3
br label %30
30: ; preds = %27, %22, %11
%31 = load i8, i8* %3
ret i8 %31
}

LLVM IR (-O2):
define signext i8 @invertcase_transform(i32 %0, i8* nocapture readnone %1) {
%3 = add i32 %0, -97
%4 = icmp ult i32 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = add nsw i32 %0, -32
br label %12
7: ; preds = %2
%8 = add i32 %0, -65
%9 = icmp ult i32 %8, 26
%10 = add i32 %0, 32
%11 = select i1 %9, i32 %10, i32 %0
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
%14 = trunc i32 %13 to i8
ret i8 %14
}
int adjust(int val, int limit) {
  while (val < 0)
    val += limit;
  while (val >= limit)
    val -= limit;
  return val;
}


x86 assembly (clang, -O0):
<adjust>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1122 <adjust+0x22>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <adjust+0xa>
jmp    1127 <adjust+0x27>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1143 <adjust+0x43>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <adjust+0x27>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust>:
mov    %edi,%eax
mov    %esi,%ecx
neg    %ecx
cs nopw 0x0(%rax,%rax,1)
add    %esi,%eax
mov    %ecx,%edx
add    %eax,%edx
js     1110 <adjust+0x10>
nopl   0x0(%rax,%rax,1)
sub    %esi,%eax
cmp    %esi,%eax
jge    1120 <adjust+0x20>
ret

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

LLVM IR (-O2):
define i32 @adjust(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = icmp slt i32 %4, 0
%6 = add nsw i32 %4, %1
br i1 %5, label %3, label %7
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ %4, %3 ]
%9 = icmp slt i32 %8, %1
%10 = sub nsw i32 %8, %1
br i1 %9, label %11, label %7
11: ; preds = %7
ret i32 %8
}
int functionB() { return 7; }


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

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

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

LLVM IR (-O2):
define i32 @functionB() {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x2f() {
  Assert_real((isbdigit(47) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              240, ("isbdigit should be 0 for /"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x2f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2f,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xf0,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x2f>:
push   %rax
mov    $0x2f,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xf0,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for /\00"
define void @t_isbdigit_0x2f() {
%1 = call i64 @isbdigit(i32 47)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 240, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for /\00"
define void @t_isbdigit_0x2f() {
%1 = tail call i64 @isbdigit(i32 47)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 240, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int gzreplace(char *, char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
              char *);
int gzappend(char *input_file, char *output_file, char *member_file) {
  return gzreplace(input_file, output_file, NULL, NULL, member_file);
}


x86 assembly (clang, -O0):
<gzappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <gzreplace@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gzappend>:
mov    %rdx,%r8
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <gzreplace@plt>

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

LLVM IR (-O2):
define i32 @gzappend(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @gzreplace(i8* %0, i8* %1, i32* null, i32* null, i8* %2)
ret i32 %4
}
void foo_2_2_1_2_1_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_1_2_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void restaura_tela(void) { printf("\033[0m\033[2J\033[H"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[0m\1B[2J\1B[H\00"
define void @restaura_tela() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[0m\1B[2J\1B[H\00"
define void @restaura_tela() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ doubletimeval(double, struct timeval *);
double mean(int /*<<< orphan*/, int);
int /*<<< orphan*/ timevaldouble(struct timeval *);
void avgtime(struct timeval *TotalTime, int NumTimes, struct timeval *AvgTime) {
  double meantime;
  meantime = mean(timevaldouble(TotalTime), NumTimes);
  doubletimeval(meantime, AvgTime);
}


x86 assembly (clang, -O0):
<avgtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <timevaldouble@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1050 <mean@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
call   1040 <doubletimeval@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avgtime>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1030 <timevaldouble@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1050 <mean@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <doubletimeval@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @avgtime(%struct.timeval* %0, i32 %1, %struct.timeval* %2) {
%4 = alloca %struct.timeval*
%5 = alloca i32
%6 = alloca %struct.timeval*
%7 = alloca double
store %struct.timeval* %0, %struct.timeval** %4
store i32 %1, i32* %5
store %struct.timeval* %2, %struct.timeval** %6
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = call i32 @timevaldouble(%struct.timeval* %8)
%10 = load i32, i32* %5
%11 = call double @mean(i32 %9, i32 %10)
store double %11, double* %7
%12 = load double, double* %7
%13 = load %struct.timeval*, %struct.timeval** %6
%14 = call i32 @doubletimeval(double %12, %struct.timeval* %13)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @avgtime(%struct.timeval* %0, i32 %1, %struct.timeval* %2) {
%4 = tail call i32 @timevaldouble(%struct.timeval* %0)
%5 = tail call double @mean(i32 %4, i32 %1)
%6 = tail call i32 @doubletimeval(double %5, %struct.timeval* %2)
ret void
}
/* Type definitions */
typedef size_t uint32_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          size_t);
int __int8_t_encode_array(void *_buf, uint32_t offset, uint32_t maxlen,
                          const int8_t *p, uint32_t elements) {
  if (maxlen < elements)
    return -1;
  int8_t *buf = (int8_t *)_buf;
  memcpy(&buf[offset], p, elements);
  return elements;
}


x86 assembly (clang, -O0):
<__int8_t_encode_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    1146 <__int8_t_encode_array+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <__int8_t_encode_array+0x61>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int8_t_encode_array>:
mov    $0xffffffff,%eax
cmp    %r8,%rdx
jb     1130 <__int8_t_encode_array+0x20>
push   %rbx
mov    %r8,%rbx
lea    (%rdi,%rsi,4),%rdi
mov    %rcx,%rsi
mov    %r8,%rdx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @__int8_t_encode_array(i8* %0, i64 %1, i64 %2, i32* %3, i64 %4) {
%6 = icmp ult i64 %2, %4
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = bitcast i8* %0 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 %1
%10 = tail call i32 @memcpy(i32* %9, i32* %3, i64 %4)
%11 = trunc i64 %4 to i32
br label %12
12: ; preds = %5, %7
%13 = phi i32 [ %11, %7 ], [ -1, %5 ]
ret i32 %13
}
int test_imm_DDint16_mem(short *val) {
  return ((*val) & (0xDD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DDint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 221
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void prof_stop(int pr) {}


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

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

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

LLVM IR (-O2):
define void @prof_stop(i32 %0) {
ret void
}
int BlockTotalBytes(int bHasPts, int bHasDts, int nDataSize) {
  return 14 + 6 + 3 + (bHasPts ? 5 : 0) + (bHasDts ? 5 : 0) + nDataSize;
}


x86 assembly (clang, -O0):
<BlockTotalBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x17,%eax
mov    -0x8(%rbp),%esi
xor    %ecx,%ecx
mov    $0x5,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BlockTotalBytes>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
lea    (%rax,%rax,4),%eax
add    %edx,%eax
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
lea    (%rcx,%rcx,4),%ecx
add    %ecx,%eax
add    $0x17,%eax
ret

LLVM IR (-O0):
define i32 @BlockTotalBytes(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 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 5, i32 0
%11 = add nsw i32 23, %10
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 5, i32 0
%16 = add nsw i32 %11, %15
%17 = load i32, i32* %6
%18 = add nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @BlockTotalBytes(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 23, i32 28
%6 = icmp eq i32 %1, 0
%7 = select i1 %6, i32 0, i32 5
%8 = add i32 %5, %2
%9 = add i32 %8, %7
ret i32 %9
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int64_t timespec_to_nsec(const struct timespec *a) {
  return (int64_t)a->tv_sec * 1000000000 + a->tv_nsec;
}


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

x86 assembly (clang, -O2):
<timespec_to_nsec>:
imul   $0x3b9aca00,0x8(%rdi),%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i32 @timespec_to_nsec(%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 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000000
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i32 @timespec_to_nsec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = mul nsw i32 %4, 1000000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int SwapLong(long);
int SwapInt(int data) { return SwapLong((long)data); }


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

x86 assembly (clang, -O2):
<SwapInt>:
movslq %edi,%rdi
jmp    1030 <SwapLong@plt>

LLVM IR (-O0):
define i32 @SwapInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = call i32 @SwapLong(i64 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @SwapInt(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i32 @SwapLong(i64 %2)
ret i32 %3
}
unsigned long stack4_new(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @stack4_new() {
ret i64 0
}

LLVM IR (-O2):
define i64 @stack4_new() {
ret i64 0
}
/* Variables and functions */
char *strtriml(int /*<<< orphan*/);
int /*<<< orphan*/ strtrimr(char *);
char *strtrim(char *pstr) { return strtriml(strtrimr(pstr)); }


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

x86 assembly (clang, -O2):
<strtrim>:
push   %rax
call   1040 <strtrimr@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <strtriml@plt>

LLVM IR (-O0):
define i8* @strtrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strtrimr(i8* %3)
%5 = call i8* @strtriml(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @strtrim(i8* %0) {
%2 = tail call i32 @strtrimr(i8* %0)
%3 = tail call i8* @strtriml(i32 %2)
ret i8* %3
}
unsigned int dmnsn_terminal_width(void) {
  unsigned int width = 80;
  return width;
}


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

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

LLVM IR (-O0):
define i32 @dmnsn_terminal_width() {
%1 = alloca i32
store i32 80, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @dmnsn_terminal_width() {
ret i32 80
}
void I210ToAR30Row_AVX2() {}


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

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

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

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

/* Variables and functions */
uint16_t psector_Read_ImgAuthLevel(void) {
  uint16_t (*p_psector_Read_ImgAuthLevel)(void);
  p_psector_Read_ImgAuthLevel = (uint16_t(*)(void))0x03005299U;
  return p_psector_Read_ImgAuthLevel();
}


x86 assembly (clang, -O0):
<psector_Read_ImgAuthLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3005299,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psector_Read_ImgAuthLevel>:
mov    $0x3005299,%eax
jmp    *%rax

LLVM IR (-O0):
define i32 @psector_Read_ImgAuthLevel() {
%1 = alloca i32 ()*
store i32 ()* inttoptr (i64 50352793 to i32 ()*), i32 ()** %1
%2 = load i32 ()*, i32 ()** %1
%3 = call i32 %2()
ret i32 %3
}

LLVM IR (-O2):
define i32 @psector_Read_ImgAuthLevel() {
%1 = tail call i32 inttoptr (i64 50352793 to i32 ()*)()
ret i32 %1
}
void psxNULL() {}


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

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

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

LLVM IR (-O2):
define void @psxNULL() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int very_complex_function(char *password) {
  char buffer[16];
  int result;
  result = 0;
  strcpy(buffer, password);
  if (strcmp(buffer, "V3RY53cr37") == 0)
    result = 1;
  return result;
}


x86 assembly (clang, -O0):
<very_complex_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1161 <very_complex_function+0x41>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<very_complex_function>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"V3RY53cr37\00"
define i32 @very_complex_function(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i8]
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %4
br label %12
12: ; preds = %11, %1
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"V3RY53cr37\00"
define i32 @very_complex_function(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int powx(int x, int y) {
  int r = 1, b;
  while (y) {
    if (y & 1)
      r *= b;
    b *= b;
    y >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<powx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114c <powx+0x4c>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <powx+0x34>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <powx+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<powx>:
test   %esi,%esi
je     113a <powx+0x3a>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %ecx,%edx
cmove  %r8d,%edx
imul   %edx,%eax
imul   %ecx,%ecx
sar    %edi
cmp    $0x1,%esi
mov    %edi,%esi
ja     1120 <powx+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @powx(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ undef, %2 ]
%6 = phi i32 [ %11, %4 ], [ 1, %2 ]
%7 = phi i32 [ %13, %4 ], [ %1, %2 ]
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %5
%11 = mul nsw i32 %10, %6
%12 = mul nsw i32 %5, %5
%13 = ashr i32 %7, 1
%14 = icmp ult i32 %7, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
float fabsf(float);
float *vec3_abs(float *result, float *a) {
  result[0] = fabsf(a[0]);
  result[1] = fabsf(a[1]);
  result[2] = fabsf(a[2]);
  return result;
}


x86 assembly (clang, -O0):
<vec3_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movaps 0xee5(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movaps 0xec9(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movaps 0xeac(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_abs>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movaps 0xef2(%rip),%xmm1
andps  %xmm1,%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
andps  %xmm1,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
andps  %xmm1,%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define float* @vec3_abs(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = call float @llvm.fabs.f32(float %7)
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = call float @llvm.fabs.f32(float %13)
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = call float @llvm.fabs.f32(float %19)
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 2
store float %20, float* %22
%23 = load float*, float** %3
ret float* %23
}

LLVM IR (-O2):
define float* @vec3_abs(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @llvm.fabs.f32(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @llvm.fabs.f32(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @llvm.fabs.f32(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func() { printf("will exit\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"will exit\00"
define void @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t set_xtrail_1s(uint64_t u) { return (u + 1) | ~u; }


x86 assembly (clang, -O0):
<set_xtrail_1s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_xtrail_1s>:
lea    0x1(%rdi),%eax
not    %edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @set_xtrail_1s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = load i32, i32* %2
%6 = xor i32 %5, -1
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @set_xtrail_1s(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = xor i32 %0, -1
%4 = or i32 %2, %3
ret i32 %4
}
void foo(int *a) { *a = 555; }


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

x86 assembly (clang, -O2):
<foo>:
movl   $0x22b,(%rdi)
ret

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

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0) {
store i32 555, i32* %0
ret void
}
int DefMock_timerfd_create(int clockid, int flags) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @DefMock_timerfd_create(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void nf_error(const char *msg, bool isSysError) {
  if (isSysError) {
    perror(msg);
  } else {
    fprintf(stderr, "%s", msg);
  }
}


x86 assembly (clang, -O0):
<nf_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1147 <nf_error+0x27>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    1160 <nf_error+0x40>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nf_error>:
mov    %rdi,%rdx
test   %esi,%esi
jne    113c <nf_error+0x1c>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
jmp    1030 <fprintf@plt>
mov    %rdx,%rdi
jmp    1040 <perror@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @nf_error(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
br label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t entropy_source_test_rep_cutoff(uint32_t entropy_per_sample) {
  return (1 + ((20 * 65536) / entropy_per_sample));
}


x86 assembly (clang, -O0):
<entropy_source_test_rep_cutoff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x140000,%eax
cltd
idivl  -0x4(%rbp)
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<entropy_source_test_rep_cutoff>:
mov    $0x140000,%eax
xor    %edx,%edx
idiv   %edi
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @entropy_source_test_rep_cutoff(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 1310720, %3
%5 = add nsw i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @entropy_source_test_rep_cutoff(i32 %0) {
%2 = sdiv i32 1310720, %0
%3 = add nsw i32 %2, 1
ret i32 %3
}
void array2dNcFree(double **array, int dim1) {
  int i;
  for (i = 0; i < dim1; i++) {
    free(array[i]);
  }
  free(array);
}


x86 assembly (clang, -O0):
<array2dNcFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <array2dNcFree+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <array2dNcFree+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array2dNcFree>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <array2dNcFree+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <array2dNcFree+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @array2dNcFree(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
void XMatchVisualInfo() {}


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

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

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

LLVM IR (-O2):
define void @XMatchVisualInfo() {
ret void
}
int helper(int n, int from_left) {
  if (n == 1)
    return 1;
  if (from_left)
    return 2 * helper(n / 2, 0);
  else
    return 2 * helper(n / 2, 1) - 1 + n % 2;
}


x86 assembly (clang, -O0):
<helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1134 <helper+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1190 <helper+0x80>
cmpl   $0x0,-0xc(%rbp)
je     115d <helper+0x4d>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
xor    %esi,%esi
call   1030 <helper@plt>
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <helper+0x80>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <helper@plt>
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper>:
push   %rbx
mov    $0x1,%eax
cmp    $0x1,%edi
je     1135 <helper+0x25>
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
mov    %eax,%edi
sar    %edi
test   %esi,%esi
je     1137 <helper+0x27>
xor    %esi,%esi
call   1030 <helper@plt>
add    %eax,%eax
pop    %rbx
ret
and    $0xfffffffe,%eax
sub    %eax,%ebx
mov    $0x1,%esi
call   1030 <helper@plt>
lea    (%rbx,%rax,2),%eax
add    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @helper(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
%6 = sdiv i32 %0, 2
%7 = srem i32 %0, 2
br i1 %5, label %13, label %10
8: ; preds = %2, %13, %10
%9 = phi i32 [ %12, %10 ], [ %17, %13 ], [ 1, %2 ]
ret i32 %9
10: ; preds = %4
%11 = tail call i32 @helper(i32 %6, i32 0)
%12 = shl nsw i32 %11, 1
br label %8
13: ; preds = %4
%14 = tail call i32 @helper(i32 %6, i32 1)
%15 = shl nsw i32 %14, 1
%16 = add nsw i32 %7, -1
%17 = add i32 %16, %15
br label %8
}
/* Variables and functions */
scalar_t__ ceil(float);
scalar_t__ floor(float);
__attribute__((always_)) __attribute__((const)) float truncf(float x) {
  return (float)((x > 0) ? floor(x) : ceil(x));
}


x86 assembly (clang, -O0):
<truncf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1151 <truncf+0x31>
movss  -0x4(%rbp),%xmm0
call   1040 <floor@plt>
mov    %rax,-0x10(%rbp)
jmp    115f <truncf+0x3f>
movss  -0x4(%rbp),%xmm0
call   1030 <ceil@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncf>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1130 <truncf+0x10>
call   1040 <floor@plt>
jmp    1135 <truncf+0x15>
call   1030 <ceil@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @truncf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = call i64 @floor(float %6)
br label %11
8: ; preds = %1
%9 = load float, float* %2
%10 = call i64 @ceil(float %9)
br label %11
11: ; preds = %8, %5
%12 = phi i64 [ %7, %5 ], [ %10, %8 ]
%13 = sitofp i64 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @truncf(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i64 @floor(float %0)
br label %7
5: ; preds = %1
%6 = tail call i64 @ceil(float %0)
br label %7
7: ; preds = %5, %3
%8 = phi i64 [ %4, %3 ], [ %6, %5 ]
%9 = sitofp i64 %8 to float
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int reboot(int);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main() {
  if (reboot(0x01234567) == -1) {
    fprintf(stderr, "reboot failed: %s\n", strerror(errno));
    return 8;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1234567,%edi
call   1040 <reboot@plt>
cmp    $0xffffffff,%eax
jne    118a <main+0x5a>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x8,-0x4(%rbp)
jmp    1191 <main+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1234567,%edi
call   1040 <reboot@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1146 <main+0x16>
pop    %rbx
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%ebx
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe9c(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x8,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"reboot failed: %s\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @reboot(i32 19088743)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = call i8* @strerror(i32 %6)
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 8, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"reboot failed: %s\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = tail call i32 @reboot(i32 19088743)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %0, %3
%9 = phi i32 [ 8, %3 ], [ 0, %0 ]
ret i32 %9
}
int mode(int *array, int size) {
  int *count;
  int j, k;
  for (j = 0; j < size; j++) {
  }
}


x86 assembly (clang, -O0):
<mode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1131 <mode+0x31>
jmp    1123 <mode+0x23>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1112 <mode+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mode(i32* nocapture readnone %0, i32 %1) {
ret i32 undef
}
void terminate_connection(const char *nm) {}


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

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

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

LLVM IR (-O2):
define void @terminate_connection(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char const *strstr(char const *, char const *);
bool hasPrefix(const char *s, const char *prefix) {
  assert(s != NULL && prefix != NULL);
  return (strstr(s, prefix) == s);
}


x86 assembly (clang, -O0):
<hasPrefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <hasPrefix+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasPrefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @hasPrefix(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i8* @strstr(i8* %14, i8* %15)
%17 = load i8*, i8** %3
%18 = icmp eq i8* %16, %17
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @hasPrefix(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%9 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %8)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}