xunge/DecIR huggingface dataset:
double PDFCauchy(double x, double m, double sigma) {
  double z = (x - m) / sigma;
  return 1 / (3.1415926535897932384626433832795 * sigma * (1 + z * z));
}


x86 assembly (clang, -O0):
<PDFCauchy>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed9(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xeb6(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xea6(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDFCauchy>:
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
mulsd  0xef0(%rip),%xmm2
mulsd  %xmm0,%xmm0
movsd  0xeec(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @PDFCauchy(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fsub double %8, %9
%11 = load double, double* %6
%12 = fdiv double %10, %11
store double %12, double* %7
%13 = load double, double* %6
%14 = fmul double 0x400921FB54442D18, %13
%15 = load double, double* %7
%16 = load double, double* %7
%17 = call double @llvm.fmuladd.f64(double %15, double %16, double 1.000000e+00)
%18 = fmul double %14, %17
%19 = fdiv double 1.000000e+00, %18
ret double %19
}

LLVM IR (-O2):
define double @PDFCauchy(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fdiv double %4, %2
%6 = fmul double %2, 0x400921FB54442D18
%7 = tail call double @llvm.fmuladd.f64(double %5, double %5, double 1.000000e+00)
%8 = fmul double %6, %7
%9 = fdiv double 1.000000e+00, %8
ret double %9
}
/* Type definitions */
typedef scalar_t__ pthread_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, char const *, unsigned int, unsigned int,
                          unsigned int);
scalar_t__ pthread_self();
void printids(const char *s) {
  pid_t pid;
  pthread_t tid;
  pid = getpid();
  tid = pthread_self();
  printf("%s pid %u tid %u (0x%x)\n", s, (unsigned int)pid, (unsigned int)tid,
         (unsigned int)tid);
}


x86 assembly (clang, -O0):
<printids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %eax,%r8d
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printids>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb1(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%s pid %u tid %u (0x%x)\0A\00"
define void @printids(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = call i64 (...) @getpid()
store i64 %5, i64* %3
%6 = call i64 (...) @pthread_self()
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
%10 = load i64, i64* %4
%11 = trunc i64 %10 to i32
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %9, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s pid %u tid %u (0x%x)\0A\00"
define void @printids(i8* %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i64 (...) @pthread_self()
%4 = trunc i64 %2 to i32
%5 = trunc i64 %3 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4, i32 %5, i32 %5)
ret void
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
void strlower(char *string) {
  int len, x;
  len = strlen(string);
  for (x = 0; x < len; x++)
    *(string + x) = tolower(*(string + x));
}


x86 assembly (clang, -O0):
<strlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <strlower+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <strlower+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlower>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <strlower+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <strlower+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @strlower(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @tolower(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
/* Variables and functions */
scalar_t__ cset82(unsigned char const *, int const, int /*<<< orphan*/, int,
                  int, int *, int *, char *);
int x1__25(const unsigned char *data, const int data_len, int *p_err_no,
           int *p_err_posn, char err_msg[50]) {
  return data_len >= 1 && data_len <= 25 &&
         cset82(data, data_len, 0, 1, 25, p_err_no, p_err_posn, err_msg);
}


x86 assembly (clang, -O0):
<x1__25>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jl     1181 <x1__25+0x71>
xor    %eax,%eax
cmpl   $0x19,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jg     1181 <x1__25+0x71>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x19,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <cset82@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x1__25>:
mov    %rcx,%r10
lea    -0x1(%rsi),%ecx
xor    %eax,%eax
cmp    $0x18,%ecx
ja     114d <x1__25+0x3d>
push   %rax
mov    %r8,%r11
mov    %rdx,%r9
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x19,%r8d
push   %r11
push   %r10
call   1030 <cset82@plt>
add    $0x10,%rsp
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @x1__25(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = add i32 %1, -1
%7 = icmp ult i32 %6, 25
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @cset82(i8* %0, i32 %1, i32 0, i32 1, i32 25, i32* %2, i32* %3, i8* %4)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void printf_footbar(int handicap, int *cnt_shots, int row, int points,
                    int *level) {
  printf("\n\n\t"
         "\x1b[34m"
         "Remaining shots:"
         "\x1b[0m"
         " %d\t\t\t"
         "\x1b[34m"
         "Points:"
         "\x1b[0m"
         " %d\n\t\t\t\t\t\t"
         "\x1b[34m"
         "Level:"
         "\x1b[0m"
         " %d\n"
         "\x1b[0m",
         handicap - cnt_shots[row], points, *level);
}


x86 assembly (clang, -O0):
<printf_footbar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
sub    (%rax,%rcx,4),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_footbar>:
mov    %edi,%eax
movslq %edx,%rdx
sub    (%rsi,%rdx,4),%eax
mov    (%r8),%r8d
lea    0xede(%rip),%rdi
mov    %eax,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [84 x i8] c"\0A\0A\09\1B[34mRemaining shots:\1B[0m %d\09\09\09\1B[34mPoints:\1B[0m %d\0A\09\09\09\09\09\09\1B[34mLevel:\1B[0m %d\0A\1B[0m\00"
define void @printf_footbar(i32 %0, i32* %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = sub nsw i32 %11, %16
%18 = load i32, i32* %9
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [84 x i8] c"\0A\0A\09\1B[34mRemaining shots:\1B[0m %d\09\09\09\1B[34mPoints:\1B[0m %d\0A\09\09\09\09\09\09\1B[34mLevel:\1B[0m %d\0A\1B[0m\00"
define void @printf_footbar(i32 %0, i32* nocapture %1, i32 %2, i32 %3, i32* nocapture %4) {
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = sub nsw i32 %0, %8
%10 = load i32, i32* %4
%11 = tail call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %3, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flow_control_push_to(int, int);
void flow_control_push(int can) { flow_control_push_to(can, 0x7e8); }


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

x86 assembly (clang, -O2):
<flow_control_push>:
mov    $0x7e8,%esi
jmp    1030 <flow_control_push_to@plt>

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

LLVM IR (-O2):
define void @flow_control_push(i32 %0) {
%2 = tail call i32 @flow_control_push_to(i32 %0, i32 2024)
ret void
}
void foo() {
  char a[1000];
  *a = 'a';
  foo();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movb   $0x61,-0x3f0(%rbp)
call   1030 <foo@plt>
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

LLVM IR (-O0):
define void @foo() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
store i8 97, i8* %2
ret void
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %1, %0
br label %1
}
int left(int i) { return ((i + 1) << 1) - 1; }


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
shl    $0x1,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = shl i32 %4, 1
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @left(i32 %0) {
%2 = shl i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void intr_config(int intr, unsigned int prio, _Bool fiq) {
  IntPrioritySet(intr, prio, fiq ? ((0x00000001u)) : (0));
}


x86 assembly (clang, -O0):
<intr_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
and    $0x1,%al
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x9(%rbp),%cl
xor    %edx,%edx
mov    $0x1,%eax
test   $0x1,%cl
cmovne %eax,%edx
mov    $0x0,%al
call   1030 <IntPrioritySet@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @intr_config(i32 %0, i32 %1, i1 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = zext i1 %2 to i8
store i8 %7, i8* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i8, i8* %6
%11 = trunc i8 %10 to i1
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
%14 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @IntPrioritySet to i32 (i32, i32, i32, ...)*)(i32 %8, i32 %9, i32 %13)
ret void
}

LLVM IR (-O2):
define void @intr_config(i32 %0, i32 %1, i1 zeroext %2) {
%4 = zext i1 %2 to i32
%5 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @IntPrioritySet to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ rand();
void main() {
  unsigned int uInt = (unsigned int)(rand());
  if (uInt < 0) {
    printf("Never prints");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jae    1148 <main+0x28>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Never prints\00"
define void @main() {
%1 = alloca i32
%2 = call i64 (...) @rand()
%3 = trunc i64 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ult i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 (...) @rand()
ret void
}
/* Variables and functions */
size_t BRMurmur3_32(void const *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
size_t BRAddressHash(const void *addr) {
  return BRMurmur3_32(addr, strlen((const char *)addr), 0);
}


x86 assembly (clang, -O0):
<BRAddressHash>:
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 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <BRMurmur3_32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BRAddressHash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <BRMurmur3_32@plt>

LLVM IR (-O0):
define i64 @BRAddressHash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i64 @BRMurmur3_32(i8* %3, i32 %5, i32 0)
ret i64 %6
}

LLVM IR (-O2):
define i64 @BRAddressHash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i64 @BRMurmur3_32(i8* %0, i32 %2, i32 0)
ret i64 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int read32(int);
int /*<<< orphan*/ write32(int, int);
void mask32(uint32_t address, uint32_t mask, uint32_t value) {
  uint32_t contents = read32(address);
  contents &= ~(mask);
  contents |= (value & mask);
  write32(address, contents);
}


x86 assembly (clang, -O0):
<mask32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <read32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <write32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask32>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
call   1040 <read32@plt>
xor    %eax,%ebx
and    %r14d,%ebx
xor    %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write32@plt>

LLVM IR (-O0):
define void @mask32(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
%8 = load i32, i32* %4
%9 = call i32 @read32(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %5
%11 = xor i32 %10, -1
%12 = load i32, i32* %7
%13 = and i32 %12, %11
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = and i32 %14, %15
%17 = load i32, i32* %7
%18 = or i32 %17, %16
store i32 %18, i32* %7
%19 = load i32, i32* %4
%20 = load i32, i32* %7
%21 = call i32 @write32(i32 %19, i32 %20)
ret void
}

LLVM IR (-O2):
define void @mask32(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @read32(i32 %0)
%5 = xor i32 %1, -1
%6 = and i32 %4, %5
%7 = and i32 %2, %1
%8 = or i32 %6, %7
%9 = tail call i32 @write32(i32 %0, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void yyerror(char *s) { printf("ERROR: %s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void print_usage(const char *name) {
  printf("usage: %s [-vh?Vidq] [-w 0x<addr> -z 0x<data>]\n", name);
  printf("\n"
         "   -v | --version:                   print the version\n"
         "   -h | --help:                      print this help\n\n"
         "   -V | --verbose:                   print debug information\n"
         "   -d | --dump:                      print RAM\n"
         "   -i | --idx:                       print IDX RAM & RAM\n"
         "   -q | --query:                     print query byte\n"
         "   -w <addr in hex>                  write to addr\n"
         "   -z <data in hex>                  write to data\n"
         "\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"usage: %s [-vh?Vidq] [-w 0x<addr> -z 0x<data>]\0A\00"
@.str.1 = [433 x i8] c"\0A -v | --version: print the version\0A -h | --help: print this help\0A\0A -V | --verbose: print debug information\0A -d | --dump: print RAM\0A -i | --idx: print IDX RAM & RAM\0A -q | --query: print query byte\0A -w <addr in hex> write to addr\0A -z <data in hex> write to data\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([433 x i8], [433 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [48 x i8] c"usage: %s [-vh?Vidq] [-w 0x<addr> -z 0x<data>]\0A\00"
@str = [432 x i8] c"\0A -v | --version: print the version\0A -h | --help: print this help\0A\0A -V | --verbose: print debug information\0A -d | --dump: print RAM\0A -i | --idx: print IDX RAM & RAM\0A -q | --query: print query byte\0A -w <addr in hex> write to addr\0A -z <data in hex> write to data\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([432 x i8], [432 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_RED_LED_OUTPUT() { set_io_bit(0x39, 7); }


x86 assembly (clang, -O0):
<TOSH_MAKE_RED_LED_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
mov    $0x7,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_RED_LED_OUTPUT>:
mov    $0x39,%edi
mov    $0x7,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_RED_LED_OUTPUT() {
%1 = call i32 @set_io_bit(i32 57, i32 7)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_RED_LED_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 57, i32 7)
ret void
}
/* Variables and functions */
void *Cyc_BansheeIf_composite_constraint(unsigned int, void *, void *);
void *Cyc_BansheeIf_and_constraint(void *c1, void *c2) {
  void *_T0;
  _T0 = Cyc_BansheeIf_composite_constraint(0U, c1, c2);
  return _T0;
}


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

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

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

LLVM IR (-O2):
define i8* @Cyc_BansheeIf_and_constraint(i8* %0, i8* %1) {
%3 = tail call i8* @Cyc_BansheeIf_composite_constraint(i32 0, i8* %0, i8* %1)
ret i8* %3
}
float modf_neon_hfp(float x, int *i) {}


x86 assembly (clang, -O0):
<modf_neon_hfp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @modf_neon_hfp(float %0, i32* nocapture readnone %1) {
ret float undef
}
int reg_int_cb(struct int_param_s *int_param) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.int_param_s = type opaque
define i32 @reg_int_cb(%struct.int_param_s* nocapture readnone %0) {
ret i32 0
}
int f(j)
int j;
{ return ++j > 0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
/* Variables and functions */
void mem_zero(void *dst_, size_t n) {
  unsigned char *dst = (unsigned char *)dst_;
  size_t i;
  for (i = 0; i < n; i++) {
    dst[i] = 0;
  }
}


x86 assembly (clang, -O0):
<mem_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1147 <mem_zero+0x47>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <mem_zero+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_zero>:
test   %rsi,%rsi
je     1124 <mem_zero+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @mem_zero(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
store i64 0, i64* %6
br label %8
8: ; preds = %16, %2
%9 = load i64, i64* %6
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %12
%17 = load i64, i64* %6
%18 = add i64 %17, 1
store i64 %18, i64* %6
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @mem_zero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int main() {
  const int number = 4;
  printf("Constant number: %i\n", number);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"Constant number: %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
struct rtas_hotplug_scn {
  int dummy;
};
struct rtas_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_re_scn(struct rtas_event *, int);
struct rtas_hotplug_scn *rtas_get_hotplug_scn(struct rtas_event *re) {
  return (struct rtas_hotplug_scn *)get_re_scn(re, 19);
}


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

x86 assembly (clang, -O2):
<rtas_get_hotplug_scn>:
mov    $0x13,%esi
jmp    1030 <get_re_scn@plt>

LLVM IR (-O0):
%struct.rtas_hotplug_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_hotplug_scn* @rtas_get_hotplug_scn(%struct.rtas_event* %0) {
%2 = alloca %struct.rtas_event*
store %struct.rtas_event* %0, %struct.rtas_event** %2
%3 = load %struct.rtas_event*, %struct.rtas_event** %2
%4 = call i64 @get_re_scn(%struct.rtas_event* %3, i32 19)
%5 = inttoptr i64 %4 to %struct.rtas_hotplug_scn*
ret %struct.rtas_hotplug_scn* %5
}

LLVM IR (-O2):
%struct.rtas_hotplug_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_hotplug_scn* @rtas_get_hotplug_scn(%struct.rtas_event* %0) {
%2 = tail call i64 @get_re_scn(%struct.rtas_event* %0, i32 19)
%3 = inttoptr i64 %2 to %struct.rtas_hotplug_scn*
ret %struct.rtas_hotplug_scn* %3
}
/* Variables and functions */
int readchar();
void wait_for(int ch) {
  int c;
  if (ch == '\n')
    while ((c = readchar()) != '\n')
      continue;
  else
    while (readchar() != ch)
      continue;
}


x86 assembly (clang, -O0):
<wait_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    1147 <wait_for+0x37>
jmp    112a <wait_for+0x1a>
mov    $0x0,%al
call   1030 <readchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     1142 <wait_for+0x32>
jmp    112a <wait_for+0x1a>
jmp    1166 <wait_for+0x56>
jmp    114c <wait_for+0x3c>
mov    $0x0,%al
call   1030 <readchar@plt>
cmp    -0x4(%rbp),%eax
je     1161 <wait_for+0x51>
jmp    114c <wait_for+0x3c>
jmp    1166 <wait_for+0x56>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for>:
push   %rbx
cmp    $0xa,%edi
jne    112e <wait_for+0x1e>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <readchar@plt>
cmp    $0xa,%eax
jne    1120 <wait_for+0x10>
jmp    113b <wait_for+0x2b>
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <readchar@plt>
cmp    %ebx,%eax
jne    1130 <wait_for+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @wait_for(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1, %3
%4 = tail call i32 (...) @readchar()
%5 = icmp eq i32 %4, 10
br i1 %5, label %9, label %3
6: ; preds = %1, %6
%7 = tail call i32 (...) @readchar()
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %6
9: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ write(int, char *, int);
void *handler2(void *arg) {
  int *p = (int *)arg;
  int fd = *p;
  write(fd, "quit", 4);
  printf("send a message:quit!\n");
}


x86 assembly (clang, -O0):
<handler2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
lea    0xeb9(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler2>:
push   %rax
mov    (%rdi),%edi
lea    0xed6(%rip),%rsi
mov    $0x4,%edx
call   1040 <write@plt>
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"quit\00"
@.str.1 = [22 x i8] c"send a message:quit!\0A\00"
define i8* @handler2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i32 @write(i32 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"quit\00"
@str = [21 x i8] c"send a message:quit!\00"
define noalias i8* @handler2(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free2d(void *pp) {
  void *p;
  p = ((void **)pp)[0];
  free(pp);
  free(p);
}


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

x86 assembly (clang, -O2):
<free2d>:
push   %rbx
mov    (%rdi),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free2d(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
store i8* %7, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
define void @free2d(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %0)
%5 = tail call i32 @free(i8* %3)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t mp2vseq_get_vertical(const uint8_t *p_mp2vseq) {
  return ((p_mp2vseq[5] & 0xf) << 8) | p_mp2vseq[6];
}


x86 assembly (clang, -O0):
<mp2vseq_get_vertical>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0xf,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x18(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseq_get_vertical>:
mov    0x14(%rdi),%eax
and    $0xf,%eax
shl    $0x8,%eax
or     0x18(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @mp2vseq_get_vertical(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = and i32 %5, 15
%7 = shl i32 %6, 8
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 6
%10 = load i32, i32* %9
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mp2vseq_get_vertical(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, 3840
%6 = getelementptr inbounds i32, i32* %0, i64 6
%7 = load i32, i32* %6
%8 = or i32 %5, %7
ret i32 %8
}
/* Variables and functions */
size_t strlen(char *);
void unpad_spaces(char *str) {
  size_t x;
  for (x = strlen(str); x > 0 && str[x - 1] == ' '; x--)
    ;
  str[x] = 0;
}


x86 assembly (clang, -O0):
<unpad_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jbe    1152 <unpad_spaces+0x42>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1162 <unpad_spaces+0x52>
jmp    1178 <unpad_spaces+0x68>
jmp    1167 <unpad_spaces+0x57>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1129 <unpad_spaces+0x19>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpad_spaces>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
nopl   0x0(%rax)
mov    %rax,%rcx
sub    $0x1,%rax
jb     1130 <unpad_spaces+0x20>
cmpb   $0x20,-0x1(%rbx,%rcx,1)
je     1120 <unpad_spaces+0x10>
movb   $0x0,(%rbx,%rcx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @unpad_spaces(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
br label %3
3: ; preds = %6, %1
%4 = phi i64 [ %2, %1 ], [ %7, %6 ]
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = add i64 %4, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 32
br i1 %10, label %3, label %11
11: ; preds = %3, %6
%12 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  int n = 4;
  printf("Heyy!!! \n");
  printf("Refer 3.3 \n");
  printf("HERE IS A SONG FOR YOU  (VOL UP UP & UP) \n");
  sleep(n);
  printf("\a");
  printf("Bye!!!! :-) :-) \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <sleep@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
mov    $0x4,%edi
call   1050 <sleep@plt>
mov    $0x7,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Heyy!!! \0A\00"
@.str.1 = [12 x i8] c"Refer 3.3 \0A\00"
@.str.2 = [43 x i8] c"HERE IS A SONG FOR YOU (VOL UP UP & UP) \0A\00"
@.str.3 = [2 x i8] c"\07\00"
@.str.4 = [18 x i8] c"Bye!!!! :-) :-) \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @sleep(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"Heyy!!! \00"
@str.5 = [11 x i8] c"Refer 3.3 \00"
@str.6 = [42 x i8] c"HERE IS A SONG FOR YOU (VOL UP UP & UP) \00"
@str.7 = [17 x i8] c"Bye!!!! :-) :-) \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 4)
%5 = tail call i32 @putchar(i32 7)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Emit1(int);
int /*<<< orphan*/ EmitString(char const *);
void EmitRexString(const char *string) {
  Emit1(0x48);
  EmitString(string);
}


x86 assembly (clang, -O0):
<EmitRexString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x48,%edi
call   1040 <Emit1@plt>
mov    -0x8(%rbp),%rdi
call   1030 <EmitString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EmitRexString>:
push   %rbx
mov    %rdi,%rbx
mov    $0x48,%edi
call   1040 <Emit1@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <EmitString@plt>

LLVM IR (-O0):
define void @EmitRexString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @Emit1(i32 72)
%4 = load i8*, i8** %2
%5 = call i32 @EmitString(i8* %4)
ret void
}

LLVM IR (-O2):
define void @EmitRexString(i8* %0) {
%2 = tail call i32 @Emit1(i32 72)
%3 = tail call i32 @EmitString(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_tanhf();
scalar_t__ tanhf(float);
void test_tanhf(float f) {
  if (tanhf(f) != tanhf(f))
    link_failure_tanhf();
}


x86 assembly (clang, -O0):
<test_tanhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <tanhf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <tanhf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_tanhf+0x3c>
mov    $0x0,%al
call   1040 <link_failure_tanhf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tanhf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <tanhf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <tanhf@plt>
cmp    %rax,%rbx
jne    1149 <test_tanhf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_tanhf@plt>

LLVM IR (-O0):
define void @test_tanhf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @tanhf(float %3)
%5 = load float, float* %2
%6 = call i64 @tanhf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_tanhf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_tanhf(float %0) {
%2 = tail call i64 @tanhf(float %0)
%3 = tail call i64 @tanhf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_tanhf()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void error(int e) {
  switch (e) {
  case 1:
    printf("erreur d'alloc\n");
    break;
  case 2:
    printf("carac not in alphabet\n");
    break;
  default:
    printf("error incunue\n");
    break;
  }
  exit(e);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1150 <error+0x30>
jmp    113f <error+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1161 <error+0x41>
jmp    1172 <error+0x52>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    117e <error+0x5e>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    117e <error+0x5e>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
lea    0xed3(%rip),%rax
lea    0xef1(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xed4(%rip),%rdi
cmovne %rcx,%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"erreur d'alloc\0A\00"
@.str.1 = [23 x i8] c"carac not in alphabet\0A\00"
@.str.2 = [15 x i8] c"error incunue\0A\00"
define void @error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 1, label %4
i32 2, label %6
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6, %4
%11 = load i32, i32* %2
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"carac not in alphabet\00"
@str.3 = [15 x i8] c"erreur d'alloc\00"
@str.4 = [14 x i8] c"error incunue\00"
define void @error(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.4, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0), i8* %3
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
%7 = tail call i32 @exit(i32 %0)
unreachable
}