xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int determineFileSize(FILE *f) {
  int end;
  fseek(f, 0, SEEK_END);
  end = ftell(f);
  fseek(f, 0, SEEK_SET);
  return end;
}


x86 assembly (clang, -O0):
<determineFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determineFileSize>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ebp
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @determineFileSize(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @ftell(i32* %7)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @determineFileSize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i32 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *, char const *);
int /*<<< orphan*/ stderr;
int print_usage(const char *name) {
  const char *m = "Usage: %s COMMAND where COMMAND is one of:\n"
                  " create - create a new shared memory queue\n"
                  " produce - take lines from stdin and enqueue them\n"
                  " consume - dequeue items and print them\n";
  fprintf(stderr, m, name);
  return 125;
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <fprintf@plt>
mov    $0x7d,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x7d,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [177 x i8] c"Usage: %s COMMAND where COMMAND is one of:\0A create - create a new shared memory queue\0A produce - take lines from stdin and enqueue them\0A consume - dequeue items and print them\0A\00"
@stderr = global i32 0
define i32 @print_usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %4, i8* %5, i8* %6)
ret i32 125
}

LLVM IR (-O2):
@.str = [177 x i8] c"Usage: %s COMMAND where COMMAND is one of:\0A create - create a new shared memory queue\0A produce - take lines from stdin and enqueue them\0A consume - dequeue items and print them\0A\00"
@stderr = global i32 0
define i32 @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 125
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int separate(int first, int indent, FILE *fp) {
  if (first)
    fprintf(fp, (indent ? "\n" : "\n\n"));
  return 0;
}


x86 assembly (clang, -O0):
<separate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114d <separate+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%ecx
lea    0xec6(%rip),%rsi
lea    0xec0(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<separate>:
test   %edi,%edi
je     1135 <separate+0x25>
push   %rax
test   %esi,%esi
lea    0xee2(%rip),%rax
lea    0xedc(%rip),%rsi
cmove  %rax,%rsi
mov    %rdx,%rdi
call   1030 <fprintf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @separate(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load i32*, i32** %6
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%15 = call i32 @fprintf(i32* %10, i8* %14)
br label %16
16: ; preds = %9, %3
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @separate(i32 %0, i32 %1, i32* nocapture %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = icmp eq i32 %1, 0
%7 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%8 = tail call i32 @fprintf(i32* %2, i8* %7)
br label %9
9: ; preds = %5, %3
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ make_fibonacci_sequence(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ printf(char *, double);
double sum_of_roots(int /*<<< orphan*/ *, int);
int main() {
  uint64_t num[90];
  make_fibonacci_sequence(num, 90);
  printf("Sum of roots of fibonaci numbers: %f\n", sum_of_roots(num, 90));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x170(%rbp),%rdi
mov    $0x5a,%esi
call   1040 <make_fibonacci_sequence@plt>
lea    -0x170(%rbp),%rdi
mov    $0x5a,%esi
call   1050 <sum_of_roots@plt>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x170,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5a,%esi
call   1040 <make_fibonacci_sequence@plt>
mov    %rbx,%rdi
mov    $0x5a,%esi
call   1050 <sum_of_roots@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x170,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Sum of roots of fibonaci numbers: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [90 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [90 x i32], [90 x i32]* %2, i64 0, i64 0
%4 = call i32 @make_fibonacci_sequence(i32* %3, i32 90)
%5 = getelementptr inbounds [90 x i32], [90 x i32]* %2, i64 0, i64 0
%6 = call double @sum_of_roots(i32* %5, i32 90)
%7 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Sum of roots of fibonaci numbers: %f\0A\00"
define i32 @main() {
%1 = alloca [90 x i32]
%2 = bitcast [90 x i32]* %1 to i8*
%3 = getelementptr inbounds [90 x i32], [90 x i32]* %1, i64 0, i64 0
%4 = call i32 @make_fibonacci_sequence(i32* %3, i32 90)
%5 = call double @sum_of_roots(i32* %3, i32 90)
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glmMod3fs(float *, float *, float);
void glmMod3fs_(float x[3], float y) { glmMod3fs(x, x, y); }


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

x86 assembly (clang, -O2):
<glmMod3fs_>:
mov    %rdi,%rsi
jmp    1030 <glmMod3fs@plt>

LLVM IR (-O0):
define void @glmMod3fs_(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float*, float** %3
%7 = load float, float* %4
%8 = call i32 @glmMod3fs(float* %5, float* %6, float %7)
ret void
}

LLVM IR (-O2):
define void @glmMod3fs_(float* %0, float %1) {
%3 = tail call i32 @glmMod3fs(float* %0, float* %0, float %1)
ret void
}
/* Variables and functions */
int HashBuf(void const *);
unsigned HT_GenHash(const void *Key) { return HashBuf(Key); }


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

x86 assembly (clang, -O2):
<HT_GenHash>:
jmp    1030 <HashBuf@plt>

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

LLVM IR (-O2):
define i32 @HT_GenHash(i8* %0) {
%2 = tail call i32 @HashBuf(i8* %0)
ret i32 %2
}
/* Type definitions */
struct super_block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pr_debug(char *);
void azkfs_put_super(struct super_block *sb) {
  pr_debug("azkfs super block destroyed\n");
}


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

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

LLVM IR (-O0):
%struct.super_block = type { i32 }
@.str = [29 x i8] c"azkfs super block destroyed\0A\00"
define void @azkfs_put_super(%struct.super_block* %0) {
%2 = alloca %struct.super_block*
store %struct.super_block* %0, %struct.super_block** %2
%3 = call i32 @pr_debug(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.super_block = type { i32 }
@.str = [29 x i8] c"azkfs super block destroyed\0A\00"
define void @azkfs_put_super(%struct.super_block* nocapture readnone %0) {
%2 = tail call i32 @pr_debug(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int abs_val(int val) {
  if (val < 0)
    return -val;
  else
    return val;
}


x86 assembly (clang, -O0):
<abs_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <abs_val+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs_val+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_val>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs_val(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @abs_val(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int result, n;
  printf("Enter the value of n");
  scanf("%d", &n);
  result = fact(n);
  printf("The factorial of %d is %d", n, result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fact@plt>
mov    0x4(%rsp),%esi
lea    0xeb1(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter the value of n\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"The factorial of %d is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @fact(i32 %5)
store i32 %6, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Enter the value of n\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"The factorial of %d is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fact(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello, GNU!\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, GNU!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello, GNU!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int bn_rand_range(int, int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
int BN_pseudo_rand_range(BIGNUM *r, const BIGNUM *range) {
  return bn_rand_range(1, r, range);
}


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

x86 assembly (clang, -O2):
<BN_pseudo_rand_range>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <bn_rand_range@plt>

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

LLVM IR (-O2):
define i32 @BN_pseudo_rand_range(i32* %0, i32* %1) {
%3 = tail call i32 @bn_rand_range(i32 1, i32* %0, i32* %1)
ret i32 %3
}
int rdchk(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rdchk(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t read16(uint8_t *buf) {
  uint32_t v = 0;
  for (unsigned int i = 0; i < 2; i++) {
    v <<= 8;
    v |= buf[i];
  }
  return v;
}


x86 assembly (clang, -O0):
<read16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jae    1147 <read16+0x47>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <read16+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %5, %3
ret i32 %6
}
const char *wcslib_version(int vers[3]) {
  static const char *wcsver = "5.18";
  if (vers != 0x0) {
    vers[2] = 0;
    sscanf(wcsver, "%d.%d.%d", vers, vers + 1, vers + 2);
  }
  return wcsver;
}


x86 assembly (clang, -O0):
<wcslib_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115b <wcslib_version+0x4b>
mov    -0x8(%rbp),%rax
movl   $0x0,0x8(%rax)
mov    0x2eef(%rip),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
add    $0x4,%rcx
mov    -0x8(%rbp),%r8
add    $0x8,%r8
lea    0xeb1(%rip),%rsi
mov    $0x0,%al
call   1030 <sscanf@plt>
mov    0x2ec6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcslib_version>:
test   %rdi,%rdi
je     1141 <wcslib_version+0x31>
push   %rax
mov    %rdi,%rdx
lea    0x8(%rdi),%r8
movl   $0x0,0x8(%rdi)
lea    0x4(%rdi),%rcx
lea    0xed1(%rip),%rdi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
call   1030 <sscanf@plt>
add    $0x8,%rsp
lea    0xeb8(%rip),%rax
ret

LLVM IR (-O0):
@wcslib_version.wcsver = internal global i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0)
@.str = [5 x i8] c"5.18\00"
@.str.1 = [9 x i8] c"%d.%d.%d\00"
define i8* @wcslib_version(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 2
store i32 0, i32* %7
%8 = load i8*, i8** @wcslib_version.wcsver
%9 = load i32*, i32** %2
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = call i32 (i8*, i8*, ...) @sscanf(i8* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %9, i32* %11, i32* %13)
br label %15
15: ; preds = %5, %1
%16 = load i8*, i8** @wcslib_version.wcsver
ret i8* %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"5.18\00"
@.str.1 = [9 x i8] c"%d.%d.%d\00"
define i8* @wcslib_version(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = getelementptr inbounds i32, i32* %0, i64 2
store i32 0, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = tail call i32 (i8*, i8*, ...) @sscanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %0, i32* %5, i32* %4)
br label %7
7: ; preds = %3, %1
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  while (argc--) {
    printf("%s\n", *argv++);
  }
  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),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     115f <main+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
je     1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
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
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %5
%13 = load i8*, i8** %11
%14 = ptrtoint i8* %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %6
16: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i8** [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = getelementptr inbounds i8*, i8** %5, i64 1
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp eq i32 %7, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %2
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_usec;
  double tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double py_gettime(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (1.0e-6 * t.tv_usec + t.tv_sec);
}


x86 assembly (clang, -O0):
<py_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<py_gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @py_gettime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %4, double %6)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @py_gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %8
}
void dove_pcie_init(int init_port0, int init_port1) {}


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

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

LLVM IR (-O0):
define void @dove_pcie_init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @dove_pcie_init(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ posix_spawn(int /*<<< orphan*/ *, char *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
void go(void) {
  pid_t pid;
  (void)posix_spawn(&pid, "/usr/bin/ls", NULL, NULL, NULL, NULL);
  (void)waitpid(pid, NULL, 0);
}


x86 assembly (clang, -O0):
<go>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    0xecd(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
call   1040 <posix_spawn@plt>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<go>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0x4(%rsp),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <posix_spawn@plt>
mov    0x4(%rsp),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <waitpid@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/usr/bin/ls\00"
define void @go() {
%1 = alloca i32
%2 = call i32 @posix_spawn(i32* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i32* null, i32* null)
%3 = load i32, i32* %1
%4 = call i32 @waitpid(i32 %3, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"/usr/bin/ls\00"
define void @go() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @posix_spawn(i32* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i32* null, i32* null)
%4 = load i32, i32* %1
%5 = call i32 @waitpid(i32 %4, i32* null, i32 0)
ret void
}
void foo_2_1_2_2_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_2_2_2_2_1_1() {
ret void
}
/* Variables and functions */
int d35(int);
int d36(int a) { return d35(d35(a)); }


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

x86 assembly (clang, -O2):
<d36>:
push   %rax
call   1030 <d35@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d35@plt>

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

LLVM IR (-O2):
define i32 @d36(i32 %0) {
%2 = tail call i32 @d35(i32 %0)
%3 = tail call i32 @d35(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t libtask_now_usecs() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (uint64_t)(tv.tv_sec) * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<libtask_now_usecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
cltq
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libtask_now_usecs>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movabs $0xf424000000000,%rax
imul   0x10(%rsp),%rax
sar    $0x20,%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @libtask_now_usecs() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @libtask_now_usecs() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 4294967296000000
%7 = ashr exact i64 %6, 32
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
ret i64 %10
}
int xclose(void *fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xclose(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct link_iter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct link_iter *);
void link_iter_free(struct link_iter *iter) { free(iter); }


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

x86 assembly (clang, -O2):
<link_iter_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.link_iter = type { i32 }
define void @link_iter_free(%struct.link_iter* %0) {
%2 = alloca %struct.link_iter*
store %struct.link_iter* %0, %struct.link_iter** %2
%3 = load %struct.link_iter*, %struct.link_iter** %2
%4 = call i32 @free(%struct.link_iter* %3)
ret void
}

LLVM IR (-O2):
%struct.link_iter = type { i32 }
define void @link_iter_free(%struct.link_iter* nocapture %0) {
%2 = tail call i32 @free(%struct.link_iter* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void f(int x) {
  printf("void f(int)\n");
  printf("%d\n", x);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [12 x i8] c"void f(int)\00"
define void @f(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
unsigned char inb(unsigned short port) {
  unsigned char ret;
  __asm__ volatile("inb %1, %0" : "=a"(ret) : "Nd"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xmotion_send_event(void *_p) {
  return (int)((XEvent *)_p)->xmotion.send_event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xmotion_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xmotion_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int pif(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", pif("**********", "**********"));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [11 x i8] c"**********\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @pif(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [11 x i8] c"**********\00"
define i32 @main() {
%1 = tail call i32 @pif(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int syscall(int, char const *, char const *);
int rename(const char *old, const char *new) { return syscall(38, old, new); }


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

x86 assembly (clang, -O2):
<rename>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x26,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @rename(i8* %0, i8* %1) {
%3 = tail call i32 @syscall(i32 38, i8* %0, i8* %1)
ret i32 %3
}
int test_and_clear_bit(int nr, volatile unsigned long *addr) {
  unsigned long index = nr / 32;
  unsigned long *tmp = (unsigned long *)&((addr)[index]);
  unsigned char bit = 32 - (nr % 32) - 1;
  *tmp = *tmp & ~(1 << bit);
  return 1;
}


x86 assembly (clang, -O0):
<test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    $0x20,%eax
sub    %edx,%eax
sub    $0x1,%eax
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
movzbl -0x21(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x30(%rbp),%rcx
xor    $0xffffffff,%eax
cltq
and    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_clear_bit>:
mov    %edi,%ecx
lea    0x1f(%rcx),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    $0x80000000,%edx
shr    %cl,%edx
sar    $0x5,%eax
cltq
not    %edx
movslq %edx,%rcx
and    %rcx,(%rsi,%rax,8)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_and_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i8
store i32 %0, i32* %3
store i64* %1, i64** %4
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 32
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64*, i64** %4
%12 = load i64, i64* %5
%13 = getelementptr inbounds i64, i64* %11, i64 %12
store i64* %13, i64** %6
%14 = load i32, i32* %3
%15 = srem i32 %14, 32
%16 = sub nsw i32 32, %15
%17 = sub nsw i32 %16, 1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i64*, i64** %6
%20 = load i64, i64* %19
%21 = load i8, i8* %7
%22 = zext i8 %21 to i32
%23 = shl i32 1, %22
%24 = xor i32 %23, -1
%25 = sext i32 %24 to i64
%26 = and i64 %20, %25
%27 = load i64*, i64** %6
store i64 %26, i64* %27
ret i32 1
}

LLVM IR (-O2):
define i32 @test_and_clear_bit(i32 %0, i64* nocapture %1) {
%3 = sdiv i32 %0, 32
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i64, i64* %1, i64 %4
%6 = load i64, i64* %5
%7 = and i32 %0, 31
%8 = lshr i32 -2147483648, %7
%9 = xor i32 %8, -1
%10 = sext i32 %9 to i64
%11 = and i64 %6, %10
store i64 %11, i64* %5
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: rbootd [-ad] [-i interface] [config_file]\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    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"usage: rbootd [-ad] [-i interface] [config_file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"usage: rbootd [-ad] [-i interface] [config_file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void foo_1_2_1_2_1_2_2_2_2() {}


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

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

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

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

/* Variables and functions */
int get_total_energy_consumed(int /*<<< orphan*/, int, double *);
int /*<<< orphan*/ pp1_node_to_cpu(int /*<<< orphan*/);
int get_pp1_total_energy_consumed(uint64_t node,
                                  double *total_energy_consumed_joules) {
  uint64_t cpu = pp1_node_to_cpu(node);
  return get_total_energy_consumed(cpu, 0x641, total_energy_consumed_joules);
}


x86 assembly (clang, -O0):
<get_pp1_total_energy_consumed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pp1_node_to_cpu@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x641,%esi
call   1040 <get_total_energy_consumed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pp1_total_energy_consumed>:
push   %rbx
mov    %rsi,%rbx
call   1030 <pp1_node_to_cpu@plt>
mov    %eax,%edi
mov    $0x641,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <get_total_energy_consumed@plt>

LLVM IR (-O0):
define i32 @get_pp1_total_energy_consumed(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%6 = load i32, i32* %3
%7 = call i32 @pp1_node_to_cpu(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load double*, double** %4
%10 = call i32 @get_total_energy_consumed(i32 %8, i32 1601, double* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_pp1_total_energy_consumed(i32 %0, double* %1) {
%3 = tail call i32 @pp1_node_to_cpu(i32 %0)
%4 = tail call i32 @get_total_energy_consumed(i32 %3, i32 1601, double* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ vdicgi_errh(char *);
void vdescp(int *escape_code, int *n, float args) {
  if (*n < 0) {
    vdicgi_errh(" SVDI Shell (VDESCP) Error Number 802, Severity Code 5 ");
    return;
  }
}


x86 assembly (clang, -O0):
<vdescp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jge    113e <vdescp+0x2e>
lea    0xec7(%rip),%rdi
call   1030 <vdicgi_errh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdescp>:
cmpl   $0x0,(%rsi)
js     1116 <vdescp+0x6>
ret
lea    0xee3(%rip),%rdi
jmp    1030 <vdicgi_errh@plt>

LLVM IR (-O0):
@.str = [56 x i8] c" SVDI Shell (VDESCP) Error Number 802, Severity Code 5 \00"
define void @vdescp(i32* %0, i32* %1, float %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca float
store i32* %0, i32** %4
store i32* %1, i32** %5
store float %2, float* %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @vdicgi_errh(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c" SVDI Shell (VDESCP) Error Number 802, Severity Code 5 \00"
define void @vdescp(i32* nocapture readnone %0, i32* nocapture %1, float %2) {
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @vdicgi_errh(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Mali_WrReg(int, int, int, int);
int /*<<< orphan*/ printk(char *);
void Mali_clear_and_set_masks_for_mmu_irq(void) {
  printk("Clear the MMU IRQ flags\n");
  Mali_WrReg(0x20, 0x0, 0x2004, 0xFFFFFFFF);
  printk("Set the MMU IRQ Mask to all 1s\n");
  Mali_WrReg(0x20, 0x0, 0x2008, 0xFFFFFFFF);
}


x86 assembly (clang, -O0):
<Mali_clear_and_set_masks_for_mmu_irq>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printk@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x2004,%edx
mov    $0xffffffff,%ecx
call   1040 <Mali_WrReg@plt>
lea    0xecc(%rip),%rdi
call   1030 <printk@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x2008,%edx
mov    $0xffffffff,%ecx
call   1040 <Mali_WrReg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mali_clear_and_set_masks_for_mmu_irq>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printk@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x2004,%edx
mov    $0xffffffff,%ecx
call   1040 <Mali_WrReg@plt>
lea    0xecf(%rip),%rdi
call   1030 <printk@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x2008,%edx
mov    $0xffffffff,%ecx
pop    %rax
jmp    1040 <Mali_WrReg@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Clear the MMU IRQ flags\0A\00"
@.str.1 = [32 x i8] c"Set the MMU IRQ Mask to all 1s\0A\00"
define void @Mali_clear_and_set_masks_for_mmu_irq() {
%1 = call i32 @printk(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Mali_WrReg(i32 32, i32 0, i32 8196, i32 -1)
%3 = call i32 @printk(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @Mali_WrReg(i32 32, i32 0, i32 8200, i32 -1)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Clear the MMU IRQ flags\0A\00"
@.str.1 = [32 x i8] c"Set the MMU IRQ Mask to all 1s\0A\00"
define void @Mali_clear_and_set_masks_for_mmu_irq() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Mali_WrReg(i32 32, i32 0, i32 8196, i32 -1)
%3 = tail call i32 @printk(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @Mali_WrReg(i32 32, i32 0, i32 8200, i32 -1)
ret void
}