xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cylindre_of_bloc(unsigned int, unsigned int);
int /*<<< orphan*/ read_sector(int /*<<< orphan*/, int /*<<< orphan*/,
                               unsigned char *);
int /*<<< orphan*/ sector_of_bloc(unsigned int, unsigned int);
void read_bloc(unsigned int vol, unsigned int blk, unsigned char *buffer) {
  if (vol < 8 && blk < 512) {
    read_sector(cylindre_of_bloc(vol, blk), sector_of_bloc(vol, blk), buffer);
  }
}


x86 assembly (clang, -O0):
<read_bloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x8,-0x4(%rbp)
jae    1180 <read_bloc+0x50>
cmpl   $0x200,-0x8(%rbp)
jae    1180 <read_bloc+0x50>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <cylindre_of_bloc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <sector_of_bloc@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1030 <read_sector@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x7,%edi
ja     1175 <read_bloc+0x45>
mov    %esi,%ebp
cmp    $0x1ff,%esi
ja     1175 <read_bloc+0x45>
mov    %rdx,%r14
mov    %edi,%ebx
mov    %ebp,%esi
call   1040 <cylindre_of_bloc@plt>
mov    %eax,%r15d
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <sector_of_bloc@plt>
mov    %r15d,%edi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <read_sector@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @read_bloc(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = icmp ult i32 %7, 8
br i1 %8, label %9, label %21
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp ult i32 %10, 512
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @cylindre_of_bloc(i32 %13, i32 %14)
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 @sector_of_bloc(i32 %16, i32 %17)
%19 = load i8*, i8** %6
%20 = call i32 @read_sector(i32 %15, i32 %18, i8* %19)
br label %21
21: ; preds = %12, %9, %3
ret void
}

LLVM IR (-O2):
define void @read_bloc(i32 %0, i32 %1, i8* %2) {
%4 = icmp ult i32 %0, 8
%5 = icmp ult i32 %1, 512
%6 = and i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = tail call i32 @cylindre_of_bloc(i32 %0, i32 %1)
%9 = tail call i32 @sector_of_bloc(i32 %0, i32 %1)
%10 = tail call i32 @read_sector(i32 %8, i32 %9, i8* %2)
br label %11
11: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ funct_one();
int /*<<< orphan*/ funct_two();
int main(int argc, char *argv[]) {
  funct_one();
  funct_two();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @funct_one()
%4 = tail call i32 (...) @funct_two()
ret i32 0
}
void __cxa_finalize(void *d) { (void)d; }


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

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

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

LLVM IR (-O2):
define void @__cxa_finalize(i8* nocapture %0) {
ret void
}
char jam_toupper(char ch) {
  return ((char)(((ch >= 'a') && (ch <= 'z')) ? (ch + 'A' - 'a') : ch));
}


x86 assembly (clang, -O0):
<jam_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <jam_toupper+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1136 <jam_toupper+0x36>
movsbl -0x1(%rbp),%eax
add    $0x41,%eax
sub    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <jam_toupper+0x3d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jam_toupper>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @jam_toupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 65
%14 = sub nsw i32 %13, 97
br label %18
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %10
%19 = phi i32 [ %14, %10 ], [ %17, %15 ]
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @jam_toupper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
int trailz(int /*<<< orphan*/);
int subnet4_to_prefixlen(uint32_t sn) { return 32 - trailz(ntohl(sn)); }


x86 assembly (clang, -O0):
<subnet4_to_prefixlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,%edi
call   1030 <trailz@plt>
mov    %eax,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subnet4_to_prefixlen>:
push   %rax
call   1040 <ntohl@plt>
mov    %eax,%edi
call   1030 <trailz@plt>
mov    $0x20,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @subnet4_to_prefixlen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ntohl(i32 %3)
%5 = call i32 @trailz(i32 %4)
%6 = sub nsw i32 32, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @subnet4_to_prefixlen(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
%3 = tail call i32 @trailz(i32 %2)
%4 = sub nsw i32 32, %3
ret i32 %4
}
void av_frame_set_channels() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_set_channels() {
ret void
}
int f9() {
  int x = 4;
  x = x + 10;
  return 1;
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f9() {
%1 = alloca i32
store i32 4, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 10
store i32 %3, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @f9() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void loop_dump(double *state, size_t n) {
  for (size_t i = 0; i < n; ++i) {
    printf("%f  ", state[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<loop_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1162 <loop_dump+0x52>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <loop_dump+0x18>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_dump>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1159 <loop_dump+0x39>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <loop_dump+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%f \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @loop_dump(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds double, double* %11, i64 %12
%14 = load double, double* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%f \00"
define void @loop_dump(double* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %6
}
int get_hash(struct cli_fields *fields, unsigned char *md5digest) { return 0; }


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

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

LLVM IR (-O0):
%struct.cli_fields = type opaque
define i32 @get_hash(%struct.cli_fields* %0, i8* %1) {
%3 = alloca %struct.cli_fields*
%4 = alloca i8*
store %struct.cli_fields* %0, %struct.cli_fields** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.cli_fields = type opaque
define i32 @get_hash(%struct.cli_fields* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int strlen(char *);
int read_line(FILE *stream, char line[1000]) {
  if (fgets(line, 1000, stream) == NULL)
    return 1;
  line[strlen(line) - 1] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x3e8,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    1158 <read_line+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1180 <read_line+0x60>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    %rsi,%rdi
mov    $0x3e8,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     114c <read_line+0x2c>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @read_line(i32* nocapture %0, i8* %1) {
%3 = tail call i32* @fgets(i8* %1, i32 1000, i32* %0)
%4 = icmp eq i32* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %1)
%7 = add nsw i32 %6, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int __m128i;

/* Variables and functions */
int _mm_slli_epi32(int, int);
int _mm_srli_epi32(int, int);
__m128i _mm_ROL(__m128i x, int n) {
  return _mm_slli_epi32(x, n) | _mm_srli_epi32(x, 32 - n);
}


x86 assembly (clang, -O0):
<_mm_ROL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_slli_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
sub    -0x8(%rbp),%esi
call   1040 <_mm_srli_epi32@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_ROL>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_mm_slli_epi32@plt>
mov    %eax,%r14d
mov    $0x20,%esi
sub    %ebx,%esi
mov    %ebp,%edi
call   1040 <_mm_srli_epi32@plt>
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_mm_ROL(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 = call i32 @_mm_slli_epi32(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = call i32 @_mm_srli_epi32(i32 %8, i32 %10)
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_mm_ROL(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_slli_epi32(i32 %0, i32 %1)
%4 = sub nsw i32 32, %1
%5 = tail call i32 @_mm_srli_epi32(i32 %0, i32 %4)
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *, int, char *);
void *malloc(size_t);
void *h2o_mem_alloc(size_t sz) {
  void *p = malloc(sz);
  if (p == NULL)
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/cwyang/h2o/refs/heads/master/"
               "lib/common/h2o/memory.h",
               375, "no memory");
  return p;
}


x86 assembly (clang, -O0):
<h2o_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <h2o_mem_alloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x177,%esi
lea    0xf38(%rip),%rdx
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <h2o_mem_alloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf53(%rip),%rdx
mov    $0x177,%esi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cwyang/h2o/refs/heads/master/lib/common/h2o/memory.h\00"
@.str.1 = [10 x i8] c"no memory\00"
define i8* @h2o_mem_alloc(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 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @h2o__fatal(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 375, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cwyang/h2o/refs/heads/master/lib/common/h2o/memory.h\00"
@.str.1 = [10 x i8] c"no memory\00"
define noalias i8* @h2o_mem_alloc(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 @h2o__fatal(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 375, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int gcd2nums(int, int);
int lcm2nums(int p, int q) { return (p * q) / gcd2nums(p, q); }


x86 assembly (clang, -O0):
<lcm2nums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd2nums@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm2nums>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <gcd2nums@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm2nums(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 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @gcd2nums(i32 %8, i32 %9)
%11 = sdiv i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @lcm2nums(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @gcd2nums(i32 %0, i32 %1)
%5 = sdiv i32 %3, %4
ret i32 %5
}
int randint(int min, int max) {
  static unsigned long long seed = 1;
  seed *= 3249286849523012805ULL;
  return (int)((unsigned int)seed % (max - min)) + min;
}


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movabs $0x2d17c92c972ad4c5,%rax
c9 17 2d
imul   0x2f04(%rip),%rax
mov    %rax,0x2efd(%rip)
mov    0x2ef6(%rip),%rax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
movabs $0x2d17c92c972ad4c5,%rax
c9 17 2d
imul   0x2f0e(%rip),%rax
mov    %rax,0x2f07(%rip)
sub    %edi,%esi
xor    %edx,%edx
div    %esi
lea    (%rdx,%rdi,1),%eax
ret

LLVM IR (-O0):
@randint.seed = internal global i64 1
define i32 @randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i64, i64* @randint.seed
%6 = mul i64 %5, 3249286849523012805
store i64 %6, i64* @randint.seed
%7 = load i64, i64* @randint.seed
%8 = trunc i64 %7 to i32
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = urem i32 %8, %11
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
@randint.seed = internal unnamed_addr global i64 1
define i32 @randint(i32 %0, i32 %1) {
%3 = load i64, i64* @randint.seed
%4 = mul i64 %3, 3249286849523012805
store i64 %4, i64* @randint.seed
%5 = trunc i64 %4 to i32
%6 = sub nsw i32 %1, %0
%7 = urem i32 %5, %6
%8 = add nsw i32 %7, %0
ret i32 %8
}
void adc_init() {}


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

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

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

LLVM IR (-O2):
define void @adc_init() {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t I2SInPointerGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(0x40021000 + 0x00000024))));
}


x86 assembly (clang, -O0):
<I2SInPointerGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x40021024,%eax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SInPointerGet>:
mov    %rdi,-0x8(%rsp)
mov    0x40021024,%rax
40
ret

LLVM IR (-O0):
define i64 @I2SInPointerGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073877028 to i64*)
ret i64 %3
}

LLVM IR (-O2):
define i64 @I2SInPointerGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073877028 to i64*)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strangePrinter(char *);
int main() {
  char *s = "qjhztuoyfrxnpzmvxadzqgcmbteytrbzhchsmrtrwppfaxzblxanohjdgwghnlgzfb"
            "rdcsgadtisyvopvcbhuxkcbxhejfpxmgzl";
  int res = strangePrinter(s);
  printf("sz: %d\n", res);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [101 x i8] c"qjhztuoyfrxnpzmvxadzqgcmbteytrbzhchsmrtrwppfaxzblxanohjdgwghnlgzfbrdcsgadtisyvopvcbhuxkcbxhejfpxmgzl\00"
@.str.1 = [8 x i8] c"sz: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @strangePrinter(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wNotYet(char *);
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasDirExists() {
  wNotYet("DirExists");
  wPushNumber(0);
}


x86 assembly (clang, -O0):
<wBasDirExists>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <wNotYet@plt>
xor    %edi,%edi
call   1030 <wPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasDirExists>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <wNotYet@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <wPushNumber@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"DirExists\00"
define void @wBasDirExists() {
%1 = call i32 @wNotYet(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @wPushNumber(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"DirExists\00"
define void @wBasDirExists() {
%1 = tail call i32 @wNotYet(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @wPushNumber(i32 0)
ret void
}
/* Variables and functions */
int bin_append_posn(int const, int const, char *, int const);
int az_bin_append_posn(const int arg, const int length, char *binary,
                       const int bin_posn) {
  if (bin_posn + length > 17940) {
    return 0;
  }
  return bin_append_posn(arg, length, binary, bin_posn);
}


x86 assembly (clang, -O0):
<az_bin_append_posn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x4614,%eax
jle    1142 <az_bin_append_posn+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1157 <az_bin_append_posn+0x47>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <bin_append_posn@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<az_bin_append_posn>:
lea    (%rcx,%rsi,1),%eax
cmp    $0x4614,%eax
jle    111d <az_bin_append_posn+0xd>
xor    %eax,%eax
ret
jmp    1030 <bin_append_posn@plt>

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

LLVM IR (-O2):
define i32 @az_bin_append_posn(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = add nsw i32 %3, %1
%6 = icmp sgt i32 %5, 17940
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @bin_append_posn(i32 %0, i32 %1, i8* %2, i32 %3)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ 0, %4 ]
ret i32 %10
}
int syscall1(int eax) {
  int result;
  asm("int $0x80" : "=a"(result) : "a"(eax));
  return result;
}


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

x86 assembly (clang, -O2):
<syscall1>:
mov    %edi,%eax
int    $0x80
ret

LLVM IR (-O0):
define i32 @syscall1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "int $$0x80", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @syscall1(i32 %0) {
%2 = tail call i32 asm "int $$0x80", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
double cosh(double);
double d_cosh(double *x) { return (cosh(*x)); }


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

x86 assembly (clang, -O2):
<d_cosh>:
movsd  (%rdi),%xmm0
jmp    1030 <cosh@plt>

LLVM IR (-O0):
define double @d_cosh(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call double @cosh(double %4)
ret double %5
}

LLVM IR (-O2):
define double @d_cosh(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @cosh(double %2)
ret double %3
}
void glCreateProgram(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ chr2setBank1(int);
void s4setParams9000(uint16_t addr, uint8_t val) {
  (void)addr;
  chr2setBank1(val << 11);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xb,%edi
jmp    1030 <chr2setBank1@plt>

LLVM IR (-O0):
define void @s4setParams9000(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 = shl i32 %6, 11
%8 = call i32 @chr2setBank1(i32 %7)
ret void
}

LLVM IR (-O2):
define void @s4setParams9000(i32 %0, i32 %1) {
%3 = shl i32 %1, 11
%4 = tail call i32 @chr2setBank1(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int setnoblock(int fd) {
  int flag = fcntl(fd, F_GETFL, 0);
  flag |= O_NONBLOCK;
  return fcntl(fd, F_SETFL, flag);
}


x86 assembly (clang, -O0):
<setnoblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnoblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @setnoblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* @O_NONBLOCK
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = call i32 @fcntl(i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @setnoblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i32 @fcntl(i32 %0, i32 %6, i32 %5)
ret i32 %7
}
void CL_HTTP_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @CL_HTTP_Shutdown() {
ret void
}
int f_eq_mr2(float *a1, float a2) { return !(((*a1) == (a2))); }


x86 assembly (clang, -O0):
<f_eq_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0xc(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_eq_mr2>:
cmpneqss (%rdi),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_eq_mr2(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp oeq float %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_eq_mr2(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp une float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct sexpr {
  int dummy;
};

/* Variables and functions */
struct sexpr *sexpr_new();
struct sexpr *sexpr_nil(void) {
  return sexpr_new();
}


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

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

LLVM IR (-O0):
%struct.sexpr = type { i32 }
define %struct.sexpr* @sexpr_nil() {
%1 = call %struct.sexpr* (...) @sexpr_new()
ret %struct.sexpr* %1
}

LLVM IR (-O2):
%struct.sexpr = type { i32 }
define %struct.sexpr* @sexpr_nil() {
%1 = tail call %struct.sexpr* (...) @sexpr_new()
ret %struct.sexpr* %1
}
/* Variables and functions */
int /*<<< orphan*/ sec_disconnect();
void rdp_disconnect(void) { sec_disconnect(); }


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

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

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

LLVM IR (-O2):
define void @rdp_disconnect() {
%1 = tail call i32 (...) @sec_disconnect()
ret void
}
/* Type definitions */
struct rlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rlist_add(struct rlist *, struct rlist *);
int /*<<< orphan*/ rlist_del(struct rlist *);
void rlist_move(struct rlist *to, struct rlist *item) {
  rlist_del(item);
  rlist_add(to, item);
}


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

x86 assembly (clang, -O2):
<rlist_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <rlist_del@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <rlist_add@plt>

LLVM IR (-O0):
%struct.rlist = type { i32 }
define void @rlist_move(%struct.rlist* %0, %struct.rlist* %1) {
%3 = alloca %struct.rlist*
%4 = alloca %struct.rlist*
store %struct.rlist* %0, %struct.rlist** %3
store %struct.rlist* %1, %struct.rlist** %4
%5 = load %struct.rlist*, %struct.rlist** %4
%6 = call i32 @rlist_del(%struct.rlist* %5)
%7 = load %struct.rlist*, %struct.rlist** %3
%8 = load %struct.rlist*, %struct.rlist** %4
%9 = call i32 @rlist_add(%struct.rlist* %7, %struct.rlist* %8)
ret void
}

LLVM IR (-O2):
%struct.rlist = type { i32 }
define void @rlist_move(%struct.rlist* %0, %struct.rlist* %1) {
%3 = tail call i32 @rlist_del(%struct.rlist* %1)
%4 = tail call i32 @rlist_add(%struct.rlist* %0, %struct.rlist* %1)
ret void
}
unsigned long read_size(char *data) {
  unsigned long result;
  unsigned long a, b, c, d;
  a = (unsigned char)data[0];
  b = (unsigned char)data[1];
  c = (unsigned char)data[2];
  d = (unsigned char)data[3];
  result = (a << 24) | (b << 16) | (c << 8) | d;
  return result;
}


x86 assembly (clang, -O0):
<read_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x18,%rax
mov    -0x20(%rbp),%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x28(%rbp),%rcx
shl    $0x8,%rcx
or     %rcx,%rax
or     -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_size>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @read_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %2
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
store i64 %11, i64* %4
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i64
store i64 %15, i64* %5
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i64
store i64 %19, i64* %6
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i64
store i64 %23, i64* %7
%24 = load i64, i64* %4
%25 = shl i64 %24, 24
%26 = load i64, i64* %5
%27 = shl i64 %26, 16
%28 = or i64 %25, %27
%29 = load i64, i64* %6
%30 = shl i64 %29, 8
%31 = or i64 %28, %30
%32 = load i64, i64* %7
%33 = or i64 %31, %32
store i64 %33, i64* %3
%34 = load i64, i64* %3
ret i64 %34
}

LLVM IR (-O2):
define i64 @read_size(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %3, 24
%14 = shl nuw nsw i64 %6, 16
%15 = or i64 %14, %13
%16 = shl nuw nsw i64 %9, 8
%17 = or i64 %15, %16
%18 = or i64 %17, %12
ret i64 %18
}
/* Variables and functions */
int write(int, char *, int);
int my_putstr(char *str) {
  int i;
  i = 0;
  while (str[i++])
    ;
  return (write(1, str, i));
}


x86 assembly (clang, -O0):
<my_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1144 <my_putstr+0x34>
jmp    1123 <my_putstr+0x13>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr>:
mov    %rdi,%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <my_putstr+0x10>
mov    $0x1,%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @my_putstr(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %4 to i32
%10 = tail call i32 @write(i32 1, i8* %0, i32 %9)
ret i32 %10
}
/* Variables and functions */
bool is_xdigit(char ch) {
  return (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') ||
         (ch >= 'A' && ch <= 'F');
}


x86 assembly (clang, -O0):
<is_xdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <is_xdigit+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_xdigit+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <is_xdigit+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_xdigit+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <is_xdigit+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_xdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_xdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_xdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void defaultOnClosed(void *p) {
  ((void)p);
  ;
}


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

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

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

LLVM IR (-O2):
define void @defaultOnClosed(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *op_get_time();
int /*<<< orphan*/ opd_do_jitdumps();
int /*<<< orphan*/ opd_ext_deinitialize();
int /*<<< orphan*/ opd_print_stats();
int /*<<< orphan*/ printf(char *, char *);
void opd_sigterm(void) {
  opd_do_jitdumps();
  opd_print_stats();
  printf("oprofiled stopped %s", op_get_time());
  opd_ext_deinitialize();
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<opd_sigterm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <opd_do_jitdumps@plt>
mov    $0x0,%al
call   1060 <opd_print_stats@plt>
mov    $0x0,%al
call   1030 <op_get_time@plt>
mov    %rax,%rsi
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <opd_ext_deinitialize@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<opd_sigterm>:
push   %rax
xor    %eax,%eax
call   1070 <opd_do_jitdumps@plt>
xor    %eax,%eax
call   1060 <opd_print_stats@plt>
xor    %eax,%eax
call   1030 <op_get_time@plt>
lea    0xe83(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <opd_ext_deinitialize@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"oprofiled stopped %s\00"
@EXIT_FAILURE = global i32 0
define void @opd_sigterm() {
%1 = call i32 (...) @opd_do_jitdumps()
%2 = call i32 (...) @opd_print_stats()
%3 = call i8* (...) @op_get_time()
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @opd_ext_deinitialize()
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"oprofiled stopped %s\00"
@EXIT_FAILURE = global i32 0
define void @opd_sigterm() {
%1 = tail call i32 (...) @opd_do_jitdumps()
%2 = tail call i32 (...) @opd_print_stats()
%3 = tail call i8* (...) @op_get_time()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 (...) @opd_ext_deinitialize()
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
main() {
  int x;
  x = 3;
  if (x)
    return 3;
  x = 4;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <main+0x28>
movl   $0x3,-0x4(%rbp)
jmp    112f <main+0x2f>
movl   $0x4,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
char *ft_itoa(int);
int /*<<< orphan*/ ft_putstr(char *);
void ft_putnbr(int n) {
  char *value;
  value = ft_itoa(n);
  ft_putstr(value);
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_itoa@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %rax
call   1030 <ft_itoa@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <ft_putstr@plt>

LLVM IR (-O0):
define void @ft_putnbr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @ft_itoa(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @ft_putstr(i8* %6)
ret void
}

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
%2 = tail call i8* @ft_itoa(i32 %0)
%3 = tail call i32 @ft_putstr(i8* %2)
ret void
}
int test_imm_A9uint8_mem(unsigned char *val) {
  return ((*val) & (-0xA9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A9uint8_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, -169
%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_A9uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 87
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int lpgfr(unsigned long, unsigned long *);
int /*<<< orphan*/ printf(char *, unsigned long, int);
void t3264(unsigned long value) {
  int cc;
  unsigned long n;
  cc = lpgfr(value, &n);
  printf("new: %ld cc: %d\n", n, cc);
}


x86 assembly (clang, -O0):
<t3264>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lpgfr@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t3264>:
push   %rax
mov    %rsp,%rsi
call   1040 <lpgfr@plt>
mov    (%rsp),%rsi
lea    0xecc(%rip),%rdi
mov    %eax,%edx
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"new: %ld cc: %d\0A\00"
define void @t3264(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i32 @lpgfr(i64 %5, i64* %4)
store i32 %6, i32* %3
%7 = load i64, i64* %4
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"new: %ld cc: %d\0A\00"
define void @t3264(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @lpgfr(i64 %0, i64* %2)
%5 = load i64, i64* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %5, i32 %4)
ret void
}