xunge/DecIR huggingface dataset:
void char2() {
  int ch;
  ch = L'x';
}


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

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

LLVM IR (-O0):
define void @char2() {
%1 = alloca i32
store i32 120, i32* %1
ret void
}

LLVM IR (-O2):
define void @char2() {
ret void
}
unsigned long pci_reserve_size_io(struct pci_bus *bus) { return 0; }


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

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

LLVM IR (-O0):
%struct.pci_bus = type opaque
define i64 @pci_reserve_size_io(%struct.pci_bus* %0) {
%2 = alloca %struct.pci_bus*
store %struct.pci_bus* %0, %struct.pci_bus** %2
ret i64 0
}

LLVM IR (-O2):
%struct.pci_bus = type opaque
define i64 @pci_reserve_size_io(%struct.pci_bus* nocapture readnone %0) {
ret i64 0
}
void bug(const char *str, int param) {
  char buf[16384];
  strcpy(buf, "[***] BUG: ");
  sprintf(buf + strlen(buf), str, param);
  log_string(buf);
  return;
}


x86 assembly (clang, -O0):
<bug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x4010(%rbp),%rdi
lea    0xea0(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x4010(%rbp),%rax
mov    %rax,-0x4018(%rbp)
lea    -0x4010(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x4018(%rbp),%rdi
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x4010(%rbp),%rdi
mov    $0x0,%al
call   1040 <log_string@plt>
add    $0x4020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bug>:
push   %rbp
push   %r14
push   %rbx
sub    $0x4000,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
movabs $0x5542205d2a2a2a5b,%rax
20 42 55
mov    %rax,(%rsp)
movl   $0x203a47,0x8(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rsp,%rax,1),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <log_string@plt>
add    $0x4000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"[***] BUG: \00"
define void @bug(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [16384 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [16384 x i8], [16384 x i8]* %5, i64 0, i64 0
%7 = call i8* @strcpy(i8* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [16384 x i8], [16384 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [16384 x i8], [16384 x i8]* %5, i64 0, i64 0
%10 = call i64 @strlen(i8* %9)
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* %12, i32 %13)
%15 = getelementptr inbounds [16384 x i8], [16384 x i8]* %5, i64 0, i64 0
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @log_string to i32 (i8*, ...)*)(i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"[***] BUG: \00"
define void @bug(i8* nocapture %0, i32 %1) {
%3 = alloca [16384 x i8]
%4 = getelementptr inbounds [16384 x i8], [16384 x i8]* %3, i64 0, i64 0
%5 = call i64 @strlen(i8* %4)
%6 = getelementptr inbounds [16384 x i8], [16384 x i8]* %3, i64 0, i64 %5
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) %0, i32 %1)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @log_string to i32 (i8*, ...)*)(i8* %4)
ret void
}
unsigned short w10bit2z(unsigned short w) {
  return (w >> 2) | ((w & 0x03) << 8);
}


x86 assembly (clang, -O0):
<w10bit2z>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x2,%eax
movzwl -0x2(%rbp),%ecx
and    $0x3,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<w10bit2z>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0x3,%edi
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @w10bit2z(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 2
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = and i32 %7, 3
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
%11 = trunc i32 %10 to i16
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @w10bit2z(i16 zeroext %0) {
%2 = lshr i16 %0, 2
%3 = shl i16 %0, 8
%4 = and i16 %3, 768
%5 = or i16 %4, %2
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void usage(char *appname) {
  fprintf(stderr, "%s [auto]|[mem_size in %lu byte] [s]\n", appname,
          sizeof(int));
}


x86 assembly (clang, -O0):
<usage>:
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
mov    $0x4,%ecx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"%s [auto]|[mem_size in %lu byte] [s]\0A\00"
define void @usage(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 ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %4, i32 4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"%s [auto]|[mem_size in %lu byte] [s]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0, i32 4)
ret void
}
/* Variables and functions */
int imagePush(int /*<<< orphan*/);
int /*<<< orphan*/ imageTop();
int imageDouble() { return imagePush(imageTop()); }


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

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

LLVM IR (-O0):
define i32 @imageDouble() {
%1 = call i32 (...) @imageTop()
%2 = call i32 @imagePush(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @imageDouble() {
%1 = tail call i32 (...) @imageTop()
%2 = tail call i32 @imagePush(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ PDCWrite(int, unsigned char);
void PDCLEDWrite(unsigned char ucLED) { PDCWrite(0x5, ucLED); }


x86 assembly (clang, -O0):
<PDCLEDWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x5,%edi
movzbl -0x1(%rbp),%esi
call   1030 <PDCWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDCLEDWrite>:
mov    %edi,%esi
mov    $0x5,%edi
jmp    1030 <PDCWrite@plt>

LLVM IR (-O0):
define void @PDCLEDWrite(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @PDCWrite(i32 5, i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @PDCLEDWrite(i8 zeroext %0) {
%2 = tail call i32 @PDCWrite(i32 5, i8 zeroext %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int test_and_clear_bit(int nr, uint8_t *addr) {
  uint8_t bit_place = nr % 8;
  if (nr > 7) {
    addr += (nr / 8);
  }
  int oldbit = *addr & (0x1 << bit_place);
  *addr &= ~(0x1 << bit_place);
  return oldbit;
}


x86 assembly (clang, -O0):
<test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmpl   $0x7,-0x4(%rbp)
jle    1142 <test_and_clear_bit+0x42>
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x10(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_clear_bit>:
mov    %edi,%ecx
xor    %eax,%eax
cmp    $0x8,%edi
jl     1114 <test_and_clear_bit+0x14>
lea    0x7(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
mov    %eax,%edx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
mov    (%rsi,%rdx,4),%edi
and    %edi,%eax
btr    %ecx,%edi
mov    %edi,(%rsi,%rdx,4)
ret

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

LLVM IR (-O2):
define i32 @test_and_clear_bit(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 7
%4 = sdiv i32 %0, 8
%5 = select i1 %3, i32 %4, i32 0
%6 = zext i32 %5 to i64
%7 = getelementptr i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = and i32 %0, 7
%10 = shl nuw nsw i32 1, %9
%11 = and i32 %8, %10
%12 = xor i32 %10, -1
%13 = and i32 %8, %12
store i32 %13, i32* %7
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ baz();
void test(void) { baz(); }


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

x86 assembly (clang, -O2):
<test>:
xor    %eax,%eax
jmp    1030 <baz@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 (...) @baz()
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @baz()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
scalar_t__ scanf(char *, unsigned long *, unsigned long *);
int main() {
  unsigned long int a, b;
  while (scanf("%lu %lu", &a, &b) > 0) {
    printf("%lu\n", a ^ b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x0,%rax
jle    1166 <main+0x46>
mov    -0x10(%rbp),%rsi
xor    -0x18(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xece(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
test   %rax,%rax
jle    1185 <main+0x65>
lea    0xebb(%rip),%r14
lea    0xeac(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%rbx
xchg   %ax,%ax
mov    0x8(%rsp),%rsi
xor    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
test   %rax,%rax
jg     1160 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lu %lu\00"
@.str.1 = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
br label %4
4: ; preds = %7, %0
%5 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i64, i64* %2
%9 = load i64, i64* %3
%10 = xor i64 %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %10)
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lu %lu\00"
@.str.1 = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = load i64, i64* %1
%9 = load i64, i64* %2
%10 = xor i64 %9, %8
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %10)
%12 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%13 = icmp sgt i64 %12, 0
br i1 %13, label %7, label %14
14: ; preds = %7, %0
ret i32 0
}
/* Type definitions */
struct stream {
  int dummy;
};

/* Variables and functions */
int decode_long_address(unsigned char const *, struct stream *);
int decode_long_address_64bit_is0(const unsigned char *pkt,
                                  struct stream *stream) {
  return decode_long_address(pkt, stream);
}


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

x86 assembly (clang, -O2):
<decode_long_address_64bit_is0>:
jmp    1030 <decode_long_address@plt>

LLVM IR (-O0):
%struct.stream = type { i32 }
define i32 @decode_long_address_64bit_is0(i8* %0, %struct.stream* %1) {
%3 = alloca i8*
%4 = alloca %struct.stream*
store i8* %0, i8** %3
store %struct.stream* %1, %struct.stream** %4
%5 = load i8*, i8** %3
%6 = load %struct.stream*, %struct.stream** %4
%7 = call i32 @decode_long_address(i8* %5, %struct.stream* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stream = type { i32 }
define i32 @decode_long_address_64bit_is0(i8* %0, %struct.stream* %1) {
%3 = tail call i32 @decode_long_address(i8* %0, %struct.stream* %1)
ret i32 %3
}
/* Variables and functions */
int alpha_h(double const);
int beta_h(double const);
double tau_h(const double V_tilde) {
  return 1. / (alpha_h(V_tilde) + beta_h(V_tilde));
}


x86 assembly (clang, -O0):
<tau_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <alpha_h@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <beta_h@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xea9(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tau_h>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <alpha_h@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1040 <beta_h@plt>
add    %ebx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeb5(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @tau_h(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @alpha_h(double %3)
%5 = load double, double* %2
%6 = call i32 @beta_h(double %5)
%7 = add nsw i32 %4, %6
%8 = sitofp i32 %7 to double
%9 = fdiv double 1.000000e+00, %8
ret double %9
}

LLVM IR (-O2):
define double @tau_h(double %0) {
%2 = tail call i32 @alpha_h(double %0)
%3 = tail call i32 @beta_h(double %0)
%4 = add nsw i32 %3, %2
%5 = sitofp i32 %4 to double
%6 = fdiv double 1.000000e+00, %5
ret double %6
}
int FiveTimes(int a) {
  int t;
  t = (a << 2) + a;
  return t;
}


x86 assembly (clang, -O0):
<FiveTimes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FiveTimes>:
lea    (%rdi,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @FiveTimes(i32 %0) {
%2 = mul i32 %0, 5
ret i32 %2
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local2;
  unsigned long local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + 274866410UL;
    local1 = 0UL;
    while (local1 < 0UL) {
      local2 = 0UL;
      while (local2 < 0UL) {
        if (state[0UL] != local2 + local1) {
        }
        local2++;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 454761159UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x30dd5ac,%rax
add    $0x106220ea,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jae    1185 <RandomFunc+0x85>
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1174 <RandomFunc+0x74>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
add    -0x28(%rbp),%rcx
cmp    %rcx,%rax
je     1163 <RandomFunc+0x63>
jmp    1163 <RandomFunc+0x63>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113e <RandomFunc+0x3e>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    112b <RandomFunc+0x2b>
mov    -0x18(%rbp),%rcx
add    $0x1b1b1ac7,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x2e8b115d,%eax
add    (%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = add i64 %10, 51238316
%12 = add i64 %11, 274866410
%13 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %12, i64* %13
store i64 0, i64* %7
br label %14
14: ; preds = %32, %2
%15 = load i64, i64* %7
%16 = icmp ult i64 %15, 0
br i1 %16, label %17, label %35
17: ; preds = %14
store i64 0, i64* %6
br label %18
18: ; preds = %29, %17
%19 = load i64, i64* %6
%20 = icmp ult i64 %19, 0
br i1 %20, label %21, label %32
21: ; preds = %18
%22 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%23 = load i64, i64* %22
%24 = load i64, i64* %6
%25 = load i64, i64* %7
%26 = add i64 %24, %25
%27 = icmp ne i64 %23, %26
br i1 %27, label %28, label %29
28: ; preds = %21
br label %29
29: ; preds = %28, %21
%30 = load i64, i64* %6
%31 = add i64 %30, 1
store i64 %31, i64* %6
br label %18
32: ; preds = %18
%33 = load i64, i64* %7
%34 = add i64 %33, 2
store i64 %34, i64* %7
br label %14
35: ; preds = %14
%36 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%37 = load i64, i64* %36
%38 = add i64 %37, 454761159
%39 = load i64*, i64** %4
%40 = getelementptr inbounds i64, i64* %39, i64 0
store i64 %38, i64* %40
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, 780865885
store i64 %4, i64* %1
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ newton_raphson(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  printf("root at %lf\n", newton_raphson(10));
  return EXIT_SUCCESS;
}


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    $0xa,%edi
call   1030 <newton_raphson@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <newton_raphson@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"root at %lf\0A\00"
@EXIT_SUCCESS = global i32 0
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 = call i32 @newton_raphson(i32 10)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [13 x i8] c"root at %lf\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @newton_raphson(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 56;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x38,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 56, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 56)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xf4() {
  Assert_real((isodigit(244) == 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_isodigit.c",
              1225, ("isodigit should be 0 for 0xf4"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xf4\00"
define void @t_isodigit_0xf4() {
%1 = tail call i64 @isodigit(i32 244)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1225, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ eventfd_using_fork();
int eventfd_using_poll();
scalar_t__ eventfd_using_various_flags();
int main(int argc, char *argv[]) {
  int ret = 0;
  ret = eventfd_using_poll();
  ret += eventfd_using_various_flags();
  ret += eventfd_using_fork();
  return ret;
}


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    $0x0,%al
call   1030 <eventfd_using_poll@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <eventfd_using_various_flags@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <eventfd_using_fork@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <eventfd_using_poll@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <eventfd_using_various_flags@plt>
mov    %rax,%rbx
add    %ebp,%ebx
xor    %eax,%eax
call   1040 <eventfd_using_fork@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
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
store i32 0, i32* %6
%7 = call i32 (...) @eventfd_using_poll()
store i32 %7, i32* %6
%8 = call i64 (...) @eventfd_using_various_flags()
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %6
%13 = call i64 (...) @eventfd_using_fork()
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @eventfd_using_poll()
%4 = tail call i64 (...) @eventfd_using_various_flags()
%5 = trunc i64 %4 to i32
%6 = add i32 %3, %5
%7 = tail call i64 (...) @eventfd_using_fork()
%8 = trunc i64 %7 to i32
%9 = add i32 %6, %8
ret i32 %9
}
void svcPanic(void) {
  asm("movq $"
      "0"
      ", %rax; movq %rcx, %r10; syscall");
}


x86 assembly (clang, -O0):
<svcPanic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%rax
mov    %rcx,%r10
syscall
pop    %rbp
ret

x86 assembly (clang, -O2):
<svcPanic>:
mov    $0x0,%rax
mov    %rcx,%r10
syscall
ret

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

LLVM IR (-O2):
define void @svcPanic() {
tail call void asm sideeffect "movq $$0, %rax; movq %rcx, %r10; syscall", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
gt(a, b) { return a > b; }


x86 assembly (clang, -O0):
<gt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @gt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @gt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double conversion(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, double);
int main() {
  int cels;
  cels = 300;
  while (cels > 0) {
    printf("%6d - %4.2f\n", cels, conversion(cels));
    cels -= 10;
  }
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12c,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    117b <main+0x4b>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <conversion@plt>
mov    -0xc(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x136,%ebx
lea    0xec0(%rip),%r14
add    $0xfffffff6,%ebx
mov    %ebx,%edi
call   1050 <conversion@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0xa,%ebx
ja     1140 <main+0x10>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%6d - %4.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 300, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call double @conversion(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7, double %9)
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 10
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%6d - %4.2f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 300, %0 ], [ %5, %1 ]
%3 = tail call double @conversion(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2, double %3)
%5 = add nsw i32 %2, -10
%6 = icmp ugt i32 %2, 10
br i1 %6, label %1, label %7
7: ; preds = %1
%8 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int divTest(int);
int task5() { return divTest(20); }


x86 assembly (clang, -O0):
<task5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
call   1030 <divTest@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<task5>:
mov    $0x14,%edi
jmp    1030 <divTest@plt>

LLVM IR (-O0):
define i32 @task5() {
%1 = call i32 @divTest(i32 20)
ret i32 %1
}

LLVM IR (-O2):
define i32 @task5() {
%1 = tail call i32 @divTest(i32 20)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *indexToStr(int cliIndex) {
  static char buf[80];
  sprintf(buf, "%d", cliIndex);
  return buf;
}


x86 assembly (clang, -O0):
<indexToStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexToStr>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@indexToStr.buf = internal global [80 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @indexToStr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @indexToStr.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @indexToStr.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@indexToStr.buf = internal global [80 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @indexToStr(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @indexToStr.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @indexToStr.buf, i64 0, i64 0)
}
long NumSift(long *array, unsigned long k) {
  if (array[k] < array[k + 1L])
    ++k;
  return array[k];
}


x86 assembly (clang, -O0):
<NumSift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
cmp    0x8(%rcx,%rdx,8),%rax
jge    1137 <NumSift+0x37>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumSift>:
mov    (%rdi,%rsi,8),%rax
cmp    0x8(%rdi,%rsi,8),%rax
lea    0x1(%rsi),%rax
cmovge %rsi,%rax
mov    (%rdi,%rax,8),%rax
ret

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

LLVM IR (-O2):
define i64 @NumSift(i64* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i64, i64* %0, i64 %1
%4 = load i64, i64* %3
%5 = add i64 %1, 1
%6 = getelementptr inbounds i64, i64* %0, i64 %5
%7 = load i64, i64* %6
%8 = icmp slt i64 %4, %7
%9 = select i1 %8, i64 %5, i64 %1
%10 = getelementptr inbounds i64, i64* %0, i64 %9
%11 = load i64, i64* %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_sql_comments() {
  test_parser_verify_parse(test_parser_sourcefile("sql", " --comment"), "sql",
                           "", "--comment", 0);
}


x86 assembly (clang, -O0):
<test_sql_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebc(%rip),%rdx
lea    0xeb7(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sql_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec5(%rip),%rdx
lea    0xec0(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sql\00"
@.str.1 = [11 x i8] c" --comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"--comment\00"
define void @test_sql_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"sql\00"
@.str.1 = [11 x i8] c" --comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"--comment\00"
define void @test_sql_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
int ft_count2darray(char **arr) {
  int i;
  int count;
  i = -1;
  count = 0;
  while (arr[++i])
    count++;
  return (count);
}


x86 assembly (clang, -O0):
<ft_count2darray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     113f <ft_count2darray+0x3f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <ft_count2darray+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_count2darray>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <ft_count2darray+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_count2darray(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %5, %2 ], [ -1, %1 ]
%4 = phi i32 [ %9, %2 ], [ 0, %1 ]
%5 = add nsw i64 %3, 1
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
%9 = add nuw nsw i32 %4, 1
br i1 %8, label %10, label %2
10: ; preds = %2
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
unsigned short read_le_word(FILE *f) {
  unsigned char c;
  unsigned short i;
  fread(&c, sizeof(char), 1, f);
  i = c;
  fread(&c, sizeof(char), 1, f);
  i |= (c << 8);
  return i;
}


x86 assembly (clang, -O0):
<read_le_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
movzbl -0x9(%rbp),%eax
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
movzbl -0x9(%rbp),%ecx
shl    $0x8,%ecx
movzwl -0xc(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xc(%rbp)
movzwl -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_le_word>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf(%rsp),%r14
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
movzbl 0xf(%rsp),%ebp
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
movzbl 0xf(%rsp),%eax
shl    $0x8,%eax
or     %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @read_le_word(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca i16
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @fread(i8* %3, i32 1, i32 1, i32* %5)
%7 = load i8, i8* %3
%8 = zext i8 %7 to i16
store i16 %8, i16* %4
%9 = load i32*, i32** %2
%10 = call i32 @fread(i8* %3, i32 1, i32 1, i32* %9)
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
%16 = or i32 %15, %13
%17 = trunc i32 %16 to i16
store i16 %17, i16* %4
%18 = load i16, i16* %4
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @read_le_word(i32* nocapture %0) {
%2 = alloca i8
%3 = call i32 @fread(i8* %2, i32 1, i32 1, i32* %0)
%4 = load i8, i8* %2
%5 = call i32 @fread(i8* %2, i32 1, i32 1, i32* %0)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i16
%8 = shl nuw i16 %7, 8
%9 = zext i8 %4 to i16
%10 = or i16 %8, %9
ret i16 %10
}
/* Variables and functions */
int ft_strlen(char *);
void ft_strclr(char *s) {
  int i;
  if (s) {
    i = ft_strlen(s);
    while (i >= 0) {
      s[i] = '\0';
      i--;
    }
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115c <ft_strclr+0x4c>
mov    -0x8(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1157 <ft_strclr+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <ft_strclr+0x23>
jmp    115c <ft_strclr+0x4c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
push   %rbx
test   %rdi,%rdi
je     1142 <ft_strclr+0x22>
mov    %rdi,%rbx
call   1030 <ft_strlen@plt>
test   %eax,%eax
js     1142 <ft_strclr+0x22>
add    $0x1,%eax
mov    %rbx,%rdi
xor    %esi,%esi
mov    %rax,%rdx
call   1040 <memset@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = add nuw i32 %4, 1
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *add_nl(const char *orig) {
  int len = strlen(orig);
  char *new = malloc(sizeof(char) * (len + 2));
  memset(new, '\0', len + 2);
  strncpy(new, orig, len);
  strcat(new, "\n");
  return new;
}


x86 assembly (clang, -O0):
<add_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x2,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xe55(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_nl>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%r15d
lea    0x2(%r15),%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <strncpy@plt>
lea    0xe6f(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i8* @add_nl(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 2
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 2
%16 = call i32 @memset(i8* %13, i8 signext 0, i32 %15)
%17 = load i8*, i8** %4
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = call i32 @strncpy(i8* %17, i8* %18, i32 %19)
%21 = load i8*, i8** %4
%22 = call i32 @strcat(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i8* @add_nl(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 2
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @memset(i8* %4, i8 signext 0, i32 %3)
%6 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %2)
%7 = tail call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
/* Variables and functions */
int mprotect(const void *addr __attribute__((unused)),
             size_t len __attribute__((unused)),
             int prot __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<mprotect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mprotect(i8* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float x;
  printf("Enter x: ");
  scanf("%f", &x);
  printf("The value of y = 4x + 3 is %.2f", 4 * x + 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xea6(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe9e(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xeb2(%rip),%xmm0
addss  0xeae(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Enter x: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [32 x i8] c"The value of y = 4x + 3 is %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = call float @llvm.fmuladd.f32(float 4.000000e+00, float %5, float 3.000000e+00)
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Enter x: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [32 x i8] c"The value of y = 4x + 3 is %.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call float @llvm.fmuladd.f32(float %5, float 4.000000e+00, float 3.000000e+00)
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}