xunge/DecIR huggingface dataset:
int uri_hex_conv(int c) {
  if (c >= 'a' && c <= 'f')
    return c + 10 - 'a';
  else if (c >= 'A' && c <= 'F')
    return c + 10 - 'a';
  else
    return c - '0';
}


x86 assembly (clang, -O0):
<uri_hex_conv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <uri_hex_conv+0x2c>
cmpl   $0x66,-0x8(%rbp)
jg     112c <uri_hex_conv+0x2c>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <uri_hex_conv+0x5a>
cmpl   $0x41,-0x8(%rbp)
jl     1151 <uri_hex_conv+0x51>
cmpl   $0x46,-0x8(%rbp)
jg     1151 <uri_hex_conv+0x51>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <uri_hex_conv+0x5a>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uri_hex_conv>:
lea    -0x30(%rdi),%ecx
lea    -0x57(%rdi),%eax
mov    %edi,%edx
and    $0xffffffdf,%edx
add    $0xffffffbf,%edx
cmp    $0x6,%edx
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @uri_hex_conv(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 102
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 10
%12 = sub nsw i32 %11, 97
store i32 %12, i32* %2
br label %26
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 70
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 10
%22 = sub nsw i32 %21, 97
store i32 %22, i32* %2
br label %26
23: ; preds = %16, %13
%24 = load i32, i32* %3
%25 = sub nsw i32 %24, 48
store i32 %25, i32* %2
br label %26
26: ; preds = %23, %19, %9
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @uri_hex_conv(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 6
%5 = select i1 %4, i32 -87, i32 -48
%6 = add nsw i32 %5, %0
ret i32 %6
}
void generate_desktop(int argc, char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @generate_desktop(i32 %0, i8** nocapture %1) {
ret void
}
float f2(float x, float y) { return (x * x + 4 * y * y - 4); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xee0(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xec6(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movss  0xef8(%rip),%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm0,%xmm0
addss  %xmm2,%xmm0
addss  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @f2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fmul float 4.000000e+00, %7
%9 = load float, float* %4
%10 = fmul float %8, %9
%11 = call float @llvm.fmuladd.f32(float %5, float %6, float %10)
%12 = fsub float %11, 4.000000e+00
ret float %12
}

LLVM IR (-O2):
define float @f2(float %0, float %1) {
%3 = fmul float %1, 4.000000e+00
%4 = fmul float %3, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = fadd float %5, -4.000000e+00
ret float %6
}
int trace_seq_printf(struct trace_seq *s, const char *fmt, ...) { return 0; }


x86 assembly (clang, -O0):
<trace_seq_printf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.trace_seq = type opaque
define i32 @trace_seq_printf(%struct.trace_seq* %0, i8* %1, ...) {
%3 = alloca %struct.trace_seq*
%4 = alloca i8*
store %struct.trace_seq* %0, %struct.trace_seq** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.trace_seq = type opaque
define i32 @trace_seq_printf(%struct.trace_seq* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 0
}
int func2(int x(int, int)) { return x(20, 5); }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x14,%edi
mov    $0x5,%esi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
mov    %rdi,%rax
mov    $0x14,%edi
mov    $0x5,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @func2(i32 (i32, i32)* nocapture %0) {
%2 = tail call i32 %0(i32 20, i32 5)
ret i32 %2
}
/* Variables and functions */
char *strrchr(char *, char);
char *uwsgi_get_last_char(char *what, char c) { return strrchr(what, c); }


x86 assembly (clang, -O0):
<uwsgi_get_last_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strrchr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_get_last_char>:
jmp    1030 <strrchr@plt>

LLVM IR (-O0):
define i8* @uwsgi_get_last_char(i8* %0, i8 signext %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 i8* @strrchr(i8* %5, i8 signext %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @uwsgi_get_last_char(i8* %0, i8 signext %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext %1)
ret i8* %3
}
/* Variables and functions */
int recv(int, void *, size_t, int /*<<< orphan*/);
int receive_data(int sock, void *buffer, size_t buffer_size) {
  return recv(sock, buffer, buffer_size, 0);
}


x86 assembly (clang, -O0):
<receive_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive_data>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @receive_data(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *app, int err) {
  printf("usage: %s <src> <dst>\n", app);
  exit(err);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"usage: %s <src> <dst>\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"usage: %s <src> <dst>\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t __byte_encoded_array_size(const uint8_t *p, uint32_t elements) {
  (void)p;
  return (1) * elements;
}


x86 assembly (clang, -O0):
<__byte_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__byte_encoded_array_size>:
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @__byte_encoded_array_size(i32* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help() {
  printf("Usage: "
         "sshpass-debug"
         " [-f|-d|-p|-e] [-hV] command parameters\n"
         "   -f filename   Take password to use from file\n"
         "   -d number     Use number as file descriptor for getting password\n"
         "   -p password   Provide password as argument (security unwise)\n"
         "   -e            Password is passed as env-var \"SSHPASS\"\n"
         "   With no parameters - password will be taken from stdin\n\n"
         "   -h            Show help (this screen)\n"
         "   -V            Print version information\n"
         "At most one of -f, -d, -p or -e should be used\n");
}


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

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

LLVM IR (-O0):
@.str = [488 x i8] c"Usage: sshpass-debug [-f|-d|-p|-e] [-hV] command parameters\0A -f filename Take password to use from file\0A -d number Use number as file descriptor for getting password\0A -p password Provide password as argument (security unwise)\0A -e Password is passed as env-var \22SSHPASS\22\0A With no parameters - password will be taken from stdin\0A\0A -h Show help (this screen)\0A -V Print version information\0AAt most one of -f, -d, -p or -e should be used\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([488 x i8], [488 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [487 x i8] c"Usage: sshpass-debug [-f|-d|-p|-e] [-hV] command parameters\0A -f filename Take password to use from file\0A -d number Use number as file descriptor for getting password\0A -p password Provide password as argument (security unwise)\0A -e Password is passed as env-var \22SSHPASS\22\0A With no parameters - password will be taken from stdin\0A\0A -h Show help (this screen)\0A -V Print version information\0AAt most one of -f, -d, -p or -e should be used\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([487 x i8], [487 x i8]* @str, i64 0, i64 0))
ret void
}
void do_double_fault(void *x) {
  do {
    kprintf("Unsupport Now...[%s]\n", __FUNCTION__);
    while (1)
      ;
  } while (0);
  ;
}


x86 assembly (clang, -O0):
<do_double_fault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1030 <kprintf@plt>
jmp    1131 <do_double_fault+0x21>

x86 assembly (clang, -O2):
<do_double_fault>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef7(%rip),%rsi
xor    %eax,%eax
call   1030 <kprintf@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1130 <do_double_fault+0x20>

LLVM IR (-O0):
@.str = [22 x i8] c"Unsupport Now...[%s]\0A\00"
@__FUNCTION__.do_double_fault = [16 x i8] c"do_double_fault\00"
define void @do_double_fault(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.do_double_fault, i64 0, i64 0))
br label %5
5: ; preds = %3, %5
br label %5
6: ; No predecessors!
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Unsupport Now...[%s]\0A\00"
@__FUNCTION__.do_double_fault = [16 x i8] c"do_double_fault\00"
define void @do_double_fault(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.do_double_fault, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int main() {
  print("Hello, world!\n\0");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello, world!\0A\00\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello, world!\0A\00\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ msg(char *, char const *);
void show_msg(const char *opt) { msg("%s", opt); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @show_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @msg(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 @show_msg(i8* %0) {
%2 = tail call i32 @msg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int ttrie__next(struct ttrie__obj *tt, char *key, unsigned long long *result) {
  return 0;
}


x86 assembly (clang, -O0):
<ttrie__next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.ttrie__obj = type opaque
define i32 @ttrie__next(%struct.ttrie__obj* nocapture readnone %0, i8* nocapture readnone %1, i64* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int _kill(int32_t pid, int32_t sig) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
char *strdup(char const *);
char *dostrdup(const char *s) {
  char *cp = strdup(s);
  if (!(cp)) {
    perror(s);
    exit(EXIT_FAILURE);
  }
  return cp;
}


x86 assembly (clang, -O0):
<dostrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <dostrdup+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dostrdup>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strdup@plt>
test   %rax,%rax
je     1140 <dostrdup+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i8* @dostrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @perror(i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i8* @dostrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
void ieee80211_proc_deinit_sta(struct ieee80211_local *local,
                               struct sta_info *sta) {}


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

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

LLVM IR (-O0):
%struct.ieee80211_local = type opaque
%struct.sta_info = type opaque
define void @ieee80211_proc_deinit_sta(%struct.ieee80211_local* %0, %struct.sta_info* %1) {
%3 = alloca %struct.ieee80211_local*
%4 = alloca %struct.sta_info*
store %struct.ieee80211_local* %0, %struct.ieee80211_local** %3
store %struct.sta_info* %1, %struct.sta_info** %4
ret void
}

LLVM IR (-O2):
%struct.ieee80211_local = type opaque
%struct.sta_info = type opaque
define void @ieee80211_proc_deinit_sta(%struct.ieee80211_local* nocapture %0, %struct.sta_info* nocapture %1) {
ret void
}
long f6(long x, unsigned int y) { return x & ((1L << y) - 1); }


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mov    %esi,%ecx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
not    %rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @f6(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = sub nsw i64 %8, 1
%10 = and i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @f6(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = shl nsw i64 -1, %3
%5 = xor i64 %4, -1
%6 = and i64 %5, %0
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void sorry(int rand1) {
  printf("\n\nSorry. The number was %d.", rand1);
  printf("\nBetter luck next time.\n\n");
  return;
}


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

x86 assembly (clang, -O2):
<sorry>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"\0A\0ASorry. The number was %d.\00"
@.str.1 = [26 x i8] c"\0ABetter luck next time.\0A\0A\00"
define void @sorry(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0A\0ASorry. The number was %d.\00"
@str = [25 x i8] c"\0ABetter luck next time.\0A\00"
define void @sorry(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check(void *, int, char *, char const *, char const *);
void __is_not_equal(void *context, const char *desc1, const void *subject1,
                    const char *desc2, const void *subject2) {
  check(context, subject1 == subject2, "%s equals %s (but shouldn't)", desc1,
        desc2);
}


x86 assembly (clang, -O0):
<__is_not_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xeb1(%rip),%rdx
call   1030 <check@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__is_not_equal>:
mov    %rcx,%rax
mov    %rsi,%rcx
xor    %esi,%esi
cmp    %r8,%rdx
sete   %sil
lea    0xeda(%rip),%rdx
mov    %rax,%r8
jmp    1030 <check@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"%s equals %s (but shouldn't)\00"
define void @__is_not_equal(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %8
%13 = load i8*, i8** %10
%14 = icmp eq i8* %12, %13
%15 = zext i1 %14 to i32
%16 = load i8*, i8** %7
%17 = load i8*, i8** %9
%18 = call i32 @check(i8* %11, i32 %15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"%s equals %s (but shouldn't)\00"
define void @__is_not_equal(i8* %0, i8* %1, i8* readnone %2, i8* %3, i8* readnone %4) {
%6 = icmp eq i8* %2, %4
%7 = zext i1 %6 to i32
%8 = tail call i32 @check(i8* %0, i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int plhm_find_device(const char *device) {
  struct stat st;
  if (stat(device, &st) == -1) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<plhm_find_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113e <plhm_find_device+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <plhm_find_device+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plhm_find_device>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @plhm_find_device(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef union quat {
  int dummy;
} quat;

/* Variables and functions */
int /*<<< orphan*/ quat_scale(union quat *, union quat *, float);
void quat_scale_self(union quat *q, float f) { quat_scale(q, q, f); }


x86 assembly (clang, -O0):
<quat_scale_self>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movss  -0xc(%rbp),%xmm0
call   1030 <quat_scale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_scale_self>:
mov    %rdi,%rsi
jmp    1030 <quat_scale@plt>

LLVM IR (-O0):
%union.quat = type { i32 }
define void @quat_scale_self(%union.quat* %0, float %1) {
%3 = alloca %union.quat*
%4 = alloca float
store %union.quat* %0, %union.quat** %3
store float %1, float* %4
%5 = load %union.quat*, %union.quat** %3
%6 = load %union.quat*, %union.quat** %3
%7 = load float, float* %4
%8 = call i32 @quat_scale(%union.quat* %5, %union.quat* %6, float %7)
ret void
}

LLVM IR (-O2):
%union.quat = type { i32 }
define void @quat_scale_self(%union.quat* %0, float %1) {
%3 = tail call i32 @quat_scale(%union.quat* %0, %union.quat* %0, float %1)
ret void
}
void f_b(int i) {}


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

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

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

LLVM IR (-O2):
define void @f_b(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
bool tread_obj_end(void *s) {
  fprintf(stderr, "obj_end\n");
  return true;
}


x86 assembly (clang, -O0):
<tread_obj_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tread_obj_end>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"obj_end\0A\00"
define i32 @tread_obj_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"obj_end\0A\00"
define i32 @tread_obj_end(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ nc_advise(char *, int const, char *, int);
int nc_redef(int);
int ncredef(int ncid) {
  const int status = nc_redef(ncid);
  if (status != 0) {
    nc_advise("ncredef", status, "ncid %d", ncid);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ncredef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <nc_redef@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1165 <ncredef+0x45>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xeb3(%rip),%rdi
lea    0xeb4(%rip),%rdx
call   1040 <nc_advise@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <ncredef+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncredef>:
push   %rbx
mov    %edi,%ebx
call   1030 <nc_redef@plt>
test   %eax,%eax
je     114a <ncredef+0x2a>
lea    0xecd(%rip),%rdi
lea    0xece(%rip),%rdx
mov    %eax,%esi
mov    %ebx,%ecx
call   1040 <nc_advise@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"ncredef\00"
@.str.1 = [8 x i8] c"ncid %d\00"
define i32 @ncredef(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @nc_redef(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = call i32 @nc_advise(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %11)
store i32 -1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [8 x i8] c"ncredef\00"
@.str.1 = [8 x i8] c"ncid %d\00"
define i32 @ncredef(i32 %0) {
%2 = tail call i32 @nc_redef(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @nc_advise(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
int test_imm_E6uint8_reg(unsigned char val) {
  return ((val) & (0xE6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E6uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xe6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E6uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 230
%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_E6uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -26
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef enum fe_delivery_system {
  ____Placeholder_fe_delivery_system
} fe_delivery_system;

/* Variables and functions */
int /*<<< orphan*/ DTV_DELIVERY_SYSTEM;
int set_property(int, int /*<<< orphan*/, int);
int dvbfe_set_delsys(int fd, enum fe_delivery_system delsys) {
  return set_property(fd, DTV_DELIVERY_SYSTEM, delsys);
}


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

x86 assembly (clang, -O2):
<dvbfe_set_delsys>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <set_property@plt>

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

LLVM IR (-O2):
@DTV_DELIVERY_SYSTEM = global i32 0
define i32 @dvbfe_set_delsys(i32 %0, i32 %1) {
%3 = load i32, i32* @DTV_DELIVERY_SYSTEM
%4 = tail call i32 @set_property(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
#define SIGHUP 129
#define SIGINT 128
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ unlock_pid_file();
void signal_handler(int sig) {
  switch (sig) {
  case SIGHUP:
    break;
  case SIGINT:
    unlock_pid_file();
    closelog();
    exit(0);
    break;
  }
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1169 <signal_handler+0x39>
jmp    1151 <signal_handler+0x21>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
jne    117e <signal_handler+0x4e>
jmp    1164 <signal_handler+0x34>
jmp    117e <signal_handler+0x4e>
mov    $0x0,%al
call   1040 <unlock_pid_file@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
cmp    $0x80,%edi
je     1139 <signal_handler+0x9>
ret
push   %rax
xor    %eax,%eax
call   1040 <unlock_pid_file@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %9 [
i32 129, label %4
i32 128, label %5
]
4: ; preds = %1
br label %9
5: ; preds = %1
%6 = call i32 (...) @unlock_pid_file()
%7 = call i32 (...) @closelog()
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1, %4
ret void
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 (...) @unlock_pid_file()
%5 = tail call i32 (...) @closelog()
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}
int main(void) { int a[0]; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [0 x i32]
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void WF_ProcessRxPacket() {}


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

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

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

LLVM IR (-O2):
define void @WF_ProcessRxPacket() {
ret void
}
unsigned int u32from_buf(unsigned char *buf) {
  return (buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24));
}


x86 assembly (clang, -O0):
<u32from_buf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @u32from_buf(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int id(int);
int id2(int x) {
  if (x == 0)
    return 0;
  return id(x - 1) + 1;
}


x86 assembly (clang, -O0):
<id2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <id2+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1142 <id2+0x32>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <id@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<id2>:
test   %edi,%edi
je     1125 <id2+0x15>
push   %rax
add    $0xffffffff,%edi
call   1030 <id@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @id2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @id(i32 %9)
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @id2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @id(i32 %4)
%6 = add nsw i32 %5, 1
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int standardize_primitive(double **, double **, int *, int const, double const,
                          double const);
int spgat_find_primitive(double lattice[3][3], double position[][3],
                         int types[], const int num_atom, const double symprec,
                         const double angle_tolerance) {
  return standardize_primitive(lattice, position, types, num_atom, symprec,
                               angle_tolerance);
}


x86 assembly (clang, -O0):
<spgat_find_primitive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
call   1030 <standardize_primitive@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spgat_find_primitive>:
jmp    1030 <standardize_primitive@plt>

LLVM IR (-O0):
define i32 @spgat_find_primitive([3 x double]* %0, [3 x double]* %1, i32* %2, i32 %3, double %4, double %5) {
%7 = alloca [3 x double]*
%8 = alloca [3 x double]*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca double
%12 = alloca double
store [3 x double]* %0, [3 x double]** %7
store [3 x double]* %1, [3 x double]** %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store double %4, double* %11
store double %5, double* %12
%13 = load [3 x double]*, [3 x double]** %7
%14 = bitcast [3 x double]* %13 to double**
%15 = load [3 x double]*, [3 x double]** %8
%16 = bitcast [3 x double]* %15 to double**
%17 = load i32*, i32** %9
%18 = load i32, i32* %10
%19 = load double, double* %11
%20 = load double, double* %12
%21 = call i32 @standardize_primitive(double** %14, double** %16, i32* %17, i32 %18, double %19, double %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @spgat_find_primitive([3 x double]* %0, [3 x double]* %1, i32* %2, i32 %3, double %4, double %5) {
%7 = bitcast [3 x double]* %0 to double**
%8 = bitcast [3 x double]* %1 to double**
%9 = tail call i32 @standardize_primitive(double** %7, double** %8, i32* %2, i32 %3, double %4, double %5)
ret i32 %9
}
double r11(void *x) { return *(double *)(x + 32757); }


x86 assembly (clang, -O0):
<r11>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x7ff5(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<r11>:
movsd  0x7ff5(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @r11(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32757
%5 = bitcast i8* %4 to double*
%6 = load double, double* %5
ret double %6
}

LLVM IR (-O2):
define double @r11(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32757
%3 = bitcast i8* %2 to double*
%4 = load double, double* %3
ret double %4
}
__attribute__((no, noclone)) int foo(int x) {
  asm("" : "+r"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ XIMText;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XIMText(void *_p) {
  if (_p == NULL)
    abort();
  free((XIMText *)_p);
}


x86 assembly (clang, -O0):
<free_XIMText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XIMText+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XIMText>:
test   %rdi,%rdi
je     112a <free_XIMText+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XIMText(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XIMText(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
scalar_t__ EXIT_SUCCESS;
scalar_t__ ft_putchar(char);
int ft_putnbr_base(unsigned long long, unsigned int, unsigned int);
int ft_putnbr_basel(unsigned long long int n, unsigned int base,
                    unsigned int pad) {
  int ret;
  ret = ft_putnbr_base(n, base, pad);
  ret = ft_putchar('\n') == EXIT_SUCCESS ? ret : EXIT_FAILURE;
  return (ret);
}


x86 assembly (clang, -O0):
<ft_putnbr_basel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <ft_putnbr_base@plt>
mov    %eax,-0x14(%rbp)
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%rax
jne    1169 <ft_putnbr_basel+0x49>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1175 <ft_putnbr_basel+0x55>
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_basel>:
push   %rbx
call   1040 <ft_putnbr_base@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%rax
je     1147 <ft_putnbr_basel+0x27>
mov    0x2e9b(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @ft_putnbr_basel(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @ft_putnbr_base(i64 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = call i64 @ft_putchar(i8 signext 10)
%13 = load i64, i64* @EXIT_SUCCESS
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load i32, i32* %7
br label %19
17: ; preds = %3
%18 = load i32, i32* @EXIT_FAILURE
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ %18, %17 ]
store i32 %20, i32* %7
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @ft_putnbr_basel(i64 %0, i32 %1, i32 %2) {
%4 = tail call i32 @ft_putnbr_base(i64 %0, i32 %1, i32 %2)
%5 = tail call i64 @ft_putchar(i8 signext 10)
%6 = load i64, i64* @EXIT_SUCCESS
%7 = icmp eq i64 %5, %6
%8 = load i32, i32* @EXIT_FAILURE
%9 = select i1 %7, i32 %4, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void rot_free(void *x) { free(x); }


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

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

LLVM IR (-O2):
define void @rot_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *);
void putc_i(char c_) {
  char str[] = {c_, 0};
  write(str);
}


x86 assembly (clang, -O0):
<putc_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc_i>:
push   %rax
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putc_i(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %2
store i8 %5, i8* %4
%6 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call i32 @write(i8* %7)
ret void
}

LLVM IR (-O2):
define void @putc_i(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %0, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %4
%5 = call i32 @write(i8* %3)
ret void
}