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

/* Variables and functions */
int /*<<< orphan*/ net_base_send(int, int /*<<< orphan*/ const *, size_t,
                                 int /*<<< orphan*/ *, int);
ssize_t net_stream_send(int sock, const uint8_t *buffer, size_t size,
                        int timeout_ms) {
  return net_base_send(sock, buffer, size, NULL, timeout_ms);
}


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

x86 assembly (clang, -O2):
<net_stream_send>:
mov    %ecx,%r8d
xor    %ecx,%ecx
jmp    1030 <net_base_send@plt>

LLVM IR (-O0):
define i32 @net_stream_send(i32 %0, i32* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @net_base_send(i32 %9, i32* %10, i64 %11, i32* null, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @net_stream_send(i32 %0, i32* %1, i64 %2, i32 %3) {
%5 = tail call i32 @net_base_send(i32 %0, i32* %1, i64 %2, i32* null, i32 %3)
ret i32 %5
}
void gtk_key_snooper_install() {}


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

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

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

LLVM IR (-O2):
define void @gtk_key_snooper_install() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char const *);
int set_flag_table_3_3(unsigned char **, int /*<<< orphan*/);
int f_set_flag_table_3_3(int mode, unsigned char **sec, float *data,
                         unsigned int ndata, char *inv_out, void **local,
                         const char *arg1) {
  if (mode >= 0)
    return set_flag_table_3_3(sec, atoi(arg1));
  return 0;
}


x86 assembly (clang, -O0):
<f_set_flag_table_3_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1170 <f_set_flag_table_3_3+0x50>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
call   1030 <set_flag_table_3_3@plt>
mov    %eax,-0x4(%rbp)
jmp    1177 <f_set_flag_table_3_3+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_set_flag_table_3_3>:
test   %edi,%edi
js     113d <f_set_flag_table_3_3+0x1d>
push   %rbx
mov    %rsi,%rbx
mov    0x10(%rsp),%rdi
call   1040 <atoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <set_flag_table_3_3@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @f_set_flag_table_3_3(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8**
%11 = alloca float*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8**
%15 = alloca i8*
store i32 %0, i32* %9
store i8** %1, i8*** %10
store float* %2, float** %11
store i32 %3, i32* %12
store i8* %4, i8** %13
store i8** %5, i8*** %14
store i8* %6, i8** %15
%16 = load i32, i32* %9
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %7
%19 = load i8**, i8*** %10
%20 = load i8*, i8** %15
%21 = call i32 @atoi(i8* %20)
%22 = call i32 @set_flag_table_3_3(i8** %19, i32 %21)
store i32 %22, i32* %8
br label %24
23: ; preds = %7
store i32 0, i32* %8
br label %24
24: ; preds = %23, %18
%25 = load i32, i32* %8
ret i32 %25
}

LLVM IR (-O2):
define i32 @f_set_flag_table_3_3(i32 %0, i8** %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5, i8* nocapture %6) {
%8 = icmp sgt i32 %0, -1
br i1 %8, label %9, label %12
9: ; preds = %7
%10 = tail call i32 @atoi(i8* %6)
%11 = tail call i32 @set_flag_table_3_3(i8** %1, i32 %10)
br label %12
12: ; preds = %7, %9
%13 = phi i32 [ %11, %9 ], [ 0, %7 ]
ret i32 %13
}
/* Variables and functions */
char *str_chr(const char *s, int c) {
  do {
    if (*s == (char)c)
      return (char *)s;
  } while (*s++);
  return NULL;
}


x86 assembly (clang, -O0):
<str_chr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    112d <str_chr+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <str_chr+0x52>
jmp    1132 <str_chr+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    110b <str_chr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_chr>:
mov    %rdi,%rax
movsbl %sil,%ecx
nopw   0x0(%rax,%rax,1)
movsbl (%rax),%edx
cmp    %edx,%ecx
je     1121 <str_chr+0x21>
add    $0x1,%rax
test   %dl,%dl
jne    1110 <str_chr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @str_chr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %10, %2
%6 = phi i8* [ %0, %2 ], [ %11, %10 ]
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %4, %8
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i8 %7, 0
br i1 %12, label %13, label %5
13: ; preds = %10, %5
%14 = phi i8* [ %6, %5 ], [ null, %10 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
int /*<<< orphan*/ memcpy(char *, char *, unsigned int);
char *strings_alloc(unsigned int);
unsigned int strings_length(char *);
char *strings_clone(char *string) {
  assert(string);
  char *ret;
  unsigned int length = strings_length(string);
  ret = strings_alloc(length + 1);
  memcpy(ret, string, (length + 1) * sizeof(char));
  return ret;
}


x86 assembly (clang, -O0):
<strings_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strings_length@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <strings_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x0,%rax
mov    %eax,%edx
call   1060 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strings_clone>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1030 <strings_length@plt>
lea    0x1(%rax),%r14d
mov    %r14d,%edi
call   1040 <strings_alloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1060 <memcpy@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strings_clone(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @strings_length(i8* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = add i32 %9, 1
%11 = call i8* @strings_alloc(i32 %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = load i32, i32* %4
%15 = add i32 %14, 1
%16 = zext i32 %15 to i64
%17 = mul i64 %16, 1
%18 = trunc i64 %17 to i32
%19 = call i32 @memcpy(i8* %12, i8* %13, i32 %18)
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @strings_clone(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @strings_length(i8* %0)
%4 = add i32 %3, 1
%5 = tail call i8* @strings_alloc(i32 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %4)
ret i8* %5
}
/* Variables and functions */
char *ntos(int, char *, size_t *);
int /*<<< orphan*/ printf(char *, int, char *);
void test_num2str() {
  int num = 92185;
  char str[128];
  size_t len = sizeof str;
  printf("num =  %d, str = \"%s\"\n", num, ntos(num, str, &len));
}


x86 assembly (clang, -O0):
<test_num2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x16819,-0x4(%rbp)
movq   $0x80,-0x98(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x90(%rbp),%rsi
lea    -0x98(%rbp),%rdx
call   1030 <ntos@plt>
mov    -0x9c(%rbp),%esi
mov    %rax,%rdx
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_num2str>:
sub    $0x98,%rsp
movq   $0x80,0x8(%rsp)
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    $0x16819,%edi
call   1030 <ntos@plt>
lea    0xeb5(%rip),%rdi
mov    $0x16819,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
add    $0x98,%rsp
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"num = %d, str = \22%s\22\0A\00"
define void @test_num2str() {
%1 = alloca [128 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = bitcast i64* %2 to i8*
store i64 128, i64* %2
%5 = call i8* @ntos(i32 92185, i8* %3, i64* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 92185, i8* %5)
ret void
}
void sig_interrupt(int sig) { return; }


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

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

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

LLVM IR (-O2):
define void @sig_interrupt(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;
typedef int mpfr_rnd_t;

/* Variables and functions */
int /*<<< orphan*/ mpfr_root(int /*<<< orphan*/, int /*<<< orphan*/,
                             unsigned long, int);
void mpfrroot(mpfr_t r2, mpfr_t r1, int *nrt, mpfr_rnd_t *irnd) {
  unsigned long int n1;
  int n2;
  n1 = *nrt;
  n2 = *irnd;
  mpfr_root(r2, r1, n1, n2);
}


x86 assembly (clang, -O0):
<mpfrroot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <mpfr_root@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfrroot>:
movslq (%rdx),%rdx
mov    (%rcx),%ecx
jmp    1030 <mpfr_root@plt>

LLVM IR (-O0):
define void @mpfrroot(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%11 = load i32*, i32** %7
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
store i64 %13, i64* %9
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
store i32 %15, i32* %10
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i64, i64* %9
%19 = load i32, i32* %10
%20 = call i32 @mpfr_root(i32 %16, i32 %17, i64 %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @mpfrroot(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = load i32, i32* %3
%8 = tail call i32 @mpfr_root(i32 %0, i32 %1, i64 %6, i32 %7)
ret void
}
echo(a) int a;
{ return (a); }


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

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

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

LLVM IR (-O2):
define i32 @echo(i32 returned %0) {
ret i32 %0
}
void strupper(s) char *s;
{
  while (*s != '\0') {
    *s = toupper(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <strupper+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strupper+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strupper+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strupper+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strupper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @toupper(i32 %7)
%9 = trunc i32 %8 to i8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
int op_mul(int a, int b) { return (a * b); }


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

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

LLVM IR (-O0):
define i32 @op_mul(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 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @op_mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void builtin_exit(char *argv[]) {
  (void)argv;
  _exit(0);
}


x86 assembly (clang, -O0):
<builtin_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<builtin_exit>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define void @builtin_exit(i8** nocapture readnone %0) {
%2 = tail call i32 @_exit(i32 0)
unreachable
}
double f3(const double x) {
  int i;
  double f = x;
  for (i = 0; i < 3; i++) {
    f *= (1.5 - 0.5 * f * f);
  }
  return f;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1175 <f3+0x75>
movsd  0xedc(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <f3+0x1a>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
movsd  0xef8(%rip),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeec(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f3(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
store double %5, double* %4
store i32 0, i32* %3
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load double, double* %4
%11 = fmul double 5.000000e-01, %10
%12 = load double, double* %4
%13 = fneg double %11
%14 = call double @llvm.fmuladd.f64(double %13, double %12, double 1.500000e+00)
%15 = load double, double* %4
%16 = fmul double %15, %14
store double %16, double* %4
br label %17
17: ; preds = %9
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %6
20: ; preds = %6
%21 = load double, double* %4
ret double %21
}

LLVM IR (-O2):
define double @f3(double %0) {
%2 = fmul double %0, -5.000000e-01
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.500000e+00)
%4 = fmul double %3, %0
%5 = fmul double %4, -5.000000e-01
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double 1.500000e+00)
%7 = fmul double %4, %6
%8 = fmul double %7, -5.000000e-01
%9 = tail call double @llvm.fmuladd.f64(double %8, double %7, double 1.500000e+00)
%10 = fmul double %7, %9
ret double %10
}
/* Variables and functions */
int test_footer();
int /*<<< orphan*/ test_header(char const *);
int do_test(const char *testname, void (*testfunc)(void)) {
  test_header(testname);
  testfunc();
  return test_footer();
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <test_header@plt>
call   *-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_footer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rbx
mov    %rsi,%rbx
call   1040 <test_header@plt>
call   *%rbx
xor    %eax,%eax
pop    %rbx
jmp    1030 <test_footer@plt>

LLVM IR (-O0):
define i32 @do_test(i8* %0, void ()* %1) {
%3 = alloca i8*
%4 = alloca void ()*
store i8* %0, i8** %3
store void ()* %1, void ()** %4
%5 = load i8*, i8** %3
%6 = call i32 @test_header(i8* %5)
%7 = load void ()*, void ()** %4
%8 = call i32 (...) @test_footer()
ret i32 %8
}

LLVM IR (-O2):
define i32 @do_test(i8* %0, void ()* nocapture %1) {
%3 = tail call i32 @test_header(i8* %0)
tail call void %1()
%4 = tail call i32 (...) @test_footer()
ret i32 %4
}
unsigned sha1DigestLen(void) { return 20; }


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

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

LLVM IR (-O0):
define i32 @sha1DigestLen() {
ret i32 20
}

LLVM IR (-O2):
define i32 @sha1DigestLen() {
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int str_isnumber(const char *p) {
  char *q = (char *)p;
  while (*q) {
    if (!isdigit(*q))
      return 0;
    q++;
  }
  return 1;
}


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

x86 assembly (clang, -O2):
<str_isnumber>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <str_isnumber+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <str_isnumber+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <str_isnumber+0x20>
jmp    114b <str_isnumber+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @str_isnumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Type definitions */
struct SocketBuffer {
  int dummy;
};

/* Variables and functions */
scalar_t__ buffRead(int, struct SocketBuffer *);
double readDouble(struct SocketBuffer *buff) {
  return (*(double *)buffRead(sizeof(double), buff));
}


x86 assembly (clang, -O0):
<readDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x8,%edi
call   1030 <buffRead@plt>
movsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readDouble>:
push   %rax
mov    %rdi,%rsi
mov    $0x8,%edi
call   1030 <buffRead@plt>
movsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.SocketBuffer = type { i32 }
define double @readDouble(%struct.SocketBuffer* %0) {
%2 = alloca %struct.SocketBuffer*
store %struct.SocketBuffer* %0, %struct.SocketBuffer** %2
%3 = load %struct.SocketBuffer*, %struct.SocketBuffer** %2
%4 = call i64 @buffRead(i32 8, %struct.SocketBuffer* %3)
%5 = inttoptr i64 %4 to double*
%6 = load double, double* %5
ret double %6
}

LLVM IR (-O2):
%struct.SocketBuffer = type { i32 }
define double @readDouble(%struct.SocketBuffer* %0) {
%2 = tail call i64 @buffRead(i32 8, %struct.SocketBuffer* %0)
%3 = inttoptr i64 %2 to double*
%4 = load double, double* %3
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ inv_host_serif_get_instance();
int inv_host_serif_write_reg(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/ const *, int /*<<< orphan*/);
int inv_host_serif_write_reg_i(uint8_t reg, const uint8_t *data, uint32_t len) {
  return inv_host_serif_write_reg(inv_host_serif_get_instance(), reg, data,
                                  len);
}


x86 assembly (clang, -O0):
<inv_host_serif_write_reg_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1040 <inv_host_serif_get_instance@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <inv_host_serif_write_reg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_host_serif_write_reg_i>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <inv_host_serif_get_instance@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <inv_host_serif_write_reg@plt>

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

LLVM IR (-O2):
define i32 @inv_host_serif_write_reg_i(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 (...) @inv_host_serif_get_instance()
%5 = tail call i32 @inv_host_serif_write_reg(i32 %4, i32 %0, i32* %1, i32 %2)
ret i32 %5
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *lastNode(struct node *);
int /*<<< orphan*/ quickSortRecur(struct node *, struct node *);
void quickSort(struct node *head) {
  if (head == NULL)
    return;
  struct node *last = lastNode(head);
  quickSortRecur(head, last);
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <quickSort+0x1c>
jmp    1156 <quickSort+0x36>
mov    -0x8(%rbp),%rdi
call   1030 <lastNode@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <quickSortRecur@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
test   %rdi,%rdi
je     113a <quickSort+0x1a>
push   %rbx
mov    %rdi,%rbx
call   1030 <lastNode@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <quickSortRecur@plt>
ret

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

LLVM IR (-O2):
%struct.node = type { i32 }
define void @quickSort(%struct.node* %0) {
%2 = icmp eq %struct.node* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call %struct.node* @lastNode(%struct.node* %0)
%5 = tail call i32 @quickSortRecur(%struct.node* %0, %struct.node* %4)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
char tolower(char);
int isletter(char c) {
  c = tolower(c);
  return ((c >= 'a') && (c <= 'z'));
}


x86 assembly (clang, -O0):
<isletter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jl     1149 <isletter+0x39>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isletter>:
push   %rax
call   1030 <tolower@plt>
add    $0x9f,%al
xor    %ecx,%ecx
cmp    $0x1a,%al
setb   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isletter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @tolower(i8 signext %3)
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 122
br label %12
12: ; preds = %8, %1
%13 = phi i1 [ false, %1 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isletter(i8 signext %0) {
%2 = tail call signext i8 @tolower(i8 signext %0)
%3 = add i8 %2, -97
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ commit_creds(int /*<<< orphan*/);
int /*<<< orphan*/ prepare_kernel_cred(int /*<<< orphan*/);
int payload(void) {
  commit_creds(prepare_kernel_cred(0));
  return 0;
}


x86 assembly (clang, -O0):
<payload>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <prepare_kernel_cred@plt>
mov    %eax,%edi
call   1040 <commit_creds@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<payload>:
push   %rax
xor    %edi,%edi
call   1030 <prepare_kernel_cred@plt>
mov    %eax,%edi
call   1040 <commit_creds@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @payload() {
%1 = call i32 @prepare_kernel_cred(i32 0)
%2 = call i32 @commit_creds(i32 %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @payload() {
%1 = tail call i32 @prepare_kernel_cred(i32 0)
%2 = tail call i32 @commit_creds(i32 %1)
ret i32 0
}
int foo(int x, int y) {
  return (x <= y) && ((unsigned int)x >= (unsigned int)y);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
jg     1127 <foo+0x27>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setae  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    %esi,%edi
setle  %al
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @foo(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 = icmp sle i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp uge i32 %9, %10
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ false, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = icmp uge i32 %0, %1
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void early_ioremap_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @early_ioremap_reset() {
ret void
}
/* Variables and functions */
int strlen(char *);
char *substring(char *, int, int);
char *suffix(char *pattern, int elementsFound) {
  if (pattern != NULL) {
    int length = strlen(pattern);
    return substring(pattern, elementsFound, length);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<suffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <suffix+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <substring@plt>
mov    %rax,-0x8(%rbp)
jmp    1166 <suffix+0x46>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suffix>:
test   %rdi,%rdi
je     1144 <suffix+0x24>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <substring@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @suffix(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i8* @substring(i8* %0, i32 %1, i32 %5)
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ null, %2 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ _dgr(double, double);
int _dleq(double a, double b) { return !_dgr(a, b); }


x86 assembly (clang, -O0):
<_dleq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <_dgr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dleq>:
push   %rax
call   1030 <_dgr@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_dleq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @_dgr(double %5, double %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_dleq(double %0, double %1) {
%3 = tail call i32 @_dgr(double %0, double %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
void serial_port_flush(int fd) { tcflush(fd, TCIOFLUSH); }


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

x86 assembly (clang, -O2):
<serial_port_flush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define void @serial_port_flush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TCIOFLUSH
%5 = call i32 @tcflush(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define void @serial_port_flush(i32 %0) {
%2 = load i32, i32* @TCIOFLUSH
%3 = tail call i32 @tcflush(i32 %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
__attribute__((visibility("hidden"))) void
osmo_conv_gen_vdec_free(int16_t *ptr) {
  free(ptr);
}


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

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

LLVM IR (-O2):
define hidden void @osmo_conv_gen_vdec_free(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
int f(int a, short b, char c, int d, short e, char f, int g, short h, char i) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %r8d,-0x24(%rbp)
mov    %ecx,%eax
mov    -0x24(%rbp),%ecx
mov    %eax,-0x20(%rbp)
mov    %edx,%eax
mov    -0x20(%rbp),%edx
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    -0x1c(%rbp),%esi
mov    %eax,-0x18(%rbp)
mov    %edi,%r8d
mov    -0x18(%rbp),%edi
mov    %r9b,%al
mov    0x20(%rbp),%r9b
mov    0x18(%rbp),%r9w
mov    0x10(%rbp),%r9d
mov    %r8d,-0x8(%rbp)
mov    %di,-0xa(%rbp)
mov    %sil,-0xb(%rbp)
mov    %edx,-0x10(%rbp)
mov    %cx,-0x12(%rbp)
mov    %al,-0x13(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0, i16 signext %1, i8 signext %2, i32 %3, i16 signext %4, i8 signext %5, i32 %6, i16 signext %7, i8 signext %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16
%13 = alloca i8
%14 = alloca i32
%15 = alloca i16
%16 = alloca i8
%17 = alloca i32
%18 = alloca i16
%19 = alloca i8
store i32 %0, i32* %11
store i16 %1, i16* %12
store i8 %2, i8* %13
store i32 %3, i32* %14
store i16 %4, i16* %15
store i8 %5, i8* %16
store i32 %6, i32* %17
store i16 %7, i16* %18
store i8 %8, i8* %19
%20 = load i32, i32* %10
ret i32 %20
}

LLVM IR (-O2):
define i32 @f(i32 %0, i16 signext %1, i8 signext %2, i32 %3, i16 signext %4, i8 signext %5, i32 %6, i16 signext %7, i8 signext %8) {
ret i32 undef
}
void kbase_rk_dvfs_disable(struct kbase_device *kbdev) {}


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

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

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

LLVM IR (-O2):
%struct.kbase_device = type opaque
define void @kbase_rk_dvfs_disable(%struct.kbase_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *ts_malloc_default(size_t size) {
  void *result = malloc(size);
  if (size > 0 && !result) {
    fprintf(stderr, "tree-sitter failed to allocate %zu bytes", size);
    exit(1);
  }
  return result;
}


x86 assembly (clang, -O0):
<ts_malloc_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    1182 <ts_malloc_default+0x52>
cmpq   $0x0,-0x10(%rbp)
jne    1182 <ts_malloc_default+0x52>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_malloc_default>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rbx,%rbx
je     1143 <ts_malloc_default+0x13>
test   %rax,%rax
je     1145 <ts_malloc_default+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"tree-sitter failed to allocate %zu bytes\00"
define i8* @ts_malloc_default(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = icmp ugt i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = load i32, i32* @stderr
%13 = load i64, i64* %2
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %8, %1
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"tree-sitter failed to allocate %zu bytes\00"
define noalias i8* @ts_malloc_default(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i64 %0, 0
%4 = icmp ne i8* %2, null
%5 = or i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t test16(void) { return L'\r'; }


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

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

LLVM IR (-O0):
define i32 @test16() {
ret i32 13
}

LLVM IR (-O2):
define i32 @test16() {
ret i32 13
}
/* Variables and functions */
int str_icmp(char const *, char const *);
int object_name_table_cmp(const void *a, const void *b) {
  const char *i = *((const char **)a);
  const char *j = *((const char **)b);
  return str_icmp(i, j);
}


x86 assembly (clang, -O0):
<object_name_table_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <str_icmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @object_name_table_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @str_icmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @object_name_table_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @str_icmp(i8* %4, i8* %6)
ret i32 %7
}
void XAutoRepeatOn() {}


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

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

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

LLVM IR (-O2):
define void @XAutoRepeatOn() {
ret void
}
/* Variables and functions */
double pow(double, double);
double linear_to_rgb(double c) {
  return c > 0.0031308 ? pow(c, 1.0 / 2.4) * 1.055 - 0.055 : c * 12.92;
}


x86 assembly (clang, -O0):
<linear_to_rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1168 <linear_to_rgb+0x58>
movsd  -0x8(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
call   1030 <pow@plt>
movsd  0xec2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebe(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    117a <linear_to_rgb+0x6a>
movsd  0xe98(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_to_rgb>:
push   %rax
ucomisd 0xee7(%rip),%xmm0
jbe    113a <linear_to_rgb+0x2a>
movsd  0xeed(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
pop    %rax
ret
mulsd  0xec6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @linear_to_rgb(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 3.130800e-03
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = call double @pow(double %6, double 0x3FDAAAAAAAAAAAAB)
%8 = call double @llvm.fmuladd.f64(double %7, double 1.055000e+00, double -5.500000e-02)
br label %12
9: ; preds = %1
%10 = load double, double* %2
%11 = fmul double %10, 1.292000e+01
br label %12
12: ; preds = %9, %5
%13 = phi double [ %8, %5 ], [ %11, %9 ]
ret double %13
}

LLVM IR (-O2):
define double @linear_to_rgb(double %0) {
%2 = fcmp ogt double %0, 3.130800e-03
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call double @pow(double %0, double 0x3FDAAAAAAAAAAAAB)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.055000e+00, double -5.500000e-02)
br label %8
6: ; preds = %1
%7 = fmul double %0, 1.292000e+01
br label %8
8: ; preds = %6, %3
%9 = phi double [ %5, %3 ], [ %7, %6 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, char const *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  const char *pname = getprogname();
  (void)fprintf(stderr,
                "Usage:\t%s [-T] [-d domain] [[-h] host]\n"
                "\t%s [-fTt] [-d domain] [-h host] -m [mapname]\n"
                "\t%s [-T] -x\n",
                pname, pname, pname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1030 <getprogname@plt>
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb8(%rip),%rsi
mov    %rax,%rdx
mov    %rax,%rcx
mov    %rax,%r8
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [98 x i8] c"Usage:\09%s [-T] [-d domain] [[-h] host]\0A\09%s [-fTt] [-d domain] [-h host] -m [mapname]\0A\09%s [-T] -x\0A\00"
define void @usage() {
%1 = alloca i8*
%2 = call i8* (...) @getprogname()
store i8* %2, i8** %1
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = load i8*, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [98 x i8] c"Usage:\09%s [-T] [-d domain] [[-h] host]\0A\09%s [-fTt] [-d domain] [-h host] -m [mapname]\0A\09%s [-T] -x\0A\00"
define void @usage() {
%1 = tail call i8* (...) @getprogname()
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %1, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void i2v_GENERAL_NAMES(void) {}


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

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

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

LLVM IR (-O2):
define void @i2v_GENERAL_NAMES() {
ret void
}
void av_stream_get_r_frame_rate() {}


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

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

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

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