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

/* Variables and functions */
int /*<<< orphan*/ n163AudioGet8_48XX(int /*<<< orphan*/);
int /*<<< orphan*/ namcoSetN163(int /*<<< orphan*/);
uint8_t namco_getParams48XX_SetN163(uint16_t addr) {
  namcoSetN163(addr);
  return n163AudioGet8_48XX(addr);
}


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

x86 assembly (clang, -O2):
<namco_getParams48XX_SetN163>:
push   %rbx
mov    %edi,%ebx
call   1030 <namcoSetN163@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <n163AudioGet8_48XX@plt>

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

LLVM IR (-O2):
define i32 @namco_getParams48XX_SetN163(i32 %0) {
%2 = tail call i32 @namcoSetN163(i32 %0)
%3 = tail call i32 @n163AudioGet8_48XX(i32 %0)
ret i32 %3
}
/* Variables and functions */
void *sj_malloc(size_t);
void *sj_calloc(size_t num, size_t size) { return sj_malloc(num * size); }


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

x86 assembly (clang, -O2):
<sj_calloc>:
imul   %rsi,%rdi
jmp    1030 <sj_malloc@plt>

LLVM IR (-O0):
define i8* @sj_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul i64 %5, %6
%8 = call i8* @sj_malloc(i64 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @sj_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @sj_malloc(i64 %3)
ret i8* %4
}
void bio_endio(struct bio *x, unsigned int y, int z) { return; }


x86 assembly (clang, -O0):
<bio_endio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bio = type opaque
define void @bio_endio(%struct.bio* %0, i32 %1, i32 %2) {
%4 = alloca %struct.bio*
%5 = alloca i32
%6 = alloca i32
store %struct.bio* %0, %struct.bio** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.bio = type opaque
define void @bio_endio(%struct.bio* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("#include <stdio.h>\n\n int main(){ printf( return 0 };");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"#include <stdio.h>\0A\0A int main(){ printf( return 0 };\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"#include <stdio.h>\0A\0A int main(){ printf( return 0 };\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int basetodec(char *, int);
int ctoi(char);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char str[] = "9C5545";
  printf("%d\n", basetodec(str, 16));
  printf("%d\n", ctoi('A'));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x7(%rbp),%rdi
mov    $0x10,%esi
call   1050 <basetodec@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x41,%edi
call   1030 <ctoi@plt>
mov    %eax,%esi
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x353435,0xb(%rsp)
movl   $0x35354339,0x8(%rsp)
35
lea    0x8(%rsp),%rdi
mov    $0x10,%esi
call   1050 <basetodec@plt>
lea    0xeac(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x41,%edi
call   1030 <ctoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [7 x i8] c"9C5545\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = bitcast [7 x i8]* %1 to i8*
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = call i32 @basetodec(i8* %3, i32 16)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @ctoi(i8 signext 65)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [7 x i8] c"9C5545\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @basetodec(i8* %2, i32 16)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @ctoi(i8 signext 65)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void version(void) { printf("%s version %s\n", "corpus", "0.6.0"); }


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

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
lea    0xef1(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s version %s\0A\00"
@.str.1 = [7 x i8] c"corpus\00"
@.str.2 = [6 x i8] c"0.6.0\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s version %s\0A\00"
@.str.1 = [7 x i8] c"corpus\00"
@.str.2 = [6 x i8] c"0.6.0\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xfb() {
  Assert_real((isdigit(251) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              1260, ("isdigit should be 0 for 0xfb"));
}


x86 assembly (clang, -O0):
<t_isdigit_0xfb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfb,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4ec,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0xfb>:
push   %rax
mov    $0xfb,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ec,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xfb\00"
define void @t_isdigit_0xfb() {
%1 = call i64 @isdigit(i32 251)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1260, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xfb\00"
define void @t_isdigit_0xfb() {
%1 = tail call i64 @isdigit(i32 251)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1260, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct index_mm_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct index_mm_node *);
void index_mm_free_node(struct index_mm_node *node) { free(node); }


x86 assembly (clang, -O0):
<index_mm_free_node>:
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):
<index_mm_free_node>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.index_mm_node = type { i32 }
define void @index_mm_free_node(%struct.index_mm_node* nocapture %0) {
%2 = tail call i32 @free(%struct.index_mm_node* %0)
ret void
}
void yy_1_LinkOptionKeyword(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_LinkOptionKeyword(i8* nocapture %0, i32 %1) {
ret void
}
void DecodeOutputs(unsigned char *outputs, unsigned char *layer) {
  *layer = *outputs & 0x70;
  *outputs = *outputs & 0x0f;
}


x86 assembly (clang, -O0):
<DecodeOutputs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x70,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xf,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecodeOutputs>:
mov    (%rdi),%al
and    $0x70,%al
mov    %al,(%rsi)
andb   $0xf,(%rdi)
ret

LLVM IR (-O0):
define void @DecodeOutputs(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* %5
%7 = zext i8 %6 to i32
%8 = and i32 %7, 112
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
store i8 %9, i8* %10
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 15
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
store i8 %15, i8* %16
ret void
}

LLVM IR (-O2):
define void @DecodeOutputs(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = and i8 %3, 112
store i8 %4, i8* %1
%5 = load i8, i8* %0
%6 = and i8 %5, 15
store i8 %6, i8* %0
ret void
}
void ipipe_trace_panic_freeze(void) {}


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

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

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

LLVM IR (-O2):
define void @ipipe_trace_panic_freeze() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bot_quat_to_angle_axis(double *, double *, double *);
int /*<<< orphan*/ bot_roll_pitch_yaw_to_quat(double const *, double *);
void bot_roll_pitch_yaw_to_angle_axis(const double rpy[3], double *theta,
                                      double axis[3]) {
  double q[4];
  bot_roll_pitch_yaw_to_quat(rpy, q);
  bot_quat_to_angle_axis(q, theta, axis);
}


x86 assembly (clang, -O0):
<bot_roll_pitch_yaw_to_angle_axis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <bot_roll_pitch_yaw_to_quat@plt>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <bot_quat_to_angle_axis@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_roll_pitch_yaw_to_angle_axis>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rsp,%r15
mov    %r15,%rsi
call   1040 <bot_roll_pitch_yaw_to_quat@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <bot_quat_to_angle_axis@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @bot_roll_pitch_yaw_to_angle_axis(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [4 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %4
%9 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%10 = call i32 @bot_roll_pitch_yaw_to_quat(double* %8, double* %9)
%11 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%12 = load double*, double** %5
%13 = load double*, double** %6
%14 = call i32 @bot_quat_to_angle_axis(double* %11, double* %12, double* %13)
ret void
}

LLVM IR (-O2):
define void @bot_roll_pitch_yaw_to_angle_axis(double* %0, double* %1, double* %2) {
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %4 to i8*
%6 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%7 = call i32 @bot_roll_pitch_yaw_to_quat(double* %0, double* %6)
%8 = call i32 @bot_quat_to_angle_axis(double* %6, double* %1, double* %2)
ret void
}
void dvbapi_read_priority(void) {}


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

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

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

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

/* Variables and functions */
double my_fabs(double x) {
  union {
    double f;
    uint64_t i;
  } u = {x};
  u.i &= -1ULL / 2;
  return u.f;
}


x86 assembly (clang, -O0):
<my_fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
and    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fabs>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @my_fabs(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = bitcast %union.anon* %3 to double*
%5 = load double, double* %2
store double %5, double* %4
%6 = bitcast %union.anon* %3 to i64*
%7 = load i64, i64* %6
%8 = and i64 %7, 9223372036854775807
store i64 %8, i64* %6
%9 = bitcast %union.anon* %3 to double*
%10 = load double, double* %9
ret double %10
}

LLVM IR (-O2):
define double @my_fabs(double %0) {
%2 = bitcast double %0 to i64
%3 = and i64 %2, 9223372036854775807
%4 = bitcast i64 %3 to double
ret double %4
}
int add(double x) { return (x + 0.5); }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @add(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @add(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int shutdown(int __fd, int __how) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shutdown>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @shutdown(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @shutdown(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void UI_SoundOptionsMenu_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame2_l");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame1_r");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_0");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_1");
}


x86 assembly (clang, -O0):
<UI_SoundOptionsMenu_Cache>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef3(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf01(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf0d(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_SoundOptionsMenu_Cache>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef6(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf04(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf10(%rip),%rdi
pop    %rax
jmp    1030 <trap_R_RegisterShaderNoMip@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.1 = [26 x i8] c"menu/art_blueish/frame1_r\00"
@.str.2 = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.3 = [24 x i8] c"menu/art_blueish/back_1\00"
define void @UI_SoundOptionsMenu_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.1 = [26 x i8] c"menu/art_blueish/frame1_r\00"
@.str.2 = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.3 = [24 x i8] c"menu/art_blueish/back_1\00"
define void @UI_SoundOptionsMenu_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_html_end(void) { printf("</body></html>\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"</body></html>\0A\00"
define void @print_html_end() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"</body></html>\00"
define void @print_html_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int getpid();
int /*<<< orphan*/ printf(char *, int);
void sig_pipe(int signo) {
  printf("%d SIGPIPE caught\n", getpid());
  exit(1);
}


x86 assembly (clang, -O0):
<sig_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sig_pipe>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%d SIGPIPE caught\0A\00"
define void @sig_pipe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"%d SIGPIPE caught\0A\00"
define void @sig_pipe(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int LOG_NOWAIT;
int LOG_PID;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char const *, int, int /*<<< orphan*/);
void logging_set_prefix(const char *ident) {
  closelog();
  openlog(ident, LOG_NOWAIT | LOG_PID, LOG_DAEMON);
}


x86 assembly (clang, -O0):
<logging_set_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <closelog@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
mov    0x2e91(%rip),%rax
or     (%rax),%esi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
call   1040 <openlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logging_set_prefix>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <closelog@plt>
mov    0x2e9e(%rip),%rax
mov    0x2e9f(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <openlog@plt>

LLVM IR (-O0):
@LOG_NOWAIT = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @logging_set_prefix(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @closelog()
%4 = load i8*, i8** %2
%5 = load i32, i32* @LOG_NOWAIT
%6 = load i32, i32* @LOG_PID
%7 = or i32 %5, %6
%8 = load i32, i32* @LOG_DAEMON
%9 = call i32 @openlog(i8* %4, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@LOG_NOWAIT = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @logging_set_prefix(i8* %0) {
%2 = tail call i32 (...) @closelog()
%3 = load i32, i32* @LOG_NOWAIT
%4 = load i32, i32* @LOG_PID
%5 = or i32 %4, %3
%6 = load i32, i32* @LOG_DAEMON
%7 = tail call i32 @openlog(i8* %0, i32 %5, i32 %6)
ret void
}
void B_CleanupAlloc(void) {}


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

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

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

LLVM IR (-O2):
define void @B_CleanupAlloc() {
ret void
}
/* Variables and functions */
unsigned int f05(unsigned int);
unsigned int f06(unsigned int a) { return f05(f05(a)); }


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

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

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

LLVM IR (-O2):
define i32 @f06(i32 %0) {
%2 = tail call i32 @f05(i32 %0)
%3 = tail call i32 @f05(i32 %2)
ret i32 %3
}
extern int strcmp(const char *cs, const char *ct) {
  register int __res;
  __asm__("cld\n"
          "1:\tlodsb\n\t"
          "scasb\n\t"
          "jne 2f\n\t"
          "testb %%al,%%al\n\t"
          "jne 1b\n\t"
          "xorl %%eax,%%eax\n\t"
          "jmp 3f\n"
          "2:\tmovl $1,%%eax\n\t"
          "jl 3f\n\t"
          "negl %%eax\n"
          "3:"
          : "=a"(__res)
          : "D"(cs), "S"(ct));
  return __res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
cld
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    112c <strcmp+0x2c>
test   %al,%al
jne    1115 <strcmp+0x15>
xor    %eax,%eax
jmp    1139 <strcmp+0x39>
mov    $0x1,%eax
jl     1139 <strcmp+0x39>
neg    %eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
cld
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    110d <strcmp+0xd>
test   %al,%al
jne    1101 <strcmp+0x1>
xor    %eax,%eax
jmp    1116 <strcmp+0x16>
mov    $0x1,%eax
jl     1116 <strcmp+0x16>
neg    %eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 asm "cld\0A1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09movl $$1,%eax\0A\09jl 3f\0A\09negl %eax\0A3:", "={ax},{di},{si},~{dirflag},~{fpsr},~{flags}"(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @strcmp(i8* readnone %0, i8* readnone %1) {
%3 = tail call i32 asm "cld\0A1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09movl $$1,%eax\0A\09jl 3f\0A\09negl %eax\0A3:", "={ax},{di},{si},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ GP_replData(short);
scalar_t__ getParLong(long *);
int /*<<< orphan*/ is1Tab();
int /*<<< orphan*/ messErr(int);
void IF_gplot_replace(void) {
  long t;
  if (getParLong(&t)) {
    if (!is1Tab()) {
      messErr(12);
      return;
    }
    GP_replData((short)t);
  }
}


x86 assembly (clang, -O0):
<IF_gplot_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1050 <getParLong@plt>
cmp    $0x0,%rax
je     1186 <IF_gplot_replace+0x46>
mov    $0x0,%al
call   1030 <is1Tab@plt>
cmp    $0x0,%eax
jne    117a <IF_gplot_replace+0x3a>
mov    $0xc,%edi
call   1040 <messErr@plt>
jmp    1186 <IF_gplot_replace+0x46>
mov    -0x8(%rbp),%rax
movswl %ax,%edi
call   1060 <GP_replData@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_gplot_replace>:
push   %rax
mov    %rsp,%rdi
call   1050 <getParLong@plt>
test   %rax,%rax
je     1162 <IF_gplot_replace+0x22>
xor    %eax,%eax
call   1030 <is1Tab@plt>
test   %eax,%eax
je     1164 <IF_gplot_replace+0x24>
movswl (%rsp),%edi
call   1060 <GP_replData@plt>
pop    %rax
ret
mov    $0xc,%edi
call   1040 <messErr@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @IF_gplot_replace() {
%1 = alloca i64
%2 = call i64 @getParLong(i64* %1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %0
%5 = call i32 (...) @is1Tab()
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = call i32 @messErr(i32 12)
br label %13
9: ; preds = %4
%10 = load i64, i64* %1
%11 = trunc i64 %10 to i16
%12 = call i32 @GP_replData(i16 signext %11)
br label %13
13: ; preds = %7, %9, %0
ret void
}

LLVM IR (-O2):
define void @IF_gplot_replace() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i64 @getParLong(i64* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %0
%6 = call i32 (...) @is1Tab()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @messErr(i32 12)
br label %14
10: ; preds = %5
%11 = load i64, i64* %1
%12 = trunc i64 %11 to i16
%13 = call i32 @GP_replData(i16 signext %12)
br label %14
14: ; preds = %0, %10, %8
ret void
}
void scaleBiasHiLoZ(const float vec[3], float *texel) {
  texel[0] = vec[2];
  texel[0] *= 0.5;
  texel[0] += 0.5;
  texel[1] = 0.0;
}


x86 assembly (clang, -O0):
<scaleBiasHiLoZ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecf(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeaf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scaleBiasHiLoZ>:
movss  0xef8(%rip),%xmm0
movss  0x8(%rdi),%xmm1
mulss  %xmm0,%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsi)
movl   $0x0,0x4(%rsi)
ret

LLVM IR (-O0):
define void @scaleBiasHiLoZ(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 = getelementptr inbounds float, float* %5, i64 2
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = fmul double %13, 5.000000e-01
%15 = fptrunc double %14 to float
store float %15, float* %11
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 0
%18 = load float, float* %17
%19 = fpext float %18 to double
%20 = fadd double %19, 5.000000e-01
%21 = fptrunc double %20 to float
store float %21, float* %17
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 1
store float 0.000000e+00, float* %23
ret void
}

LLVM IR (-O2):
define void @scaleBiasHiLoZ(float* nocapture %0, float* nocapture writeonly %1) {
%3 = getelementptr inbounds float, float* %0, i64 2
%4 = load float, float* %3
%5 = fmul float %4, 5.000000e-01
%6 = fadd float %5, 5.000000e-01
store float %6, float* %1
%7 = getelementptr inbounds float, float* %1, i64 1
store float 0.000000e+00, float* %7
ret void
}
/* Type definitions */
struct section_list_link {
  int dummy;
};
struct section_list {
  int dummy;
};
struct section {
  int dummy;
};
struct genlist_link {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_insert_before(struct genlist *, struct section *,
                                         struct genlist_link *);
void section_list_insert_before(struct section_list *tthis,
                                struct section *pfoo,
                                struct section_list_link *plink) {
  genlist_insert_before((struct genlist *)tthis, pfoo,
                        (struct genlist_link *)plink);
}


x86 assembly (clang, -O0):
<section_list_insert_before>:
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
mov    -0x18(%rbp),%rdx
call   1030 <genlist_insert_before@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<section_list_insert_before>:
jmp    1030 <genlist_insert_before@plt>

LLVM IR (-O0):
%struct.section_list = type { i32 }
%struct.section = type { i32 }
%struct.section_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @section_list_insert_before(%struct.section_list* %0, %struct.section* %1, %struct.section_list_link* %2) {
%4 = alloca %struct.section_list*
%5 = alloca %struct.section*
%6 = alloca %struct.section_list_link*
store %struct.section_list* %0, %struct.section_list** %4
store %struct.section* %1, %struct.section** %5
store %struct.section_list_link* %2, %struct.section_list_link** %6
%7 = load %struct.section_list*, %struct.section_list** %4
%8 = bitcast %struct.section_list* %7 to %struct.genlist*
%9 = load %struct.section*, %struct.section** %5
%10 = load %struct.section_list_link*, %struct.section_list_link** %6
%11 = bitcast %struct.section_list_link* %10 to %struct.genlist_link*
%12 = call i32 @genlist_insert_before(%struct.genlist* %8, %struct.section* %9, %struct.genlist_link* %11)
ret void
}

LLVM IR (-O2):
%struct.section_list = type { i32 }
%struct.section = type { i32 }
%struct.section_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @section_list_insert_before(%struct.section_list* %0, %struct.section* %1, %struct.section_list_link* %2) {
%4 = bitcast %struct.section_list* %0 to %struct.genlist*
%5 = bitcast %struct.section_list_link* %2 to %struct.genlist_link*
%6 = tail call i32 @genlist_insert_before(%struct.genlist* %4, %struct.section* %1, %struct.genlist_link* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DebugLogSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void DebugLogSettingsLogging() { UAVObjLogging(DebugLogSettingsHandle()); }


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

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

LLVM IR (-O0):
define void @DebugLogSettingsLogging() {
%1 = call i32 (...) @DebugLogSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DebugLogSettingsLogging() {
%1 = tail call i32 (...) @DebugLogSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
void EXTI3_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @EXTI3_IRQHandler() {
ret void
}
void xive_flush_interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @xive_flush_interrupt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ reconos_mmu_stats(int *, int *, int *);
void print_mmu_stats() {
  int hits, misses, pgfaults;
  reconos_mmu_stats(&hits, &misses, &pgfaults);
  printf("MMU stats: TLB hits: %d    TLB misses: %d    page faults: %d\n", hits,
         misses, pgfaults);
}


x86 assembly (clang, -O0):
<print_mmu_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <reconos_mmu_stats@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mmu_stats>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <reconos_mmu_stats@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [62 x i8] c"MMU stats: TLB hits: %d TLB misses: %d page faults: %d\0A\00"
define void @print_mmu_stats() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @reconos_mmu_stats(i32* %1, i32* %2, i32* %3)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"MMU stats: TLB hits: %d TLB misses: %d page faults: %d\0A\00"
define void @print_mmu_stats() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @reconos_mmu_stats(i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ ENGINE_add(int /*<<< orphan*/ *);
int /*<<< orphan*/ ENGINE_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ENGINE_rsa();
int /*<<< orphan*/ ERR_clear_error();
void ENGINE_load_rsa(void) {
  ENGINE *toadd = ENGINE_rsa();
  if (!toadd)
    return;
  ENGINE_add(toadd);
  ENGINE_free(toadd);
  ERR_clear_error();
}


x86 assembly (clang, -O0):
<ENGINE_load_rsa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <ENGINE_rsa@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <ENGINE_load_rsa+0x23>
jmp    117c <ENGINE_load_rsa+0x3c>
mov    -0x8(%rbp),%rdi
call   1040 <ENGINE_add@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ENGINE_free@plt>
mov    $0x0,%al
call   1050 <ERR_clear_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ENGINE_load_rsa>:
push   %rbx
xor    %eax,%eax
call   1060 <ENGINE_rsa@plt>
test   %rax,%rax
je     1168 <ENGINE_load_rsa+0x28>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <ENGINE_add@plt>
mov    %rbx,%rdi
call   1030 <ENGINE_free@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <ERR_clear_error@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ENGINE_load_rsa() {
%1 = tail call i32* (...) @ENGINE_rsa()
%2 = icmp eq i32* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @ENGINE_add(i32* %1)
%5 = tail call i32 @ENGINE_free(i32* %1)
%6 = tail call i32 (...) @ERR_clear_error()
br label %7
7: ; preds = %0, %3
ret void
}
/* Variables and functions */
char *Reverse(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char *argv[]) {
  char *str;
  str = Reverse("program");
  printf("%s %s\n", "program", str);
  free(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1050 <Reverse@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
lea    0xea7(%rip),%rdi
lea    0xe98(%rip),%rsi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
mov    %r14,%rdi
call   1050 <Reverse@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"program\00"
@.str.1 = [7 x i8] c"%s %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @Reverse(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"program\00"
@.str.1 = [7 x i8] c"%s %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @Reverse(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xd1() {
  Assert_real((isbdigit(209) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1050, ("isbdigit should be 0 for 0xd1"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0xd1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd1,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x41a,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0xd1>:
push   %rax
mov    $0xd1,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x41a,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xd1\00"
define void @t_isbdigit_0xd1() {
%1 = call i64 @isbdigit(i32 209)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1050, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xd1\00"
define void @t_isbdigit_0xd1() {
%1 = tail call i64 @isbdigit(i32 209)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1050, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double calc_humidity(unsigned int data) {
  double sensor_humid = data / 65536.0;
  return -6.0 + (125.0 * sensor_humid);
}


x86 assembly (clang, -O0):
<calc_humidity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xef9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecf(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_humidity>:
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xef1(%rip),%xmm0
mulsd  0xef1(%rip),%xmm0
addsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calc_humidity(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = uitofp i32 %4 to double
%6 = fdiv double %5, 6.553600e+04
store double %6, double* %3
%7 = load double, double* %3
%8 = call double @llvm.fmuladd.f64(double 1.250000e+02, double %7, double -6.000000e+00)
ret double %8
}

LLVM IR (-O2):
define double @calc_humidity(i32 %0) {
%2 = uitofp i32 %0 to double
%3 = fmul double %2, 0x3EF0000000000000
%4 = tail call double @llvm.fmuladd.f64(double %3, double 1.250000e+02, double -6.000000e+00)
ret double %4
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("user is %s\n", getenv("USER"));
  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    0xecf(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"user is %s\0A\00"
@.str.1 = [5 x i8] c"USER\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 i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"user is %s\0A\00"
@.str.1 = [5 x i8] c"USER\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ NewInputFile(char const *);
void InitScanner(const char *InFile) { NewInputFile(InFile); }


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

x86 assembly (clang, -O2):
<InitScanner>:
jmp    1030 <NewInputFile@plt>

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

LLVM IR (-O2):
define void @InitScanner(i8* %0) {
%2 = tail call i32 @NewInputFile(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _s2warn(char *, char *);
void *cs2qocb_(void) {
  _s2warn("cs2qocb", "function not available / useful from FORTRAN");
  return NULL;
}


x86 assembly (clang, -O0):
<cs2qocb_>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1030 <_s2warn@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"cs2qocb\00"
@.str.1 = [45 x i8] c"function not available / useful from FORTRAN\00"
define i8* @cs2qocb_() {
%1 = call i32 @_s2warn(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [8 x i8] c"cs2qocb\00"
@.str.1 = [45 x i8] c"function not available / useful from FORTRAN\00"
define noalias i8* @cs2qocb_() {
%1 = tail call i32 @_s2warn(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}