xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cvtsi128_si64(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_srli_si128(int /*<<< orphan*/, int);
int64_t hsum_epi64_si64(__m128i v_q) {
  v_q = _mm_add_epi64(v_q, _mm_srli_si128(v_q, 8));
  return _mm_cvtsi128_si64(v_q);
}


x86 assembly (clang, -O0):
<hsum_epi64_si64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1040 <_mm_srli_si128@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1050 <_mm_add_epi64@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_mm_cvtsi128_si64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hsum_epi64_si64>:
push   %rbx
mov    %edi,%ebx
mov    $0x8,%esi
call   1040 <_mm_srli_si128@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <_mm_add_epi64@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <_mm_cvtsi128_si64@plt>

LLVM IR (-O0):
define i32 @hsum_epi64_si64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_mm_srli_si128(i32 %4, i32 8)
%6 = call i32 @_mm_add_epi64(i32 %3, i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @_mm_cvtsi128_si64(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @hsum_epi64_si64(i32 %0) {
%2 = tail call i32 @_mm_srli_si128(i32 %0, i32 8)
%3 = tail call i32 @_mm_add_epi64(i32 %0, i32 %2)
%4 = tail call i32 @_mm_cvtsi128_si64(i32 %3)
ret i32 %4
}
int intcomp(const void *a, const void *b) {
  int aa = *(int *)a, bb = *(int *)b;
  return aa < bb ? -1 : (aa == bb ? 0 : 1);
}


x86 assembly (clang, -O0):
<intcomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1137 <intcomp+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <intcomp+0x4c>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcomp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @intcomp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = icmp eq i32 %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 0, i32 1
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ -1, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @intcomp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void alter_somevalue() {
  extern int somevalue;
  somevalue = 15;
}


x86 assembly (clang, -O0):
<alter_somevalue>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
movl   $0xf,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<alter_somevalue>:
mov    0x2ed1(%rip),%rax
movl   $0xf,(%rax)
ret

LLVM IR (-O0):
@somevalue = external global i32
define void @alter_somevalue() {
store i32 15, i32* @somevalue
ret void
}

LLVM IR (-O2):
@somevalue = external global i32
define void @alter_somevalue() {
store i32 15, i32* @somevalue
ret void
}
float fahr2cels(float fahr) { return (5.0 / 9.0) * (fahr - 32.0); }


x86 assembly (clang, -O0):
<fahr2cels>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr2cels>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahr2cels(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @fahr2cels(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ thread_func();
unsigned int thread_func_win(void *m) {
  thread_func();
  return 0;
}


x86 assembly (clang, -O0):
<thread_func_win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <thread_func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @thread_func_win(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @thread_func()
ret i32 0
}

LLVM IR (-O2):
define i32 @thread_func_win(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @thread_func()
ret i32 0
}
unsigned char exynos_get_ch(unsigned char *frm) { return frm[8]; }


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

x86 assembly (clang, -O2):
<exynos_get_ch>:
mov    0x8(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @exynos_get_ch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 8
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @exynos_get_ch(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = load i8, i8* %2
ret i8 %3
}
unsigned long long int unsignedlonglongint_id(unsigned long long int x) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlonglongint_id>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @unsignedlonglongint_id(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int read(int, char *, int);
int readSerial(int s, char *buf, int size) {
  int retval;
  retval = read(s, buf, size);
  if (retval < 0)
    retval = 0;
  return retval;
}


x86 assembly (clang, -O0):
<readSerial>:
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 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1145 <readSerial+0x35>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readSerial>:
push   %rax
call   1030 <read@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @readSerial(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp sgt i32 %4, 0
%6 = select i1 %5, i32 %4, i32 0
ret i32 %6
}
__attribute__((no_icf)) _Bool f7(char *s) {
  void foo_f7(char *);
  char *t1 = __builtin_strstr(s, "hello");
  foo_f7(t1);
  return (t1 == s);
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <foo_f7@plt>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <foo_f7@plt>
cmp    %r14,%rbx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define zeroext i1 @f7(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = icmp eq i8* %7, %8
ret i1 %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define zeroext i1 @f7(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
tail call void @foo_f7(i8* %2)
%3 = icmp eq i8* %2, %0
ret i1 %3
}
/* Variables and functions */
int inotifytools_str_to_event_sep(char const *, char);
int inotifytools_str_to_event(char const *event) {
  return inotifytools_str_to_event_sep(event, ',');
}


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

x86 assembly (clang, -O2):
<inotifytools_str_to_event>:
mov    $0x2c,%esi
jmp    1030 <inotifytools_str_to_event_sep@plt>

LLVM IR (-O0):
define i32 @inotifytools_str_to_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @inotifytools_str_to_event_sep(i8* %3, i8 signext 44)
ret i32 %4
}

LLVM IR (-O2):
define i32 @inotifytools_str_to_event(i8* %0) {
%2 = tail call i32 @inotifytools_str_to_event_sep(i8* %0, i8 signext 44)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sgen(char *, char *, char *);
void cgldgw(char *s) { sgen("%s\t%s,%%eax", "movl", s); }


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

x86 assembly (clang, -O2):
<cgldgw>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <sgen@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%s\09%s,%%eax\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgldgw(i8* %0) {
%2 = tail call i32 @sgen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void do_swapptr(void **tmpa, void **tmpb) {
  void *swapptr = (void *)0;
  swapptr = *tmpa;
  *tmpa = *tmpb;
  *tmpb = swapptr;
  return;
}


x86 assembly (clang, -O0):
<do_swapptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_swapptr>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @do_swapptr(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
store i8* null, i8** %5
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @do_swapptr(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
void RTCircBufDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTCircBufDestroy() {
ret void
}
/* Variables and functions */
int socknonblock(int);
int tcpnonblock(int sock) { return socknonblock(sock); }


x86 assembly (clang, -O0):
<tcpnonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <socknonblock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpnonblock>:
jmp    1030 <socknonblock@plt>

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

LLVM IR (-O2):
define i32 @tcpnonblock(i32 %0) {
%2 = tail call i32 @socknonblock(i32 %0)
ret i32 %2
}
void doInput() {
  extern void read_script_event();
  read_script_event();
}


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

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

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

LLVM IR (-O2):
define void @doInput() {
tail call void (...) @read_script_event()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putenv(char *);
void CleanEnvironment(char *envp[]) {
  envp[0] = NULL;
  putenv("PATH=/bin:/usr/bin:/sbin:/usr/sbin");
}


x86 assembly (clang, -O0):
<CleanEnvironment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
lea    0xed2(%rip),%rdi
call   1030 <putenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CleanEnvironment>:
movq   $0x0,(%rdi)
lea    0xee2(%rip),%rdi
jmp    1030 <putenv@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"PATH=/bin:/usr/bin:/sbin:/usr/sbin\00"
define void @CleanEnvironment(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
store i8* null, i8** %4
%5 = call i32 @putenv(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"PATH=/bin:/usr/bin:/sbin:/usr/sbin\00"
define void @CleanEnvironment(i8** nocapture writeonly %0) {
store i8* null, i8** %0
%2 = tail call i32 @putenv(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
int LittleEndian() {
  int endianTester = 1;
  char *endianChar = 0;
  endianChar = (char *)&endianTester;
  if (*endianChar)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<LittleEndian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1134 <LittleEndian+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <LittleEndian+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @LittleEndian() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 1, i32* %2
store i8* null, i8** %3
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @LittleEndian() {
ret i32 1
}
/* Variables and functions */
int errno;
void __set_errno(int err) { errno = err; }


x86 assembly (clang, -O0):
<__set_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_errno>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
ret

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

LLVM IR (-O2):
@errno = global i32 0
define void @__set_errno(i32 %0) {
store i32 %0, i32* @errno
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display();
int /*<<< orphan*/ find(int);
int /*<<< orphan*/ init();
int main() {
  init();
  display();
  find(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <display@plt>
mov    $0x1,%edi
call   1050 <find@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @display()
%3 = tail call i32 @find(i32 1)
ret i32 0
}
int test_imm_ECuint32_reg(unsigned int val) {
  return ((val) & (0xEC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ECuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xec,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_ECuint32_reg(i32 %0) {
%2 = and i32 %0, 236
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ TestEmbedChars();
int /*<<< orphan*/ TestEmbedString();
int /*<<< orphan*/ TestFiles();
int /*<<< orphan*/ printf(char *);
int main() {
  TestEmbedChars();
  printf("\n");
  TestEmbedString();
  printf("\n");
  TestFiles();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <TestEmbedChars@plt>
lea    0xea3(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <TestEmbedString@plt>
lea    0xe90(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <TestFiles@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <TestEmbedChars@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <TestEmbedString@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <TestFiles@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @TestEmbedChars()
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (...) @TestEmbedString()
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (...) @TestFiles()
ret i32 0
}
void RTAvlPVRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlPVRemove() {
ret void
}
int test_imm_78int8_reg(signed char val) {
  return ((val) & (0x78 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_78int8_reg(i8 signext %0) {
%2 = and i8 %0, 120
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void MpdEject() {}


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

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

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

LLVM IR (-O2):
define void @MpdEject() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vprintf(char *, char *, int, int, int *, int /*<<< orphan*/);
void print(char *form, int a, int b, int c) {
  vprintf((char *)-1, form, a, b, &c, 0);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0xffffffffffffffff,%rdi
lea    -0x14(%rbp),%r8
xor    %r9d,%r9d
call   1030 <vprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rax
mov    %edx,%eax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %ecx,0x4(%rsp)
lea    0x4(%rsp),%r8
mov    $0xffffffffffffffff,%rdi
mov    %eax,%ecx
xor    %r9d,%r9d
call   1030 <vprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @print(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @vprintf(i8* inttoptr (i64 -1 to i8*), i8* %9, i32 %10, i32 %11, i32* %8, i32 0)
ret void
}

LLVM IR (-O2):
define void @print(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
store i32 %3, i32* %5
%6 = call i32 @vprintf(i8* inttoptr (i64 -1 to i8*), i8* %0, i32 %1, i32 %2, i32* %5, i32 0)
ret void
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glCallList(int);
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glFlush();
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glCallList(1);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x1,%edi
call   1050 <glCallList@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x1,%edi
call   1050 <glCallList@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 @glCallList(i32 1)
%6 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 @glCallList(i32 1)
%6 = tail call i32 (...) @glFlush()
ret void
}
int get_brick_color(char brick_type) {
  switch (brick_type) {
  case 'i':
    return 13;
  case 'j':
    return 15;
  case 'l':
    return 11;
  case 'o':
    return 16;
  case 's':
    return 10;
  case 't':
    return 14;
  default:
    return 12;
  }
}


x86 assembly (clang, -O0):
<get_brick_color>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffff97,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xb,%eax
ja     117c <get_brick_color+0x7c>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xd,-0x4(%rbp)
jmp    1183 <get_brick_color+0x83>
movl   $0xf,-0x4(%rbp)
jmp    1183 <get_brick_color+0x83>
movl   $0xb,-0x4(%rbp)
jmp    1183 <get_brick_color+0x83>
movl   $0x10,-0x4(%rbp)
jmp    1183 <get_brick_color+0x83>
movl   $0xa,-0x4(%rbp)
jmp    1183 <get_brick_color+0x83>
movl   $0xe,-0x4(%rbp)
jmp    1183 <get_brick_color+0x83>
movl   $0xc,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_brick_color>:
add    $0xffffff97,%edi
mov    $0xc,%eax
cmp    $0xb,%edi
ja     111a <get_brick_color+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @get_brick_color(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 105, label %6
i32 106, label %7
i32 108, label %8
i32 111, label %9
i32 115, label %10
i32 116, label %11
]
6: ; preds = %1
store i32 13, i32* %2
br label %13
7: ; preds = %1
store i32 15, i32* %2
br label %13
8: ; preds = %1
store i32 11, i32* %2
br label %13
9: ; preds = %1
store i32 16, i32* %2
br label %13
10: ; preds = %1
store i32 10, i32* %2
br label %13
11: ; preds = %1
store i32 14, i32* %2
br label %13
12: ; preds = %1
store i32 12, i32* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@switch.table.get_brick_color = [12 x i32] [i32 13, i32 15, i32 12, i32 11, i32 12, i32 12, i32 16, i32 12, i32 12, i32 12, i32 10, i32 14]
define i32 @get_brick_color(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -105
%4 = icmp ult i32 %3, 12
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [12 x i32], [12 x i32]* @switch.table.get_brick_color, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 12, %1 ]
ret i32 %10
}
/* Type definitions */
struct sip_msg {
  int dummy;
};
struct fis_param {
  int dummy;
};

/* Variables and functions */
int ops_check_avp(struct sip_msg *, struct fis_param *, struct fis_param *);
int w_check_avps(struct sip_msg *msg, char *param, char *check) {
  return ops_check_avp(msg, (struct fis_param *)param,
                       (struct fis_param *)check);
}


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

x86 assembly (clang, -O2):
<w_check_avps>:
jmp    1030 <ops_check_avp@plt>

LLVM IR (-O0):
%struct.sip_msg = type { i32 }
%struct.fis_param = type { i32 }
define i32 @w_check_avps(%struct.sip_msg* %0, i8* %1, i8* %2) {
%4 = alloca %struct.sip_msg*
%5 = alloca i8*
%6 = alloca i8*
store %struct.sip_msg* %0, %struct.sip_msg** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.sip_msg*, %struct.sip_msg** %4
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to %struct.fis_param*
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to %struct.fis_param*
%12 = call i32 @ops_check_avp(%struct.sip_msg* %7, %struct.fis_param* %9, %struct.fis_param* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.sip_msg = type { i32 }
%struct.fis_param = type { i32 }
define i32 @w_check_avps(%struct.sip_msg* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %1 to %struct.fis_param*
%5 = bitcast i8* %2 to %struct.fis_param*
%6 = tail call i32 @ops_check_avp(%struct.sip_msg* %0, %struct.fis_param* %4, %struct.fis_param* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ListAddFirstElement(int);
int /*<<< orphan*/ ListInit();
int /*<<< orphan*/ ListPrint();
int /*<<< orphan*/ printf(char *);
int main() {
  ListInit();
  ListAddFirstElement(80085);
  ListAddFirstElement(123);
  ListPrint();
  printf("Hello World!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <ListInit@plt>
mov    $0x138d5,%edi
call   1040 <ListAddFirstElement@plt>
mov    $0x7b,%edi
call   1040 <ListAddFirstElement@plt>
mov    $0x0,%al
call   1060 <ListPrint@plt>
lea    0xe88(%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   1050 <ListInit@plt>
mov    $0x138d5,%edi
call   1040 <ListAddFirstElement@plt>
mov    $0x7b,%edi
call   1040 <ListAddFirstElement@plt>
xor    %eax,%eax
call   1060 <ListPrint@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @ListInit()
%3 = call i32 @ListAddFirstElement(i32 80085)
%4 = call i32 @ListAddFirstElement(i32 123)
%5 = call i32 (...) @ListPrint()
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 (...) @ListInit()
%2 = tail call i32 @ListAddFirstElement(i32 80085)
%3 = tail call i32 @ListAddFirstElement(i32 123)
%4 = tail call i32 (...) @ListPrint()
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int swap16(int);
uint32_t swap32(uint32_t value) {
  uint32_t hi = swap16(value >> 16);
  uint32_t lo = swap16(value & 0xffff);
  return (lo << 16) | hi;
}


x86 assembly (clang, -O0):
<swap32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
call   1030 <swap16@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
call   1030 <swap16@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap32>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
sar    $0x10,%edi
call   1030 <swap16@plt>
mov    %eax,%ebp
movzwl %bx,%edi
call   1030 <swap16@plt>
shl    $0x10,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @swap32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 16
%7 = call i32 @swap16(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = and i32 %8, 65535
%10 = call i32 @swap16(i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = shl i32 %11, 16
%13 = load i32, i32* %3
%14 = or i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @swap32(i32 %0) {
%2 = ashr i32 %0, 16
%3 = tail call i32 @swap16(i32 %2)
%4 = and i32 %0, 65535
%5 = tail call i32 @swap16(i32 %4)
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ deepInspectOnLevel(int, int, int /*<<< orphan*/);
void deepInspect(int op, int depth) { deepInspectOnLevel(op, depth, 0); }


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

x86 assembly (clang, -O2):
<deepInspect>:
xor    %edx,%edx
jmp    1030 <deepInspectOnLevel@plt>

LLVM IR (-O0):
define void @deepInspect(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 = call i32 @deepInspectOnLevel(i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @deepInspect(i32 %0, i32 %1) {
%3 = tail call i32 @deepInspectOnLevel(i32 %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
int bitcount(unsigned int);
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d", bitcount((unsigned)12)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
call   1040 <bitcount@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1040 <bitcount@plt>
lea    0xece(%rip),%rdi
mov    %eax,%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 = call i32 @bitcount(i32 12)
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @bitcount(i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void evalCommand(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               66, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<evalCommand>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x42,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<evalCommand>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x42,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.evalCommand = [12 x i8] c"evalCommand\00"
define void @evalCommand() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 66, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.evalCommand, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.evalCommand = [12 x i8] c"evalCommand\00"
define void @evalCommand() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 66, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.evalCommand, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello\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 = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void _M2_ramps2_finish(__attribute__((unused)) int argc,
                       __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_ramps2_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jsInlineF(char *, char *);
void resetPageNumberOnChange(char *id) {
  jsInlineF("$(function() {\n"
            " $('form').delegate('#%s','change keyup paste',function(e){\n"
            "  $('[name=cdwBrowseFiles_page]').val('1');\n"
            " });\n"
            "});\n",
            id);
}


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

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

LLVM IR (-O0):
@.str = [129 x i8] c"$(function() {\0A $('form').delegate('#%s','change keyup paste',function(e){\0A $('[name=cdwBrowseFiles_page]').val('1');\0A });\0A});\0A\00"
define void @resetPageNumberOnChange(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @jsInlineF(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [129 x i8] c"$(function() {\0A $('form').delegate('#%s','change keyup paste',function(e){\0A $('[name=cdwBrowseFiles_page]').val('1');\0A });\0A});\0A\00"
define void @resetPageNumberOnChange(i8* %0) {
%2 = tail call i32 @jsInlineF(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _nop_();
void I2CBitDly(void) {
  unsigned char time_end;
  for (time_end = 0; time_end < 10; time_end++)
    _nop_();
  return;
}


x86 assembly (clang, -O0):
<I2CBitDly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jge    113d <I2CBitDly+0x2d>
mov    $0x0,%al
call   1030 <_nop_@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    111c <I2CBitDly+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CBitDly>:
push   %rax
xor    %eax,%eax
call   1030 <_nop_@plt>
xor    %eax,%eax
call   1030 <_nop_@plt>
xor    %eax,%eax
call   1030 <_nop_@plt>
xor    %eax,%eax
call   1030 <_nop_@plt>
xor    %eax,%eax
call   1030 <_nop_@plt>
xor    %eax,%eax
call   1030 <_nop_@plt>
xor    %eax,%eax
call   1030 <_nop_@plt>
xor    %eax,%eax
call   1030 <_nop_@plt>
xor    %eax,%eax
call   1030 <_nop_@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <_nop_@plt>

LLVM IR (-O0):
define void @I2CBitDly() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %8, %0
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = call i32 (...) @_nop_()
br label %8
8: ; preds = %6
%9 = load i8, i8* %1
%10 = add i8 %9, 1
store i8 %10, i8* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @I2CBitDly() {
%1 = tail call i32 (...) @_nop_()
%2 = tail call i32 (...) @_nop_()
%3 = tail call i32 (...) @_nop_()
%4 = tail call i32 (...) @_nop_()
%5 = tail call i32 (...) @_nop_()
%6 = tail call i32 (...) @_nop_()
%7 = tail call i32 (...) @_nop_()
%8 = tail call i32 (...) @_nop_()
%9 = tail call i32 (...) @_nop_()
%10 = tail call i32 (...) @_nop_()
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int read(int, char *, int);
ssize_t exhaust(int fd, char *buf, int buf_sz) {
  ssize_t n = 0;
  for (;;) {
    int c;
    c = read(fd, buf + n, buf_sz - n);
    if (c <= 0)
      return n;
    n += c;
  }
}


x86 assembly (clang, -O0):
<exhaust>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x18(%rbp),%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
sub    -0x18(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jg     1158 <exhaust+0x48>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <exhaust+0x19>

x86 assembly (clang, -O2):
<exhaust>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %edi,%ebp
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ecx,%ebx
movslq %ecx,%rax
lea    (%r15,%rax,1),%rsi
mov    %r14d,%edx
sub    %eax,%edx
mov    %ebp,%edi
call   1030 <read@plt>
lea    (%rax,%rbx,1),%ecx
test   %eax,%eax
jg     1130 <exhaust+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @exhaust(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ 0, %3 ], [ %11, %4 ]
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = sub nsw i32 %2, %5
%9 = tail call i32 @read(i32 %0, i8* %7, i32 %8)
%10 = icmp slt i32 %9, 1
%11 = add nsw i32 %9, %5
br i1 %10, label %12, label %4
12: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_pop_missing() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_pop_missing"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_memblockq_pop_missing\00"
define i32 @pa_memblockq_pop_missing() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
float vector4Dotf(float *a, float *b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
}


x86 assembly (clang, -O0):
<vector4Dotf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector4Dotf>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm2
mulss  0x8(%rsi),%xmm2
addss  %xmm1,%xmm2
movss  0xc(%rdi),%xmm0
mulss  0xc(%rsi),%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @vector4Dotf(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
%26 = load float*, float** %3
%27 = getelementptr inbounds float, float* %26, i64 3
%28 = load float, float* %27
%29 = load float*, float** %4
%30 = getelementptr inbounds float, float* %29, i64 3
%31 = load float, float* %30
%32 = call float @llvm.fmuladd.f32(float %28, float %31, float %25)
ret float %32
}

LLVM IR (-O2):
define float @vector4Dotf(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
%16 = getelementptr inbounds float, float* %0, i64 3
%17 = load float, float* %16
%18 = getelementptr inbounds float, float* %1, i64 3
%19 = load float, float* %18
%20 = tail call float @llvm.fmuladd.f32(float %17, float %19, float %15)
ret float %20
}