xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
void *__xmalloc(size_t size, char *file, int line) { return malloc(size); }


x86 assembly (clang, -O0):
<__xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xmalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @__xmalloc(i64 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i8* @malloc(i64 %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *mymalloc(size_t n) {
  void *p;
  if ((p = malloc(n)) == (void *)0) {
    fprintf(stderr, "Virtual memory exhausted\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1176 <mymalloc+0x46>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <mymalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Virtual memory exhausted\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @mymalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Virtual memory exhausted\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @mymalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int getdtablesize();
int _rpc_dtablesize(void) {
  static int size;
  if (size == 0)
    size = getdtablesize();
  return size;
}


x86 assembly (clang, -O0):
<_rpc_dtablesize>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    112e <_rpc_dtablesize+0x1e>
mov    $0x0,%al
call   1030 <getdtablesize@plt>
mov    %eax,0x2efe(%rip)
mov    0x2ef8(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rpc_dtablesize>:
push   %rax
mov    0x2f15(%rip),%eax
test   %eax,%eax
je     111d <_rpc_dtablesize+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <getdtablesize@plt>
mov    %eax,0x2f02(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@_rpc_dtablesize.size = internal global i32 0
define i32 @_rpc_dtablesize() {
%1 = load i32, i32* @_rpc_dtablesize.size
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @getdtablesize()
store i32 %4, i32* @_rpc_dtablesize.size
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @_rpc_dtablesize.size
ret i32 %6
}

LLVM IR (-O2):
@_rpc_dtablesize.size = internal unnamed_addr global i32 0
define i32 @_rpc_dtablesize() {
%1 = load i32, i32* @_rpc_dtablesize.size
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @getdtablesize()
store i32 %4, i32* @_rpc_dtablesize.size
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
scalar_t__ sysconf(int /*<<< orphan*/);
int lmsc_get_page_size(void) {
  int s;
  s = (int)sysconf(_SC_PAGESIZE);
  if (s <= 0) {
    return s ? s : -1;
  }
  return s;
}


x86 assembly (clang, -O0):
<lmsc_get_page_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1160 <lmsc_get_page_size+0x50>
cmpl   $0x0,-0x8(%rbp)
je     1148 <lmsc_get_page_size+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <lmsc_get_page_size+0x45>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <lmsc_get_page_size+0x45>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <lmsc_get_page_size+0x56>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmsc_get_page_size>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
cmp    $0x1,%eax
sbb    %ecx,%ecx
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i32 @lmsc_get_page_size() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @_SC_PAGESIZE
%4 = call i64 @sysconf(i32 %3)
%5 = trunc i64 %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = load i32, i32* %2
br label %14
13: ; preds = %8
br label %14
14: ; preds = %13, %11
%15 = phi i32 [ %12, %11 ], [ -1, %13 ]
store i32 %15, i32* %1
br label %18
16: ; preds = %0
%17 = load i32, i32* %2
store i32 %17, i32* %1
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i32 @lmsc_get_page_size() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = tail call i64 @sysconf(i32 %1)
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -1, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ puts(char *);
void screen_print_int(int i, int base) {
  char buf[(14)];
  itoa(i, buf, base);
  puts(buf);
}


x86 assembly (clang, -O0):
<screen_print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x16(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1040 <itoa@plt>
lea    -0x16(%rbp),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_print_int>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%edx
lea    0x2(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <itoa@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @screen_print_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [14 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds [14 x i8], [14 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %4
%9 = call i32 @itoa(i32 %6, i8* %7, i32 %8)
%10 = getelementptr inbounds [14 x i8], [14 x i8]* %5, i64 0, i64 0
%11 = call i32 @puts(i8* %10)
ret void
}

LLVM IR (-O2):
define void @screen_print_int(i32 %0, i32 %1) {
%3 = alloca [14 x i8]
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%5 = call i32 @itoa(i32 %0, i8* %4, i32 %1)
%6 = call i32 @puts(i8* %4)
ret void
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double INFINITY;
double opr_inf(struct lifo *stack) { return INFINITY; }


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

x86 assembly (clang, -O2):
<opr_inf>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
%struct.lifo = type { i32 }
@INFINITY = global double 0.000000e+00
define double @opr_inf(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
store %struct.lifo* %0, %struct.lifo** %2
%3 = load double, double* @INFINITY
ret double %3
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
@INFINITY = global double 0.000000e+00
define double @opr_inf(%struct.lifo* nocapture readnone %0) {
%2 = load double, double* @INFINITY
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void usage() { printf("usage: jcontrol host [portnum (def=%d)]\n", 10500); }


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

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
mov    $0x2904,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"usage: jcontrol host [portnum (def=%d)]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 10500)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"usage: jcontrol host [portnum (def=%d)]\0A\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 10500)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[50];
  a[0] = 3;
  printf("%d", a[0]);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void copy_element(void *dest, const void *src, int size_elt) {
  memcpy(dest, src, size_elt);
}


x86 assembly (clang, -O0):
<copy_element>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_element>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @copy_element(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(int times) {
  while (times > 0) {
    printf("hello, world\n");
    times--;
  }
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113f <hello+0x2f>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <hello+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1140 <hello+0x30>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <hello+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define void @hello(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = add nsw i32 %4, -1
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) { fprintf(stderr, "server: [-p port] [-h] [-u]\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"server: [-p port] [-h] [-u]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"server: [-p port] [-h] [-u]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void goodbye(void) { printf("Goodbye\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"Goodbye\00"
define void @goodbye() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_F5int8_mem(signed char *val) {
  return ((*val) & (-0xF5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F5int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff0b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F5int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -245
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\aStartled by the sudden sound, Sally shouted, \"By the Great "
         "Pumpkin, what was that!\"\n");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [86 x i8] c"\07Startled by the sudden sound, Sally shouted, \22By the Great Pumpkin, what was that!\22\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [85 x i8] c"\07Startled by the sudden sound, Sally shouted, \22By the Great Pumpkin, what was that!\22\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
int main() {
  int key = 0;
  pthread_t a = pthread_self();
  printf("Thread = %ld\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Thread = %ld\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @pthread_self()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add_test();
int /*<<< orphan*/ b_cond_test();
int /*<<< orphan*/ cmp_test();
void initial_instruction_test(void) {
  b_cond_test();
  cmp_test();
  add_test();
}


x86 assembly (clang, -O0):
<initial_instruction_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <b_cond_test@plt>
mov    $0x0,%al
call   1040 <cmp_test@plt>
mov    $0x0,%al
call   1050 <add_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initial_instruction_test>:
push   %rax
xor    %eax,%eax
call   1030 <b_cond_test@plt>
xor    %eax,%eax
call   1040 <cmp_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <add_test@plt>

LLVM IR (-O0):
define void @initial_instruction_test() {
%1 = call i32 (...) @b_cond_test()
%2 = call i32 (...) @cmp_test()
%3 = call i32 (...) @add_test()
ret void
}

LLVM IR (-O2):
define void @initial_instruction_test() {
%1 = tail call i32 (...) @b_cond_test()
%2 = tail call i32 (...) @cmp_test()
%3 = tail call i32 (...) @add_test()
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int connect(int, struct sockaddr const *, int /*<<< orphan*/);
int plat_connect(int s, const struct sockaddr *serv_addr, socklen_t addrlen) {
  return (connect(s, serv_addr, addrlen));
}


x86 assembly (clang, -O0):
<plat_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <connect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plat_connect>:
jmp    1030 <connect@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @plat_connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32, i32* %6
%10 = call i32 @connect(i32 %7, %struct.sockaddr* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @plat_connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @connect(i32 %0, %struct.sockaddr* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct fd_set {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __DARWIN_FD_ZERO(struct fd_set *);
void qs_fd_zero(struct fd_set *set) { __DARWIN_FD_ZERO(set); }


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

x86 assembly (clang, -O2):
<qs_fd_zero>:
jmp    1030 <__DARWIN_FD_ZERO@plt>

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

LLVM IR (-O2):
%struct.fd_set = type { i32 }
define void @qs_fd_zero(%struct.fd_set* %0) {
%2 = tail call i32 @__DARWIN_FD_ZERO(%struct.fd_set* %0)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
double _timespec_to_double(struct timespec const *);
double _timespec_diff_to_double(const struct timespec *__restrict ts1,
                                const struct timespec *__restrict ts2) {
  return _timespec_to_double(ts1) - _timespec_to_double(ts2);
}


x86 assembly (clang, -O0):
<_timespec_diff_to_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_timespec_to_double@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_timespec_to_double@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_timespec_diff_to_double>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <_timespec_to_double@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <_timespec_to_double@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define double @_timespec_diff_to_double(%struct.timespec* noalias %0, %struct.timespec* noalias %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = call double @_timespec_to_double(%struct.timespec* %5)
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call double @_timespec_to_double(%struct.timespec* %7)
%9 = fsub double %6, %8
ret double %9
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define double @_timespec_diff_to_double(%struct.timespec* noalias %0, %struct.timespec* noalias %1) {
%3 = tail call double @_timespec_to_double(%struct.timespec* %0)
%4 = tail call double @_timespec_to_double(%struct.timespec* %1)
%5 = fsub double %3, %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ aesni_inverse_key(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                     int);
int /*<<< orphan*/ aesni_setkey_enc_128(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ const *);
void aeshw_setkey_dec(uint8_t *rk, const uint8_t *key) {
  uint8_t rk_tmp[272];
  aesni_setkey_enc_128(rk_tmp, key);
  aesni_inverse_key(rk, rk_tmp, ((128 >> 5) + 6));
}


x86 assembly (clang, -O0):
<aeshw_setkey_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x450(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <aesni_setkey_enc_128@plt>
mov    -0x8(%rbp),%rdi
lea    -0x450(%rbp),%rsi
mov    $0xa,%edx
call   1030 <aesni_inverse_key@plt>
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeshw_setkey_dec>:
push   %r14
push   %rbx
sub    $0x448,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <aesni_setkey_enc_128@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1030 <aesni_inverse_key@plt>
add    $0x448,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @aeshw_setkey_dec(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [272 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = getelementptr inbounds [272 x i32], [272 x i32]* %5, i64 0, i64 0
%7 = load i32*, i32** %4
%8 = call i32 @aesni_setkey_enc_128(i32* %6, i32* %7)
%9 = load i32*, i32** %3
%10 = getelementptr inbounds [272 x i32], [272 x i32]* %5, i64 0, i64 0
%11 = call i32 @aesni_inverse_key(i32* %9, i32* %10, i32 10)
ret void
}

LLVM IR (-O2):
define void @aeshw_setkey_dec(i32* %0, i32* %1) {
%3 = alloca [272 x i32]
%4 = bitcast [272 x i32]* %3 to i8*
%5 = getelementptr inbounds [272 x i32], [272 x i32]* %3, i64 0, i64 0
%6 = call i32 @aesni_setkey_enc_128(i32* %5, i32* %1)
%7 = call i32 @aesni_inverse_key(i32* %0, i32* %5, i32 10)
ret void
}
/* Variables and functions */
scalar_t__ dcac_acl_ops(int, int, int, char const *, char const *);
int dcac_set_file_rdacl(const char *file, const char *acl) {
  return (int)dcac_acl_ops(25, -1, -1, acl, file);
}


x86 assembly (clang, -O0):
<dcac_set_file_rdacl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    $0x19,%edi
mov    $0xffffffff,%edx
mov    %edx,%esi
call   1030 <dcac_acl_ops@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcac_set_file_rdacl>:
mov    %rsi,%rcx
mov    %rdi,%r8
mov    $0x19,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
jmp    1030 <dcac_acl_ops@plt>

LLVM IR (-O0):
define i32 @dcac_set_file_rdacl(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @dcac_acl_ops(i32 25, i32 -1, i32 -1, i8* %5, i8* %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @dcac_set_file_rdacl(i8* %0, i8* %1) {
%3 = tail call i64 @dcac_acl_ops(i32 25, i32 -1, i32 -1, i8* %1, i8* %0)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int islower(int c) {
  unsigned char x = c & 0xff;
  return (x >= 'a' && x <= 'z') || (x >= 223 && x != 247);
}


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1131 <islower+0x31>
movzbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x6(%rbp)
jle    115b <islower+0x5b>
movzbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0xdf,%ecx
mov    %al,-0x7(%rbp)
jl     1155 <islower+0x55>
movzbl -0x5(%rbp),%eax
cmp    $0xf7,%eax
setne  %al
mov    %al,-0x7(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
movzbl %dil,%eax
lea    -0x61(%rax),%ecx
cmp    $0x1a,%ecx
setb   %cl
cmp    $0xdf,%eax
setae  %dl
cmp    $0xf7,%eax
setne  %al
and    %dl,%al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @islower(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = icmp sge i32 %8, 97
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = icmp sle i32 %12, 122
br i1 %13, label %24, label %14
14: ; preds = %10, %1
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = icmp sge i32 %16, 223
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = icmp ne i32 %20, 247
br label %22
22: ; preds = %18, %14
%23 = phi i1 [ false, %14 ], [ %21, %18 ]
br label %24
24: ; preds = %22, %10
%25 = phi i1 [ true, %10 ], [ %23, %22 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = and i32 %0, 255
%3 = add nsw i32 %2, -97
%4 = icmp ult i32 %3, 26
%5 = icmp ugt i32 %2, 222
%6 = icmp ne i32 %2, 247
%7 = and i1 %5, %6
%8 = or i1 %4, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t fixmul24(int32_t x, int32_t y) {
  int64_t temp;
  temp = x;
  temp *= y;
  temp >>= 24;
  return (int32_t)temp;
}


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

x86 assembly (clang, -O2):
<fixmul24>:
mov    %edi,%eax
imul   %esi,%eax
sar    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @fixmul24(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, %7
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = ashr i32 %10, 24
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @fixmul24(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = ashr i32 %3, 24
ret i32 %4
}
/* Variables and functions */
int sqrt(int);
double JHKeyframeAnimationFunctionEaseInCirc(double t, double b, double c,
                                             double d) {
  return -c * (sqrt(1 - (t /= d) * t) - 1) + b;
}


x86 assembly (clang, -O0):
<JHKeyframeAnimationFunctionEaseInCirc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe78(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movsd  -0x28(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2sd %eax,%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JHKeyframeAnimationFunctionEaseInCirc>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
divsd  %xmm3,%xmm0
mulsd  %xmm0,%xmm0
movsd  0xed0(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @JHKeyframeAnimationFunctionEaseInCirc(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = fneg double %9
%11 = load double, double* %8
%12 = load double, double* %5
%13 = fdiv double %12, %11
store double %13, double* %5
%14 = load double, double* %5
%15 = fneg double %13
%16 = call double @llvm.fmuladd.f64(double %15, double %14, double 1.000000e+00)
%17 = fptosi double %16 to i32
%18 = call i32 @sqrt(i32 %17)
%19 = sub nsw i32 %18, 1
%20 = sitofp i32 %19 to double
%21 = load double, double* %6
%22 = call double @llvm.fmuladd.f64(double %10, double %20, double %21)
ret double %22
}

LLVM IR (-O2):
define double @JHKeyframeAnimationFunctionEaseInCirc(double %0, double %1, double %2, double %3) {
%5 = fneg double %2
%6 = fdiv double %0, %3
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double %6, double 1.000000e+00)
%9 = fptosi double %8 to i32
%10 = tail call i32 @sqrt(i32 %9)
%11 = add nsw i32 %10, -1
%12 = sitofp i32 %11 to double
%13 = tail call double @llvm.fmuladd.f64(double %5, double %12, double %1)
ret double %13
}
int test_imm_AEuint16_mem(unsigned short *val) {
  return ((*val) & (0xAE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_AEuint16_mem>:
testb  $0xae,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_AEuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 174
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void glDeleteVertexArrays(int n, const unsigned int *arrays) {}


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

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

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

LLVM IR (-O2):
define void @glDeleteVertexArrays(i32 %0, i32* nocapture %1) {
ret void
}
/* Type definitions */
struct dict {
  int dummy;
};

/* Variables and functions */
int dict_ihas(struct dict *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int dict_has(struct dict *dict, char *key) {
  return dict_ihas(dict, key, strlen(key));
}


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

x86 assembly (clang, -O2):
<dict_has>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dict_ihas@plt>

LLVM IR (-O0):
%struct.dict = type { i32 }
define i32 @dict_has(%struct.dict* %0, i8* %1) {
%3 = alloca %struct.dict*
%4 = alloca i8*
store %struct.dict* %0, %struct.dict** %3
store i8* %1, i8** %4
%5 = load %struct.dict*, %struct.dict** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @dict_ihas(%struct.dict* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.dict = type { i32 }
define i32 @dict_has(%struct.dict* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @dict_ihas(%struct.dict* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ isxdigit(char);
int valid_uuid(char *uuid) {
  int cnt;
  for (cnt = 0; *uuid; uuid++)
    if (isxdigit(*uuid))
      cnt++;
  return cnt == 32;
}


x86 assembly (clang, -O0):
<valid_uuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1165 <valid_uuid+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
je     114f <valid_uuid+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <valid_uuid+0x44>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <valid_uuid+0x13>
cmpl   $0x20,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_uuid>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1154 <valid_uuid+0x44>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isxdigit@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <valid_uuid+0x20>
xor    %eax,%eax
cmp    $0x20,%ebp
sete   %al
jmp    1156 <valid_uuid+0x46>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @valid_uuid(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = tail call i64 @isxdigit(i8 signext %5)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = icmp eq i32 %11, 32
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %15, %1
%19 = phi i32 [ 0, %1 ], [ %17, %15 ]
ret i32 %19
}
/* Variables and functions */
unsigned long roundup_pow_of_two(unsigned long);
int is_power_of_2(unsigned long n) { return (n == roundup_pow_of_two(n)); }


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <roundup_pow_of_two@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <roundup_pow_of_two@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_power_of_2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @roundup_pow_of_two(i64 %4)
%6 = icmp eq i64 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_power_of_2(i64 %0) {
%2 = tail call i64 @roundup_pow_of_two(i64 %0)
%3 = icmp eq i64 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
void ui_statusline_release() {}


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

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

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

LLVM IR (-O2):
define void @ui_statusline_release() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;
typedef int /*<<< orphan*/ EC_KEY;

/* Variables and functions */
int /*<<< orphan*/ *ec_key_new_method_int(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ *);
EC_KEY *EC_KEY_new_method(ENGINE *engine) {
  return ec_key_new_method_int(NULL, engine);
}


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

x86 assembly (clang, -O2):
<EC_KEY_new_method>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <ec_key_new_method_int@plt>

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

LLVM IR (-O2):
define i32* @EC_KEY_new_method(i32* %0) {
%2 = tail call i32* @ec_key_new_method_int(i32* null, i32* %0)
ret i32* %2
}
/* Variables and functions */
int rand();
int dice_roll_numeric(int num, int faces, int bias) {
  int val = 0;
  while (num--) {
    val += (rand() % faces) + 1;
  }
  val += bias;
  return val;
}


x86 assembly (clang, -O0):
<dice_roll_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1157 <dice_roll_numeric+0x47>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <dice_roll_numeric+0x18>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dice_roll_numeric>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
test   %edi,%edi
je     1147 <dice_roll_numeric+0x37>
mov    %esi,%r15d
mov    %edi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %r15d
add    %edx,%ebx
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1130 <dice_roll_numeric+0x20>
jmp    1149 <dice_roll_numeric+0x39>
xor    %ebx,%ebx
add    %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dice_roll_numeric(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %12, %5 ], [ 0, %3 ]
%7 = phi i32 [ %8, %5 ], [ %0, %3 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, %1
%11 = add i32 %6, 1
%12 = add i32 %11, %10
%13 = icmp eq i32 %8, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %3
%15 = phi i32 [ 0, %3 ], [ %12, %5 ]
%16 = add nsw i32 %15, %2
ret i32 %16
}
/* Variables and functions */
int validateChoice(unsigned int *, char const *, char const **);
int validateFlag(unsigned int *value, const char *string, const char *on,
                 const char *off) {
  const char *choices[] = {off, on, NULL};
  return validateChoice(value, string, choices);
}


x86 assembly (clang, -O0):
<validateFlag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <validateChoice@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validateFlag>:
sub    $0x18,%rsp
mov    %rcx,(%rsp)
mov    %rdx,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rdx
call   1030 <validateChoice@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @validateFlag(i32* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [3 x i8*]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [3 x i8*], [3 x i8*]* %9, i64 0, i64 0
%11 = load i8*, i8** %8
store i8* %11, i8** %10
%12 = getelementptr inbounds i8*, i8** %10, i64 1
%13 = load i8*, i8** %7
store i8* %13, i8** %12
%14 = getelementptr inbounds i8*, i8** %12, i64 1
store i8* null, i8** %14
%15 = load i32*, i32** %5
%16 = load i8*, i8** %6
%17 = getelementptr inbounds [3 x i8*], [3 x i8*]* %9, i64 0, i64 0
%18 = call i32 @validateChoice(i32* %15, i8* %16, i8** %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @validateFlag(i32* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [3 x i8*]
%6 = bitcast [3 x i8*]* %5 to i8*
%7 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 0
store i8* %3, i8** %7
%8 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 1
store i8* %2, i8** %8
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 2
store i8* null, i8** %9
%10 = call i32 @validateChoice(i32* %0, i8* %1, i8** %7)
ret i32 %10
}
/* Type definitions */
struct request_queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ blk_cleanup_queue(struct request_queue *);
void scsi_free_queue(struct request_queue *q) {
  {
    blk_cleanup_queue(q);
    return;
  }
}


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

x86 assembly (clang, -O2):
<scsi_free_queue>:
jmp    1030 <blk_cleanup_queue@plt>

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

LLVM IR (-O2):
%struct.request_queue = type { i32 }
define void @scsi_free_queue(%struct.request_queue* %0) {
%2 = tail call i32 @blk_cleanup_queue(%struct.request_queue* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char const *);
void usage(const char *filepath) {
  error(1, 0, "Usage: %s [-tv] [-p port]", filepath);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%edi
xor    %esi,%esi
lea    0xed2(%rip),%rdx
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <error@plt>

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

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: %s [-tv] [-p port]\00"
define void @usage(i8* %0) {
%2 = tail call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}