xunge/DecIR huggingface dataset:
/* Variables and functions */
int foo2(int);
int bar2(int x) {
  return foo2(x) + foo2(x) + foo2(x) + foo2(x) + foo2(x) + foo2(x);
}


x86 assembly (clang, -O0):
<bar2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo2@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo2@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo2@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo2@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo2@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
call   1030 <foo2@plt>
mov    %eax,%r14d
mov    %r15d,%edi
call   1030 <foo2@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    %r15d,%edi
call   1030 <foo2@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r15d,%edi
call   1030 <foo2@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r15d,%edi
call   1030 <foo2@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r15d,%edi
call   1030 <foo2@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bar2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo2(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @foo2(i32 %5)
%7 = add nsw i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @foo2(i32 %8)
%10 = add nsw i32 %7, %9
%11 = load i32, i32* %2
%12 = call i32 @foo2(i32 %11)
%13 = add nsw i32 %10, %12
%14 = load i32, i32* %2
%15 = call i32 @foo2(i32 %14)
%16 = add nsw i32 %13, %15
%17 = load i32, i32* %2
%18 = call i32 @foo2(i32 %17)
%19 = add nsw i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @bar2(i32 %0) {
%2 = tail call i32 @foo2(i32 %0)
%3 = tail call i32 @foo2(i32 %0)
%4 = add nsw i32 %3, %2
%5 = tail call i32 @foo2(i32 %0)
%6 = add nsw i32 %4, %5
%7 = tail call i32 @foo2(i32 %0)
%8 = add nsw i32 %6, %7
%9 = tail call i32 @foo2(i32 %0)
%10 = add nsw i32 %8, %9
%11 = tail call i32 @foo2(i32 %0)
%12 = add nsw i32 %10, %11
ret i32 %12
}
/* Variables and functions */
double snoise(double, double, double);
double noise(double x, double y, double z) {
  return 0.5 * (1.0 + snoise(x, y, z));
}


x86 assembly (clang, -O0):
<noise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <snoise@plt>
movsd  0xec5(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noise>:
push   %rax
call   1030 <snoise@plt>
addsd  0xee2(%rip),%xmm0
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @noise(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @snoise(double %7, double %8, double %9)
%11 = fadd double 1.000000e+00, %10
%12 = fmul double 5.000000e-01, %11
ret double %12
}

LLVM IR (-O2):
define double @noise(double %0, double %1, double %2) {
%4 = tail call double @snoise(double %0, double %1, double %2)
%5 = fadd double %4, 1.000000e+00
%6 = fmul double %5, 5.000000e-01
ret double %6
}
char *strupr(str)
char *str;
{
  char *ptr = str;
  while (*ptr) {
    *ptr = toupper(*ptr);
    ptr++;
  }
  return str;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strupr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strupr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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


x86 assembly (clang, -O0):
<parse_RET>:
push   %rbp
mov    %rsp,%rbp
mov    $0xee,%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_RET>:
mov    $0xee,%ax
ret

LLVM IR (-O0):
define zeroext i16 @parse_RET() {
ret i16 238
}

LLVM IR (-O2):
define zeroext i16 @parse_RET() {
ret i16 238
}
/* Variables and functions */
unsigned char dxl_read_word(unsigned char, int);
unsigned char getBaudRate(unsigned char id) { return dxl_read_word(id, (4)); }


x86 assembly (clang, -O0):
<getBaudRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x4,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_word@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBaudRate>:
mov    $0x4,%esi
jmp    1030 <dxl_read_word@plt>

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

LLVM IR (-O2):
define zeroext i8 @getBaudRate(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_word(i8 zeroext %0, i32 4)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int unlock_fd(int /*<<< orphan*/);
int unlock_file(FILE *f) {
  assert(f);
  return unlock_fd(fileno(f));
}


x86 assembly (clang, -O0):
<unlock_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
call   1050 <unlock_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock_file>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <unlock_fd@plt>

LLVM IR (-O0):
define i32 @unlock_file(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @assert(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fileno(i32* %5)
%7 = call i32 @unlock_fd(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @unlock_file(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = tail call i32 @fileno(i32* %0)
%4 = tail call i32 @unlock_fd(i32 %3)
ret i32 %4
}
void backreference2BACKREFERENCE() {}


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

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

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

LLVM IR (-O2):
define void @backreference2BACKREFERENCE() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printBuffer(char *buffer) { printf("%s\n", buffer); }


x86 assembly (clang, -O0):
<printBuffer>:
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):
<printBuffer>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printBuffer(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *strchr(const char *str, int c) {
  const char *ptr = str;
  while (*ptr) {
    if (*ptr == c) {
      return (char *)ptr;
    }
    ptr++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strchr+0x4e>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113d <strchr+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <strchr+0x56>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <strchr+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
long _ftol(double);
long _ftol2(double x) { return _ftol(x); }


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

x86 assembly (clang, -O2):
<_ftol2>:
jmp    1030 <_ftol@plt>

LLVM IR (-O0):
define i64 @_ftol2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @_ftol(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @_ftol2(double %0) {
%2 = tail call i64 @_ftol(double %0)
ret i64 %2
}
void FixedDiv1_X86() {}


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

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

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

LLVM IR (-O2):
define void @FixedDiv1_X86() {
ret void
}
/* Variables and functions */
int **imatrix(size_t const, size_t const);
int /*<<< orphan*/ memcpy_imatrix(int **, int **const, size_t const,
                                  size_t const);
int **clone_imatrix(int **const m, const size_t nrow, const size_t ncol) {
  int **m2 = imatrix(nrow, ncol);
  memcpy_imatrix(m2, m, nrow, ncol);
  return m2;
}


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

x86 assembly (clang, -O2):
<clone_imatrix>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <imatrix@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1040 <memcpy_imatrix@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32** @clone_imatrix(i32** %0, i64 %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32**
store i32** %0, i32*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i32** @imatrix(i64 %8, i64 %9)
store i32** %10, i32*** %7
%11 = load i32**, i32*** %7
%12 = load i32**, i32*** %4
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = call i32 @memcpy_imatrix(i32** %11, i32** %12, i64 %13, i64 %14)
%16 = load i32**, i32*** %7
ret i32** %16
}

LLVM IR (-O2):
define i32** @clone_imatrix(i32** %0, i64 %1, i64 %2) {
%4 = tail call i32** @imatrix(i64 %1, i64 %2)
%5 = tail call i32 @memcpy_imatrix(i32** %4, i32** %0, i64 %1, i64 %2)
ret i32** %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int SniffPcap_Close(FILE *fp) {
  if (fp) {
    fflush(NULL);
    fclose(fp);
  }
  return 0;
}


x86 assembly (clang, -O0):
<SniffPcap_Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <SniffPcap_Close+0x29>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SniffPcap_Close>:
test   %rdi,%rdi
je     1139 <SniffPcap_Close+0x19>
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <fflush@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
pop    %rbx
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @SniffPcap_Close(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @fflush(i32* null)
%7 = load i32*, i32** %2
%8 = call i32 @fclose(i32* %7)
br label %9
9: ; preds = %5, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @SniffPcap_Close(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @fflush(i32* null)
%5 = tail call i32 @fclose(i32* %0)
br label %6
6: ; preds = %3, %1
ret i32 0
}
char *ob_strtuc(char *str) {
  char *c = str;
  while ((*c) != 0) {
    if (((*c) >= 'a') && ((*c) <= 'z')) {
      (*c) -= ('a' - 'A');
    }
    c++;
  }
  return str;
}


x86 assembly (clang, -O0):
<ob_strtuc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <ob_strtuc+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     114c <ob_strtuc+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     114c <ob_strtuc+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ob_strtuc+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ob_strtuc>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <ob_strtuc+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <ob_strtuc+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <ob_strtuc+0x2c>
lea    -0x61(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <ob_strtuc+0x10>
add    $0xe0,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <ob_strtuc+0x10>
ret

LLVM IR (-O0):
define i8* @ob_strtuc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %5
29: ; preds = %5
%30 = load i8*, i8** %2
ret i8* %30
}

LLVM IR (-O2):
define i8* @ob_strtuc(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
char *malloc(int);
void *memset(char *, int /*<<< orphan*/, size_t);
void *builtin_no_leak(size_t s) {
  char *str = malloc(sizeof(s));
  if (str) {
    return memset(str, 0, s);
  }
}


x86 assembly (clang, -O0):
<builtin_no_leak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1158 <builtin_no_leak+0x38>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_no_leak>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1146 <builtin_no_leak+0x26>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @builtin_no_leak(i64 %0) {
%2 = tail call dereferenceable_or_null(8) i8* @malloc(i32 8)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @llvm.memset.p0i8.i64(i8* align 1 %2, i8 0, i64 %0, i1 false)
br label %5
5: ; preds = %1, %4
ret i8* %2
}
unsigned int strsum(const char *str) {
  unsigned int sum = 0;
  while (*str)
    sum = (sum << 4) + *(str++);
  return sum;
}


x86 assembly (clang, -O0):
<strsum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <strsum+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strsum+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsum>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <strsum+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%eax
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strsum+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strsum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 4
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
int I_DoPlatformQuit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @I_DoPlatformQuit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @I_DoPlatformQuit() {
ret i32 0
}
double adjust_reading(double va) {
  double d;
  d = (va * 10500.0) / 10000.0;
  return (d);
}


x86 assembly (clang, -O0):
<adjust_reading>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_reading>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @adjust_reading(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 1.050000e+04
%6 = fdiv double %5, 1.000000e+04
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @adjust_reading(double %0) {
%2 = fmul double %0, 1.050000e+04
%3 = fdiv double %2, 1.000000e+04
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ControlSpeak(void) { printf("Control is speaking.\n"); }


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"Control is speaking.\00"
define void @ControlSpeak() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
void INT_Excep_SCI4_TEI4(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI4_TEI4() {
ret void
}
/* Type definitions */
struct stat {
  scalar_t__ st_blksize;
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_IFCHR;
int fstat(int fd, struct stat *st) {
  if (fd < 3) {
    st->st_mode = S_IFCHR;
    st->st_blksize = 0;
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    113c <fstat+0x3c>
mov    0x2ec4(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1143 <fstat+0x43>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jg     111f <fstat+0x1f>
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsi)
movq   $0x0,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i64, i32 }
@S_IFCHR = global i32 0
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.stat*
store i32 %0, i32* %4
store %struct.stat* %1, %struct.stat** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @S_IFCHR
%10 = load %struct.stat*, %struct.stat** %5
%11 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 1
store i32 %9, i32* %11
%12 = load %struct.stat*, %struct.stat** %5
%13 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
store i64 0, i64* %13
store i32 0, i32* %3
br label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i64, i32 }
@S_IFCHR = global i32 0
define i32 @fstat(i32 %0, %struct.stat* nocapture writeonly %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @S_IFCHR
%6 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 1
store i32 %5, i32* %6
%7 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
store i64 0, i64* %7
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ 0, %4 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ TIM15_ISR();
int /*<<< orphan*/ TIM1_BRK_ISR();
void TIM1_BRK_TIM15_ISR(void) {
  TIM1_BRK_ISR();
  TIM15_ISR();
}


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

x86 assembly (clang, -O2):
<TIM1_BRK_TIM15_ISR>:
push   %rax
xor    %eax,%eax
call   1030 <TIM1_BRK_ISR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <TIM15_ISR@plt>

LLVM IR (-O0):
define void @TIM1_BRK_TIM15_ISR() {
%1 = call i32 (...) @TIM1_BRK_ISR()
%2 = call i32 (...) @TIM15_ISR()
ret void
}

LLVM IR (-O2):
define void @TIM1_BRK_TIM15_ISR() {
%1 = tail call i32 (...) @TIM1_BRK_ISR()
%2 = tail call i32 (...) @TIM15_ISR()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void *p(void *x, void *y, int z) {
  memcpy(x, y, z);
  return x;
}


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

x86 assembly (clang, -O2):
<p>:
push   %rbx
mov    %rdi,%rbx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @p(i8* returned %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret i8* %0
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};
typedef long long int64_t;

/* Variables and functions */
int64_t timespec_to_ns(struct timespec ts) {
  return (int64_t)ts.tv_nsec + 1000000000LL * (int64_t)ts.tv_sec;
}


x86 assembly (clang, -O0):
<timespec_to_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,-0x10(%rbp),%rcx
3b
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_ns>:
imul   $0x3b9aca00,%rdi,%rax
add    %rsi,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_ns(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%8 = load i64, i64* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%10 = load i64, i64* %9
%11 = mul nsw i64 1000000000, %10
%12 = add nsw i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @timespec_to_ns(i64 %0, i64 %1) {
%3 = mul nsw i64 %0, 1000000000
%4 = add nsw i64 %3, %1
ret i64 %4
}
struct sockaddr_un *get_socket(struct register_table *reg) {
  return (struct sockaddr_un *)reg;
}


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

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

LLVM IR (-O0):
%struct.sockaddr_un = type opaque
%struct.register_table = type opaque
define %struct.sockaddr_un* @get_socket(%struct.register_table* %0) {
%2 = alloca %struct.register_table*
store %struct.register_table* %0, %struct.register_table** %2
%3 = load %struct.register_table*, %struct.register_table** %2
%4 = bitcast %struct.register_table* %3 to %struct.sockaddr_un*
ret %struct.sockaddr_un* %4
}

LLVM IR (-O2):
%struct.sockaddr_un = type opaque
%struct.register_table = type opaque
define %struct.sockaddr_un* @get_socket(%struct.register_table* readnone %0) {
%2 = bitcast %struct.register_table* %0 to %struct.sockaddr_un*
ret %struct.sockaddr_un* %2
}
void GB_MemEnd(void) {}


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

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

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

LLVM IR (-O2):
define void @GB_MemEnd() {
ret void
}
void rop3_205_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_205_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_205_1_0>:
mov    (%rdi),%al
or     %esi,%edx
or     %al,%dl
not    %dl
and    %al,%sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_205_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = trunc i32 %38 to i8
%40 = load i8*, i8** %4
store i8 %39, i8* %40
ret void
}

LLVM IR (-O2):
define void @rop3_205_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ tracecmd_host_bigendian();
unsigned int be32_to_cpu(unsigned int val) {
  unsigned int swap;
  if (tracecmd_host_bigendian())
    return val;
  swap = ((val & 0xffULL) << 24) | ((val & (0xffULL << 8)) << 8) |
         ((val & (0xffULL << 16)) >> 8) | ((val & (0xffULL << 24)) >> 24);
  return swap;
}


x86 assembly (clang, -O0):
<be32_to_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <tracecmd_host_bigendian@plt>
cmp    $0x0,%rax
je     1137 <be32_to_cpu+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <be32_to_cpu+0x76>
mov    -0x8(%rbp),%eax
and    $0xff,%rax
shl    $0x18,%rax
mov    -0x8(%rbp),%ecx
and    $0xff00,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%ecx
and    $0xff0000,%rcx
shr    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%ecx
movabs $0xff000000,%rdx
and    %rdx,%rcx
shr    $0x18,%rcx
or     %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32_to_cpu>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <tracecmd_host_bigendian@plt>
test   %rax,%rax
mov    %ebx,%eax
bswap  %eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @be32_to_cpu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i64 (...) @tracecmd_host_bigendian()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %31
9: ; preds = %1
%10 = load i32, i32* %3
%11 = zext i32 %10 to i64
%12 = and i64 %11, 255
%13 = shl i64 %12, 24
%14 = load i32, i32* %3
%15 = zext i32 %14 to i64
%16 = and i64 %15, 65280
%17 = shl i64 %16, 8
%18 = or i64 %13, %17
%19 = load i32, i32* %3
%20 = zext i32 %19 to i64
%21 = and i64 %20, 16711680
%22 = lshr i64 %21, 8
%23 = or i64 %18, %22
%24 = load i32, i32* %3
%25 = zext i32 %24 to i64
%26 = and i64 %25, 4278190080
%27 = lshr i64 %26, 24
%28 = or i64 %23, %27
%29 = trunc i64 %28 to i32
store i32 %29, i32* %4
%30 = load i32, i32* %4
store i32 %30, i32* %2
br label %31
31: ; preds = %9, %7
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @be32_to_cpu(i32 %0) {
%2 = tail call i64 (...) @tracecmd_host_bigendian()
%3 = icmp eq i64 %2, 0
%4 = tail call i32 @llvm.bswap.i32(i32 %0)
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int output_data(int i) { return i * i; }


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

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

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

LLVM IR (-O2):
define i32 @output_data(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Type definitions */
typedef unsigned char uint32_t;

/* Variables and functions */
uint32_t read_uint32(unsigned char *source) {
  return source[0] << 24 | source[1] << 16 | source[2] << 8 | source[3];
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @read_uint32(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_error(const char *s) {
  fprintf(stderr, "%s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @print_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *malloc(int);
int sprintf(char *, char const *, int, int);
char *msg_app_int_int(const char *msg1, int n1, int n2) {
  char *p = malloc(200);
  int b = sprintf(p, msg1, n1, n2);
  return p;
}


x86 assembly (clang, -O0):
<msg_app_int_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <sprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_app_int_int>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1040 <sprintf@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @msg_app_int_int(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = call i8* @malloc(i32 200)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @sprintf(i8* %10, i8* %11, i32 %12, i32 %13)
store i32 %14, i32* %8
%15 = load i8*, i8** %7
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @msg_app_int_int(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0, i32 %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ embaralhar(int **);
int /*<<< orphan*/ gerar(int **);
int /*<<< orphan*/ mostrar(int **);
int /*<<< orphan*/ zerar(int **);
int main() {
  int r[4][4];
  int m[4][4];
  gerar(r);
  embaralhar(r);
  zerar(m);
  mostrar(r);
  mostrar(m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
call   1050 <gerar@plt>
lea    -0x50(%rbp),%rdi
call   1040 <embaralhar@plt>
lea    -0x90(%rbp),%rdi
call   1030 <zerar@plt>
lea    -0x50(%rbp),%rdi
call   1060 <mostrar@plt>
lea    -0x90(%rbp),%rdi
call   1060 <mostrar@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gerar@plt>
mov    %rbx,%rdi
call   1040 <embaralhar@plt>
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <zerar@plt>
mov    %rbx,%rdi
call   1060 <mostrar@plt>
mov    %r14,%rdi
call   1060 <mostrar@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [4 x i32]]
%3 = alloca [4 x [4 x i32]]
store i32 0, i32* %1
%4 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 0
%5 = bitcast [4 x i32]* %4 to i32**
%6 = call i32 @gerar(i32** %5)
%7 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 0
%8 = bitcast [4 x i32]* %7 to i32**
%9 = call i32 @embaralhar(i32** %8)
%10 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %3, i64 0, i64 0
%11 = bitcast [4 x i32]* %10 to i32**
%12 = call i32 @zerar(i32** %11)
%13 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 0
%14 = bitcast [4 x i32]* %13 to i32**
%15 = call i32 @mostrar(i32** %14)
%16 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %3, i64 0, i64 0
%17 = bitcast [4 x i32]* %16 to i32**
%18 = call i32 @mostrar(i32** %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x [4 x i32]]
%2 = alloca [4 x [4 x i32]]
%3 = bitcast [4 x [4 x i32]]* %1 to i8*
%4 = bitcast [4 x [4 x i32]]* %2 to i8*
%5 = bitcast [4 x [4 x i32]]* %1 to i32**
%6 = call i32 @gerar(i32** %5)
%7 = call i32 @embaralhar(i32** %5)
%8 = bitcast [4 x [4 x i32]]* %2 to i32**
%9 = call i32 @zerar(i32** %8)
%10 = call i32 @mostrar(i32** %5)
%11 = call i32 @mostrar(i32** %8)
ret i32 0
}
/* Type definitions */
struct RC {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rc_encode0(struct RC *, unsigned int);
void rc_treeout0(struct RC *rc, int len, unsigned int data) {
  int i;
  for (i = len; i > 0; i--)
    rc_encode0(rc, (data >> (i - 1)) & 1);
  return;
}


x86 assembly (clang, -O0):
<rc_treeout0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1157 <rc_treeout0+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
shr    %cl,%esi
and    $0x1,%esi
call   1030 <rc_encode0@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <rc_treeout0+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_treeout0>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    114b <rc_treeout0+0x3b>
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%rbp
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x2(%rbx),%ecx
mov    %r14d,%esi
shr    %cl,%esi
and    $0x1,%esi
mov    %rbp,%rdi
call   1030 <rc_encode0@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <rc_treeout0+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.RC = type { i32 }
define void @rc_treeout0(%struct.RC* %0, i32 %1, i32 %2) {
%4 = alloca %struct.RC*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.RC* %0, %struct.RC** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
store i32 %8, i32* %7
br label %9
9: ; preds = %20, %3
%10 = load i32, i32* %7
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load %struct.RC*, %struct.RC** %4
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = sub nsw i32 %15, 1
%17 = lshr i32 %14, %16
%18 = and i32 %17, 1
%19 = call i32 @rc_encode0(%struct.RC* %13, i32 %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %7
%22 = add nsw i32 %21, -1
store i32 %22, i32* %7
br label %9
23: ; preds = %9
ret void
}

LLVM IR (-O2):
%struct.RC = type { i32 }
define void @rc_treeout0(%struct.RC* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %7, %5 ], [ %1, %3 ]
%7 = add nsw i32 %6, -1
%8 = lshr i32 %2, %7
%9 = and i32 %8, 1
%10 = tail call i32 @rc_encode0(%struct.RC* %0, i32 %9)
%11 = icmp ugt i32 %6, 1
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret void
}
void XcmsTekHVCQueryMaxVSamples() {}


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

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

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

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