xunge/DecIR huggingface dataset:
int clear_score_dialog() {
  char text[][(46 - 2)] = {
      "%i) Delete all the saved scores.",
      "%i) No. Don't delete them.",
  };
  return create_numbered_dialog("CLEAR SCORES?", (char *)text, 2);
}


x86 assembly (clang, -O0):
<clear_score_dialog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x60(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x58,%edx
call   1030 <memcpy@plt>
lea    -0x60(%rbp),%rsi
lea    0xf10(%rip),%rdi
mov    $0x2,%edx
mov    $0x0,%al
call   1040 <create_numbered_dialog@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_score_dialog>:
sub    $0x58,%rsp
mov    0xf35(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xf19(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xefd(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xef6(%rip),%rdi
mov    %rsp,%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <create_numbered_dialog@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.clear_score_dialog.text = [2 x [44 x i8]] [[44 x i8] c"%i) Delete all the saved scores.\00\00\00\00\00\00\00\00\00\00\00\00", [44 x i8] c"%i) No. Don't delete them.\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [14 x i8] c"CLEAR SCORES?\00"
define i32 @clear_score_dialog() {
%1 = alloca [2 x [44 x i8]]
%2 = bitcast [2 x [44 x i8]]* %1 to i8*
%3 = getelementptr inbounds [2 x [44 x i8]], [2 x [44 x i8]]* %1, i64 0, i64 0
%4 = bitcast [44 x i8]* %3 to i8*
%5 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @create_numbered_dialog to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4, i32 2)
ret i32 %5
}

LLVM IR (-O2):
@__const.clear_score_dialog.text = [2 x [44 x i8]] [[44 x i8] c"%i) Delete all the saved scores.\00\00\00\00\00\00\00\00\00\00\00\00", [44 x i8] c"%i) No. Don't delete them.\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [14 x i8] c"CLEAR SCORES?\00"
define i32 @clear_score_dialog() {
%1 = alloca [2 x [44 x i8]]
%2 = getelementptr inbounds [2 x [44 x i8]], [2 x [44 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @create_numbered_dialog to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2, i32 2)
ret i32 %3
}
double f_prime1(double x) { return x * 2; }


x86 assembly (clang, -O0):
<f_prime1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_prime1>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @f_prime1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 2.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @f_prime1(double %0) {
%2 = fmul double %0, 2.000000e+00
ret double %2
}
/* Variables and functions */
char *getHomeDir();
char *getPersonalDataDir(void) {
  static char *personal_data_dir = NULL;
  if (personal_data_dir == NULL)
    personal_data_dir = getHomeDir();
  return personal_data_dir;
}


x86 assembly (clang, -O0):
<getPersonalDataDir>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x0,0x2f14(%rip)
jne    1130 <getPersonalDataDir+0x20>
mov    $0x0,%al
call   1030 <getHomeDir@plt>
mov    %rax,0x2f00(%rip)
mov    0x2ef9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPersonalDataDir>:
push   %rax
mov    0x2f18(%rip),%rax
test   %rax,%rax
je     111f <getPersonalDataDir+0xf>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <getHomeDir@plt>
mov    %rax,0x2f03(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@getPersonalDataDir.personal_data_dir = internal global i8* null
define i8* @getPersonalDataDir() {
%1 = load i8*, i8** @getPersonalDataDir.personal_data_dir
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i8* (...) @getHomeDir()
store i8* %4, i8** @getPersonalDataDir.personal_data_dir
br label %5
5: ; preds = %3, %0
%6 = load i8*, i8** @getPersonalDataDir.personal_data_dir
ret i8* %6
}

LLVM IR (-O2):
@getPersonalDataDir.personal_data_dir = internal unnamed_addr global i8* null
define i8* @getPersonalDataDir() {
%1 = load i8*, i8** @getPersonalDataDir.personal_data_dir
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* (...) @getHomeDir()
store i8* %4, i8** @getPersonalDataDir.personal_data_dir
br label %5
5: ; preds = %3, %0
%6 = phi i8* [ %4, %3 ], [ %1, %0 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ randomPlace(char *);
void test_randomPlace() {
  printf("Teste of randomPlace()...\n");
  char place[150];
  randomPlace(place);
  printf("Found: %s\n", place);
}


x86 assembly (clang, -O0):
<test_randomPlace>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
call   1040 <randomPlace@plt>
lea    -0xa0(%rbp),%rsi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_randomPlace>:
push   %rbx
sub    $0xa0,%rsp
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <randomPlace@plt>
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Teste of randomPlace()...\0A\00"
@.str.1 = [11 x i8] c"Found: %s\0A\00"
define void @test_randomPlace() {
%1 = alloca [150 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [150 x i8], [150 x i8]* %1, i64 0, i64 0
%4 = call i32 @randomPlace(i8* %3)
%5 = getelementptr inbounds [150 x i8], [150 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"Found: %s\0A\00"
@str = [26 x i8] c"Teste of randomPlace()...\00"
define void @test_randomPlace() {
%1 = alloca [150 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [150 x i8], [150 x i8]* %1, i64 0, i64 0
%4 = call i32 @randomPlace(i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
int checkRegisterNumber(int reg) { return reg < 10 && 0 <= reg && reg != 7; }


x86 assembly (clang, -O0):
<checkRegisterNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    1130 <checkRegisterNumber+0x30>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1130 <checkRegisterNumber+0x30>
cmpl   $0x7,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkRegisterNumber>:
cmp    $0xa,%edi
setb   %al
cmp    $0x7,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @checkRegisterNumber(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 0, %6
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 7
br label %11
11: ; preds = %8, %5, %1
%12 = phi i1 [ false, %5 ], [ false, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @checkRegisterNumber(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = icmp ne i32 %0, 7
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int egetc();
long to32bit(int, int, int, int);
long int read32bit(void) {
  int c1, c2, c3, c4;
  c1 = egetc();
  c2 = egetc();
  c3 = egetc();
  c4 = egetc();
  return to32bit(c1, c2, c3, c4);
}


x86 assembly (clang, -O0):
<read32bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <egetc@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <egetc@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <egetc@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <egetc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <to32bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read32bit>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <egetc@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <egetc@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <egetc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <egetc@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <to32bit@plt>

LLVM IR (-O0):
define i64 @read32bit() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @egetc()
store i32 %5, i32* %1
%6 = call i32 (...) @egetc()
store i32 %6, i32* %2
%7 = call i32 (...) @egetc()
store i32 %7, i32* %3
%8 = call i32 (...) @egetc()
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i64 @to32bit(i32 %9, i32 %10, i32 %11, i32 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @read32bit() {
%1 = tail call i32 (...) @egetc()
%2 = tail call i32 (...) @egetc()
%3 = tail call i32 (...) @egetc()
%4 = tail call i32 (...) @egetc()
%5 = tail call i64 @to32bit(i32 %1, i32 %2, i32 %3, i32 %4)
ret i64 %5
}
int ade7759_initialize_ring(struct iio_ring_buffer *ring) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define i32 @ade7759_initialize_ring(%struct.iio_ring_buffer* nocapture readnone %0) {
ret i32 0
}
double internal_sign_d(double value) {
  return (value >= 0 ? (value == 0 ? 0 : 1) : -1);
}


x86 assembly (clang, -O0):
<internal_sign_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1143 <internal_sign_d+0x43>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0x1,%eax
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <internal_sign_d+0x50>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <internal_sign_d+0x50>
mov    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_sign_d>:
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmpeqsd %xmm1,%xmm2
movsd  0xeeb(%rip),%xmm3
andnpd %xmm3,%xmm2
cmpnlesd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @internal_sign_d(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load double, double* %2
%7 = fcmp oeq double %6, 0.000000e+00
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %5
%12 = phi i32 [ %9, %5 ], [ -1, %10 ]
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @internal_sign_d(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = fcmp oeq double %0, 0.000000e+00
%4 = select i1 %3, double 0.000000e+00, double 1.000000e+00
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
void msg_sleep(int sig) {
  puts("got SIGINT, sleep...");
  sleep(3);
}


x86 assembly (clang, -O0):
<msg_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_sleep>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"got SIGINT, sleep...\00"
define void @msg_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"got SIGINT, sleep...\00"
define void @msg_sleep(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 3)
ret void
}
/* Variables and functions */
int close(int);
int beaglelogic_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<beaglelogic_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @beaglelogic_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ put(char);
void hex(unsigned char c) {
  put("0123456789abcdef"[(c >> 4) & 15]);
  put("0123456789abcdef"[c & 15]);
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xece(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <put@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xeb4(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rbx,%rax
shr    $0x4,%rax
lea    0xedc(%rip),%r14
movsbl (%rax,%r14,1),%edi
call   1030 <put@plt>
and    $0xf,%ebx
movsbl (%rbx,%r14,1),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <put@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789abcdef\00"
define void @hex(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = and i32 %5, 15
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = call i32 @put(i8 signext %9)
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = and i32 %12, 15
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @put(i8 signext %16)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define void @hex(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = lshr i32 %2, 4
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @put(i8 signext %6)
%8 = and i32 %2, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @put(i8 signext %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int gs_state_update_overprint();
int main() {
  if (gs_state_update_overprint() != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gs_state_update_overprint@plt>
cmp    $0x1,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <gs_state_update_overprint@plt>
cmp    $0x1,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gs_state_update_overprint()
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int moveright(int start, int *intsnps, int snpsize, int pos) {
  int i = start;
  while (i < snpsize && intsnps[i] <= pos)
    ++i;
  return i - 1;
}


x86 assembly (clang, -O0):
<moveright>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x1d(%rbp)
jge    113c <moveright+0x3c>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
setle  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    114c <moveright+0x4c>
jmp    115a <moveright+0x5a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <moveright+0x17>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveright>:
mov    %edi,%eax
cmp    %edx,%edi
jge    1121 <moveright+0x21>
movslq %eax,%rdi
lea    (%rsi,%rdi,4),%rsi
nopl   (%rax)
cmp    %ecx,(%rsi)
jg     1121 <moveright+0x21>
add    $0x1,%eax
add    $0x4,%rsi
cmp    %eax,%edx
jne    1110 <moveright+0x10>
mov    %edx,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @moveright(i32 %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
store i32 %10, i32* %9
br label %11
11: ; preds = %25, %4
%12 = load i32, i32* %9
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load i32*, i32** %6
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %8
%22 = icmp sle i32 %20, %21
br label %23
23: ; preds = %15, %11
%24 = phi i1 [ false, %11 ], [ %22, %15 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %9
br label %11
28: ; preds = %23
%29 = load i32, i32* %9
%30 = sub nsw i32 %29, 1
ret i32 %30
}

LLVM IR (-O2):
define i32 @moveright(i32 %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %0, %2
br i1 %5, label %6, label %19
6: ; preds = %4
%7 = sext i32 %0 to i64
br label %8
8: ; preds = %6, %13
%9 = phi i64 [ %7, %6 ], [ %14, %13 ]
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = icmp sgt i32 %11, %3
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = add nsw i64 %9, 1
%15 = trunc i64 %14 to i32
%16 = icmp eq i32 %15, %2
br i1 %16, label %19, label %8
17: ; preds = %8
%18 = trunc i64 %9 to i32
br label %19
19: ; preds = %13, %17, %4
%20 = phi i32 [ %0, %4 ], [ %18, %17 ], [ %2, %13 ]
%21 = add nsw i32 %20, -1
ret i32 %21
}
/* Variables and functions */
double arccosh(int);
double arcsech(double n) { return arccosh(1 / n); }


x86 assembly (clang, -O0):
<arcsech>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <arccosh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arcsech>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <arccosh@plt>

LLVM IR (-O0):
define double @arcsech(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @arccosh(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @arcsech(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fptosi double %2 to i32
%4 = tail call double @arccosh(i32 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ close(int /*<<< orphan*/);
void close_std_files() {
  close(STDIN_FILENO);
  close(STDOUT_FILENO);
  close(STDERR_FILENO);
}


x86 assembly (clang, -O0):
<close_std_files>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_std_files>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <close@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
define void @close_std_files() {
%1 = load i32, i32* @STDIN_FILENO
%2 = call i32 @close(i32 %1)
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @close(i32 %3)
%5 = load i32, i32* @STDERR_FILENO
%6 = call i32 @close(i32 %5)
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
define void @close_std_files() {
%1 = load i32, i32* @STDIN_FILENO
%2 = tail call i32 @close(i32 %1)
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @close(i32 %3)
%5 = load i32, i32* @STDERR_FILENO
%6 = tail call i32 @close(i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fpu_control_t;

/* Variables and functions */
int /*<<< orphan*/ _FPU_GETCW(int /*<<< orphan*/);
int /*<<< orphan*/ _FPU_MASK_DM;
int /*<<< orphan*/ _FPU_MASK_IM;
int /*<<< orphan*/ _FPU_MASK_OM;
int /*<<< orphan*/ _FPU_MASK_ZM;
int /*<<< orphan*/ _FPU_SETCW(int /*<<< orphan*/);
void fpudebug() {
  fpu_control_t cw;
  _FPU_GETCW(cw);
  cw &= ~(_FPU_MASK_OM);
  cw &= ~(_FPU_MASK_ZM);
  cw &= ~(_FPU_MASK_DM);
  cw &= ~(_FPU_MASK_IM);
  _FPU_SETCW(cw);
}


x86 assembly (clang, -O0):
<fpudebug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_FPU_SETCW@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpudebug>:
push   %rax
call   1030 <_FPU_GETCW@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <_FPU_SETCW@plt>

LLVM IR (-O0):
@_FPU_MASK_OM = global i32 0
@_FPU_MASK_ZM = global i32 0
@_FPU_MASK_DM = global i32 0
@_FPU_MASK_IM = global i32 0
define void @fpudebug() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @_FPU_GETCW(i32 %2)
%4 = load i32, i32* @_FPU_MASK_OM
%5 = xor i32 %4, -1
%6 = load i32, i32* %1
%7 = and i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* @_FPU_MASK_ZM
%9 = xor i32 %8, -1
%10 = load i32, i32* %1
%11 = and i32 %10, %9
store i32 %11, i32* %1
%12 = load i32, i32* @_FPU_MASK_DM
%13 = xor i32 %12, -1
%14 = load i32, i32* %1
%15 = and i32 %14, %13
store i32 %15, i32* %1
%16 = load i32, i32* @_FPU_MASK_IM
%17 = xor i32 %16, -1
%18 = load i32, i32* %1
%19 = and i32 %18, %17
store i32 %19, i32* %1
%20 = load i32, i32* %1
%21 = call i32 @_FPU_SETCW(i32 %20)
ret void
}

LLVM IR (-O2):
@_FPU_MASK_OM = global i32 0
@_FPU_MASK_ZM = global i32 0
@_FPU_MASK_DM = global i32 0
@_FPU_MASK_IM = global i32 0
define void @fpudebug() {
%1 = tail call i32 @_FPU_GETCW(i32 undef)
%2 = tail call i32 @_FPU_SETCW(i32 0)
ret void
}
/* Type definitions */
struct Graph {
  int dummy;
};

/* Variables and functions */
struct Graph *init_Graph(int, int);
int /*<<< orphan*/ release_Graph(struct Graph *);
int /*<<< orphan*/ show_Graph(struct Graph *);
int main() {
  struct Graph *p_Graph = init_Graph(12, 12);
  show_Graph(p_Graph);
  release_Graph(p_Graph);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%esi
mov    %esi,%edi
call   1050 <init_Graph@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <show_Graph@plt>
mov    -0x10(%rbp),%rdi
call   1040 <release_Graph@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xc,%edi
mov    $0xc,%esi
call   1050 <init_Graph@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <show_Graph@plt>
mov    %rbx,%rdi
call   1040 <release_Graph@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Graph = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.Graph*
store i32 0, i32* %1
%3 = call %struct.Graph* @init_Graph(i32 12, i32 12)
store %struct.Graph* %3, %struct.Graph** %2
%4 = load %struct.Graph*, %struct.Graph** %2
%5 = call i32 @show_Graph(%struct.Graph* %4)
%6 = load %struct.Graph*, %struct.Graph** %2
%7 = call i32 @release_Graph(%struct.Graph* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.Graph = type { i32 }
define i32 @main() {
%1 = tail call %struct.Graph* @init_Graph(i32 12, i32 12)
%2 = tail call i32 @show_Graph(%struct.Graph* %1)
%3 = tail call i32 @release_Graph(%struct.Graph* %1)
ret i32 0
}
const char *help(int argc, char *argv[]) {
  return "Available commands:\n"
         "\n"
         "help\n"
         "set <option> <value> ...\n"
         "subset <section> <option> <value>\n"
         "create <section>\n"
         "destroy <section>\n"
         "dump\n"
         "quit\n"
         "\n"
         "<option> is one of 'bool', 'int' 'string' and 'float'.\n";
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeee(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [187 x i8] c"Available commands:\0A\0Ahelp\0Aset <option> <value> ...\0Asubset <section> <option> <value>\0Acreate <section>\0Adestroy <section>\0Adump\0Aquit\0A\0A<option> is one of 'bool', 'int' 'string' and 'float'.\0A\00"
define i8* @help(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [187 x i8] c"Available commands:\0A\0Ahelp\0Aset <option> <value> ...\0Asubset <section> <option> <value>\0Acreate <section>\0Adestroy <section>\0Adump\0Aquit\0A\0A<option> is one of 'bool', 'int' 'string' and 'float'.\0A\00"
define i8* @help(i32 %0, i8** nocapture readnone %1) {
ret i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0)
}
void _Condition_Destroy(struct _Condition_Control *_cond) { (void)_cond; }


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

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

LLVM IR (-O0):
%struct._Condition_Control = type opaque
define void @_Condition_Destroy(%struct._Condition_Control* %0) {
%2 = alloca %struct._Condition_Control*
store %struct._Condition_Control* %0, %struct._Condition_Control** %2
%3 = load %struct._Condition_Control*, %struct._Condition_Control** %2
ret void
}

LLVM IR (-O2):
%struct._Condition_Control = type opaque
define void @_Condition_Destroy(%struct._Condition_Control* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *, int *);
int test(int *p1, int *p2) {
  int *p;
  for (p = p2; p != 0; p++) {
    if (!foo(p, p1))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116b <test+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <foo@plt>
cmp    $0x0,%eax
jne    1155 <test+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1172 <test+0x62>
jmp    115a <test+0x4a>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    1128 <test+0x18>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   %rsi,%rsi
je     113d <test+0x2d>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <foo@plt>
add    $0x4,%rbx
test   %eax,%eax
jne    1120 <test+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32* %0, i32* %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32* [ %8, %4 ], [ %1, %2 ]
%6 = tail call i32 @foo(i32* %5, i32* %0)
%7 = icmp eq i32 %6, 0
%8 = getelementptr inbounds i32, i32* %5, i64 1
br i1 %7, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ 1, %2 ], [ 0, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void end_syntax_multiline_block(void) { printf("</div>"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"</div>\00"
define void @end_syntax_multiline_block() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"</div>\00"
define void @end_syntax_multiline_block() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
void dummyaudio_RomClosed(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dummyaudio_RomClosed() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *const);
void fatal_error(char const *const msg) {
  perror(msg);
  exit(1);
}


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

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

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

LLVM IR (-O2):
define void @fatal_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int intcmp(const void *a, const void *b) { return (*(int *)a) - (*(int *)b); }


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

x86 assembly (clang, -O2):
<intcmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int mini_crt_init_io() { return 1; }


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

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

LLVM IR (-O0):
define i32 @mini_crt_init_io() {
ret i32 1
}

LLVM IR (-O2):
define i32 @mini_crt_init_io() {
ret i32 1
}
int compar_long(void *long1, void *long2) {
  int l1 = *((long int *)long1), l2 = *((long int *)long2);
  if (l1 > l2)
    return 1;
  else if (l2 > l1)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compar_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1138 <compar_long+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1157 <compar_long+0x57>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1150 <compar_long+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <compar_long+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar_long>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %eax,%ecx
setg   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compar_long(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = bitcast i8* %1 to i64*
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = icmp sgt i32 %5, %8
%10 = icmp sgt i32 %8, %5
%11 = sext i1 %10 to i32
%12 = select i1 %9, i32 1, i32 %11
ret i32 %12
}
/* Variables and functions */
void *malloc(long);
int /*<<< orphan*/ panic1(char *, int, char *, char *);
void *Marrayalloc(long size) {
  void *p;
  if (!(p = malloc(size)))
    panic1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/BMJHayward/graphviz/refs/heads/"
           "distrotech-graphviz/3rd/graphviz/cmd/lefty/mem.c",
           173, "Marrayallocate", "cannot allocate array");
  return p;
}


x86 assembly (clang, -O0):
<Marrayalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1162 <Marrayalloc+0x42>
lea    0xeb6(%rip),%rdi
mov    $0xad,%esi
lea    0xf54(%rip),%rdx
lea    0xf5c(%rip),%rcx
call   1030 <panic1@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Marrayalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114d <Marrayalloc+0x2d>
lea    0xecb(%rip),%rdi
lea    0xf6e(%rip),%rdx
lea    0xf76(%rip),%rcx
mov    $0xad,%esi
call   1030 <panic1@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/BMJHayward/graphviz/refs/heads/distrotech-graphviz/3rd/graphviz/cmd/lefty/mem.c\00"
@.str.1 = [15 x i8] c"Marrayallocate\00"
@.str.2 = [22 x i8] c"cannot allocate array\00"
define i8* @Marrayalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @panic1(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 173, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/BMJHayward/graphviz/refs/heads/distrotech-graphviz/3rd/graphviz/cmd/lefty/mem.c\00"
@.str.1 = [15 x i8] c"Marrayallocate\00"
@.str.2 = [22 x i8] c"cannot allocate array\00"
define noalias i8* @Marrayalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @panic1(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 173, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int main() {
  int x = 0;
  int y = 1;
  int z;
  int h;
  while (x < 1000) {
    x++;
    y = x / 2;
    h = y % x;
    y++;
  }
  z = x + y + h;
  return z;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1155 <main+0x55>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2001
}
int test_imm_9Cuint8_mem(unsigned char *val) {
  return ((*val) & (0x9C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Cuint8_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, 156
%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_9Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -100
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
void progress(void) {
  static unsigned int cnt = 0;
  cnt++;
  if (0 == cnt % 64) {
    putchar('.');
    fflush(stdout);
  }
}


x86 assembly (clang, -O0):
<progress>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f01(%rip)
mov    0x2efb(%rip),%ecx
and    $0x3f,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    115e <progress+0x3e>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<progress>:
push   %rax
mov    0x2f0d(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f04(%rip)
test   $0x3f,%al
je     1136 <progress+0x16>
pop    %rax
ret
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@progress.cnt = internal global i32 0
@stdout = global i32 0
define void @progress() {
%1 = load i32, i32* @progress.cnt
%2 = add i32 %1, 1
store i32 %2, i32* @progress.cnt
%3 = load i32, i32* @progress.cnt
%4 = urem i32 %3, 64
%5 = icmp eq i32 0, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @putchar(i8 signext 46)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
br label %10
10: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@progress.cnt = internal unnamed_addr global i32 0
@stdout = global i32 0
define void @progress() {
%1 = load i32, i32* @progress.cnt
%2 = add i32 %1, 1
store i32 %2, i32* @progress.cnt
%3 = and i32 %2, 63
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = tail call i32 @putchar(i8 signext 46)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
br label %9
9: ; preds = %5, %0
ret void
}
int func(char **A, char **B) {}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func(i8** nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 undef
}
void modulo_unsigned_var_Good(unsigned int len, unsigned int i) {
  char arr[len];
  arr[i % len] = 123;
}


x86 assembly (clang, -O0):
<modulo_unsigned_var_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %edx,%ecx
movb   $0x7b,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @modulo_unsigned_var_Good(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = urem i32 %11, %12
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %10, i64 %14
store i8 123, i8* %15
%16 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @modulo_unsigned_var_Good(i32 %0, i32 %1) {
ret void
}
void handle_WIND(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_WIND(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int plus1(int);
void test() { clang_analyzer_eval(plus1(2) == 3); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <plus1@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x2,%edi
call   1030 <plus1@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 @plus1(i32 2)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = call i32 @clang_analyzer_eval(i32 %3)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @plus1(i32 2)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h_form_str(char const *, char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ h_td_end();
int /*<<< orphan*/ h_td_start(char const *, int);
void h_td_empty_field(const char *name, int size, const char *class,
                      int colspan) {
  h_td_start(class, colspan);
  h_form_str(name, "text", size, NULL);
  h_td_end();
}


x86 assembly (clang, -O0):
<h_td_empty_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <h_td_start@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xea0(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <h_form_str@plt>
mov    $0x0,%al
call   1050 <h_td_end@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_td_empty_field>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
mov    %ecx,%esi
call   1040 <h_td_start@plt>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <h_form_str@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <h_td_end@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"text\00"
define void @h_td_empty_field(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i32, i32* %8
%11 = call i32 @h_td_start(i8* %9, i32 %10)
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @h_form_str(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %13, i32* null)
%15 = call i32 (...) @h_td_end()
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"text\00"
define void @h_td_empty_field(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @h_td_start(i8* %2, i32 %3)
%6 = tail call i32 @h_form_str(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1, i32* null)
%7 = tail call i32 (...) @h_td_end()
ret void
}