xunge/DecIR huggingface dataset:
/* Type definitions */
struct gsm_modul {
  int dummy;
};
struct at_call {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gsm_call_destroy(struct gsm_modul *, int /*<<< orphan*/,
                                    struct at_call *);
void gsm_destroycall(struct gsm_modul *gsm, struct at_call *call) {
  if (gsm && call) {
    gsm_call_destroy(gsm, 0, call);
  }
  return;
}


x86 assembly (clang, -O0):
<gsm_destroycall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <gsm_destroycall+0x35>
cmpq   $0x0,-0x10(%rbp)
je     1145 <gsm_destroycall+0x35>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <gsm_call_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm_destroycall>:
test   %rdi,%rdi
je     1124 <gsm_destroycall+0x14>
mov    %rsi,%rdx
test   %rsi,%rsi
je     1124 <gsm_destroycall+0x14>
xor    %esi,%esi
jmp    1030 <gsm_call_destroy@plt>
ret

LLVM IR (-O0):
%struct.gsm_modul = type { i32 }
%struct.at_call = type { i32 }
define void @gsm_destroycall(%struct.gsm_modul* %0, %struct.at_call* %1) {
%3 = alloca %struct.gsm_modul*
%4 = alloca %struct.at_call*
store %struct.gsm_modul* %0, %struct.gsm_modul** %3
store %struct.at_call* %1, %struct.at_call** %4
%5 = load %struct.gsm_modul*, %struct.gsm_modul** %3
%6 = icmp ne %struct.gsm_modul* %5, null
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load %struct.at_call*, %struct.at_call** %4
%9 = icmp ne %struct.at_call* %8, null
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load %struct.gsm_modul*, %struct.gsm_modul** %3
%12 = load %struct.at_call*, %struct.at_call** %4
%13 = call i32 @gsm_call_destroy(%struct.gsm_modul* %11, i32 0, %struct.at_call* %12)
br label %14
14: ; preds = %10, %7, %2
ret void
}

LLVM IR (-O2):
%struct.gsm_modul = type { i32 }
%struct.at_call = type { i32 }
define void @gsm_destroycall(%struct.gsm_modul* %0, %struct.at_call* %1) {
%3 = icmp ne %struct.gsm_modul* %0, null
%4 = icmp ne %struct.at_call* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @gsm_call_destroy(%struct.gsm_modul* %0, i32 0, %struct.at_call* %1)
br label %8
8: ; preds = %6, %2
ret void
}
char pop(char stack[], int *top) {
  char item;
  if (*top >= 0) {
    item = stack[*top];
    --(*top);
  } else {
    item = '~';
  }
  return item;
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jl     113a <pop+0x3a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
jmp    113e <pop+0x3e>
movb   $0x7e,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
mov    (%rsi),%ecx
test   %ecx,%ecx
js     110f <pop+0xf>
mov    (%rdi,%rcx,1),%al
add    $0xffffffff,%ecx
mov    %ecx,(%rsi)
ret
mov    $0x7e,%al
ret

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

LLVM IR (-O2):
define signext i8 @pop(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = zext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = add nsw i32 %3, -1
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %5
%11 = phi i8 [ %8, %5 ], [ 126, %2 ]
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void BSP_display_str(char *msg) { printf("%s", msg); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @BSP_display_str(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enqueue(char *);
void vend(char userInput[2], char strs[][6][3][12], int currentPage) {
  int letter = userInput[0] - 'A';
  int num = userInput[1] - '1';
  enqueue(strs[currentPage][letter][num]);
  return;
}


x86 assembly (clang, -O0):
<vend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
sub    $0x31,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
imul   $0xd8,%rax,%rax
add    %rax,%rdi
movslq -0x18(%rbp),%rax
imul   $0x24,%rax,%rax
add    %rax,%rdi
movslq -0x1c(%rbp),%rax
imul   $0xc,%rax,%rax
add    %rax,%rdi
call   1030 <enqueue@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vend>:
movsbq (%rdi),%rax
lea    (%rax,%rax,8),%rax
movsbq 0x1(%rdi),%rcx
lea    (%rcx,%rcx,2),%rcx
movslq %edx,%rdx
imul   $0xd8,%rdx,%rdx
add    %rsi,%rdx
lea    (%rdx,%rax,4),%rax
lea    (%rax,%rcx,4),%rdi
add    $0xfffffffffffff490,%rdi
jmp    1030 <enqueue@plt>

LLVM IR (-O0):
define void @vend(i8* %0, [6 x [3 x [12 x i8]]]* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca [6 x [3 x [12 x i8]]]*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store [6 x [3 x [12 x i8]]]* %1, [6 x [3 x [12 x i8]]]** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 65
store i32 %13, i32* %7
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 49
store i32 %18, i32* %8
%19 = load [6 x [3 x [12 x i8]]]*, [6 x [3 x [12 x i8]]]** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [6 x [3 x [12 x i8]]], [6 x [3 x [12 x i8]]]* %19, i64 %21
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [6 x [3 x [12 x i8]]], [6 x [3 x [12 x i8]]]* %22, i64 0, i64 %24
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [3 x [12 x i8]], [3 x [12 x i8]]* %25, i64 0, i64 %27
%29 = getelementptr inbounds [12 x i8], [12 x i8]* %28, i64 0, i64 0
%30 = call i32 @enqueue(i8* %29)
ret void
}

LLVM IR (-O2):
define void @vend(i8* nocapture %0, [6 x [3 x [12 x i8]]]* %1, i32 %2) {
%4 = load i8, i8* %0
%5 = sext i8 %4 to i64
%6 = add nsw i64 %5, -65
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i64
%10 = add nsw i64 %9, -49
%11 = sext i32 %2 to i64
%12 = getelementptr inbounds [6 x [3 x [12 x i8]]], [6 x [3 x [12 x i8]]]* %1, i64 %11, i64 %6, i64 %10, i64 0
%13 = tail call i32 @enqueue(i8* %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void U_EMRNOTIMPLEMENTED_print(const char *name, const char *contents) {
  (void)name;
  (void)contents;
  printf("   Not Implemented!\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c" Not Implemented!\0A\00"
define void @U_EMRNOTIMPLEMENTED_print(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c" Not Implemented!\00"
define void @U_EMRNOTIMPLEMENTED_print(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_FBint16_mem(short *val) {
  return ((*val) & (-0xFB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FBint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff05,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FBint16_mem>:
movzwl (%rdi),%eax
test   $0xff05,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FBint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -251
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void __do_nothing() {}


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

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

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

LLVM IR (-O2):
define void @__do_nothing() {
ret void
}
int test_imm_8Aint64_highword_reg(long long val) {
  return ((val >> 32) & (0x8A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Aint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x8a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Aint64_highword_reg>:
movabs $0x8a00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Aint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 138
%6 = icmp ne i64 %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_8Aint64_highword_reg(i64 %0) {
%2 = and i64 %0, 592705486848
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct elf_header {
  int dummy;
};

/* Variables and functions */
scalar_t__ elf_check(struct elf_header *);
scalar_t__ elf_load_program(struct elf_header *);
int elf_load(char *buf) {
  struct elf_header *header = (struct elf_header *)buf;
  if (elf_check(header) < 0)
    return -1;
  if (elf_load_program(header) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<elf_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <elf_check@plt>
cmp    $0x0,%rax
jge    1153 <elf_load+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <elf_load+0x59>
mov    -0x18(%rbp),%rdi
call   1030 <elf_load_program@plt>
cmp    $0x0,%rax
jge    1172 <elf_load+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <elf_load+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_load>:
push   %rbx
mov    %rdi,%rbx
call   1040 <elf_check@plt>
test   %rax,%rax
js     113c <elf_load+0x1c>
mov    %rbx,%rdi
call   1030 <elf_load_program@plt>
sar    $0x3f,%rax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.elf_header = type { i32 }
define i32 @elf_load(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.elf_header*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.elf_header*
store %struct.elf_header* %6, %struct.elf_header** %4
%7 = load %struct.elf_header*, %struct.elf_header** %4
%8 = call i64 @elf_check(%struct.elf_header* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %17
11: ; preds = %1
%12 = load %struct.elf_header*, %struct.elf_header** %4
%13 = call i64 @elf_load_program(%struct.elf_header* %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 -1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.elf_header = type { i32 }
define i32 @elf_load(i8* %0) {
%2 = bitcast i8* %0 to %struct.elf_header*
%3 = tail call i64 @elf_check(%struct.elf_header* %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i64 @elf_load_program(%struct.elf_header* %2)
%7 = ashr i64 %6, 63
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ -1, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
void init_randomness() {
  struct timeval t;
  gettimeofday(&t, 0);
  srand(t.tv_usec);
  return;
}


x86 assembly (clang, -O0):
<init_randomness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
call   1040 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_randomness>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%edi
call   1040 <srand@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @init_randomness() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i32 @srand(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @init_randomness() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @srand(i32 %5)
ret void
}
int strtobcd(s)
char s[];
{
  return (!*s || s[0] == ' ' && s[1] == ' '
              ? 0xAA
              : ((((s[0] - '0') << 4) & 0xF0) + ((s[1] - '0') & 0x0F)) & 0xFF);
}


x86 assembly (clang, -O0):
<strtobcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <strtobcd+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1143 <strtobcd+0x43>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x20,%eax
jne    1143 <strtobcd+0x43>
mov    $0xaa,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <strtobcd+0x6d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
shl    $0x4,%eax
and    $0xf0,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
and    $0xf,%ecx
add    %ecx,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtobcd>:
movsbl (%rdi),%ecx
mov    $0xaa,%eax
test   %ecx,%ecx
je     1119 <strtobcd+0x19>
cmp    $0x20,%cl
jne    111a <strtobcd+0x1a>
mov    0x1(%rdi),%dl
cmp    $0x20,%dl
jne    111d <strtobcd+0x1d>
ret
mov    0x1(%rdi),%dl
shl    $0x4,%ecx
and    $0xf,%dl
movzbl %dl,%edx
movzbl %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @strtobcd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 32
br i1 %17, label %18, label %19
18: ; preds = %12, %1
br label %35
19: ; preds = %12, %6
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 48
%25 = shl i32 %24, 4
%26 = and i32 %25, 240
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = sub nsw i32 %30, 48
%32 = and i32 %31, 15
%33 = add nsw i32 %26, %32
%34 = and i32 %33, 255
br label %35
35: ; preds = %19, %18
%36 = phi i32 [ 170, %18 ], [ %34, %19 ]
ret i32 %36
}

LLVM IR (-O2):
define i32 @strtobcd(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %3 [
i8 0, label %18
i8 32, label %6
]
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
br label %10
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %18, label %10
10: ; preds = %3, %6
%11 = phi i8 [ %5, %3 ], [ %8, %6 ]
%12 = sext i8 %2 to i32
%13 = shl nsw i32 %12, 4
%14 = and i8 %11, 15
%15 = zext i8 %14 to i32
%16 = and i32 %13, 240
%17 = or i32 %16, %15
br label %18
18: ; preds = %1, %6, %10
%19 = phi i32 [ %17, %10 ], [ 170, %6 ], [ 170, %1 ]
ret i32 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t do_neg(uint8_t x) { return -x; }


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

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

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

LLVM IR (-O2):
define i32 @do_neg(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
long kernel__Char__ascii(char self) {
  long var;
  long var1;
  var1 = (unsigned char)self;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<kernel__Char__ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Char__ascii>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i64 @kernel__Char__ascii(i8 signext %0) {
%2 = alloca i8
%3 = alloca i64
%4 = alloca i64
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
store i64 %7, i64* %3
br label %8
8: ; preds = %1
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @kernel__Char__ascii(i8 signext %0) {
%2 = zext i8 %0 to i64
ret i64 %2
}
/* Variables and functions */
int AF_INET;
int AF_INET6;
char *ifa_family_name_get(int ifa_family) {
  if (ifa_family == AF_INET)
    return "INET";
  else if (ifa_family == AF_INET6)
    return "INET6";
  return NULL;
}


x86 assembly (clang, -O0):
<ifa_family_name_get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
jne    1129 <ifa_family_name_get+0x29>
lea    0xee0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <ifa_family_name_get+0x58>
mov    -0xc(%rbp),%eax
mov    0x2ead(%rip),%rcx
cmp    (%rcx),%eax
jne    114b <ifa_family_name_get+0x4b>
lea    0xec3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <ifa_family_name_get+0x58>
jmp    1150 <ifa_family_name_get+0x50>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifa_family_name_get>:
mov    0x2ee1(%rip),%rax
mov    0x2ed2(%rip),%rcx
xor    %edx,%edx
cmp    %edi,(%rcx)
lea    0xeec(%rip),%rcx
cmove  %rcx,%rdx
cmp    %edi,(%rax)
lea    0xeda(%rip),%rax
cmovne %rdx,%rax
ret

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

LLVM IR (-O2):
@AF_INET = global i32 0
@.str = [5 x i8] c"INET\00"
@AF_INET6 = global i32 0
@.str.1 = [6 x i8] c"INET6\00"
define i8* @ifa_family_name_get(i32 %0) {
%2 = load i32, i32* @AF_INET
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @AF_INET6
%5 = icmp eq i32 %4, %0
%6 = select i1 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* null
%7 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x85() {
  Assert_real((isalnum(133) == 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",
              670, ("isalnum should be 0 for 0x85"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x85>:
push   %rax
mov    $0x85,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x29e,%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 0x85\00"
define void @t_isalnum_0x85() {
%1 = call i64 @isalnum(i32 133)
%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 670, 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 0x85\00"
define void @t_isalnum_0x85() {
%1 = tail call i64 @isalnum(i32 133)
%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 670, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ frobnicate();
int main(void) {
  frobnicate();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @frobnicate()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @frobnicate()
ret i32 0
}
void foo(int y) {
  switch (y) {
  case 3:
  case 5:
  case 7:
  case 11:
    break;
  default:
    __builtin_unreachable();
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x3,%eax
je     113d <foo+0x3d>
jmp    111b <foo+0x1b>
mov    -0x8(%rbp),%eax
sub    $0x5,%eax
je     113d <foo+0x3d>
jmp    112c <foo+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x7,%eax
je     113d <foo+0x3d>
jmp    113d <foo+0x3d>
jmp    1142 <foo+0x42>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 3, label %4
i32 5, label %4
i32 7, label %4
i32 11, label %4
]
4: ; preds = %1, %1, %1, %1
br label %6
5: ; preds = %1
unreachable
6: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t_initrand();
void t_stronginitrand() { t_initrand(); }


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

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

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

LLVM IR (-O2):
define void @t_stronginitrand() {
%1 = tail call i32 (...) @t_initrand()
ret void
}
double F_edgeBlendTri(int index[2], double *L) {
  return -2.0 * L[index[0]] * L[index[1]];
}


x86 assembly (clang, -O0):
<F_edgeBlendTri>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
movsd  0xee1(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x4(%rcx),%rcx
mulsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_edgeBlendTri>:
movslq (%rdi),%rax
movsd  (%rsi,%rax,8),%xmm0
mulsd  0xef0(%rip),%xmm0
movslq 0x4(%rdi),%rax
mulsd  (%rsi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @F_edgeBlendTri(i32* %0, double* %1) {
%3 = alloca i32*
%4 = alloca double*
store i32* %0, i32** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %5, i64 %9
%11 = load double, double* %10
%12 = fmul double -2.000000e+00, %11
%13 = load double*, double** %4
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %13, i64 %17
%19 = load double, double* %18
%20 = fmul double %12, %19
ret double %20
}

LLVM IR (-O2):
define double @F_edgeBlendTri(i32* nocapture %0, double* nocapture %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds double, double* %1, i64 %4
%6 = load double, double* %5
%7 = fmul double %6, -2.000000e+00
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %1, i64 %10
%12 = load double, double* %11
%13 = fmul double %7, %12
ret double %13
}
/* Type definitions */
struct qcc_arena {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *qcc_arena_alloc(struct qcc_arena *, size_t);
void *qcc_arena_copy(struct qcc_arena *arena, const void *data, size_t size) {
  void *copy = qcc_arena_alloc(arena, size);
  if (!copy)
    return 0;
  memcpy(copy, data, size);
  return copy;
}


x86 assembly (clang, -O0):
<qcc_arena_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <qcc_arena_alloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115d <qcc_arena_copy+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1176 <qcc_arena_copy+0x56>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qcc_arena_copy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdx,%rsi
call   1030 <qcc_arena_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <qcc_arena_copy+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.qcc_arena = type { i32 }
define i8* @qcc_arena_copy(%struct.qcc_arena* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca %struct.qcc_arena*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store %struct.qcc_arena* %0, %struct.qcc_arena** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load %struct.qcc_arena*, %struct.qcc_arena** %5
%10 = load i64, i64* %7
%11 = call i8* @qcc_arena_alloc(%struct.qcc_arena* %9, i64 %10)
store i8* %11, i8** %8
%12 = load i8*, i8** %8
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %3
store i8* null, i8** %4
br label %21
15: ; preds = %3
%16 = load i8*, i8** %8
%17 = load i8*, i8** %6
%18 = load i64, i64* %7
%19 = call i32 @memcpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %8
store i8* %20, i8** %4
br label %21
21: ; preds = %15, %14
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
%struct.qcc_arena = type { i32 }
define i8* @qcc_arena_copy(%struct.qcc_arena* %0, i8* %1, i64 %2) {
%4 = tail call i8* @qcc_arena_alloc(%struct.qcc_arena* %0, i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @memcpy(i8* %4, i8* %1, i64 %2)
br label %8
8: ; preds = %3, %6
ret i8* %4
}
int test_imm_07int16_reg(short val) {
  return ((val) & (0x07 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_07int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 7
%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_07int16_reg(i16 signext %0) {
%2 = and i16 %0, 7
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int japi_led(int, int, int);
int j_led(int arg0, int arg1, int arg2) { return (japi_led(arg0, arg1, arg2)); }


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

x86 assembly (clang, -O2):
<j_led>:
jmp    1030 <japi_led@plt>

LLVM IR (-O0):
define i32 @j_led(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @japi_led(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @j_led(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @japi_led(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *gethostbyname(char *);
struct hostent *get_host_by_name(char *name) {
  return gethostbyname(name);
}


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

x86 assembly (clang, -O2):
<get_host_by_name>:
jmp    1030 <gethostbyname@plt>

LLVM IR (-O0):
%struct.hostent = type { i32 }
define %struct.hostent* @get_host_by_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.hostent* @gethostbyname(i8* %3)
ret %struct.hostent* %4
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define %struct.hostent* @get_host_by_name(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
ret %struct.hostent* %2
}
/* Variables and functions */
float mus_char_to_bfloat(unsigned char const *);
float mus_char_to_lfloat(unsigned char const *);
float big_or_little_endian_float(const unsigned char *n, int little) {
  if (little)
    return (mus_char_to_lfloat(n));
  return (mus_char_to_bfloat(n));
}


x86 assembly (clang, -O0):
<big_or_little_endian_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114c <big_or_little_endian_float+0x2c>
mov    -0x10(%rbp),%rdi
call   1040 <mus_char_to_lfloat@plt>
movss  %xmm0,-0x4(%rbp)
jmp    115a <big_or_little_endian_float+0x3a>
mov    -0x10(%rbp),%rdi
call   1030 <mus_char_to_bfloat@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_or_little_endian_float>:
test   %esi,%esi
je     1129 <big_or_little_endian_float+0x9>
jmp    1040 <mus_char_to_lfloat@plt>
jmp    1030 <mus_char_to_bfloat@plt>

LLVM IR (-O0):
define float @big_or_little_endian_float(i8* %0, i32 %1) {
%3 = alloca float
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call float @mus_char_to_lfloat(i8* %9)
store float %10, float* %3
br label %14
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call float @mus_char_to_bfloat(i8* %12)
store float %13, float* %3
br label %14
14: ; preds = %11, %8
%15 = load float, float* %3
ret float %15
}

LLVM IR (-O2):
define float @big_or_little_endian_float(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call float @mus_char_to_lfloat(i8* %0)
br label %8
6: ; preds = %2
%7 = tail call float @mus_char_to_bfloat(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi float [ %5, %4 ], [ %7, %6 ]
ret float %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ *memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                           size_t);
uint8_t *knot_memdup(const uint8_t *data, size_t data_size) {
  uint8_t *result = (uint8_t *)malloc(data_size);
  if (!result) {
    return NULL;
  }
  return memcpy(result, data, data_size);
}


x86 assembly (clang, -O0):
<knot_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1155 <knot_memdup+0x35>
movq   $0x0,-0x8(%rbp)
jmp    116a <knot_memdup+0x4a>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knot_memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     114b <knot_memdup+0x2b>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
jmp    114d <knot_memdup+0x2d>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32* @knot_memdup(i32* nocapture %0, i64 %1) {
%3 = tail call i64 @malloc(i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = inttoptr i64 %3 to i32*
%7 = inttoptr i64 %3 to i8*
%8 = bitcast i32* %0 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %7, i8* align 1 %8, i64 %1, i1 false)
br label %9
9: ; preds = %2, %5
%10 = phi i32* [ %6, %5 ], [ null, %2 ]
ret i32* %10
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fileinfo_list_link {
  int dummy;
};
struct fileinfo_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_tail(struct genlist const *);
struct fileinfo_list_link *
fileinfo_list_tail(const struct fileinfo_list *tthis) {
  return (struct fileinfo_list_link *)genlist_tail(
      (const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<fileinfo_list_tail>:
jmp    1030 <genlist_tail@plt>

LLVM IR (-O0):
%struct.fileinfo_list_link = type { i32 }
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo_list_link* @fileinfo_list_tail(%struct.fileinfo_list* %0) {
%2 = alloca %struct.fileinfo_list*
store %struct.fileinfo_list* %0, %struct.fileinfo_list** %2
%3 = load %struct.fileinfo_list*, %struct.fileinfo_list** %2
%4 = bitcast %struct.fileinfo_list* %3 to %struct.genlist*
%5 = call i64 @genlist_tail(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.fileinfo_list_link*
ret %struct.fileinfo_list_link* %6
}

LLVM IR (-O2):
%struct.fileinfo_list_link = type { i32 }
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo_list_link* @fileinfo_list_tail(%struct.fileinfo_list* %0) {
%2 = bitcast %struct.fileinfo_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_tail(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.fileinfo_list_link*
ret %struct.fileinfo_list_link* %4
}
int d_bge_mm1(double *a1, double *a2) {
  return (__builtin_isgreaterequal(*a1, *a2));
}


x86 assembly (clang, -O0):
<d_bge_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bge_mm1>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @d_bge_mm1(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp oge double %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_bge_mm1(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp oge double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ atou64(char const *, int *);
int atou32(const char *str, uint32_t *val) {
  uint64_t tmp;
  if (!atou64(str, &tmp) || tmp > 0xFFFFffffUL)
    return -1;
  *val = tmp;
  return 1;
}


x86 assembly (clang, -O0):
<atou32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <atou64@plt>
cmp    $0x0,%eax
je     1148 <atou32+0x38>
movslq -0x1c(%rbp),%rax
mov    $0xffffffff,%ecx
cmp    %rcx,%rax
jbe    1154 <atou32+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <atou32+0x54>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atou32>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%rsi
call   1030 <atou64@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
je     113c <atou32+0x2c>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
js     113c <atou32+0x2c>
mov    %ecx,(%rbx)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @atou32(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @atou64(i8* %0, i32* %3)
%6 = icmp eq i32 %5, 0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %11, label %10
10: ; preds = %2
store i32 %7, i32* %1
br label %11
11: ; preds = %2, %10
%12 = phi i32 [ 1, %10 ], [ -1, %2 ]
ret i32 %12
}
/* Variables and functions */
int getegid();
int geteuid();
int getgid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main() {
  printf("UID=%d EUID=%d GID=%d EGID=%d\n", getuid(), geteuid(), getgid(),
         getegid());
  while (1) {
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    %eax,%r8d
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
jmp    119c <main+0x4c>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <getgid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <getegid@plt>
lea    0xe82(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
nopl   (%rax)
jmp    1190 <main+0x40>

LLVM IR (-O0):
@.str = [31 x i8] c"UID=%d EUID=%d GID=%d EGID=%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getuid()
%3 = call i32 (...) @geteuid()
%4 = call i32 (...) @getgid()
%5 = call i32 (...) @getegid()
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %4, i32 %5)
br label %7
7: ; preds = %0, %7
br label %7
}

LLVM IR (-O2):
@.str = [31 x i8] c"UID=%d EUID=%d GID=%d EGID=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @geteuid()
%3 = tail call i32 (...) @getgid()
%4 = tail call i32 (...) @getegid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4)
br label %6
6: ; preds = %0, %6
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int);
int isnumstr(const char *str) {
  const char *p;
  for (p = str; *p; p++)
    if (!isdigit((int)*p))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isnumstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <isnumstr+0x58>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1152 <isnumstr+0x42>
movl   $0x0,-0x4(%rbp)
jmp    116f <isnumstr+0x5f>
jmp    1157 <isnumstr+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <isnumstr+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnumstr>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1126 <isnumstr+0x26>
add    $0x1,%rdi
nop
movsbl %cl,%ecx
add    $0xffffffd0,%ecx
cmp    $0xa,%ecx
jae    1127 <isnumstr+0x27>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <isnumstr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isnumstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %7
4: ; preds = %7
%5 = load i8, i8* %13
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %13, %4 ], [ %0, %1 ]
%10 = sext i8 %8 to i32
%11 = add nsw i32 %10, -48
%12 = icmp ult i32 %11, 10
%13 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %12, label %4, label %14
14: ; preds = %7, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %15
}