xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  (void)argc;
  for (int i = 0;; ++i) {
    printf("argv[%d]=\"%s\"\n", i, argv[i]);
    fflush(NULL);
  }
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
xor    %ebx,%ebx
lea    0xecf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
add    $0x1,%rbx
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [15 x i8] c"argv[%d]=\22%s\22\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* %4
store i32 0, i32* %6
br label %8
8: ; preds = %17, %2
%9 = load i32, i32* %6
%10 = load i8**, i8*** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %10, i64 %12
%14 = load i8*, i8** %13
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %14)
%16 = call i32 @fflush(i32* null)
br label %17
17: ; preds = %8
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %8
}

LLVM IR (-O2):
@.str = [15 x i8] c"argv[%d]=\22%s\22\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8*, i8** %1, i64 %4
%6 = load i8*, i8** %5
%7 = trunc i64 %4 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %6)
%9 = tail call i32 @fflush(i32* null)
%10 = add nuw i64 %4, 1
br label %3
}
__attribute__((no, noclone)) void foo(int x) {
  if (x != 5)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
je     112a <foo+0x1a>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x5,%edi
jne    1116 <foo+0x6>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 5
br i1 %4, label %5, label %6
5: ; preds = %1
unreachable
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 5
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @abort()
unreachable
4: ; preds = %1
ret void
}
/* Type definitions */
typedef float *__m128;

/* Variables and functions */
void __attribute__((__always___)) _mm_store_ss(float *p, __m128 a) {
  *p = a[0];
}


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

x86 assembly (clang, -O2):
<_mm_store_ss>:
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @_mm_store_ss(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 = load float*, float** %3
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @_mm_store_ss(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
ret void
}
void c(unsigned int x) {
  if (x < 0)
    return;
  if (x >= 0)
    return;
  if (0 > x)
    return;
  if (0 <= x)
    return;
  if (1U >= 0)
    return;
  if (1U < 0)
    return;
  if (0 <= 1U)
    return;
  if (0 > 1U)
    return;
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jae    1116 <c+0x16>
jmp    114a <c+0x4a>
cmpl   $0x0,-0x4(%rbp)
jb     1125 <c+0x25>
jmp    114a <c+0x4a>
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jbe    1135 <c+0x35>
jmp    114a <c+0x4a>
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
ja     1145 <c+0x45>
jmp    114a <c+0x4a>
jmp    114a <c+0x4a>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @c(i32 %0) {
ret void
}
int isScript(char **tokens, int len) { return 0; }


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

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

LLVM IR (-O0):
define i32 @isScript(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 @isScript(i8** nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t SysCtlResetCauseGet(void) {
  return ((*((volatile unsigned long *)(0x400FE05C))));
}


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

x86 assembly (clang, -O2):
<SysCtlResetCauseGet>:
mov    0x400fe05c,%rax
40
ret

LLVM IR (-O0):
define i64 @SysCtlResetCauseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782300 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @SysCtlResetCauseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782300 to i64*)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void cc_parse_string(char *target, int len, char *source) {
  strncpy(target, source, len - 1);
  target[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<cc_parse_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_parse_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
lea    -0x1(%rbx),%rax
mov    %rdx,%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cc_parse_string(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = call i32 @strncpy(i8* %7, i8* %8, i32 %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8 0, i8* %16
ret void
}

LLVM IR (-O2):
define void @cc_parse_string(i8* %0, i32 %1, i8* %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @strncpy(i8* %0, i8* %2, i32 %4)
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret void
}
float fmaxf(float x, float y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<fmaxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <fmaxf+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <fmaxf+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaxf>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fmaxf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @fmaxf(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ getenv(char *);
int c_main(void) { return !(1 == atoi(getenv("EXPECTED_PCH"))); }


x86 assembly (clang, -O0):
<c_main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"EXPECTED_PCH\00"
define i32 @c_main() {
%1 = call i32 @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @atoi(i32 %1)
%3 = icmp eq i32 1, %2
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@.str = [13 x i8] c"EXPECTED_PCH\00"
define i32 @c_main() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @atoi(i32 %1)
%3 = icmp ne i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t retval = 0;
  while (*s != 0)
    ++s, ++retval;
  return retval;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113d <strlen+0x3d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int NSIG;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void ignoresigs() {
  register int i;
  for (i = 0; i < NSIG; i++)
    signal(i, SIG_IGN);
}


x86 assembly (clang, -O0):
<ignoresigs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
jge    1150 <ignoresigs+0x40>
mov    -0x4(%rbp),%edi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ignoresigs+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignoresigs>:
push   %r15
push   %r14
push   %rbx
mov    0x2ebc(%rip),%r14
cmpl   $0x0,(%r14)
jle    1142 <ignoresigs+0x32>
xor    %ebx,%ebx
mov    0x2ebd(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r15),%esi
mov    %ebx,%edi
call   1030 <signal@plt>
add    $0x1,%ebx
cmp    (%r14),%ebx
jl     1130 <ignoresigs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@NSIG = global i32 0
@SIG_IGN = global i32 0
define void @ignoresigs() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = load i32, i32* @NSIG
%5 = icmp slt i32 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = load i32, i32* %1
%8 = load i32, i32* @SIG_IGN
%9 = call i32 @signal(i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@NSIG = global i32 0
@SIG_IGN = global i32 0
define void @ignoresigs() {
%1 = load i32, i32* @NSIG
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 0, %0 ]
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = load i32, i32* @NSIG
%9 = icmp slt i32 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3, %0
ret void
}
void ScaleAddRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleAddRow_NEON() {
ret void
}
char *tape_type(int n) {
  if (n == 0)
    return "RANDOM";
  else if ((n & 0700000) == 0700000)
    return "INCREMENTAL";
  else
    return "FULL";
}


x86 assembly (clang, -O0):
<tape_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1121 <tape_type+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114f <tape_type+0x4f>
mov    -0xc(%rbp),%eax
and    $0x38000,%eax
cmp    $0x38000,%eax
jne    1144 <tape_type+0x44>
lea    0xecc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114f <tape_type+0x4f>
lea    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tape_type>:
mov    %edi,%eax
not    %eax
test   $0x38000,%eax
lea    0xef7(%rip),%rax
lea    0xefc(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xedc(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"RANDOM\00"
@.str.1 = [12 x i8] c"INCREMENTAL\00"
@.str.2 = [5 x i8] c"FULL\00"
define i8* @tape_type(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = and i32 %0, 229376
%4 = icmp eq i32 %3, 229376
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%6 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned long,
                         int /*<<< orphan*/);
void *ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
size_t fu_Fsize(FILE *stream) {
  size_t size;
  unsigned long pos = ftell(stream);
  rewind(stream);
  fseek(stream, 0, SEEK_END);
  size = ftell(stream);
  fseek(stream, pos, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<fu_Fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e54(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fu_Fsize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r15
mov    0x2e6b(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fu_Fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i8* @ftell(i32* %5)
%7 = ptrtoint i8* %6 to i64
store i64 %7, i64* %4
%8 = load i32*, i32** %2
%9 = call i32 @rewind(i32* %8)
%10 = load i32*, i32** %2
%11 = load i32, i32* @SEEK_END
%12 = call i32 @fseek(i32* %10, i64 0, i32 %11)
%13 = load i32*, i32** %2
%14 = call i8* @ftell(i32* %13)
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %3
%16 = load i32*, i32** %2
%17 = load i64, i64* %4
%18 = load i32, i32* @SEEK_SET
%19 = call i32 @fseek(i32* %16, i64 %17, i32 %18)
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fu_Fsize(i32* nocapture %0) {
%2 = tail call i8* @ftell(i32* %0)
%3 = ptrtoint i8* %2 to i64
%4 = tail call i32 @rewind(i32* %0)
%5 = load i32, i32* @SEEK_END
%6 = tail call i32 @fseek(i32* %0, i64 0, i32 %5)
%7 = tail call i8* @ftell(i32* %0)
%8 = ptrtoint i8* %7 to i64
%9 = load i32, i32* @SEEK_SET
%10 = tail call i32 @fseek(i32* %0, i64 %3, i32 %9)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void loop_bad() {
  char *p = malloc(1);
  *p = 1;
  while (*p < 127) {
    *p *= 3;
  }
  free(p);
  *p = 2;
}


x86 assembly (clang, -O0):
<loop_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7f,%eax
jge    115e <loop_bad+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
imul   $0x3,%ecx,%ecx
mov    %cl,(%rax)
jmp    113d <loop_bad+0x1d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movb   $0x2,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_bad>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
movb   $0x7f,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @loop_bad() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
store i8 1, i8* %3
br label %4
4: ; preds = %9, %0
%5 = load i8*, i8** %1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp slt i32 %7, 127
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = load i8*, i8** %1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = mul nsw i32 %12, 3
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
br label %4
15: ; preds = %4
%16 = load i8*, i8** %1
%17 = call i32 @free(i8* %16)
%18 = load i8*, i8** %1
store i8 2, i8* %18
ret void
}

LLVM IR (-O2):
define void @loop_bad() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
store i8 127, i8* %1
%2 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max_heapify(int *, int, int);
void build_max_heap(int *a, int size) {
  int i;
  i = size >> 1;
  while (i > 0) {
    max_heapify(a, size, i);
    i--;
  }
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    114f <build_max_heap+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <max_heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <build_max_heap+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1146 <build_max_heap+0x36>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <max_heapify@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @max_heapify(i32* %0, i32 %1, i32 %7)
%9 = add nsw i32 %7, -1
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
unsigned int bit_propagate_ones_towards_right(unsigned int n) {
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  return n;
}


x86 assembly (clang, -O0):
<bit_propagate_ones_towards_right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_propagate_ones_towards_right>:
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bit_propagate_ones_towards_right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 2
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 8
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 16
%21 = load i32, i32* %2
%22 = or i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @bit_propagate_ones_towards_right(i32 %0) {
%2 = lshr i32 %0, 1
%3 = or i32 %2, %0
%4 = lshr i32 %3, 2
%5 = or i32 %4, %3
%6 = lshr i32 %5, 4
%7 = or i32 %6, %5
%8 = lshr i32 %7, 8
%9 = or i32 %8, %7
%10 = lshr i32 %9, 16
%11 = or i32 %10, %9
ret i32 %11
}
void mod() {
  asm volatile("popq %%rbx\n\t"
               "popq %%rax\n\t"
               "idivq %%rbx\n\t"
               "pushq %%rdx\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
pop    %rbx
pop    %rax
idiv   %rbx
push   %rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
pop    %rbx
pop    %rax
idiv   %rbx
push   %rdx
ret

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

LLVM IR (-O2):
define void @mod() {
tail call void asm sideeffect "popq %rbx\0A\09popq %rax\0A\09idivq %rbx\0A\09pushq %rdx\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void _aic_write32(uintptr_t addr, uint32_t data) {
  *(volatile uint32_t *)(addr) = data;
}


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

x86 assembly (clang, -O2):
<_aic_write32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @_aic_write32(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @_aic_write32(i64 %0, i32 %1) {
%3 = inttoptr i64 %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x36() {
  Assert_real((isalpha(54) == 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_isalpha.c",
              275, ("isalpha should be 0 for 6"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x36>:
push   %rax
mov    $0x36,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x113,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for 6\00"
define void @t_isalpha_0x36() {
%1 = call i64 @isalpha(i32 54)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 275, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for 6\00"
define void @t_isalpha_0x36() {
%1 = tail call i64 @isalpha(i32 54)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 275, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p2();
int main() {
  p2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <p2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @p2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage_short(const char *argv0) {
  fprintf(stderr,
          "Usage: flash [OPTIONS] MATES_1.FASTQ MATES_2.FASTQ\n"
          "Run `%s --help | "
          "less"
          "' for more information.\n",
          argv0);
}


x86 assembly (clang, -O0):
<usage_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage_short>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [97 x i8] c"Usage: flash [OPTIONS] MATES_1.FASTQ MATES_2.FASTQ\0ARun `%s --help | less' for more information.\0A\00"
define void @usage_short(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [97 x i8] c"Usage: flash [OPTIONS] MATES_1.FASTQ MATES_2.FASTQ\0ARun `%s --help | less' for more information.\0A\00"
define void @usage_short(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct TYPE_2__ {
  int fd;
};
struct epoll_event {
  TYPE_1__ data;
  int /*<<< orphan*/ events;
};

/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_ADD;
int epoll_ctl(int, int /*<<< orphan*/, int, struct epoll_event *);
int add_watch(int epfd, int fd, uint32_t events) {
  struct epoll_event e;
  e.events = events;
  e.data.fd = fd;
  return epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &e);
}


x86 assembly (clang, -O0):
<add_watch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
lea    -0x18(%rbp),%rcx
call   1030 <epoll_ctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_watch>:
push   %rax
mov    %esi,%eax
mov    %edx,0x4(%rsp)
mov    %esi,(%rsp)
mov    0x2ec7(%rip),%rcx
mov    (%rcx),%esi
mov    %rsp,%rcx
mov    %eax,%edx
call   1030 <epoll_ctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.epoll_event = type { %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
@EPOLL_CTL_ADD = global i32 0
define i32 @add_watch(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.epoll_event
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %7, i32 0, i32 1
store i32 %8, i32* %9
%10 = load i32, i32* %5
%11 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %7, i32 0, i32 0
%12 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %11, i32 0, i32 0
store i32 %10, i32* %12
%13 = load i32, i32* %4
%14 = load i32, i32* @EPOLL_CTL_ADD
%15 = load i32, i32* %5
%16 = call i32 @epoll_ctl(i32 %13, i32 %14, i32 %15, %struct.epoll_event* %7)
ret i32 %16
}

LLVM IR (-O2):
%struct.epoll_event = type { %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
@EPOLL_CTL_ADD = global i32 0
define i32 @add_watch(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.epoll_event
%5 = bitcast %struct.epoll_event* %4 to i8*
%6 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %4, i64 0, i32 1
store i32 %2, i32* %6
%7 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %4, i64 0, i32 0, i32 0
store i32 %1, i32* %7
%8 = load i32, i32* @EPOLL_CTL_ADD
%9 = call i32 @epoll_ctl(i32 %0, i32 %8, i32 %1, %struct.epoll_event* %4)
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void from_minutes(uint32_t t, uint16_t *cdn, uint8_t *h, uint8_t *m) {
  *m = t % 60;
  t /= 60;
  *h = t % 24;
  t /= 24;
  *cdn = t;
}


x86 assembly (clang, -O0):
<from_minutes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%rax
mov    %edx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_minutes>:
movslq %edi,%r8
imul   $0xffffffff88888889,%r8,%r10
shr    $0x20,%r10
add    %r8d,%r10d
mov    %r10d,%edi
shr    $0x1f,%edi
sar    $0x5,%r10d
add    %edi,%r10d
imul   $0x3c,%r10d,%r9d
imul   $0xffffffffb60b60b7,%r8,%rdi
shr    $0x20,%rdi
add    %r8d,%edi
mov    %r8d,%eax
sub    %r9d,%eax
mov    %eax,(%rcx)
movslq %r10d,%rax
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%r8
shr    $0x3f,%r8
shr    $0x22,%rcx
add    %r8d,%ecx
shl    $0x3,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    %eax,(%rdx)
mov    %edi,%eax
shr    $0x1f,%eax
sar    $0xa,%edi
add    %eax,%edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @from_minutes(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = srem i32 %9, 60
%11 = load i32*, i32** %8
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = sdiv i32 %12, 60
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = srem i32 %14, 24
%16 = load i32*, i32** %7
store i32 %15, i32* %16
%17 = load i32, i32* %5
%18 = sdiv i32 %17, 24
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = load i32*, i32** %6
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @from_minutes(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = srem i32 %0, 60
store i32 %5, i32* %3
%6 = sdiv i32 %0, 60
%7 = srem i32 %6, 24
store i32 %7, i32* %2
%8 = sdiv i32 %0, 1440
store i32 %8, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void closeYAKThread(void) { _exit(0); }


x86 assembly (clang, -O0):
<closeYAKThread>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<closeYAKThread>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @closeYAKThread() {
%1 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @closeYAKThread() {
%1 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
fun2() { printf("Iam in function 2\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Iam in function 2\0A\00"
define i32 @fun2() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [18 x i8] c"Iam in function 2\00"
define i32 @fun2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _clear_error_stack();
char *_read_pem_data(char const *, char const *, int);
char *read_pem_data(const char *pemfile, const char *tag, int nospace) {
  { _clear_error_stack(); };
  return (_read_pem_data(pemfile, tag, nospace));
}


x86 assembly (clang, -O0):
<read_pem_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <_clear_error_stack@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <_read_pem_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pem_data>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
call   1030 <_clear_error_stack@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_read_pem_data@plt>

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

LLVM IR (-O2):
define i8* @read_pem_data(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (...) @_clear_error_stack()
%5 = tail call i8* @_read_pem_data(i8* %0, i8* %1, i32 %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void dieWithError(char *errorMessage) {
  perror(errorMessage);
  exit(1);
}


x86 assembly (clang, -O0):
<dieWithError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<dieWithError>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @dieWithError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @dieWithError(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char EOF;
int whitespace(char c) {
  if ((c == '\t') || (c == ' ') || (c == '\n') || (c == EOF))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1147 <whitespace+0x47>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1147 <whitespace+0x47>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1147 <whitespace+0x47>
movsbl -0x5(%rbp),%eax
mov    0x2eac(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1153 <whitespace+0x53>
movl   $0x1,-0x4(%rbp)
jmp    115a <whitespace+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %6
i8 10, label %6
i8 9, label %6
]
2: ; preds = %1
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %3, %0
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %2, %1, %1, %1
%7 = phi i32 [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ %5, %2 ]
ret i32 %7
}
void bitmap_zero(unsigned long *b, int n) {
  int i;
  for (i = 0; i < (((n) + (8 * sizeof(long)) - 1) / (8 * sizeof(long))); i++)
    (b)[i] = 0;
}


x86 assembly (clang, -O0):
<bitmap_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    $0x40,%rcx
sub    $0x1,%rcx
shr    $0x6,%rcx
cmp    %rcx,%rax
jae    114d <bitmap_zero+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <bitmap_zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_zero>:
movslq %esi,%rax
add    $0x3f,%rax
cmp    $0x40,%rax
jb     113e <bitmap_zero+0x2e>
push   %rax
shr    $0x6,%rax
cmp    $0x2,%rax
mov    $0x1,%edx
cmovae %rax,%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bitmap_zero(i64* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = add nsw i64 %3, 63
%5 = icmp ult i64 %4, 64
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = lshr i64 %4, 6
%8 = bitcast i64* %0 to i8*
%9 = call i64 @llvm.umax.i64(i64 %7, i64 1)
%10 = shl nuw nsw i64 %9, 3
br label %11
11: ; preds = %6, %2
ret void
}
int pd_snk_is_vbus_provided(int port) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pd_snk_is_vbus_provided(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("USAGE: client hostname port filename\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"USAGE: client hostname port filename\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"USAGE: client hostname port filename\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello world!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int test_sanity_check() {
  {
    if (!(32 * 3 <= 160)) {
      printf("Line %d, assertion failed: %s\n", 26, "Ramp length too short");
      return 1;
    }
  };
  {
    if (!(80 > 57)) {
      printf("Line %d, assertion failed: %s\n", 27, "Transition too short");
      return 1;
    }
  };
  {
    if (!(32 > 10)) {
      printf("Line %d, assertion failed: %s\n", 28,
             "Default ramp increment too short");
      return 1;
    }
  };
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @test_sanity_check() {
ret i32 0
}