xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _PC_REC_XFER_ALIGN;
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int pathconf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int get_alignment(char *fname) {
  int alignment;
  if ((alignment = pathconf(fname, _PC_REC_XFER_ALIGN)) < 1)
    fprintf(stderr, "pathconf(%s) alignment error (errno %d)\n", fname, errno);
  return (alignment);
}


x86 assembly (clang, -O0):
<get_alignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <pathconf@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x1,%eax
jge    116c <get_alignment+0x4c>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    0x2e7a(%rip),%rax
mov    (%rax),%ecx
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_alignment>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1030 <pathconf@plt>
mov    %eax,%ebp
test   %eax,%eax
jg     115b <get_alignment+0x3b>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%ecx
lea    0xead(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@_PC_REC_XFER_ALIGN = global i32 0
@stderr = global i32 0
@.str = [41 x i8] c"pathconf(%s) alignment error (errno %d)\0A\00"
@errno = global i32 0
define i32 @get_alignment(i8* %0) {
%2 = load i32, i32* @_PC_REC_XFER_ALIGN
%3 = tail call i32 @pathconf(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i32, i32* @errno
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %7)
br label %9
9: ; preds = %5, %1
ret i32 %3
}
char getVolume() {
  char volume[20];
  printf("What is the volume of the article you are citing?\n");
  scanf("%s", volume);
  return volume;
}


x86 assembly (clang, -O0):
<getVolume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getVolume>:
push   %rbx
sub    $0x20,%rsp
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"What is the volume of the article you are citing?\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define signext i8 @getVolume() {
%1 = alloca [20 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = ptrtoint i8* %5 to i8
ret i8 %6
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [50 x i8] c"What is the volume of the article you are citing?\00"
define signext i8 @getVolume() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = ptrtoint [20 x i8]* %1 to i64
%6 = trunc i64 %5 to i8
ret i8 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t bytes2Int(uint8_t h, uint8_t m1, uint8_t m2, uint8_t l) {
  uint32_t a = h;
  uint32_t b = m1;
  uint32_t c = m2;
  uint32_t d = l;
  a = a << 24;
  b = b << 16;
  c = c << 8;
  return a | b | c | d;
}


x86 assembly (clang, -O0):
<bytes2Int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x18,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x10,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
or     -0x1c(%rbp),%eax
or     -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes2Int>:
mov    %edx,%eax
shl    $0x18,%edi
shl    $0x10,%esi
or     %edi,%esi
shl    $0x8,%eax
or     %ecx,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @bytes2Int(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 24
%6 = shl i32 %1, 16
%7 = shl i32 %2, 8
%8 = or i32 %6, %5
%9 = or i32 %8, %7
%10 = or i32 %9, %3
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dp_disklock();
size_t fread_orig(void *, size_t, size_t, int /*<<< orphan*/ *);
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
  dp_disklock();
  return (fread_orig(ptr, size, nmemb, stream));
}


x86 assembly (clang, -O0):
<fread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1040 <dp_disklock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fread_orig@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dp_disklock@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fread_orig@plt>

LLVM IR (-O0):
define i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = call i32 (...) @dp_disklock()
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i32*, i32** %8
%14 = call i64 @fread_orig(i8* %10, i64 %11, i64 %12, i32* %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i32 (...) @dp_disklock()
%6 = tail call i64 @fread_orig(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %6
}
ttputc(c) {}


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

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

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

LLVM IR (-O2):
define i32 @ttputc(i32 %0) {
ret i32 undef
}
void *unit_rcv(void *data) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @unit_rcv(i8* nocapture readnone %0) {
ret i8* undef
}
void mem_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @mem_init() {
ret void
}
/* Type definitions */
struct _Unwind_Exception {
  int dummy;
};
struct _Unwind_Context {
  int dummy;
};
typedef int /*<<< orphan*/ _Unwind_Reason_Code;

/* Variables and functions */
int /*<<< orphan*/ _URC_CONTINUE_UNWIND;
_Unwind_Reason_Code continueUnwind(struct _Unwind_Exception *exceptionObject,
                                   struct _Unwind_Context *context) {
  return _URC_CONTINUE_UNWIND;
}


x86 assembly (clang, -O0):
<continueUnwind>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<continueUnwind>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct._Unwind_Exception = type { i32 }
%struct._Unwind_Context = type { i32 }
@_URC_CONTINUE_UNWIND = global i32 0
define i32 @continueUnwind(%struct._Unwind_Exception* %0, %struct._Unwind_Context* %1) {
%3 = alloca %struct._Unwind_Exception*
%4 = alloca %struct._Unwind_Context*
store %struct._Unwind_Exception* %0, %struct._Unwind_Exception** %3
store %struct._Unwind_Context* %1, %struct._Unwind_Context** %4
%5 = load i32, i32* @_URC_CONTINUE_UNWIND
ret i32 %5
}

LLVM IR (-O2):
%struct._Unwind_Exception = type { i32 }
%struct._Unwind_Context = type { i32 }
@_URC_CONTINUE_UNWIND = global i32 0
define i32 @continueUnwind(%struct._Unwind_Exception* nocapture readnone %0, %struct._Unwind_Context* nocapture readnone %1) {
%3 = load i32, i32* @_URC_CONTINUE_UNWIND
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printMemoryError() { fprintf(stderr, "Could not allocate memory\n"); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Could not allocate memory\0A\00"
define void @printMemoryError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Could not allocate memory\0A\00"
define void @printMemoryError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pow(int, float);
double moffat_alpha(double fwhm, double beta) {
  return (fwhm / 2) / pow((pow(2, 1 / beta) - 1), 0.5f);
}


x86 assembly (clang, -O0):
<moffat_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec8(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xead(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movss  0xe95(%rip),%xmm0
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moffat_alpha>:
push   %rax
mulsd  0xee7(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xee2(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  0xed0(%rip),%xmm0
cvttsd2si %xmm0,%edi
movss  0xecc(%rip),%xmm0
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @moffat_alpha(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fdiv double %5, 2.000000e+00
%7 = load double, double* %4
%8 = fdiv double 1.000000e+00, %7
%9 = fptrunc double %8 to float
%10 = call double @pow(i32 2, float %9)
%11 = fsub double %10, 1.000000e+00
%12 = fptosi double %11 to i32
%13 = call double @pow(i32 %12, float 5.000000e-01)
%14 = fdiv double %6, %13
ret double %14
}

LLVM IR (-O2):
define double @moffat_alpha(double %0, double %1) {
%3 = fmul double %0, 5.000000e-01
%4 = fdiv double 1.000000e+00, %1
%5 = fptrunc double %4 to float
%6 = tail call double @pow(i32 2, float %5)
%7 = fadd double %6, -1.000000e+00
%8 = fptosi double %7 to i32
%9 = tail call double @pow(i32 %8, float 5.000000e-01)
%10 = fdiv double %3, %9
ret double %10
}
char *setlocale(int category, const char *locale) { return 0; }


x86 assembly (clang, -O0):
<setlocale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @setlocale(i32 %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ gmx_helixorient(int, char **);
int main(int argc, char *argv[]) {
  gmx_helixorient(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_helixorient(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ROL8(int /*<<< orphan*/);
int /*<<< orphan*/ SA1Direct(int);
void Op26M1(void) { ROL8(SA1Direct(3)); }


x86 assembly (clang, -O0):
<Op26M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
call   1040 <ROL8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op26M1>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ROL8@plt>

LLVM IR (-O0):
define void @Op26M1() {
%1 = call i32 @SA1Direct(i32 3)
%2 = call i32 @ROL8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op26M1() {
%1 = tail call i32 @SA1Direct(i32 3)
%2 = tail call i32 @ROL8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgbss(char *s, int z) { ngen(".lcomm\t%s,%d", s, z); }


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

x86 assembly (clang, -O2):
<cgbss>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c".lcomm\09%s,%d\00"
define void @cgbss(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c".lcomm\09%s,%d\00"
define void @cgbss(i8* %0, i32 %1) {
%3 = tail call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getChar();
int /*<<< orphan*/ skipWhite();
void init() {
  getChar();
  skipWhite();
}


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

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

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @getChar()
%2 = call i32 (...) @skipWhite()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @getChar()
%2 = tail call i32 (...) @skipWhite()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showHelp(void) { printf("showHelp!\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"showHelp!\0A\00"
define void @showHelp() {
%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"showHelp!\00"
define void @showHelp() {
%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 scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
float get_speed(clock_t c1, clock_t c2) {
  return (((float)(c2 - c1)) / ((float)CLOCKS_PER_SEC));
}


x86 assembly (clang, -O0):
<get_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2ss %rax,%xmm0
mov    0x2ec8(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_speed>:
sub    %rdi,%rsi
cvtsi2ss %rsi,%xmm0
mov    0x2ed9(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define float @get_speed(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to float
%9 = load i64, i64* @CLOCKS_PER_SEC
%10 = sitofp i64 %9 to float
%11 = fdiv float %8, %10
ret float %11
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define float @get_speed(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to float
%5 = load i64, i64* @CLOCKS_PER_SEC
%6 = sitofp i64 %5 to float
%7 = fdiv float %4, %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: jfs_mkdir <volumename> <dirname>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Usage: jfs_mkdir <volumename> <dirname>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Usage: jfs_mkdir <volumename> <dirname>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int nsvg__getArgsPerElement(char cmd) {
  switch (cmd) {
  case 'v':
  case 'V':
  case 'h':
  case 'H':
    return 1;
  case 'm':
  case 'M':
  case 'l':
  case 'L':
  case 't':
  case 'T':
    return 2;
  case 'q':
  case 'Q':
  case 's':
  case 'S':
    return 4;
  case 'c':
  case 'C':
    return 6;
  case 'a':
  case 'A':
    return 7;
  }
  return 0;
}


x86 assembly (clang, -O0):
<nsvg__getArgsPerElement>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x35,%eax
ja     1170 <nsvg__getArgsPerElement+0x70>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1177 <nsvg__getArgsPerElement+0x77>
movl   $0x2,-0x4(%rbp)
jmp    1177 <nsvg__getArgsPerElement+0x77>
movl   $0x4,-0x4(%rbp)
jmp    1177 <nsvg__getArgsPerElement+0x77>
movl   $0x6,-0x4(%rbp)
jmp    1177 <nsvg__getArgsPerElement+0x77>
movl   $0x7,-0x4(%rbp)
jmp    1177 <nsvg__getArgsPerElement+0x77>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__getArgsPerElement>:
add    $0xffffffbf,%edi
cmp    $0x35,%edi
ja     1135 <nsvg__getArgsPerElement+0x35>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x2,%eax
ret
mov    $0x4,%eax
ret
mov    $0x6,%eax
ret
mov    $0x7,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @nsvg__getArgsPerElement(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
switch i32 %5, label %11 [
i32 118, label %6
i32 86, label %6
i32 104, label %6
i32 72, label %6
i32 109, label %7
i32 77, label %7
i32 108, label %7
i32 76, label %7
i32 116, label %7
i32 84, label %7
i32 113, label %8
i32 81, label %8
i32 115, label %8
i32 83, label %8
i32 99, label %9
i32 67, label %9
i32 97, label %10
i32 65, label %10
]
6: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %12
7: ; preds = %1, %1, %1, %1, %1, %1
store i32 2, i32* %2
br label %12
8: ; preds = %1, %1, %1, %1
store i32 4, i32* %2
br label %12
9: ; preds = %1, %1
store i32 6, i32* %2
br label %12
10: ; preds = %1, %1
store i32 7, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @nsvg__getArgsPerElement(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 118, label %8
i32 86, label %8
i32 104, label %8
i32 72, label %8
i32 109, label %3
i32 77, label %3
i32 108, label %3
i32 76, label %3
i32 116, label %3
i32 84, label %3
i32 113, label %4
i32 81, label %4
i32 115, label %4
i32 83, label %4
i32 99, label %5
i32 67, label %5
i32 97, label %6
i32 65, label %6
]
3: ; preds = %1, %1, %1, %1, %1, %1
br label %8
4: ; preds = %1, %1, %1, %1
br label %8
5: ; preds = %1, %1
br label %8
6: ; preds = %1, %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %1, %1, %1, %7, %6, %5, %4, %3
%9 = phi i32 [ 0, %7 ], [ 7, %6 ], [ 6, %5 ], [ 4, %4 ], [ 2, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %9
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(char const **);
void _free_test_strings(const char **test_strings, uint32_t count) {
  uint32_t i = 0;
  assert(test_strings != NULL);
  for (; i < count; ++i)
    free((void *)test_strings[i]);
  free(test_strings);
}


x86 assembly (clang, -O0):
<_free_test_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    117a <_free_test_strings+0x5a>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114a <_free_test_strings+0x2a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_free_test_strings>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1040 <assert@plt>
test   %r14,%r14
je     1152 <_free_test_strings+0x32>
xor    %ebx,%ebx
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <_free_test_strings+0x20>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_free_test_strings(i8** %0, i64 %1) {
%3 = icmp ne i8** %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i64 %1, 0
br i1 %6, label %15, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %13, %7 ], [ 0, %2 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = bitcast i8** %9 to i8***
%11 = load i8**, i8*** %10
%12 = tail call i32 @free(i8** %11)
%13 = add nuw i64 %8, 1
%14 = icmp eq i64 %13, %1
br i1 %14, label %15, label %7
15: ; preds = %7, %2
%16 = tail call i32 @free(i8** %0)
ret void
}
int draw_enable(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @draw_enable() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *, int, char const *);
char *strdup(char const *);
char *xstrdup_(const char *s, const char *file, int line, const char *func) {
  char *p = strdup(s);
  if (!p)
    err(1, "%s:%d (%s): strdup() failed", file, line, func);
  return p;
}


x86 assembly (clang, -O0):
<xstrdup_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    116b <xstrdup_+0x4b>
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    $0x1,%edi
lea    0xe9a(%rip),%rsi
call   1030 <err@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%rbp
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1157 <xstrdup_+0x37>
lea    0xebc(%rip),%rsi
mov    $0x1,%edi
mov    %rbp,%rdx
mov    %r15d,%ecx
mov    %r14,%r8
call   1030 <err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"%s:%d (%s): strdup() failed\00"
define i8* @xstrdup_(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %5
%11 = call i8* @strdup(i8* %10)
store i8* %11, i8** %9
%12 = load i8*, i8** %9
%13 = icmp ne i8* %12, null
br i1 %13, label %19, label %14
14: ; preds = %4
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = load i8*, i8** %8
%18 = call i32 @err(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, i8* %17)
br label %19
19: ; preds = %14, %4
%20 = load i8*, i8** %9
ret i8* %20
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s:%d (%s): strdup() failed\00"
define noalias i8* @xstrdup_(i8* nocapture %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i8* @strdup(i8* %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3)
br label %9
9: ; preds = %7, %4
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ const *);
int /*<<< orphan*/ be64toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint64_t knot_wire_read_u64(const uint8_t *pos) {
  assert(pos);
  uint64_t result;
  memcpy(&result, pos, sizeof(result));
  return be64toh(result);
}


x86 assembly (clang, -O0):
<knot_wire_read_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <be64toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knot_wire_read_u64>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <assert@plt>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    0xc(%rsp),%edi
call   1040 <be64toh@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @knot_wire_read_u64(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @assert(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @memcpy(i32* %3, i32* %6, i32 4)
%8 = load i32, i32* %3
%9 = call i32 @be64toh(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @knot_wire_read_u64(i32* %0) {
%2 = alloca i32
%3 = tail call i32 @assert(i32* %0)
%4 = bitcast i32* %2 to i8*
%5 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%6 = load i32, i32* %2
%7 = call i32 @be64toh(i32 %6)
ret i32 %7
}
void main() {}


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

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a = 10;
  int *p = &a;
  printf("%d\n", ++*p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    %esi,(%rax)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 11)
ret i32 0
}
/* Type definitions */
struct vnic_rq {
  int dummy;
};

/* Variables and functions */
int stub1(struct vnic_rq *);
scalar_t__ vnic_rq_desc_avail(struct vnic_rq *);
int vnic_rq_fill(struct vnic_rq *rq, int (*buf_fill)(struct vnic_rq *rq)) {
  int err;
  while (vnic_rq_desc_avail(rq) > 0) {
    err = (*buf_fill)(rq);
    if (err) {
      return err;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<vnic_rq_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <vnic_rq_desc_avail@plt>
cmp    $0x0,%rax
jle    115a <vnic_rq_fill+0x4a>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1155 <vnic_rq_fill+0x45>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <vnic_rq_fill+0x51>
jmp    1120 <vnic_rq_fill+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnic_rq_fill>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <vnic_rq_desc_avail@plt>
test   %rax,%rax
jle    1139 <vnic_rq_fill+0x29>
mov    %rbx,%rdi
call   *%r14
test   %eax,%eax
je     1120 <vnic_rq_fill+0x10>
jmp    113b <vnic_rq_fill+0x2b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.vnic_rq = type { i32 }
define i32 @vnic_rq_fill(%struct.vnic_rq* %0, i32 (%struct.vnic_rq*)* nocapture %1) {
br label %3
3: ; preds = %6, %2
%4 = tail call i64 @vnic_rq_desc_avail(%struct.vnic_rq* %0)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 %1(%struct.vnic_rq* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %3, %6
%10 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;
typedef int /*<<< orphan*/ __be64;

/* Variables and functions */
int /*<<< orphan*/ __swab64p(int /*<<< orphan*/ *);
__u64 __be64_to_cpup(const __be64 *p) { return __swab64p((__u64 *)p); }


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

x86 assembly (clang, -O2):
<__be64_to_cpup>:
jmp    1030 <__swab64p@plt>

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

LLVM IR (-O2):
define i32 @__be64_to_cpup(i32* %0) {
%2 = tail call i32 @__swab64p(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double const floor(double const);
double normalize(const double x, const double N) {
  double n;
  assert(N > 0.0);
  n = x - (N * floor(x / N));
  assert(n <= N);
  return n;
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
xor    %edi,%edi
ucomisd %xmm0,%xmm1
seta   %dil
call   1030 <assert@plt>
movsd  0x8(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
call   1040 <floor@plt>
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %edi,%edi
ucomisd %xmm1,%xmm2
setae  %dil
call   1030 <assert@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @normalize(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fcmp ogt double %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load double, double* %3
%11 = load double, double* %4
%12 = load double, double* %3
%13 = load double, double* %4
%14 = fdiv double %12, %13
%15 = call double @floor(double %14)
%16 = fneg double %11
%17 = call double @llvm.fmuladd.f64(double %16, double %15, double %10)
store double %17, double* %5
%18 = load double, double* %5
%19 = load double, double* %4
%20 = fcmp ole double %18, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load double, double* %5
ret double %23
}

LLVM IR (-O2):
define double @normalize(double %0, double %1) {
%3 = fcmp ogt double %1, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = fdiv double %0, %1
%7 = tail call double @llvm.floor.f64(double %6)
%8 = fneg double %1
%9 = tail call double @llvm.fmuladd.f64(double %8, double %7, double %0)
%10 = fcmp ole double %9, %1
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ errorf(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ read_error_directive();
void read_error(void) {
  errorf("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/zhuzhaoyuan/8cc/refs/heads/master/cpp.c",
         632, "#error: %s", read_error_directive());
}


x86 assembly (clang, -O0):
<read_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <read_error_directive@plt>
mov    %eax,%ecx
lea    0xecc(%rip),%rdi
mov    $0x278,%esi
lea    0xf42(%rip),%rdx
call   1040 <errorf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_error>:
push   %rax
xor    %eax,%eax
call   1030 <read_error_directive@plt>
lea    0xed1(%rip),%rdi
lea    0xf4c(%rip),%rdx
mov    $0x278,%esi
mov    %eax,%ecx
pop    %rax
jmp    1040 <errorf@plt>

LLVM IR (-O0):
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhuzhaoyuan/8cc/refs/heads/master/cpp.c\00"
@.str.1 = [11 x i8] c"#error: %s\00"
define void @read_error() {
%1 = call i32 (...) @read_error_directive()
%2 = call i32 @errorf(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 632, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhuzhaoyuan/8cc/refs/heads/master/cpp.c\00"
@.str.1 = [11 x i8] c"#error: %s\00"
define void @read_error() {
%1 = tail call i32 (...) @read_error_directive()
%2 = tail call i32 @errorf(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 632, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
void *ccol_MallocNoInit(unsigned int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
void *ccol_Malloc(unsigned int sz) {
  void *p = ccol_MallocNoInit(sz);
  if (p == NULL)
    return NULL;
  memset(p, 0, sz);
  return p;
}


x86 assembly (clang, -O0):
<ccol_Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <ccol_MallocNoInit@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114f <ccol_Malloc+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1165 <ccol_Malloc+0x45>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccol_Malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <ccol_MallocNoInit@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113e <ccol_Malloc+0x1e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @ccol_Malloc(i32 %0) {
%2 = tail call i8* @ccol_MallocNoInit(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
br label %6
6: ; preds = %1, %4
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ console_putc(int /*<<< orphan*/);
void console_puts(const char *s) {
  while (*s) {
    console_putc(*s++);
  }
}


x86 assembly (clang, -O0):
<console_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <console_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <console_putc@plt>
jmp    111c <console_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <console_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <console_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <console_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @console_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @console_putc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void incomplete() {
  struct E {
    struct F *f;
  } e;
}


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

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

LLVM IR (-O0):
%struct.E = type { %struct.F* }
%struct.F = type opaque
define void @incomplete() {
%1 = alloca %struct.E
ret void
}

LLVM IR (-O2):
%struct.F = type opaque
define void @incomplete() {
ret void
}
int test_imm_AFuint8_mem(unsigned char *val) {
  return ((*val) & (-0xAF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_AFuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -175
%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_AFuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 81
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}