xunge/DecIR huggingface dataset:
void bwx_terminate(void) {
  bwx_DEBUG(__FUNCTION__);
  exit(0);
}


x86 assembly (clang, -O0):
<bwx_terminate>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <bwx_DEBUG@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bwx_terminate>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <bwx_DEBUG@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@__FUNCTION__.bwx_terminate = [14 x i8] c"bwx_terminate\00"
define void @bwx_terminate() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.bwx_terminate, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@__FUNCTION__.bwx_terminate = [14 x i8] c"bwx_terminate\00"
define void @bwx_terminate() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.bwx_terminate, i64 0, i64 0))
tail call void @exit(i32 0)
unreachable
}
/* Type definitions */
struct stab_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct stab_data *);
void stab_freedata(struct stab_data *data) { free(data); }


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

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

LLVM IR (-O2):
%struct.stab_data = type { i32 }
define void @stab_freedata(%struct.stab_data* nocapture %0) {
%2 = tail call i32 @free(%struct.stab_data* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ip_acl_free() {
  printf("NOT IMPLEMENTED:"
         "pa_ip_acl_free"
         "\n");
}


x86 assembly (clang, -O0):
<pa_ip_acl_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_ip_acl_free\0A\00"
define i32 @pa_ip_acl_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_ip_acl_free\00"
define i32 @pa_ip_acl_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ k_error(int /*<<< orphan*/);
int /*<<< orphan*/ sysmsg(int);
void phantom_error() { k_error(sysmsg(1711)); }


x86 assembly (clang, -O0):
<phantom_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6af,%edi
call   1030 <sysmsg@plt>
mov    %eax,%edi
call   1040 <k_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<phantom_error>:
push   %rax
mov    $0x6af,%edi
call   1030 <sysmsg@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <k_error@plt>

LLVM IR (-O0):
define void @phantom_error() {
%1 = call i32 @sysmsg(i32 1711)
%2 = call i32 @k_error(i32 %1)
ret void
}

LLVM IR (-O2):
define void @phantom_error() {
%1 = tail call i32 @sysmsg(i32 1711)
%2 = tail call i32 @k_error(i32 %1)
ret void
}
int ft_isx(char *str, int (*is)(int)) {
  while (*str) {
    if (!is(*str))
      return (0);
    str++;
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_isx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <ft_isx+0x50>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%edi
call   *%rax
cmp    $0x0,%eax
jne    113f <ft_isx+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1157 <ft_isx+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ft_isx+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isx>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
mov    $0x1,%r14d
test   %al,%al
je     113a <ft_isx+0x3a>
mov    %rsi,%rbx
mov    %rdi,%rbp
add    $0x1,%rbp
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   *%rbx
test   %eax,%eax
je     1137 <ft_isx+0x37>
movzbl 0x0(%rbp),%eax
add    $0x1,%rbp
test   %al,%al
jne    1120 <ft_isx+0x20>
jmp    113a <ft_isx+0x3a>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ft_isx(i8* %0, i32 (i32)* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32 (i32)*
store i8* %0, i8** %4
store i32 (i32)* %1, i32 (i32)** %5
br label %6
6: ; preds = %18, %2
%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 i32 (i32)*, i32 (i32)** %5
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = call i32 %11(i32 %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %10
store i32 0, i32* %3
br label %22
18: ; preds = %10
%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* %3
br label %22
22: ; preds = %21, %17
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @ft_isx(i8* nocapture %0, i32 (i32)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %8
5: ; preds = %8
%6 = load i8, i8* %14
%7 = icmp eq i8 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %14, %5 ], [ %0, %2 ]
%11 = sext i8 %9 to i32
%12 = tail call i32 %1(i32 %11)
%13 = icmp eq i32 %12, 0
%14 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %13, label %15, label %5
15: ; preds = %8, %5, %2
%16 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 20;
  *&a = 30;
  printf("%u\n", *&a);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 30)
ret i32 0
}
/* Variables and functions */
scalar_t__ Fork();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void doit() {
  if (Fork() == 0) {
    Fork();
    printf("hello\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Fork@plt>
cmp    $0x0,%rax
jne    115f <doit+0x2f>
mov    $0x0,%al
call   1030 <Fork@plt>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doit>:
push   %rax
xor    %eax,%eax
call   1030 <Fork@plt>
test   %rax,%rax
je     113f <doit+0xf>
pop    %rax
ret
xor    %eax,%eax
call   1030 <Fork@plt>
lea    0xeb3(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define void @doit() {
%1 = call i64 (...) @Fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i64 (...) @Fork()
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %0
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @doit() {
%1 = tail call i64 (...) @Fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @Fork()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
ret void
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
unsigned long xstrtoull_range_sfx(char const *, int, unsigned long,
                                  unsigned long, struct suffix_mult const *);
__attribute__((always_)) unsigned long
xstrtoul_range_sfx(const char *str, int b, unsigned long l, unsigned long u,
                   const struct suffix_mult *sfx) {
  return xstrtoull_range_sfx(str, b, l, u, sfx);
}


x86 assembly (clang, -O0):
<xstrtoul_range_sfx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <xstrtoull_range_sfx@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrtoul_range_sfx>:
jmp    1030 <xstrtoull_range_sfx@plt>

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i64 @xstrtoul_range_sfx(i8* %0, i32 %1, i64 %2, i64 %3, %struct.suffix_mult* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca %struct.suffix_mult*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store %struct.suffix_mult* %4, %struct.suffix_mult** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load %struct.suffix_mult*, %struct.suffix_mult** %10
%16 = call i64 @xstrtoull_range_sfx(i8* %11, i32 %12, i64 %13, i64 %14, %struct.suffix_mult* %15)
ret i64 %16
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i64 @xstrtoul_range_sfx(i8* %0, i32 %1, i64 %2, i64 %3, %struct.suffix_mult* %4) {
%6 = tail call i64 @xstrtoull_range_sfx(i8* %0, i32 %1, i64 %2, i64 %3, %struct.suffix_mult* %4)
ret i64 %6
}
/* Variables and functions */
int board_ti_is(char *);
int board_is_evm_sk(void) { return board_ti_is("A335X_SK"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"A335X_SK\00"
define i32 @board_is_evm_sk() {
%1 = call i32 @board_ti_is(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"A335X_SK\00"
define i32 @board_is_evm_sk() {
%1 = tail call i32 @board_ti_is(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  for (;;) {
    printf("dene");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [5 x i8] c"dene\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"dene\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
void scheduler_callback(evutil_socket_t fd, short flags, void *_param) {}


x86 assembly (clang, -O0):
<scheduler_callback>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @scheduler_callback(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @scheduler_callback(i32 %0, i16 signext %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("\nUsage: Sbsa [-v <n>] | [-l <n>] | [--skip <n>]\n"
         "Options:\n"
         "-v      Verbosity of the Prints\n"
         "        1 shows all prints, 5 shows Errors\n"
         "-l      Level of compliance to be tested for\n"
         "        As per SBSA spec, 0 to 3\n"
         "--skip  Test(s) to be skipped\n"
         "        Refer to section 4 of SBSA_ACS_User_Guide\n"
         "        To skip a module, use Model_ID as mentioned in user guide\n"
         "        To skip a particular test within a module, use the exact "
         "testcase number\n");
}


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

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

LLVM IR (-O0):
@.str = [438 x i8] c"\0AUsage: Sbsa [-v <n>] | [-l <n>] | [--skip <n>]\0AOptions:\0A-v Verbosity of the Prints\0A 1 shows all prints, 5 shows Errors\0A-l Level of compliance to be tested for\0A As per SBSA spec, 0 to 3\0A--skip Test(s) to be skipped\0A Refer to section 4 of SBSA_ACS_User_Guide\0A To skip a module, use Model_ID as mentioned in user guide\0A To skip a particular test within a module, use the exact testcase number\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([438 x i8], [438 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [437 x i8] c"\0AUsage: Sbsa [-v <n>] | [-l <n>] | [--skip <n>]\0AOptions:\0A-v Verbosity of the Prints\0A 1 shows all prints, 5 shows Errors\0A-l Level of compliance to be tested for\0A As per SBSA spec, 0 to 3\0A--skip Test(s) to be skipped\0A Refer to section 4 of SBSA_ACS_User_Guide\0A To skip a module, use Model_ID as mentioned in user guide\0A To skip a particular test within a module, use the exact testcase number\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([437 x i8], [437 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn14() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn14");
  return result;
}


x86 assembly (clang, -O0):
<fn14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn14>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn14\00"
define i8* @fn14() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn14\00"
define i8* @fn14() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
unsigned short inw(int port) {
  unsigned short val;
  __asm__ __volatile__("inw %w1, %w0" : "=a"(val) : "Nd"(port));
  return val;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i16 @inw(i32 %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i16 %2
}
/* Type definitions */
struct timer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct timer *);
void timer_destroy(struct timer **ptimer) {
  if (ptimer && *ptimer) {
    free(*ptimer);
    *ptimer = NULL;
  }
}


x86 assembly (clang, -O0):
<timer_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <timer_destroy+0x3c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <timer_destroy+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_destroy>:
push   %rbx
test   %rdi,%rdi
je     112d <timer_destroy+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <timer_destroy+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.timer = type { i32 }
define void @timer_destroy(%struct.timer** %0) {
%2 = icmp eq %struct.timer** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load %struct.timer*, %struct.timer** %0
%5 = icmp eq %struct.timer* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(%struct.timer* %4)
store %struct.timer* null, %struct.timer** %0
br label %8
8: ; preds = %6, %3, %1
ret void
}
int test_imm_1Cuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x1C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Cuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x1c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Cuint64_midword_reg>:
test   $0x1c0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Cuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 28
%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_1Cuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 1835008
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
extern intmax_t imaxabs(intmax_t j) { return (j >= 0 ? j : -j); }


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

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

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

LLVM IR (-O2):
define i32 @imaxabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ luaL_check_lstr(int, long *);
int /*<<< orphan*/ lua_pushnumber(long);
void str_len(void) {
  long l;
  luaL_check_lstr(1, &l);
  lua_pushnumber(l);
}


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

x86 assembly (clang, -O2):
<str_len>:
push   %rax
mov    %rsp,%rsi
mov    $0x1,%edi
call   1040 <luaL_check_lstr@plt>
mov    (%rsp),%rdi
call   1030 <lua_pushnumber@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @str_len() {
%1 = alloca i64
%2 = call i32 @luaL_check_lstr(i32 1, i64* %1)
%3 = load i64, i64* %1
%4 = call i32 @lua_pushnumber(i64 %3)
ret void
}

LLVM IR (-O2):
define void @str_len() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @luaL_check_lstr(i32 1, i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @lua_pushnumber(i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_ret_nz(void) { op_write1(0xc0); }


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

x86 assembly (clang, -O2):
<op_enc_ret_nz>:
mov    $0xc0,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_ret_nz() {
%1 = call i32 @op_write1(i32 192)
ret void
}

LLVM IR (-O2):
define void @op_enc_ret_nz() {
%1 = tail call i32 @op_write1(i32 192)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ test_case();
int main() {
  int n;
  scanf("%d", &n);
  while (n--)
    test_case();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     115f <main+0x3f>
mov    $0x0,%al
call   1030 <test_case@plt>
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
subl   $0x1,0x4(%rsp)
jb     114e <main+0x2e>
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <test_case@plt>
subl   $0x1,0x4(%rsp)
jae    1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = icmp eq i32 %4, 0
br i1 %6, label %12, label %7
7: ; preds = %0, %7
%8 = call i32 (...) @test_case()
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
%11 = icmp eq i32 %9, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x0a() {
  Assert_real((isodigit(10) == 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_isodigit.c",
              55, ("isodigit should be 0 for 0x0a"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x0a\00"
define void @t_isodigit_0x0a() {
%1 = tail call i64 @isodigit(i32 10)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void eapol_test_eapol_done_cb(void *ctx) {
  printf("WPA: EAPOL processing complete\n");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"WPA: EAPOL processing complete\0A\00"
define void @eapol_test_eapol_done_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"WPA: EAPOL processing complete\00"
define void @eapol_test_eapol_done_cb(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          char *);
void time_print(char *str) {
  struct timeval t;
  gettimeofday(&t, NULL);
  printf("[%ld.%06ld] %s", t.tv_sec, t.tv_usec, str);
}


x86 assembly (clang, -O0):
<time_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_print>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%esi
lea    0xebd(%rip),%rdi
mov    %rbx,%rcx
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [15 x i8] c"[%ld.%06ld] %s\00"
define void @time_print(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.timeval
store i8* %0, i8** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [15 x i8] c"[%ld.%06ld] %s\00"
define void @time_print(i8* %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SA1StackRelative(int);
int /*<<< orphan*/ STA16(int /*<<< orphan*/, int);
void Op83M0(void) { STA16(SA1StackRelative(2), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op83M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1StackRelative@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <STA16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op83M0>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1StackRelative@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <STA16@plt>

LLVM IR (-O0):
define void @Op83M0() {
%1 = call i32 @SA1StackRelative(i32 2)
%2 = call i32 @STA16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op83M0() {
%1 = tail call i32 @SA1StackRelative(i32 2)
%2 = tail call i32 @STA16(i32 %1, i32 16777215)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_abrt(int sig) { printf("ABRT\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"ABRT\00"
define void @catch_abrt(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
void xmlvm_init_native_org_xmlvm_runtime_Condition() {}


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

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

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

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

/* Variables and functions */
int htonl(int);
uint64_t little_endian_htonll(uint64_t value) {
  const uint32_t high_part = htonl(value >> 32);
  const uint32_t low_part = htonl(value & 0xFFFFFFFFLL);
  return (((uint64_t)low_part << 32) | high_part);
}


x86 assembly (clang, -O0):
<little_endian_htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <htonl@plt>
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%edi
call   1030 <htonl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<little_endian_htonll>:
push   %rbx
mov    %edi,%ebx
call   1030 <htonl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i32 @little_endian_htonll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 32
%7 = call i32 @htonl(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = and i64 %9, 4294967295
%11 = trunc i64 %10 to i32
%12 = call i32 @htonl(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = shl i32 %13, 32
%15 = load i32, i32* %3
%16 = or i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @little_endian_htonll(i32 %0) {
%2 = tail call i32 @htonl(i32 poison)
%3 = tail call i32 @htonl(i32 %0)
ret i32 poison
}
void cpuhotplug_cooling_unregister(struct thermal_cooling_device *cdev) {
  return;
}


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

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

LLVM IR (-O0):
%struct.thermal_cooling_device = type opaque
define void @cpuhotplug_cooling_unregister(%struct.thermal_cooling_device* %0) {
%2 = alloca %struct.thermal_cooling_device*
store %struct.thermal_cooling_device* %0, %struct.thermal_cooling_device** %2
ret void
}

LLVM IR (-O2):
%struct.thermal_cooling_device = type opaque
define void @cpuhotplug_cooling_unregister(%struct.thermal_cooling_device* nocapture %0) {
ret void
}
void glmAddMatrix2f(float result[4], const float m1[4], const float m2[4]) {
  int i;
  for (i = 0; i < 4; i++)
    result[i] = m1[i] + m2[i];
}


x86 assembly (clang, -O0):
<glmAddMatrix2f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1156 <glmAddMatrix2f+0x56>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <glmAddMatrix2f+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmAddMatrix2f>:
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
addss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
addss  0xc(%rdx),%xmm0
movss  %xmm0,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @glmAddMatrix2f(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
%19 = getelementptr inbounds float, float* %1, i64 3
%20 = load float, float* %19
%21 = getelementptr inbounds float, float* %2, i64 3
%22 = load float, float* %21
%23 = fadd float %20, %22
%24 = getelementptr inbounds float, float* %0, i64 3
store float %23, float* %24
ret void
}
/* Type definitions */
struct ip {
  int ip_hl;
};

/* Variables and functions */
int get_ip_hlen(struct ip *self) { return self->ip_hl; }


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

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

LLVM IR (-O0):
%struct.ip = type { i32 }
define i32 @get_ip_hlen(%struct.ip* %0) {
%2 = alloca %struct.ip*
store %struct.ip* %0, %struct.ip** %2
%3 = load %struct.ip*, %struct.ip** %2
%4 = getelementptr inbounds %struct.ip, %struct.ip* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.ip = type { i32 }
define i32 @get_ip_hlen(%struct.ip* nocapture %0) {
%2 = getelementptr inbounds %struct.ip, %struct.ip* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void shr_reg32_cl(unsigned long reg32) {
  put8(0xD3);
  put8(0xE8 + reg32);
}


x86 assembly (clang, -O0):
<shr_reg32_cl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xd3,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
add    $0xe8,%rax
mov    %eax,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shr_reg32_cl>:
push   %rbx
mov    %rdi,%rbx
mov    $0xd3,%edi
call   1030 <put8@plt>
add    $0xe8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @shr_reg32_cl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 211)
%4 = load i64, i64* %2
%5 = add i64 232, %4
%6 = trunc i64 %5 to i32
%7 = call i32 @put8(i32 %6)
ret void
}

LLVM IR (-O2):
define void @shr_reg32_cl(i64 %0) {
%2 = tail call i32 @put8(i32 211)
%3 = trunc i64 %0 to i32
%4 = add i32 %3, 232
%5 = tail call i32 @put8(i32 %4)
ret void
}
long long gi5(long long j, unsigned int *b, int i) { return j + b[i]; }


x86 assembly (clang, -O0):
<gi5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gi5>:
movslq %edx,%rax
mov    (%rsi,%rax,4),%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @gi5(i64 %0, i32* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32
store i64 %0, i64* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = zext i32 %12 to i64
%14 = add nsw i64 %7, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @gi5(i64 %0, i32* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = zext i32 %6 to i64
%8 = add nsw i64 %7, %0
ret i64 %8
}
void __attribute__((no)) bar(int ignored, int n) { asm volatile(""); }


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

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

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

LLVM IR (-O2):
define void @bar(i32 %0, i32 %1) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_booted(void) { return -EINVAL; }


x86 assembly (clang, -O0):
<sd_booted>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_booted>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_booted() {
%1 = load i32, i32* @EINVAL
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_booted() {
%1 = load i32, i32* @EINVAL
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ NoDepAFunction();
void NoDepCFunction() { NoDepAFunction(); }


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

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

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

LLVM IR (-O2):
define void @NoDepCFunction() {
%1 = tail call i32 (...) @NoDepAFunction()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delayMicroseconds(int);
int /*<<< orphan*/ spiWriteRegister(int, int);
void rfmSetTX(void) {
  spiWriteRegister(0x07, (0x08 | 0x01));
  delayMicroseconds(200);
}


x86 assembly (clang, -O0):
<rfmSetTX>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
mov    $0x9,%esi
call   1030 <spiWriteRegister@plt>
mov    $0xc8,%edi
call   1040 <delayMicroseconds@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfmSetTX>:
push   %rax
mov    $0x7,%edi
mov    $0x9,%esi
call   1030 <spiWriteRegister@plt>
mov    $0xc8,%edi
pop    %rax
jmp    1040 <delayMicroseconds@plt>

LLVM IR (-O0):
define void @rfmSetTX() {
%1 = call i32 @spiWriteRegister(i32 7, i32 9)
%2 = call i32 @delayMicroseconds(i32 200)
ret void
}

LLVM IR (-O2):
define void @rfmSetTX() {
%1 = tail call i32 @spiWriteRegister(i32 7, i32 9)
%2 = tail call i32 @delayMicroseconds(i32 200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func(char *);
int main(int argc, char *argv[]) {
  func(argv[1]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @func(i8* %4)
ret i32 0
}
double quarticEaseInd(double p) { return p * p * p * p; }


x86 assembly (clang, -O0):
<quarticEaseInd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quarticEaseInd>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @quarticEaseInd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @quarticEaseInd(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *);
int snprintf(char *, int, char *, int, unsigned int);
void putoctal(char *dst, unsigned num, int size) {
  if (snprintf(dst, size, "%.*o", size - 1, num) >= size)
    eprintf("snprintf: input number too large\n");
}


x86 assembly (clang, -O0):
<putoctal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    -0xc(%rbp),%r8d
lea    0xeb6(%rip),%rdx
call   1030 <snprintf@plt>
cmp    -0x10(%rbp),%eax
jl     1164 <putoctal+0x44>
lea    0xea6(%rip),%rdi
call   1040 <eprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putoctal>:
push   %rbx
mov    %edx,%ebx
mov    %esi,%r8d
lea    -0x1(%rbx),%ecx
lea    0xed0(%rip),%rdx
mov    %ebx,%esi
call   1030 <snprintf@plt>
cmp    %ebx,%eax
jge    113d <putoctal+0x1d>
pop    %rbx
ret
lea    0xec1(%rip),%rdi
pop    %rbx
jmp    1040 <eprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%.*o\00"
@.str.1 = [34 x i8] c"snprintf: input number too large\0A\00"
define void @putoctal(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = load i32, i32* %6
%10 = sub nsw i32 %9, 1
%11 = load i32, i32* %5
%12 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* %6
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 @eprintf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.*o\00"
@.str.1 = [34 x i8] c"snprintf: input number too large\0A\00"
define void @putoctal(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @snprintf(i8* %0, i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %1)
%6 = icmp slt i32 %5, %2
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @eprintf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}