xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(char);
int /*<<< orphan*/ memmove(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
char *ltrim(char *s) {
  char *newstart = s;
  while (isspace(*newstart)) {
    ++newstart;
  }
  memmove(s, newstart, strlen(newstart) + 1);
  return s;
}


x86 assembly (clang, -O0):
<ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     116b <ltrim+0x3b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1144 <ltrim+0x14>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1050 <memmove@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    -0x1(%rdi),%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1040 <isspace@plt>
test   %rax,%rax
jne    1140 <ltrim+0x10>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <memmove@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ltrim(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = tail call i64 @strlen(i8* %3)
%10 = add nsw i64 %9, 1
%11 = tail call i32 @memmove(i8* %0, i8* %3, i64 %10)
ret i8* %0
}
void DIST_POINT_NAME_free(void) {}


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

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

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

LLVM IR (-O2):
define void @DIST_POINT_NAME_free() {
ret void
}
/* Variables and functions */
int omp_get_max_threads();
int mic_get_max_threads(int device, int offload) {
  int mthreads;
#pragma offload target(mic : device) out(mthreads) if (offload)
  { mthreads = omp_get_max_threads(); }
  return mthreads;
}


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

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

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

LLVM IR (-O2):
define i32 @mic_get_max_threads(i32 %0, i32 %1) {
%3 = tail call i32 (...) @omp_get_max_threads()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ stdout;
void print_buf(char *buffer, int len) {
  for (int i = 0; i < len; i++) {
    printf("%c", buffer[i]);
  }
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1168 <print_buf+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xeaf(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <print_buf+0x16>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1156 <print_buf+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_buf+0x20>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@stdout = global i32 0
define void @print_buf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %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* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %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 = load i32, i32* @stdout
%22 = call i32 @fflush(i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@stdout = global i32 0
define void @print_buf(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %9
6: ; preds = %9, %2
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
ret void
9: ; preds = %4, %9
%10 = phi i64 [ 0, %4 ], [ %14, %9 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %12)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %9
}
int not(int a) { return (~a) != 0; }


x86 assembly (clang, -O0):
<not>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<not>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @not(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @not(i32 %0) {
%2 = icmp ne i32 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int pathconN_nm9_f0(double const **, double **, int *, double *, int);
int pathconN_nm9(const double **arg, double **res, int *iw, double *w,
                 int mem) {
  return pathconN_nm9_f0(arg, res, iw, w, mem);
}


x86 assembly (clang, -O0):
<pathconN_nm9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <pathconN_nm9_f0@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm9>:
jmp    1030 <pathconN_nm9_f0@plt>

LLVM IR (-O0):
define i32 @pathconN_nm9(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load double**, double*** %7
%13 = load i32*, i32** %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call i32 @pathconN_nm9_f0(double** %11, double** %12, i32* %13, double* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @pathconN_nm9(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @pathconN_nm9_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int are_equal(int *, int *, int);
int /*<<< orphan*/ heapsort(int *, int);
int test_heapsort_all_equal() {
  int input[] = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3};
  int expected[] = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3};
  heapsort(input, 10);
  return are_equal(input, expected, 10);
}


x86 assembly (clang, -O0):
<test_heapsort_all_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <heapsort@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0xa,%edx
call   1050 <are_equal@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_heapsort_all_equal>:
push   %rbx
sub    $0x60,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xebc(%rip),%xmm1
movaps %xmm1,0x30(%rsp)
mov    %rax,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm1,(%rsp)
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <heapsort@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
call   1040 <are_equal@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_heapsort_all_equal.input = [10 x i32] [i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3]
@__const.test_heapsort_all_equal.expected = [10 x i32] [i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3]
define i32 @test_heapsort_all_equal() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @heapsort(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @are_equal(i32* %7, i32* %8, i32 10)
ret i32 %9
}

LLVM IR (-O2):
@__const.test_heapsort_all_equal.expected = [10 x i32] [i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3]
define i32 @test_heapsort_all_equal() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @heapsort(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @are_equal(i32* %5, i32* %7, i32 10)
ret i32 %8
}
void g_queue_remove_all() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_remove_all() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
usage() {
  fprintf(stderr, "Usage: split [inputFile] [chunkSize] [outputBase]\n");
  fprintf(stderr, "chunksize is bytes or kbytes (ex: 1440k)\n");
  fprintf(stderr, "creates <outputBase>.000, <outputBase>.001, etc\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: split [inputFile] [chunkSize] [outputBase]\0A\00"
@.str.1 = [42 x i8] c"chunksize is bytes or kbytes (ex: 1440k)\0A\00"
@.str.2 = [49 x i8] c"creates <outputBase>.000, <outputBase>.001, etc\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: split [inputFile] [chunkSize] [outputBase]\0A\00"
@.str.1 = [42 x i8] c"chunksize is bytes or kbytes (ex: 1440k)\0A\00"
@.str.2 = [49 x i8] c"creates <outputBase>.000, <outputBase>.001, etc\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ so_reuseaddr;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
void set_reuse(int fd) {
  int so_reuseaddr = 1;
  setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &so_reuseaddr, sizeof(so_reuseaddr));
}


x86 assembly (clang, -O0):
<set_reuse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_reuse>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define void @set_reuse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define void @set_reuse(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret void
}
/* Type definitions */
struct light {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ light_init_mesh(struct light *);
int /*<<< orphan*/ light_load_epitaxy(struct light *, char *);
void light_load_config(struct light *in) {
  light_load_epitaxy(in, "optics_epitaxy.inp");
  light_init_mesh(in);
}


x86 assembly (clang, -O0):
<light_load_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <light_load_epitaxy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <light_init_mesh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<light_load_config>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <light_load_epitaxy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <light_init_mesh@plt>

LLVM IR (-O0):
%struct.light = type { i32 }
@.str = [19 x i8] c"optics_epitaxy.inp\00"
define void @light_load_config(%struct.light* %0) {
%2 = alloca %struct.light*
store %struct.light* %0, %struct.light** %2
%3 = load %struct.light*, %struct.light** %2
%4 = call i32 @light_load_epitaxy(%struct.light* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = load %struct.light*, %struct.light** %2
%6 = call i32 @light_init_mesh(%struct.light* %5)
ret void
}

LLVM IR (-O2):
%struct.light = type { i32 }
@.str = [19 x i8] c"optics_epitaxy.inp\00"
define void @light_load_config(%struct.light* %0) {
%2 = tail call i32 @light_load_epitaxy(%struct.light* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @light_init_mesh(%struct.light* %0)
ret void
}
int srmmu_device_memory(unsigned long x) { return ((x & 0xF0000000) != 0); }


x86 assembly (clang, -O0):
<srmmu_device_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xf0000000,%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<srmmu_device_memory>:
xor    %eax,%eax
test   $0xf0000000,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @srmmu_device_memory(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4026531840
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @srmmu_device_memory(i64 %0) {
%2 = and i64 %0, 4026531840
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ native_halt();
__attribute__((__section__(".cpuidle.text"))) void halt(void) { native_halt(); }


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

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

LLVM IR (-O0):
define void @halt() section ".cpuidle.text" {
%1 = call i32 (...) @native_halt()
ret void
}

LLVM IR (-O2):
define void @halt() section ".cpuidle.text" {
%1 = tail call i32 (...) @native_halt()
ret void
}
/* Type definitions */
struct url_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct url_struct *);
int /*<<< orphan*/ url_destroy(struct url_struct *);
void url_free(struct url_struct *url) {
  if (url) {
    url_destroy(url);
    free(url);
  }
}


x86 assembly (clang, -O0):
<url_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <url_free+0x29>
mov    -0x8(%rbp),%rdi
call   1040 <url_destroy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<url_free>:
test   %rdi,%rdi
je     1137 <url_free+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <url_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.url_struct = type { i32 }
define void @url_free(%struct.url_struct* %0) {
%2 = alloca %struct.url_struct*
store %struct.url_struct* %0, %struct.url_struct** %2
%3 = load %struct.url_struct*, %struct.url_struct** %2
%4 = icmp ne %struct.url_struct* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load %struct.url_struct*, %struct.url_struct** %2
%7 = call i32 @url_destroy(%struct.url_struct* %6)
%8 = load %struct.url_struct*, %struct.url_struct** %2
%9 = call i32 @free(%struct.url_struct* %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.url_struct = type { i32 }
define void @url_free(%struct.url_struct* %0) {
%2 = icmp eq %struct.url_struct* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @url_destroy(%struct.url_struct* %0)
%5 = tail call i32 @free(%struct.url_struct* %0)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void _source(char *source) { printf("%s", source); }


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

x86 assembly (clang, -O2):
<_source>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @_source(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @_source(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double CalcKaiserWidth(const double rejection, const int order) {
  double w_t = 2.0 * 3.14159265358979323846;
  if (rejection > 21.0)
    return (rejection - 7.95) / (order * 2.285 * w_t);
  return 5.79 / (order * w_t);
}


x86 assembly (clang, -O0):
<CalcKaiserWidth>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeda(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1165 <CalcKaiserWidth+0x65>
movsd  -0x10(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xeca(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <CalcKaiserWidth+0x80>
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  0xe99(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcKaiserWidth>:
movapd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
ucomisd %xmm0,%xmm1
cvtsi2sd %edi,%xmm2
movsd  0xeec(%rip),%xmm3
addsd  %xmm1,%xmm3
jbe    112a <CalcKaiserWidth+0x2a>
mulsd  0xee6(%rip),%xmm2
cmpltsd %xmm1,%xmm0
andpd  %xmm0,%xmm3
movsd  0xedd(%rip),%xmm1
andnpd %xmm1,%xmm0
orpd   %xmm3,%xmm0
mulsd  0xed5(%rip),%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @CalcKaiserWidth(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
store double 0x401921FB54442D18, double* %6
%7 = load double, double* %4
%8 = fcmp ogt double %7, 2.100000e+01
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load double, double* %4
%11 = fsub double %10, 7.950000e+00
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 2.285000e+00
%15 = load double, double* %6
%16 = fmul double %14, %15
%17 = fdiv double %11, %16
store double %17, double* %3
br label %24
18: ; preds = %2
%19 = load i32, i32* %5
%20 = sitofp i32 %19 to double
%21 = load double, double* %6
%22 = fmul double %20, %21
%23 = fdiv double 5.790000e+00, %22
store double %23, double* %3
br label %24
24: ; preds = %18, %9
%25 = load double, double* %3
ret double %25
}

LLVM IR (-O2):
define double @CalcKaiserWidth(double %0, i32 %1) {
%3 = fcmp ogt double %0, 2.100000e+01
%4 = sitofp i32 %1 to double
%5 = fadd double %0, -7.950000e+00
%6 = sitofp i32 %1 to double
%7 = fmul double %6, 2.285000e+00
%8 = select i1 %3, double %7, double %4
%9 = select i1 %3, double %5, double 5.790000e+00
%10 = fmul double %8, 0x401921FB54442D18
%11 = fdiv double %9, %10
ret double %11
}
/* Variables and functions */
char *strstr(char *, char *);
int str_pos(char *haystack, char *needle) {
  char *p = strstr(haystack, needle);
  if (p)
    return p - haystack;
  return -1;
}


x86 assembly (clang, -O0):
<str_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114f <str_pos+0x3f>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1156 <str_pos+0x46>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_pos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @str_pos(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i8* @strstr(i8* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %19
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
store i32 %18, i32* %3
br label %20
19: ; preds = %2
store i32 -1, i32* %3
br label %20
20: ; preds = %19, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @str_pos(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ CL_QueryGetInfoMessage(char *);
void CL_QueryGetInfoMessage_f(void) { CL_QueryGetInfoMessage("getinfo"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"getinfo\00"
define void @CL_QueryGetInfoMessage_f() {
%1 = call i32 @CL_QueryGetInfoMessage(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"getinfo\00"
define void @CL_QueryGetInfoMessage_f() {
%1 = tail call i32 @CL_QueryGetInfoMessage(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arc_core_mpu_default(int /*<<< orphan*/);
void arc_core_mpu_enable(void) { arc_core_mpu_default(0); }


x86 assembly (clang, -O0):
<arc_core_mpu_enable>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <arc_core_mpu_default@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arc_core_mpu_enable>:
xor    %edi,%edi
jmp    1030 <arc_core_mpu_default@plt>

LLVM IR (-O0):
define void @arc_core_mpu_enable() {
%1 = call i32 @arc_core_mpu_default(i32 0)
ret void
}

LLVM IR (-O2):
define void @arc_core_mpu_enable() {
%1 = tail call i32 @arc_core_mpu_default(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned int);
void emit(FILE *fp, unsigned int addr, unsigned int flags) {
  unsigned int val = (addr << 20) | flags;
  fprintf(fp, "\t.word\t0x%x\n", val);
}


x86 assembly (clang, -O0):
<emit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x14,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit>:
shl    $0x14,%esi
or     %esi,%edx
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\09.word\090x%x\0A\00"
define void @emit(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = shl i32 %8, 20
%10 = load i32, i32* %6
%11 = or i32 %9, %10
store i32 %11, i32* %7
%12 = load i32*, i32** %4
%13 = load i32, i32* %7
%14 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\09.word\090x%x\0A\00"
define void @emit(i32* nocapture %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 20
%5 = or i32 %4, %2
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printvinl(int *, int);
int /*<<< orphan*/ selection_sorti(int *, int);
int main() {
  int x[] = {42, -1, 3, 0, 99, 2, 2, 0, 8};
  selection_sorti(x, (sizeof(x) / sizeof(x[0])));
  printvinl(x, (sizeof(x) / sizeof(x[0])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1030 <selection_sorti@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1050 <printvinl@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <selection_sorti@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <printvinl@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.x = [9 x i32] [i32 42, i32 -1, i32 3, i32 0, i32 99, i32 2, i32 2, i32 0, i32 8]
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
store i32 0, i32* %1
%3 = bitcast [9 x i32]* %2 to i8*
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%5 = call i32 @selection_sorti(i32* %4, i32 9)
%6 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%7 = call i32 @printvinl(i32* %6, i32 9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [9 x i32] [i32 42, i32 -1, i32 3, i32 0, i32 99, i32 2, i32 2, i32 0, i32 8]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @selection_sorti(i32* %3, i32 9)
%5 = call i32 @printvinl(i32* %3, i32 9)
ret i32 0
}
/* Variables and functions */
int random();
int rand(int a) {
  int m = (random() % 10) % a;
  return m == 0 ? 1 : m;
}


x86 assembly (clang, -O0):
<rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114a <rand+0x3a>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <rand+0x40>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cltd
idiv   %ebx
test   %edx,%edx
mov    $0x1,%eax
cmovne %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @random()
%5 = srem i32 %4, 10
%6 = load i32, i32* %2
%7 = srem i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
br label %13
13: ; preds = %11, %10
%14 = phi i32 [ 1, %10 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @rand(i32 %0) {
%2 = tail call i32 (...) @random()
%3 = srem i32 %2, 10
%4 = srem i32 %3, %0
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 1, i32 %4
ret i32 %6
}
int fun1352() { return 1352; }


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

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

LLVM IR (-O0):
define i32 @fun1352() {
ret i32 1352
}

LLVM IR (-O2):
define i32 @fun1352() {
ret i32 1352
}
double toDegrees(double angle_rad) {
  return angle_rad / 3.141592653589793238 * 180.0;
}


x86 assembly (clang, -O0):
<toDegrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<toDegrees>:
divsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @toDegrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x400921FB54442D18
%5 = fmul double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @toDegrees(double %0) {
%2 = fdiv double %0, 0x400921FB54442D18
%3 = fmul double %2, 1.800000e+02
ret double %3
}
unsigned int reverse_bits(unsigned int value) {
  unsigned int answer;
  unsigned int i;
  answer = 0;
  for (i = 1; i != 0; i <<= 1) {
    answer <<= 1;
    if (value & 1)
      answer |= 1;
    value >>= 1;
  }
  return answer;
}


x86 assembly (clang, -O0):
<reverse_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1157 <reverse_bits+0x57>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1140 <reverse_bits+0x40>
mov    -0x8(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <reverse_bits+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_bits>:
xor    %eax,%eax
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
shl    $0x4,%ecx
mov    %edi,%edx
and    $0x1,%edx
shl    $0x2,%edx
lea    (%rdx,%rax,8),%eax
mov    %edi,%edx
and    $0x2,%edx
or     %eax,%edx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
or     %edx,%eax
mov    %edi,%edx
shr    $0x3,%edx
and    $0x1,%edx
lea    (%rdx,%rax,2),%eax
shr    $0x4,%edi
test   %ecx,%ecx
jne    1110 <reverse_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse_bits(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %19, %2 ]
%5 = phi i32 [ %0, %1 ], [ %20, %2 ]
%6 = shl i32 %3, 4
%7 = shl i32 %4, 3
%8 = shl i32 %5, 2
%9 = and i32 %8, 4
%10 = or i32 %7, %9
%11 = and i32 %5, 2
%12 = or i32 %10, %11
%13 = lshr i32 %5, 2
%14 = and i32 %13, 1
%15 = or i32 %12, %14
%16 = lshr i32 %5, 3
%17 = shl i32 %15, 1
%18 = and i32 %16, 1
%19 = or i32 %17, %18
%20 = lshr i32 %5, 4
%21 = icmp eq i32 %6, 0
br i1 %21, label %22, label %2
22: ; preds = %2
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ safe_cprintf(void *, int, char *);
void Svcmd_Test_f(void) { safe_cprintf(((void *)0), 2, "Svcmd_Test_f()\n"); }


x86 assembly (clang, -O0):
<Svcmd_Test_f>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
mov    $0x2,%esi
lea    0xedc(%rip),%rdx
call   1030 <safe_cprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Svcmd_Test_f>:
lea    0xee9(%rip),%rdx
xor    %edi,%edi
mov    $0x2,%esi
jmp    1030 <safe_cprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Svcmd_Test_f()\0A\00"
define void @Svcmd_Test_f() {
%1 = call i32 @safe_cprintf(i8* null, i32 2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Svcmd_Test_f()\0A\00"
define void @Svcmd_Test_f() {
%1 = tail call i32 @safe_cprintf(i8* null, i32 2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ndb_unix_version_local();
void ndb_osdep_version_local() { ndb_unix_version_local(); }


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

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

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

LLVM IR (-O2):
define void @ndb_osdep_version_local() {
%1 = tail call i32 (...) @ndb_unix_version_local()
ret void
}
union unempty {
} retunempty() {
  union unempty res;
  return res;
}


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

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

LLVM IR (-O0):
%union.unempty = type {}
define void @retunempty() {
ret void
}

LLVM IR (-O2):
%union.unempty = type {}
define void @retunempty() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help_host(void) {
  printf(" -H, --hostname=ADDRESS\n      Host name or IP Address.\n");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c" -H, --hostname=ADDRESS\0A Host name or IP Address.\0A\00"
define void @print_help_host() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [55 x i8] c" -H, --hostname=ADDRESS\0A Host name or IP Address.\00"
define void @print_help_host() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
ret void
}
indreg0adrx1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((*p0) <= (((short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movswl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     1147 <indreg0adrx1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <indreg0adrx1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adrx1>:
movzwl (%r8),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx,%rcx,1),%dx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @indreg0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = load i16, i16* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %8
%10 = load i16, i16* %9
%11 = icmp sle i16 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ parse_options(int, char **);
int /*<<< orphan*/ sf_exit();
int /*<<< orphan*/ sf_init();
int /*<<< orphan*/ test_procon();
int main(int argc, char *argv[]) {
  parse_options(argc, argv);
  sf_init();
  test_procon();
  sf_exit();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <parse_options@plt>
xor    %eax,%eax
call   1060 <sf_init@plt>
xor    %eax,%eax
call   1040 <test_procon@plt>
xor    %eax,%eax
call   1050 <sf_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse_options(i32 %6, i8** %7)
%9 = call i32 (...) @sf_init()
%10 = call i32 (...) @test_procon()
%11 = call i32 (...) @sf_exit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_options(i32 %0, i8** %1)
%4 = tail call i32 (...) @sf_init()
%5 = tail call i32 (...) @test_procon()
%6 = tail call i32 (...) @sf_exit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNC_9() {
  long int stat = 99;
  BNCIO(9);
  return (stat);
}


x86 assembly (clang, -O0):
<BNC_9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x9,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNC_9>:
push   %rax
mov    $0x9,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNC_9() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 9)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNC_9() {
%1 = tail call i32 @BNCIO(i32 9)
ret i64 99
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
double foo(double, double);
int main() {
  if (foo(1.0, 4.0) != 6.0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  0xec1(%rip),%xmm1
call   1040 <foo@plt>
movsd  0xea4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1171 <main+0x41>
jp     1171 <main+0x41>
jmp    1178 <main+0x48>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
movsd  0xec7(%rip),%xmm1
call   1040 <foo@plt>
ucomisd 0xec2(%rip),%xmm0
jne    1152 <main+0x22>
jnp    1159 <main+0x29>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @foo(double 1.000000e+00, double 4.000000e+00)
%3 = fcmp une double %2, 6.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @foo(double 1.000000e+00, double 4.000000e+00)
%2 = fcmp une double %1, 6.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: \n"
                  "--shell\tSpawn a shell (/bin/bash), passing input to this "
                  "subprocess, and receiving its output\n"
                  "NO OPTIONS\tEcho standard input to standard output, with "
                  "some changes to newlines");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [183 x i8] c"Usage: \0A--shell\09Spawn a shell (/bin/bash), passing input to this subprocess, and receiving its output\0ANO OPTIONS\09Echo standard input to standard output, with some changes to newlines\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [183 x i8] c"Usage: \0A--shell\09Spawn a shell (/bin/bash), passing input to this subprocess, and receiving its output\0ANO OPTIONS\09Echo standard input to standard output, with some changes to newlines\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *smalloc(size_t n) {
  void *p;
  p = malloc(n);
  if (p == NULL) {
    fprintf(stderr, "cannot malloc()\n");
    exit(EXIT_FAILURE);
  }
  return (p);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"cannot malloc()\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @smalloc(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 %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([17 x i8], [17 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
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"cannot malloc()\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @smalloc(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 ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}