xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ registers_write_byte(int, int);
int /*<<< orphan*/ registers_write_word(int, int, int);
void pid_registers_defaults(void) {
  registers_write_byte(0x21, 0x00);
  registers_write_word(0x22, 0x23, 0x0000);
  registers_write_word(0x24, 0x25, 0x0000);
  registers_write_word(0x26, 0x27, 0x0000);
  registers_write_word(0x2A, 0x2B, 0x0060);
  registers_write_word(0x2C, 0x2D, 0x03A0);
  registers_write_byte(0x2E, 0x00);
}


x86 assembly (clang, -O0):
<pid_registers_defaults>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <registers_write_byte@plt>
mov    $0x22,%edi
mov    $0x23,%esi
xor    %edx,%edx
call   1040 <registers_write_word@plt>
mov    $0x24,%edi
mov    $0x25,%esi
xor    %edx,%edx
call   1040 <registers_write_word@plt>
mov    $0x26,%edi
mov    $0x27,%esi
xor    %edx,%edx
call   1040 <registers_write_word@plt>
mov    $0x2a,%edi
mov    $0x2b,%esi
mov    $0x60,%edx
call   1040 <registers_write_word@plt>
mov    $0x2c,%edi
mov    $0x2d,%esi
mov    $0x3a0,%edx
call   1040 <registers_write_word@plt>
mov    $0x2e,%edi
xor    %esi,%esi
call   1030 <registers_write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pid_registers_defaults>:
push   %rax
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <registers_write_byte@plt>
mov    $0x22,%edi
mov    $0x23,%esi
xor    %edx,%edx
call   1040 <registers_write_word@plt>
mov    $0x24,%edi
mov    $0x25,%esi
xor    %edx,%edx
call   1040 <registers_write_word@plt>
mov    $0x26,%edi
mov    $0x27,%esi
xor    %edx,%edx
call   1040 <registers_write_word@plt>
mov    $0x2a,%edi
mov    $0x2b,%esi
mov    $0x60,%edx
call   1040 <registers_write_word@plt>
mov    $0x2c,%edi
mov    $0x2d,%esi
mov    $0x3a0,%edx
call   1040 <registers_write_word@plt>
mov    $0x2e,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <registers_write_byte@plt>

LLVM IR (-O0):
define void @pid_registers_defaults() {
%1 = call i32 @registers_write_byte(i32 33, i32 0)
%2 = call i32 @registers_write_word(i32 34, i32 35, i32 0)
%3 = call i32 @registers_write_word(i32 36, i32 37, i32 0)
%4 = call i32 @registers_write_word(i32 38, i32 39, i32 0)
%5 = call i32 @registers_write_word(i32 42, i32 43, i32 96)
%6 = call i32 @registers_write_word(i32 44, i32 45, i32 928)
%7 = call i32 @registers_write_byte(i32 46, i32 0)
ret void
}

LLVM IR (-O2):
define void @pid_registers_defaults() {
%1 = tail call i32 @registers_write_byte(i32 33, i32 0)
%2 = tail call i32 @registers_write_word(i32 34, i32 35, i32 0)
%3 = tail call i32 @registers_write_word(i32 36, i32 37, i32 0)
%4 = tail call i32 @registers_write_word(i32 38, i32 39, i32 0)
%5 = tail call i32 @registers_write_word(i32 42, i32 43, i32 96)
%6 = tail call i32 @registers_write_word(i32 44, i32 45, i32 928)
%7 = tail call i32 @registers_write_byte(i32 46, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t, size_t, char const *);
void onMarkParagraph(size_t start, size_t end, void *callbackContext) {
  printf("MARK PARAGRAPH: (%zu, %zu) [%s]\n", start, end,
         (const char *)callbackContext);
}


x86 assembly (clang, -O0):
<onMarkParagraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onMarkParagraph>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"MARK PARAGRAPH: (%zu, %zu) [%s]\0A\00"
define void @onMarkParagraph(i64 %0, i64 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"MARK PARAGRAPH: (%zu, %zu) [%s]\0A\00"
define void @onMarkParagraph(i64 %0, i64 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1, i8* %2)
ret void
}
double GetVy(double *sln, int yardage) {
  double size = sln[50001 * 10 + 1];
  if (yardage < size) {
    return sln[10 * yardage + 8];
  } else
    return 0;
}


x86 assembly (clang, -O0):
<GetVy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x3d0958(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114d <GetVy+0x4d>
mov    -0x10(%rbp),%rax
imul   $0xa,-0x14(%rbp),%ecx
add    $0x8,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <GetVy+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetVy>:
cvtsi2sd %esi,%xmm1
movsd  0x3d0958(%rdi),%xmm2
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm2
jbe    1122 <GetVy+0x22>
add    %esi,%esi
lea    (%rsi,%rsi,4),%eax
cltq
movsd  0x40(%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @GetVy(double* %0, i32 %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
store double* %0, double** %4
store i32 %1, i32* %5
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 500011
%9 = load double, double* %8
store double %9, double* %6
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = load double, double* %6
%13 = fcmp olt double %11, %12
br i1 %13, label %14, label %22
14: ; preds = %2
%15 = load double*, double** %4
%16 = load i32, i32* %5
%17 = mul nsw i32 10, %16
%18 = add nsw i32 %17, 8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %15, i64 %19
%21 = load double, double* %20
store double %21, double* %3
br label %23
22: ; preds = %2
store double 0.000000e+00, double* %3
br label %23
23: ; preds = %22, %14
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @GetVy(double* nocapture %0, i32 %1) {
%3 = getelementptr inbounds double, double* %0, i64 500011
%4 = load double, double* %3
%5 = sitofp i32 %1 to double
%6 = fcmp ogt double %4, %5
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = mul nsw i32 %1, 10
%9 = add nsw i32 %8, 8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %0, i64 %10
%12 = load double, double* %11
br label %13
13: ; preds = %2, %7
%14 = phi double [ %12, %7 ], [ 0.000000e+00, %2 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void ivprint(int n, int *vec) {
  int i;
  for (i = 0; i < n; i++)
    printf(" %8d \n", vec[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<ivprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1159 <ivprint+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <ivprint+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivprint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1157 <ivprint+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <ivprint+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c" %8d \0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @ivprint(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = 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 = [7 x i8] c" %8d \0A\00"
define void @ivprint(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
pid_t getppid(void) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<getppid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getppid>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getppid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getppid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ GLvoid;
typedef int /*<<< orphan*/ GLsizei;
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glTexSubImage1D(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/ *);
void TexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width,
                   GLenum format, GLenum type, GLvoid *pixels) {
  glTexSubImage1D(target, level, xoffset, width, format, type, pixels);
}


x86 assembly (clang, -O0):
<TexSubImage1D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <glTexSubImage1D@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TexSubImage1D>:
jmp    1030 <glTexSubImage1D@plt>

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

LLVM IR (-O2):
define void @TexSubImage1D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* %6) {
%8 = tail call i32 @glTexSubImage1D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* %6)
ret void
}
int test_imm_C1int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xC1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C1int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xc1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_C1int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 193
%7 = icmp ne i64 %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_C1int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12648448
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int omp_get_num_threads();
int /*<<< orphan*/ printf(char *, int, int);
void report_num_threads(int level) {
#pragma omp single
  {
    printf("Level %d: number of threads in the team - %d\n", level,
           omp_get_num_threads());
  }
}


x86 assembly (clang, -O0):
<report_num_threads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <omp_get_num_threads@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_num_threads>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <omp_get_num_threads@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Level %d: number of threads in the team - %d\0A\00"
define void @report_num_threads(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @omp_get_num_threads()
%5 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Level %d: number of threads in the team - %d\0A\00"
define void @report_num_threads(i32 %0) {
%2 = tail call i32 (...) @omp_get_num_threads()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
/* Variables and functions */
void *ustring_dup(void const *);
void *_cpy(const void *src) { return ustring_dup(src); }


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

x86 assembly (clang, -O2):
<_cpy>:
jmp    1030 <ustring_dup@plt>

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

LLVM IR (-O2):
define i8* @_cpy(i8* %0) {
%2 = tail call i8* @ustring_dup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ do_some_work();
void eat(void) { do_some_work(); }


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

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

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

LLVM IR (-O2):
define void @eat() {
%1 = tail call i32 (...) @do_some_work()
ret void
}
int f(unsigned int b, unsigned int c) {
  unsigned int a = (unsigned short)b * (c >> 16);
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
movzwl %ax,%eax
mov    -0x8(%rbp),%ecx
shr    $0x10,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movzwl %di,%eax
shr    $0x10,%esi
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i16
%8 = zext i16 %7 to i32
%9 = load i32, i32* %4
%10 = lshr i32 %9, 16
%11 = mul i32 %8, %10
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = lshr i32 %1, 16
%5 = mul nuw i32 %4, %3
ret i32 %5
}
unsigned char *CalculateScanLine(unsigned char *bits, unsigned pitch,
                                 int scanline) {
  return (bits + (pitch * scanline));
}


x86 assembly (clang, -O0):
<CalculateScanLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
mov    %ecx,%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateScanLine>:
imul   %edx,%esi
lea    (%rsi,%rdi,1),%rax
ret

LLVM IR (-O0):
define i8* @CalculateScanLine(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul i32 %8, %9
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
ret i8* %12
}

LLVM IR (-O2):
define i8* @CalculateScanLine(i8* readnone %0, i32 %1, i32 %2) {
%4 = mul i32 %2, %1
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}
/* Variables and functions */
size_t _rndup2pow64(unsigned long long x) {
  --x;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  x |= x >> 32;
  ++x;
  return x;
}


x86 assembly (clang, -O0):
<_rndup2pow64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rndup2pow64>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %rcx,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @_rndup2pow64(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = add i64 %14, 1
ret i64 %15
}
void strength_result10(int *data) {
  int stop = data[3] * 21;
  int i = 0;
  do {
    data[data[2]] = i;
    i = i + 21;
  } while (i < stop);
}


x86 assembly (clang, -O0):
<strength_result10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x15,0xc(%rax),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x15,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     111a <strength_result10+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_result10>:
mov    0xc(%rdi),%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,4),%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movslq 0x8(%rdi),%rdx
mov    %ecx,(%rdi,%rdx,4)
add    $0x15,%ecx
cmp    %eax,%ecx
jl     1110 <strength_result10+0x10>
ret

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

LLVM IR (-O2):
define void @strength_result10(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 21
%5 = getelementptr inbounds i32, i32* %0, i64 2
br label %6
6: ; preds = %6, %1
%7 = phi i32 [ 0, %1 ], [ %11, %6 ]
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %7, i32* %10
%11 = add nuw nsw i32 %7, 21
%12 = icmp slt i32 %11, %4
br i1 %12, label %6, label %13
13: ; preds = %6
ret void
}
void local() {}


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

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

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

LLVM IR (-O2):
define void @local() {
ret void
}
/* Variables and functions */
void *gc_addref(void *);
int /*<<< orphan*/ gc_delref(void *);
void gc_swapref(void **dest, void *newref) {
  void *oldref = *dest;
  *dest = gc_addref(newref);
  gc_delref(oldref);
}


x86 assembly (clang, -O0):
<gc_swapref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gc_addref@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <gc_delref@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gc_swapref(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = call i8* @gc_addref(i8* %8)
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = call i32 @gc_delref(i8* %11)
ret void
}

LLVM IR (-O2):
define void @gc_swapref(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i8* @gc_addref(i8* %1)
store i8* %4, i8** %0
%5 = tail call i32 @gc_delref(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MEDIUM_ERROR;
int tcmu_set_sense_data(int /*<<< orphan*/ *, int /*<<< orphan*/, unsigned int,
                        int /*<<< orphan*/ *);
int set_medium_error(uint8_t *sense, unsigned asc_ascq) {
  return tcmu_set_sense_data(sense, MEDIUM_ERROR, asc_ascq, NULL);
}


x86 assembly (clang, -O0):
<set_medium_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <tcmu_set_sense_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_medium_error>:
mov    %esi,%edx
mov    0x2edf(%rip),%rax
mov    (%rax),%esi
xor    %ecx,%ecx
jmp    1030 <tcmu_set_sense_data@plt>

LLVM IR (-O0):
@MEDIUM_ERROR = global i32 0
define i32 @set_medium_error(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* @MEDIUM_ERROR
%7 = load i32, i32* %4
%8 = call i32 @tcmu_set_sense_data(i32* %5, i32 %6, i32 %7, i32* null)
ret i32 %8
}

LLVM IR (-O2):
@MEDIUM_ERROR = global i32 0
define i32 @set_medium_error(i32* %0, i32 %1) {
%3 = load i32, i32* @MEDIUM_ERROR
%4 = tail call i32 @tcmu_set_sense_data(i32* %0, i32 %3, i32 %1, i32* null)
ret i32 %4
}
/* Variables and functions */
char **__environ;
int /*<<< orphan*/ __libc_init(int, char **, char **);
void init(int *data) {
  int argc = *data;
  char **argv = (void *)(data + 1);
  char **envp = &argv[argc + 1];
  __environ = envp;
  __libc_init(argc, argv, envp);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    0x2ea4(%rip),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <__libc_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
movslq (%rdi),%rax
lea    (%rdi,%rax,8),%rdx
add    $0xc,%rdx
lea    0x4(%rdi),%rsi
mov    0x2ed2(%rip),%rcx
mov    %rdx,(%rcx)
mov    %eax,%edi
jmp    1030 <__libc_init@plt>

LLVM IR (-O0):
@__environ = global i8** null
define void @init(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8**
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = bitcast i32* %9 to i8*
%11 = bitcast i8* %10 to i8**
store i8** %11, i8*** %4
%12 = load i8**, i8*** %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %12, i64 %15
store i8** %16, i8*** %5
%17 = load i8**, i8*** %5
store i8** %17, i8*** @__environ
%18 = load i32, i32* %3
%19 = load i8**, i8*** %4
%20 = load i8**, i8*** %5
%21 = call i32 @__libc_init(i32 %18, i8** %19, i8** %20)
ret void
}

LLVM IR (-O2):
@__environ = global i8** null
define void @init(i32* %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = bitcast i32* %3 to i8**
%5 = add nsw i32 %2, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8*, i8** %4, i64 %6
store i8** %7, i8*** @__environ
%8 = tail call i32 @__libc_init(i32 %2, i8** %4, i8** %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_boolean(int *b) {
  if (!*b)
    printf("#f");
  else
    printf("#t");
}


x86 assembly (clang, -O0):
<print_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jne    113a <print_boolean+0x2a>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
jmp    1146 <print_boolean+0x36>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_boolean>:
cmpl   $0x0,(%rdi)
lea    0xee6(%rip),%rax
lea    0xee2(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"#f\00"
@.str.1 = [3 x i8] c"#t\00"
define void @print_boolean(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"#f\00"
@.str.1 = [3 x i8] c"#t\00"
define void @print_boolean(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EKFStateVarianceHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void EKFStateVarianceRequestUpdate() {
  UAVObjRequestUpdate(EKFStateVarianceHandle());
}


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

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

LLVM IR (-O0):
define void @EKFStateVarianceRequestUpdate() {
%1 = call i32 (...) @EKFStateVarianceHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @EKFStateVarianceRequestUpdate() {
%1 = tail call i32 (...) @EKFStateVarianceHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RevoSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void RevoSettingsUpdated() { UAVObjUpdated(RevoSettingsHandle()); }


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

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

LLVM IR (-O0):
define void @RevoSettingsUpdated() {
%1 = call i32 (...) @RevoSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RevoSettingsUpdated() {
%1 = tail call i32 (...) @RevoSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  register void *value = malloc(size);
  if (value == 0) {
    fprintf(stderr, "tree: virtual memory exhausted.\n");
    exit(1);
  }
  return value;
}


x86 assembly (clang, -O0):
<xmalloc>:
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    1173 <xmalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"tree: virtual memory exhausted.\0A\00"
define i8* @xmalloc(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 %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"tree: virtual memory exhausted.\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
size_t strnlen(const char *s, size_t maxlen) {
  const char *max = s + maxlen;
  const char *orig = s;
  while (s < max && *s)
    ++s;
  return s - orig;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x21(%rbp)
jae    1143 <strnlen+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1153 <strnlen+0x53>
jmp    1164 <strnlen+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <strnlen+0x20>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
jle    111e <strnlen+0x1e>
add    %rdi,%rsi
mov    %rdi,%rax
xchg   %ax,%ax
cmpb   $0x0,(%rax)
je     111e <strnlen+0x1e>
add    $0x1,%rax
cmp    %rsi,%rax
jb     1110 <strnlen+0x10>
sub    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %2, %9
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = icmp ult i8* %10, %3
br i1 %11, label %5, label %12
12: ; preds = %5, %9, %2
%13 = phi i8* [ %0, %2 ], [ %10, %9 ], [ %6, %5 ]
%14 = ptrtoint i8* %13 to i64
%15 = ptrtoint i8* %0 to i64
%16 = sub i64 %14, %15
ret i64 %16
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ putc(int);
void putu(uint32_t num) {
  if (num == 0)
    putc('0');
  else {
    if (num >= 10)
      putu(num / 10);
    putc('0' + num % 10);
  }
}


x86 assembly (clang, -O0):
<putu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1144 <putu+0x24>
mov    $0x30,%edi
call   1030 <putc@plt>
jmp    1175 <putu+0x55>
cmpl   $0xa,-0x4(%rbp)
jl     1160 <putu+0x40>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <putu@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putu>:
test   %edi,%edi
je     116a <putu+0x4a>
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jl     1140 <putu+0x20>
mov    %ebx,%eax
mov    $0xcccccccd,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
call   1040 <putu@plt>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
lea    (%rbx,%rax,1),%edi
add    $0x30,%edi
pop    %rbx
jmp    1030 <putc@plt>
mov    $0x30,%edi
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define void @putu(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 9
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = udiv i32 %0, 10
tail call void @putu(i32 %6)
br label %7
7: ; preds = %5, %3
%8 = srem i32 %0, 10
%9 = add nsw i32 %8, 48
br label %10
10: ; preds = %1, %7
%11 = phi i32 [ %9, %7 ], [ 48, %1 ]
%12 = tail call i32 @putc(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int, char const *);
int /*<<< orphan*/ stderr;
const char *dummy_unprocessed(void *user, char letter, float value,
                              const char *remaining) {
  fprintf(stderr, "GCodeParser: unprocessed('%c', %d, '%s')\n", letter,
          (int)value, remaining);
  return NULL;
}


x86 assembly (clang, -O0):
<dummy_unprocessed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movss  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x9(%rbp),%al
cvttss2si -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xeb9(%rip),%rsi
movsbl %al,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_unprocessed>:
push   %rax
mov    %rdx,%r8
mov    %esi,%edx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
cvttss2si %xmm0,%ecx
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"GCodeParser: unprocessed('%c', %d, '%s')\0A\00"
define i8* @dummy_unprocessed(i8* %0, i8 signext %1, float %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca float
%8 = alloca i8*
store i8* %0, i8** %5
store i8 %1, i8* %6
store float %2, float* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8, i8* %6
%11 = load float, float* %7
%12 = fptosi float %11 to i32
%13 = load i8*, i8** %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8 signext %10, i32 %12, i8* %13)
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"GCodeParser: unprocessed('%c', %d, '%s')\0A\00"
define noalias i8* @dummy_unprocessed(i8* nocapture readnone %0, i8 signext %1, float %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = fptosi float %2 to i32
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8 signext %1, i32 %6, i8* %3)
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int clipboard_internal_close(FILE *s) { return fclose(s); }


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

x86 assembly (clang, -O2):
<clipboard_internal_close>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define i32 @clipboard_internal_close(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret i32 %2
}
/* Variables and functions */
int TIOCM_DSR;
int get_mlines(int);
int get_dsr(int fd) {
  if (get_mlines(fd) & TIOCM_DSR)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<get_dsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <get_mlines@plt>
mov    0x2ebe(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1141 <get_dsr+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <get_dsr+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dsr>:
push   %rax
call   1030 <get_mlines@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
test   %eax,(%rdx)
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCM_DSR = global i32 0
define i32 @get_dsr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @get_mlines(i32 %4)
%6 = load i32, i32* @TIOCM_DSR
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@TIOCM_DSR = global i32 0
define i32 @get_dsr(i32 %0) {
%2 = tail call i32 @get_mlines(i32 %0)
%3 = load i32, i32* @TIOCM_DSR
%4 = and i32 %3, %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
__int128 submem(__int128 *a, __int128_t *b) { return *a - *b; }


x86 assembly (clang, -O0):
<submem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    0x8(%rax),%rax
mov    -0x20(%rbp),%rdx
mov    (%rdx),%rsi
mov    0x8(%rdx),%rdx
sub    %rsi,%rcx
sbb    %rdx,%rax
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<submem>:
mov    (%rdi),%rax
sub    (%rsi),%rax
mov    0x8(%rdi),%rdx
sbb    0x8(%rsi),%rdx
ret

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

LLVM IR (-O2):
define { i64, i64 } @submem(i128* nocapture %0, i128* nocapture %1) {
%3 = load i128, i128* %0
%4 = load i128, i128* %1
%5 = sub nsw i128 %3, %4
%6 = trunc i128 %5 to i64
%7 = lshr i128 %5, 64
%8 = trunc i128 %7 to i64
%9 = insertvalue { i64, i64 } poison, i64 %6, 0
%10 = insertvalue { i64, i64 } %9, i64 %8, 1
ret { i64, i64 } %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *data = malloc(size);
  if (!data) {
    fprintf(stderr, "malloc error\n");
    exit(EXIT_FAILURE);
  }
  memset(data, 0, size);
  return data;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1187 <xmalloc+0x47>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
test   %rax,%rax
je     116c <xmalloc+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"malloc error\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(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 ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = load i64, i64* %2
%16 = call i32 @memset(i8* %14, i32 0, i64 %15)
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"malloc error\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
%10 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
void test_two(int x, int y) {
#pragma omp target
#pragma omp teams distribute
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_two+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_two+0x43>
jmp    1135 <test_two+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_two+0x24>
jmp    1148 <test_two+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_two+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_two(i32 %0, i32 %1) {
ret void
}