xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void cli_print_byte(unsigned char byte) { printf("%02hhX", byte); }


x86 assembly (clang, -O0):
<cli_print_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_print_byte>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%02hhX\00"
define void @cli_print_byte(i8 zeroext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
ret void
}
/* Variables and functions */
char *env_get(char const *);
const char *env_get_def(const char name[], const char def[]) {
  const char *result = env_get(name);
  if (result == NULL || result[0] == '\0') {
    result = def;
  }
  return result;
}


x86 assembly (clang, -O0):
<env_get_def>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <env_get@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1148 <env_get_def+0x38>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1150 <env_get_def+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_get_def>:
push   %rbx
mov    %rsi,%rbx
call   1030 <env_get@plt>
test   %rax,%rax
je     1125 <env_get_def+0x15>
cmpb   $0x0,(%rax)
je     1125 <env_get_def+0x15>
pop    %rbx
ret
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @env_get_def(i8* %0, i8* readnone %1) {
%3 = tail call i8* @env_get(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5, %2
br label %9
9: ; preds = %8, %5
%10 = phi i8* [ %1, %8 ], [ %3, %5 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_matrix(void **matrix) {
  free(matrix[0]);
  free(matrix);
}


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

x86 assembly (clang, -O2):
<free_matrix>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_matrix(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i8**
%7 = call i32 @free(i8** %6)
%8 = load i8**, i8*** %2
%9 = call i32 @free(i8** %8)
ret void
}

LLVM IR (-O2):
define void @free_matrix(i8** nocapture %0) {
%2 = bitcast i8** %0 to i8***
%3 = load i8**, i8*** %2
%4 = tail call i32 @free(i8** %3)
%5 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int check_variable_against_config(char *, char const *);
int check_tt_root(const char *tt_root) {
  return check_variable_against_config("mapreduce.cluster.local.dir", tt_root);
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"mapreduce.cluster.local.dir\00"
define i32 @check_tt_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @check_variable_against_config(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [28 x i8] c"mapreduce.cluster.local.dir\00"
define i32 @check_tt_root(i8* %0) {
%2 = tail call i32 @check_variable_against_config(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mvpmod_stop_audit();
int stop_audit(int argc, char **argv) {
  mvpmod_stop_audit();
  return (0);
}


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

x86 assembly (clang, -O2):
<stop_audit>:
push   %rax
xor    %eax,%eax
call   1030 <mvpmod_stop_audit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stop_audit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @mvpmod_stop_audit()
ret i32 0
}

LLVM IR (-O2):
define i32 @stop_audit(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @mvpmod_stop_audit()
ret i32 0
}
/* Type definitions */
struct glirc_string {
  int dummy;
};
struct glirc {
  int dummy;
};
typedef void FILE;

/* Variables and functions */
void *fopen(char *, char *);
void *start(struct glirc *glirc, const char *path,
            const struct glirc_string *args, size_t args_len) {
  FILE *file = fopen("sample-output.txt", "w");
  return file;
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed1(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
lea    0xee9(%rip),%rdi
lea    0xef4(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
%struct.glirc = type { i32 }
%struct.glirc_string = type { i32 }
@.str = [18 x i8] c"sample-output.txt\00"
@.str.1 = [2 x i8] c"w\00"
define i8* @start(%struct.glirc* %0, i8* %1, %struct.glirc_string* %2, i64 %3) {
%5 = alloca %struct.glirc*
%6 = alloca i8*
%7 = alloca %struct.glirc_string*
%8 = alloca i64
%9 = alloca i8*
store %struct.glirc* %0, %struct.glirc** %5
store i8* %1, i8** %6
store %struct.glirc_string* %2, %struct.glirc_string** %7
store i64 %3, i64* %8
%10 = call i8* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %10, i8** %9
%11 = load i8*, i8** %9
ret i8* %11
}

LLVM IR (-O2):
%struct.glirc = type { i32 }
%struct.glirc_string = type { i32 }
@.str = [18 x i8] c"sample-output.txt\00"
@.str.1 = [2 x i8] c"w\00"
define noalias i8* @start(%struct.glirc* nocapture readnone %0, i8* nocapture readnone %1, %struct.glirc_string* nocapture readnone %2, i64 %3) {
%5 = tail call i8* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: phttpget server [file ...]\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"usage: phttpget server [file ...]\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"usage: phttpget server [file ...]\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
double stub_math_abs(double value) { return (value < 0) ? -value : value; }


x86 assembly (clang, -O0):
<stub_math_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <stub_math_abs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <stub_math_abs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<stub_math_abs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @stub_math_abs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @stub_math_abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ inv_host_serif_get_instance();
int inv_host_serif_read_reg(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/ *, int /*<<< orphan*/);
int inv_host_serif_read_reg_i(uint8_t reg, uint8_t *data, uint32_t len) {
  return inv_host_serif_read_reg(inv_host_serif_get_instance(), reg, data, len);
}


x86 assembly (clang, -O0):
<inv_host_serif_read_reg_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <inv_host_serif_get_instance@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1040 <inv_host_serif_read_reg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_host_serif_read_reg_i>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <inv_host_serif_get_instance@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <inv_host_serif_read_reg@plt>

LLVM IR (-O0):
define i32 @inv_host_serif_read_reg_i(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 = call i32 (...) @inv_host_serif_get_instance()
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 @inv_host_serif_read_reg(i32 %7, i32 %8, i32* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @inv_host_serif_read_reg_i(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 (...) @inv_host_serif_get_instance()
%5 = tail call i32 @inv_host_serif_read_reg(i32 %4, i32 %0, i32* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void abort(void) { exit(EXIT_FAILURE); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @abort() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @abort() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = tail call i32 @exit(i32 %1)
unreachable
}
int isPrime(int number) {
  unsigned int j = 2;
  for (j = 2; j * j <= number; j++) {
    if (number % j == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     1155 <isPrime+0x55>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
jne    1142 <isPrime+0x42>
movl   $0x0,-0x4(%rbp)
jmp    115c <isPrime+0x5c>
jmp    1147 <isPrime+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <isPrime+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
cmp    $0x4,%edi
jae    110b <isPrime+0xb>
mov    $0x1,%eax
ret
mov    $0x2,%esi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %edx,%edx
je     113c <isPrime+0x3c>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jbe    1120 <isPrime+0x20>
mov    $0x1,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %11, label %6
3: ; preds = %6
%4 = mul i32 %10, %10
%5 = icmp ugt i32 %4, %0
br i1 %5, label %11, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %10, %3 ], [ 2, %1 ]
%8 = urem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = add i32 %7, 1
br i1 %9, label %11, label %3
11: ; preds = %6, %3, %1
%12 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
int _foo2_helper();
int /*<<< orphan*/ printf(char *, double);
scalar_t__ sin(double);
int libfoo2_LTX_foo2() {
  printf("sin (0.0) = %g\n", (double)sin((double)0.0));
  return _foo2_helper();
}


x86 assembly (clang, -O0):
<libfoo2_LTX_foo2>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
call   1050 <sin@plt>
cvtsi2sd %rax,%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <_foo2_helper@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<libfoo2_LTX_foo2>:
push   %rax
xorps  %xmm0,%xmm0
call   1050 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <_foo2_helper@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"sin (0.0) = %g\0A\00"
define i32 @libfoo2_LTX_foo2() {
%1 = call i64 @sin(double 0.000000e+00)
%2 = sitofp i64 %1 to double
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call i32 (...) @_foo2_helper()
ret i32 %4
}

LLVM IR (-O2):
@.str = [16 x i8] c"sin (0.0) = %g\0A\00"
define i32 @libfoo2_LTX_foo2() {
%1 = tail call i64 @sin(double 0.000000e+00)
%2 = sitofp i64 %1 to double
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
%4 = tail call i32 (...) @_foo2_helper()
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void col_set_red(int *colour, uint8_t red) {
  *colour = (*colour & ~0xFF0000) | ((red << 16) & 0xFF0000);
}


x86 assembly (clang, -O0):
<col_set_red>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xff00ffff,%ecx
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
and    $0xff0000,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<col_set_red>:
mov    %sil,0x2(%rdi)
ret

LLVM IR (-O0):
define void @col_set_red(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* %5
%7 = and i32 %6, -16711681
%8 = load i32, i32* %4
%9 = shl i32 %8, 16
%10 = and i32 %9, 16711680
%11 = or i32 %7, %10
%12 = load i32*, i32** %3
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @col_set_red(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, -16711681
%5 = shl i32 %1, 16
%6 = and i32 %5, 16711680
%7 = or i32 %4, %6
store i32 %7, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: snodfish [-d][-f <configfile>][-w <workers>]\n");
  exit(2);
}


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    $0x2,%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    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Usage: snodfish [-d][-f <configfile>][-w <workers>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Usage: snodfish [-d][-f <configfile>][-w <workers>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "vita-libs-gen by xerpi\n"
          "usage: vita-libs-gen [-c] nids.yml [extra.yml ...] output-dir\n"
          "\t-c: Generate CMakeLists.txt instead of a Makefile\n");
}


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 = [137 x i8] c"vita-libs-gen by xerpi\0Ausage: vita-libs-gen [-c] nids.yml [extra.yml ...] output-dir\0A\09-c: Generate CMakeLists.txt instead of a Makefile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [137 x i8] c"vita-libs-gen by xerpi\0Ausage: vita-libs-gen [-c] nids.yml [extra.yml ...] output-dir\0A\09-c: Generate CMakeLists.txt instead of a Makefile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
char *strcut(char *str, int len) {
  memmove(str, str + len, strlen(str) - len);
  return str;
}


x86 assembly (clang, -O0):
<strcut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
movslq -0xc(%rbp),%rax
sub    %rax,%rdx
call   1040 <memmove@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcut>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
movslq %esi,%r15
lea    (%rdi,%r15,1),%r14
call   1030 <strlen@plt>
sub    %r15,%rax
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <memmove@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strcut(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8*, i8** %3
%11 = call i64 @strlen(i8* %10)
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = sub nsw i64 %11, %13
%15 = call i32 @memmove(i8* %5, i8* %9, i64 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @strcut(i8* returned %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = sub nsw i64 %5, %3
%7 = tail call i32 @memmove(i8* %0, i8* %4, i64 %6)
ret i8* %0
}
/* Variables and functions */
int bit_turnoff_rightmost_bit(int);
int bit_turn_off_rightmost_bit(int n) { return bit_turnoff_rightmost_bit(n); }


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

x86 assembly (clang, -O2):
<bit_turn_off_rightmost_bit>:
jmp    1030 <bit_turnoff_rightmost_bit@plt>

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

LLVM IR (-O2):
define i32 @bit_turn_off_rightmost_bit(i32 %0) {
%2 = tail call i32 @bit_turnoff_rightmost_bit(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ myPow(double, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  printf("%lf\n", myPow(2.0, -3));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
mov    $0xfffffffd,%edi
call   1040 <myPow@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0xfffffffd,%edi
call   1040 <myPow@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @myPow(double 2.000000e+00, i32 -3)
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = tail call i32 @myPow(double 2.000000e+00, i32 -3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ send_command_to_vpi(int);
void dbg_client_detached(void) { send_command_to_vpi(0xd); }


x86 assembly (clang, -O0):
<dbg_client_detached>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
call   1030 <send_command_to_vpi@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_client_detached>:
mov    $0xd,%edi
jmp    1030 <send_command_to_vpi@plt>

LLVM IR (-O0):
define void @dbg_client_detached() {
%1 = call i32 @send_command_to_vpi(i32 13)
ret void
}

LLVM IR (-O2):
define void @dbg_client_detached() {
%1 = tail call i32 @send_command_to_vpi(i32 13)
ret void
}
__attribute__((always_)) int is_highmem_idx(int idx) { return (idx == 2); }


x86 assembly (clang, -O0):
<is_highmem_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_highmem_idx>:
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_highmem_idx(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ wiringXSPIDataRW(int /*<<< orphan*/, unsigned char *, int);
void setCursorSPI() {
  unsigned char spi_data[2] = {0x79, 0x00};
  wiringXSPIDataRW(0, spi_data, 2);
}


x86 assembly (clang, -O0):
<setCursorSPI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rsi
xor    %edi,%edi
mov    $0x2,%edx
call   1030 <wiringXSPIDataRW@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCursorSPI>:
push   %rax
movw   $0x79,0x6(%rsp)
lea    0x6(%rsp),%rsi
xor    %edi,%edi
mov    $0x2,%edx
call   1030 <wiringXSPIDataRW@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.setCursorSPI.spi_data = [2 x i8] c"y\00"
define void @setCursorSPI() {
%1 = alloca [2 x i8]
%2 = bitcast [2 x i8]* %1 to i8*
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = call i32 @wiringXSPIDataRW(i32 0, i8* %3, i32 2)
ret void
}

LLVM IR (-O2):
define void @setCursorSPI() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 121, i16* %1
%3 = call i32 @wiringXSPIDataRW(i32 0, i8* %2, i32 2)
ret void
}
int intTest(int value) { return value; }


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

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

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

LLVM IR (-O2):
define i32 @intTest(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
double fabs(double);
int areEqualFloats(double x, double y) {
  if (fabs(x - y) < 0.0001)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<areEqualFloats>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movaps 0xef1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1141 <areEqualFloats+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <areEqualFloats+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<areEqualFloats>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
movsd  0xefc(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @areEqualFloats(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = call double @llvm.fabs.f64(double %8)
%10 = fcmp olt double %9, 1.000000e-04
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @areEqualFloats(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fcmp olt double %4, 1.000000e-04
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Report(char *);
int astG3DText(const char *text, float ref[3], const char *just, float up[3],
               float norm[3]) {
  Report("astG3DText");
  return 0;
}


x86 assembly (clang, -O0):
<astG3DText>:
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    %r8,-0x28(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <Report@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"astG3DText\00"
define i32 @astG3DText(i8* %0, float* %1, i8* %2, float* %3, float* %4) {
%6 = alloca i8*
%7 = alloca float*
%8 = alloca i8*
%9 = alloca float*
%10 = alloca float*
store i8* %0, i8** %6
store float* %1, float** %7
store i8* %2, i8** %8
store float* %3, float** %9
store float* %4, float** %10
%11 = call i32 @Report(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"astG3DText\00"
define i32 @astG3DText(i8* nocapture readnone %0, float* nocapture readnone %1, i8* nocapture readnone %2, float* nocapture readnone %3, float* nocapture readnone %4) {
%6 = tail call i32 @Report(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void ff_hevc_put_hevc_bi_epel_h6_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h6_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *realloc(void *, size_t);
void *resizeMemory(void *Memory, size_t count, size_t size) {
  void *result = realloc(Memory, count * size);
  if (!result)
    printf("Reallocate memory error\n");
  return result;
}


x86 assembly (clang, -O0):
<resizeMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1161 <resizeMemory+0x41>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resizeMemory>:
push   %rbx
imul   %rdx,%rsi
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113e <resizeMemory+0x1e>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Reallocate memory error\0A\00"
define i8* @resizeMemory(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = mul i64 %9, %10
%12 = call i8* @realloc(i8* %8, i64 %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = icmp ne i8* %13, null
br i1 %14, label %17, label %15
15: ; preds = %3
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %3
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
@str = [24 x i8] c"Reallocate memory error\00"
define noalias i8* @resizeMemory(i8* nocapture %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i8* @realloc(i8* %0, i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret i8* %5
}
/* Variables and functions */
void stub1(int);
void testClosureZrV(void (*closure)(bool), bool a1) {
  if (closure != NULL)
    (*closure)(a1);
}


x86 assembly (clang, -O0):
<testClosureZrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <testClosureZrV+0x23>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureZrV>:
test   %rdi,%rdi
je     110c <testClosureZrV+0xc>
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureZrV(void (i32)* %0, i32 %1) {
%3 = icmp eq void (i32)* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
tail call void %0(i32 %1)
br label %5
5: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
int /*<<< orphan*/ replace();
void main(int i) {
  f();
  {
    replace();
    replace();
  }
  g();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1050 <replace@plt>
mov    $0x0,%al
call   1050 <replace@plt>
mov    $0x0,%al
call   1040 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
call   1050 <replace@plt>
xor    %eax,%eax
call   1050 <replace@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <g@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @f()
%4 = call i32 (...) @replace()
%5 = call i32 (...) @replace()
%6 = call i32 (...) @g()
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 (...) @f()
%3 = tail call i32 (...) @replace()
%4 = tail call i32 (...) @replace()
%5 = tail call i32 (...) @g()
ret void
}
int fun(int *a) {
  a[3] = 1;
  a[6] = 1;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,0xc(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,0x18(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
movl   $0x1,0xc(%rdi)
movl   $0x1,0x18(%rdi)
ret

LLVM IR (-O0):
define i32 @fun(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 3
store i32 1, i32* %5
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 6
store i32 1, i32* %7
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @fun(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
store i32 1, i32* %2
%3 = getelementptr inbounds i32, i32* %0, i64 6
store i32 1, i32* %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void lines(int option) {
  switch (option) {
  case 1:
    printf("\n*****************************************************************"
           "*******\n");
    break;
  case 2:
    printf("\n+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+"
           "=+=+=+=+\n");
    break;
  default:
    printf("\n-----------------------------------------------------------------"
           "-------\n");
  }
}


x86 assembly (clang, -O0):
<lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1140 <lines+0x30>
jmp    112f <lines+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1151 <lines+0x41>
jmp    1162 <lines+0x52>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <lines+0x5e>
lea    0xef3(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <lines+0x5e>
lea    0xf2e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lines>:
cmp    $0x2,%edi
lea    0xee6(%rip),%rax
lea    0xf74(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xf1c(%rip),%rdi
cmovne %rcx,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [75 x i8] c"\0A************************************************************************\0A\00"
@.str.1 = [76 x i8] c"\0A+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+\0A\00"
@.str.2 = [75 x i8] c"\0A------------------------------------------------------------------------\0A\00"
define void @lines(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 1, label %4
i32 2, label %6
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6, %4
ret void
}

LLVM IR (-O2):
@str = [75 x i8] c"\0A+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+\00"
@str.3 = [74 x i8] c"\0A************************************************************************\00"
@str.4 = [74 x i8] c"\0A------------------------------------------------------------------------\00"
define void @lines(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @str.4, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @str.3, i64 0, i64 0), i8* %3
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/
ArbiterP__0__ResourceDefaultOwner__default__immediateRequested();
void ArbiterP__0__ResourceDefaultOwner__immediateRequested(void) {
  ArbiterP__0__ResourceDefaultOwner__default__immediateRequested();
}


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

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

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

LLVM IR (-O2):
define void @ArbiterP__0__ResourceDefaultOwner__immediateRequested() {
%1 = tail call i32 (...) @ArbiterP__0__ResourceDefaultOwner__default__immediateRequested()
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int bind(int, struct sockaddr *, int);
int test(void) {
  int sockfd = 4;
  struct sockaddr addr;
  socklen_t addrlen = sizeof(addr);
  return bind(sockfd, &addr, addrlen);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%edx
lea    -0x8(%rbp),%rsi
call   1030 <bind@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x4,%edx
call   1030 <bind@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca %struct.sockaddr
%3 = alloca i32
store i32 4, i32* %1
store i32 4, i32* %3
%4 = load i32, i32* %1
%5 = load i32, i32* %3
%6 = call i32 @bind(i32 %4, %struct.sockaddr* %2, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca %struct.sockaddr
%2 = bitcast %struct.sockaddr* %1 to i8*
%3 = call i32 @bind(i32 4, %struct.sockaddr* %1, i32 4)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ CC2420ControlP__StartupTimer__fired();
int /*<<< orphan*/ CC2420TransmitP__BackoffTimer__fired();
void TransformAlarmC__0__Alarm__fired(void) {
  CC2420TransmitP__BackoffTimer__fired();
  CC2420ControlP__StartupTimer__fired();
}


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

x86 assembly (clang, -O2):
<TransformAlarmC__0__Alarm__fired>:
push   %rax
xor    %eax,%eax
call   1040 <CC2420TransmitP__BackoffTimer__fired@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CC2420ControlP__StartupTimer__fired@plt>

LLVM IR (-O0):
define void @TransformAlarmC__0__Alarm__fired() {
%1 = call i32 (...) @CC2420TransmitP__BackoffTimer__fired()
%2 = call i32 (...) @CC2420ControlP__StartupTimer__fired()
ret void
}

LLVM IR (-O2):
define void @TransformAlarmC__0__Alarm__fired() {
%1 = tail call i32 (...) @CC2420TransmitP__BackoffTimer__fired()
%2 = tail call i32 (...) @CC2420ControlP__StartupTimer__fired()
ret void
}
/* Type definitions */
struct core_instr_params {
  int dummy;
};
struct core_cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ core_cpu_i__call(struct core_cpu *,
                                    struct core_instr_params *, int);
void core_cpu_i_op_cz(struct core_cpu *cpu, struct core_instr_params *p) {
  core_cpu_i__call(cpu, p, 0x01);
}


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

x86 assembly (clang, -O2):
<core_cpu_i_op_cz>:
mov    $0x1,%edx
jmp    1030 <core_cpu_i__call@plt>

LLVM IR (-O0):
%struct.core_cpu = type { i32 }
%struct.core_instr_params = type { i32 }
define void @core_cpu_i_op_cz(%struct.core_cpu* %0, %struct.core_instr_params* %1) {
%3 = alloca %struct.core_cpu*
%4 = alloca %struct.core_instr_params*
store %struct.core_cpu* %0, %struct.core_cpu** %3
store %struct.core_instr_params* %1, %struct.core_instr_params** %4
%5 = load %struct.core_cpu*, %struct.core_cpu** %3
%6 = load %struct.core_instr_params*, %struct.core_instr_params** %4
%7 = call i32 @core_cpu_i__call(%struct.core_cpu* %5, %struct.core_instr_params* %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.core_cpu = type { i32 }
%struct.core_instr_params = type { i32 }
define void @core_cpu_i_op_cz(%struct.core_cpu* %0, %struct.core_instr_params* %1) {
%3 = tail call i32 @core_cpu_i__call(%struct.core_cpu* %0, %struct.core_instr_params* %1, i32 1)
ret void
}
/* Variables and functions */
float asinf(float);
void __hv_asin_f(float bIn, float *bOut) { *bOut = asinf(bIn); }


x86 assembly (clang, -O0):
<__hv_asin_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <asinf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_asin_f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <asinf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__hv_asin_f(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 = call float @asinf(float %5)
%7 = load float*, float** %4
store float %6, float* %7
ret void
}

LLVM IR (-O2):
define void @__hv_asin_f(float %0, float* nocapture writeonly %1) {
%3 = tail call float @asinf(float %0)
store float %3, float* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ path;

/* Variables and functions */
int /*<<< orphan*/ F_OK;
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int __rtinfo_internal_disk_isblock(char *device) {
  char path[512];
  snprintf(path, sizeof(path), "/sys/block/%s/dev", device);
  return !access(path, F_OK);
}


x86 assembly (clang, -O0):
<__rtinfo_internal_disk_isblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x200,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rtinfo_internal_disk_isblock>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1030 <snprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <access@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/sys/block/%s/dev\00"
@F_OK = global i32 0
define i32 @__rtinfo_internal_disk_isblock(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 512, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* @F_OK
%9 = call i32 @access(i8* %7, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [18 x i8] c"/sys/block/%s/dev\00"
@F_OK = global i32 0
define i32 @__rtinfo_internal_disk_isblock(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 512, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @F_OK
%6 = call i32 @access(i8* %3, i32 %5)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  int a = 1;
  int b = 2;
  __VERIFIER_assert(a >= b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp sge i32 %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}