xunge/DecIR huggingface dataset:
unsigned long byteswap32(unsigned long x) { return __builtin_bswap32(x); }


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

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

LLVM IR (-O0):
define i64 @byteswap32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @llvm.bswap.i32(i32 %4)
%6 = zext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @byteswap32(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Type definitions */
struct razor_property_iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct razor_property_iterator *);
__attribute__((visibility("default"))) void
razor_property_iterator_destroy(struct razor_property_iterator *pi) {
  free(pi);
}


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

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

LLVM IR (-O2):
%struct.razor_property_iterator = type { i32 }
define void @razor_property_iterator_destroy(%struct.razor_property_iterator* nocapture %0) {
%2 = tail call i32 @free(%struct.razor_property_iterator* %0)
ret void
}
void initsimd(int enable) {}


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

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

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

LLVM IR (-O2):
define void @initsimd(i32 %0) {
ret void
}
int M68KDummyInit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @M68KDummyInit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @M68KDummyInit() {
ret i32 0
}
int __ltsf2(float a __attribute__((unused)), float b __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<__ltsf2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @rte_smp_mb() {
ret void
}
__attribute__((unused)) int iuAlwaysTrue(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @iuAlwaysTrue() {
ret i32 1
}

LLVM IR (-O2):
define i32 @iuAlwaysTrue() {
ret i32 1
}
void function(short width, int data[][width]) {}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @function(i16 signext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i64
ret void
}

LLVM IR (-O2):
define void @function(i16 signext %0, i32* nocapture %1) {
ret void
}
void init_list_entries() {}


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

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

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

LLVM IR (-O2):
define void @init_list_entries() {
ret void
}
void foo672() {}


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

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

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

LLVM IR (-O2):
define void @foo672() {
ret void
}
void RTErrCOMGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTErrCOMGet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void ErrorOut(char *message) {
  fprintf(stderr, "%s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<ErrorOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ErrorOut>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ErrorOut(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ErrorOut(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ BLS_LOAD_BINARY_LOADER_C();
int /*<<< orphan*/ display_splash();
int /*<<< orphan*/ loader_main();
void main() {
  display_splash();
  BLS_LOAD_BINARY_LOADER_C();
  loader_main();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <display_splash@plt>
mov    $0x0,%al
call   1040 <BLS_LOAD_BINARY_LOADER_C@plt>
mov    $0x0,%al
call   1030 <loader_main@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @display_splash()
%2 = call i32 (...) @BLS_LOAD_BINARY_LOADER_C()
%3 = call i32 (...) @loader_main()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @display_splash()
%2 = tail call i32 (...) @BLS_LOAD_BINARY_LOADER_C()
%3 = tail call i32 (...) @loader_main()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(int, char *);
void *malloc(size_t);
void *emalloc(size_t size) {
  void *p;
  if (!(p = malloc(size)))
    die(1, "malloc:");
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1154 <emalloc+0x34>
mov    $0x1,%edi
lea    0xeb1(%rip),%rsi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <emalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"malloc:\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void av_stream_set_recommended_encoder_configuration() {}


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

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

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

LLVM IR (-O2):
define void @av_stream_set_recommended_encoder_configuration() {
ret void
}
/* Variables and functions */
unsigned long parleft();
unsigned long coreleft(void) {
  unsigned long l;
  l = parleft();
  return l << 4;
}


x86 assembly (clang, -O0):
<coreleft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <parleft@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coreleft>:
push   %rax
xor    %eax,%eax
call   1030 <parleft@plt>
shl    $0x4,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @coreleft() {
%1 = alloca i64
%2 = call i64 (...) @parleft()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = shl i64 %3, 4
ret i64 %4
}

LLVM IR (-O2):
define i64 @coreleft() {
%1 = tail call i64 (...) @parleft()
%2 = shl i64 %1, 4
ret i64 %2
}
int unix_fcntl_o_tmpfile() { return -1; }


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

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

LLVM IR (-O0):
define i32 @unix_fcntl_o_tmpfile() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @unix_fcntl_o_tmpfile() {
ret i32 -1
}
/* Variables and functions */
int pow(int, int);
int int_pow(int x, int y) { return pow(x, y); }


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

x86 assembly (clang, -O2):
<int_pow>:
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define i32 @int_pow(i32 %0, i32 %1) {
%3 = tail call i32 @pow(i32 %0, i32 %1)
ret i32 %3
}
A0AX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*((int *)10000000)) = (((int *)11111111)[x1]); }


x86 assembly (clang, -O0):
<A0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,4),%ecx
mov    $0x989680,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0AX1>:
movslq %ecx,%rax
mov    0xa98ac7(,%rax,4),%eax
mov    %eax,0x989680
ret

LLVM IR (-O0):
define i32 @A0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %11
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %15
%17 = load i32, i32* %16
store i32 %17, i32* inttoptr (i64 10000000 to i32*)
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @A0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* inttoptr (i64 10000000 to i32*)
ret i32 undef
}
/* Type definitions */
struct mem_block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mem_block_header_btag(struct mem_block *);
int mem_btag_allocated(int /*<<< orphan*/);
bool mem_block_allocated(struct mem_block *block) {
  return mem_btag_allocated(mem_block_header_btag(block));
}


x86 assembly (clang, -O0):
<mem_block_allocated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mem_block_header_btag@plt>
mov    %eax,%edi
call   1040 <mem_btag_allocated@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_block_allocated>:
push   %rax
call   1030 <mem_block_header_btag@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <mem_btag_allocated@plt>

LLVM IR (-O0):
%struct.mem_block = type { i32 }
define i32 @mem_block_allocated(%struct.mem_block* %0) {
%2 = alloca %struct.mem_block*
store %struct.mem_block* %0, %struct.mem_block** %2
%3 = load %struct.mem_block*, %struct.mem_block** %2
%4 = call i32 @mem_block_header_btag(%struct.mem_block* %3)
%5 = call i32 @mem_btag_allocated(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.mem_block = type { i32 }
define i32 @mem_block_allocated(%struct.mem_block* %0) {
%2 = tail call i32 @mem_block_header_btag(%struct.mem_block* %0)
%3 = tail call i32 @mem_btag_allocated(i32 %2)
ret i32 %3
}
int main() {
  int $m = 10;
  float PI = (float)22 / 7;
  int maximumValue = 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movss  0xeed(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 10, i32* %1
store float 0x4009249240000000, float* %2
store i32 10, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
float zmalloc_used_memory();
float zmalloc_get_fragmentation_ratio(size_t rss) {
  return (float)rss / zmalloc_used_memory();
}


x86 assembly (clang, -O0):
<zmalloc_get_fragmentation_ratio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x10(%rbp)
test   %rax,%rax
movss  %xmm0,-0xc(%rbp)
js     1159 <zmalloc_get_fragmentation_ratio+0x49>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <zmalloc_used_memory@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zmalloc_get_fragmentation_ratio>:
push   %rax
test   %rdi,%rdi
js     111d <zmalloc_get_fragmentation_ratio+0xd>
cvtsi2ss %rdi,%xmm0
jmp    1132 <zmalloc_get_fragmentation_ratio+0x22>
mov    %rdi,%rax
shr    %rax
and    $0x1,%edi
or     %rax,%rdi
cvtsi2ss %rdi,%xmm0
addss  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <zmalloc_used_memory@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @zmalloc_get_fragmentation_ratio(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to float
%5 = call float (...) @zmalloc_used_memory()
%6 = fdiv float %4, %5
ret float %6
}

LLVM IR (-O2):
define float @zmalloc_get_fragmentation_ratio(i64 %0) {
%2 = uitofp i64 %0 to float
%3 = tail call float (...) @zmalloc_used_memory()
%4 = fdiv float %2, %3
ret float %4
}
double check3(double x) { return -__builtin_copysign(x, 1.0); }


x86 assembly (clang, -O0):
<check3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @check3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.copysign.f64(double %3, double 1.000000e+00)
%5 = fneg double %4
ret double %5
}

LLVM IR (-O2):
define double @check3(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fneg double %2
ret double %3
}
int inp_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @inp_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @inp_init() {
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
int *nr_ivector(long nl, long nh) {
  int *v;
  v = (int *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(int)));
  if (!v)
    nrerror("allocation failure in ivector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<nr_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <nr_ivector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nr_ivector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <nr_ivector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x2,%r14
sub    %r14,%rbx
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @nr_ivector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = icmp ne i32* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i32*, i32** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = getelementptr inbounds i32, i32* %22, i64 1
ret i32* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @nr_ivector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i32*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = getelementptr inbounds i32, i32* %13, i64 1
ret i32* %14
}
void arm_nop(int i, unsigned tar, unsigned arg1, unsigned arg2) {}


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

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

LLVM IR (-O0):
define void @arm_nop(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @arm_nop(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void clear_type() { system("busybox clear"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"busybox clear\00"
define void @clear_type() {
%1 = call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"busybox clear\00"
define void @clear_type() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
const char *X509_get_default_cert_dir_env(void) { return ("SSL_CERT_DIR"); }


x86 assembly (clang, -O0):
<X509_get_default_cert_dir_env>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_get_default_cert_dir_env>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"SSL_CERT_DIR\00"
define i8* @X509_get_default_cert_dir_env() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"SSL_CERT_DIR\00"
define i8* @X509_get_default_cert_dir_env() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ creo_clave(int);
int /*<<< orphan*/ exit(int);
int msgget(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int createMessageQueue(int key) {
  int msqid = msgget(creo_clave(key), 0644 | IPC_CREAT);
  if (msqid == -1) {
    printf("Error al obtener identificador para cola mensajes\n");
    exit(-1);
  }
  return msqid;
}


x86 assembly (clang, -O0):
<createMessageQueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <creo_clave@plt>
mov    %eax,%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
or     $0x1a4,%esi
call   1030 <msgget@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    118c <createMessageQueue+0x4c>
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createMessageQueue>:
push   %rax
call   1040 <creo_clave@plt>
mov    0x2e93(%rip),%rcx
mov    $0x1a4,%esi
or     (%rcx),%esi
mov    %eax,%edi
call   1030 <msgget@plt>
cmp    $0xffffffff,%eax
je     1162 <createMessageQueue+0x22>
pop    %rcx
ret
lea    0xe97(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@.str = [51 x i8] c"Error al obtener identificador para cola mensajes\0A\00"
define i32 @createMessageQueue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @creo_clave(i32 %4)
%6 = load i32, i32* @IPC_CREAT
%7 = or i32 420, %6
%8 = call i32 @msgget(i32 %5, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@str = [50 x i8] c"Error al obtener identificador para cola mensajes\00"
define i32 @createMessageQueue(i32 %0) {
%2 = tail call i32 @creo_clave(i32 %0)
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 420
%5 = tail call i32 @msgget(i32 %2, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
ret i32 %5
}
unsigned char spdif_get_channel_status(unsigned char *chnsts,
                                       unsigned int spdif_frames) {
  unsigned int bytes, bits;
  bytes = spdif_frames >> 3;
  bits = spdif_frames - (bytes << 3);
  return ((chnsts[bytes] >> bits) & 0x01);
}


x86 assembly (clang, -O0):
<spdif_get_channel_status>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spdif_get_channel_status>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%rax
movzbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @spdif_get_channel_status(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = lshr i32 %7, 3
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = shl i32 %10, 3
%12 = sub i32 %9, %11
store i32 %12, i32* %6
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i32, i32* %6
%20 = ashr i32 %18, %19
%21 = and i32 %20, 1
%22 = trunc i32 %21 to i8
ret i8 %22
}

LLVM IR (-O2):
define zeroext i8 @spdif_get_channel_status(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = and i32 %1, 7
%5 = zext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = lshr i32 %8, %4
%10 = trunc i32 %9 to i8
%11 = and i8 %10, 1
ret i8 %11
}
/* Variables and functions */
scalar_t__ SupportsAvx();
int /*<<< orphan*/ printf(char *);
int main() {
  if (SupportsAvx())
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <SupportsAvx@plt>
cmp    $0x0,%rax
je     1151 <main+0x31>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
jmp    115d <main+0x3d>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"Yes\0A\00"
@.str.1 = [4 x i8] c"No\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @SupportsAvx()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"No\00"
@str.2 = [4 x i8] c"Yes\00"
define i32 @main() {
%1 = tail call i64 (...) @SupportsAvx()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
void chopNewline(char *buff, int length) {
  for (int i = 0; i < length; i++) {
    char c = buff[i];
    if (c == '\n' || c == '\r') {
      buff[i] = '\0';
      break;
    }
  }
}


x86 assembly (clang, -O0):
<chopNewline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116a <chopNewline+0x6a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
je     1146 <chopNewline+0x46>
movsbl -0x11(%rbp),%eax
cmp    $0xd,%eax
jne    1157 <chopNewline+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    116a <chopNewline+0x6a>
jmp    115c <chopNewline+0x5c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <chopNewline+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chopNewline>:
test   %esi,%esi
jle    1137 <chopNewline+0x37>
mov    %esi,%eax
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
movzbl -0x1(%rdi,%rcx,1),%edx
cmp    $0xd,%dl
je     111f <chopNewline+0x1f>
cmp    $0xa,%dl
jne    1124 <chopNewline+0x24>
movb   $0x0,-0x1(%rdi,%rcx,1)
cmp    %rax,%rcx
jae    1137 <chopNewline+0x37>
cmp    $0xd,%dl
je     1137 <chopNewline+0x37>
add    $0x1,%rcx
cmp    $0xa,%dl
jne    1110 <chopNewline+0x10>
ret

LLVM IR (-O0):
define void @chopNewline(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %30, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %33
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
store i8 %16, i8* %6
%17 = load i8, i8* %6
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 10
br i1 %19, label %24, label %20
20: ; preds = %11
%21 = load i8, i8* %6
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 13
br i1 %23, label %24, label %29
24: ; preds = %20, %11
%25 = load i8*, i8** %3
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
store i8 0, i8* %28
br label %33
29: ; preds = %20
br label %30
30: ; preds = %29
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %7
33: ; preds = %24, %7
ret void
}

LLVM IR (-O2):
define void @chopNewline(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %14, %4
%7 = phi i64 [ %12, %14 ], [ 0, %4 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
switch i8 %9, label %11 [
i8 13, label %10
i8 10, label %10
]
10: ; preds = %6, %6
store i8 0, i8* %8
br label %11
11: ; preds = %6, %10
%12 = add i64 %7, 1
%13 = icmp ult i64 %12, %5
br i1 %13, label %14, label %15
14: ; preds = %11
switch i8 %9, label %6 [
i8 13, label %15
i8 10, label %15
]
15: ; preds = %11, %14, %14, %2
ret void
}
int mh_byte(char *in, unsigned int *tot_bytes_read, const char **buf,
            unsigned int *len) {
  if (*len == 0)
    return 0;
  *in = **buf;
  *tot_bytes_read += 1;
  *buf += 1;
  *len -= 1;
  return 1;
}


x86 assembly (clang, -O0):
<mh_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jne    112d <mh_byte+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1167 <mh_byte+0x67>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mh_byte>:
cmpl   $0x0,(%rcx)
je     111c <mh_byte+0x1c>
mov    (%rdx),%rax
mov    (%rax),%al
mov    %al,(%rdi)
addl   $0x1,(%rsi)
addq   $0x1,(%rdx)
addl   $0xffffffff,(%rcx)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mh_byte(i8* nocapture writeonly %0, i32* nocapture %1, i8** nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
store i8 %9, i8* %0
%10 = load i32, i32* %1
%11 = add i32 %10, 1
store i32 %11, i32* %1
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
%14 = load i32, i32* %3
%15 = add i32 %14, -1
store i32 %15, i32* %3
br label %16
16: ; preds = %4, %7
%17 = phi i32 [ 1, %7 ], [ 0, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xcf() {
  Assert_real((isalnum(207) == 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_isalnum.c",
              1040, ("isalnum should be 0 for 0xcf"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xcf>:
push   %rax
mov    $0xcf,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x410,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xcf\00"
define void @t_isalnum_0xcf() {
%1 = call i64 @isalnum(i32 207)
%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 1040, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xcf\00"
define void @t_isalnum_0xcf() {
%1 = tail call i64 @isalnum(i32 207)
%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 1040, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void unblock_remote_children() { return; }


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

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

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

LLVM IR (-O2):
define void @unblock_remote_children() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
lastbytes(int outfile, int size, int buf) {
  int i = 0;
  char *last;
  last = (char *)&buf;
  for (i = 0; i < size; i++) {
    write(outfile, &last[i], 1);
  }
}


x86 assembly (clang, -O0):
<lastbytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <lastbytes+0x59>
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <lastbytes+0x27>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastbytes>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,0xc(%rsp)
test   %esi,%esi
jle    114a <lastbytes+0x3a>
mov    %edi,%r14d
mov    %esi,%ebp
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%rbp
jne    1130 <lastbytes+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @lastbytes(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = bitcast i32* %4 to i8*
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %13, %9 ]
%11 = getelementptr inbounds i8, i8* %5, i64 %10
%12 = call i32 @write(i32 %0, i8* %11, i32 1)
%13 = add nuw nsw i64 %10, 1
%14 = icmp eq i64 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
ret i32 undef
}
int test_imm_5Cuint16_reg(unsigned short val) {
  return ((val) & (0x5C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Cuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x5c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Cuint16_reg>:
test   $0x5c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Cuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 92
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_5Cuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 92
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int glutStrokeStringWidth(void *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, float);
int glutStrokeFloatWidth(void *fontface, float i) {
  char buf[64];
  snprintf(buf, 64, "%.2f", i);
  return glutStrokeStringWidth(fontface, buf);
}


x86 assembly (clang, -O0):
<glutStrokeFloatWidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0x50(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
mov    $0x40,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <glutStrokeStringWidth@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glutStrokeFloatWidth>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
lea    0xecf(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <glutStrokeStringWidth@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define i32 @glutStrokeFloatWidth(i8* %0, float %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %1)
%6 = call i32 @glutStrokeStringWidth(i8* %0, i8* %4)
ret i32 %6
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int extract_day(uint16_t date) { return (date >> 11); }


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

x86 assembly (clang, -O2):
<extract_day>:
mov    %edi,%eax
sar    $0xb,%eax
ret

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

LLVM IR (-O2):
define i32 @extract_day(i32 %0) {
%2 = ashr i32 %0, 11
ret i32 %2
}
int digit_to_num(char digit) {
  if (digit < '0') {
    return -1;
  } else if (digit <= '9') {
    return digit - '0';
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<digit_to_num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jge    1123 <digit_to_num+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <digit_to_num+0x46>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     113f <digit_to_num+0x3f>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <digit_to_num+0x46>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_to_num>:
lea    -0x30(%rdi),%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%al
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @digit_to_num(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 48
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %17
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 57
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 48
store i32 %15, i32* %2
br label %17
16: ; preds = %8
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %12, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @digit_to_num(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = add nsw i32 %2, -48
%6 = select i1 %4, i32 %5, i32 -1
ret i32 %6
}
/* Variables and functions */
int rapl_get_cpu_model();
char rapl_pp1_available() {
  int cpu_id = rapl_get_cpu_model();
  if (cpu_id == 0x2d)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<rapl_pp1_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rapl_get_cpu_model@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2d,-0x8(%rbp)
jne    1135 <rapl_pp1_available+0x25>
movb   $0x0,-0x1(%rbp)
jmp    1139 <rapl_pp1_available+0x29>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_pp1_available>:
push   %rax
xor    %eax,%eax
call   1030 <rapl_get_cpu_model@plt>
cmp    $0x2d,%eax
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @rapl_pp1_available() {
%1 = alloca i8
%2 = alloca i32
%3 = call i32 (...) @rapl_get_cpu_model()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 45
br i1 %5, label %6, label %7
6: ; preds = %0
store i8 0, i8* %1
br label %8
7: ; preds = %0
store i8 1, i8* %1
br label %8
8: ; preds = %7, %6
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @rapl_pp1_available() {
%1 = tail call i32 (...) @rapl_get_cpu_model()
%2 = icmp ne i32 %1, 45
%3 = zext i1 %2 to i8
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[], char *envp[]) { printf("%d", argc); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_option_context_get_main_group() {
ret void
}
void mbc2_rom_bank(int val) {}


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

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

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

LLVM IR (-O2):
define void @mbc2_rom_bank(i32 %0) {
ret void
}
void foo365(int p) {}


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

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

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

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