xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void p(uint32_t *msg, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%08x", msg[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <p+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <p+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <p+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <p+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%08x\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @p(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%08x\00"
define void @p(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
double ndvi(double red, double nir) {
  double result;
  if (red + nir <= 0.001) {
    result = -1.0;
  } else {
    result = (nir - red) / (red + nir);
  }
  return result;
}


x86 assembly (clang, -O0):
<ndvi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     113c <ndvi+0x3c>
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1159 <ndvi+0x59>
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndvi>:
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0xef8(%rip),%xmm3
ucomisd %xmm2,%xmm3
jae    1123 <ndvi+0x23>
subsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret
movsd  0xed5(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ndvi(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double %6, %7
%9 = fcmp ole double %8, 1.000000e-03
br i1 %9, label %10, label %11
10: ; preds = %2
store double -1.000000e+00, double* %5
br label %19
11: ; preds = %2
%12 = load double, double* %4
%13 = load double, double* %3
%14 = fsub double %12, %13
%15 = load double, double* %3
%16 = load double, double* %4
%17 = fadd double %15, %16
%18 = fdiv double %14, %17
store double %18, double* %5
br label %19
19: ; preds = %11, %10
%20 = load double, double* %5
ret double %20
}

LLVM IR (-O2):
define double @ndvi(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fcmp ugt double %3, 1.000000e-03
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = fsub double %1, %0
%7 = fdiv double %6, %3
br label %8
8: ; preds = %2, %5
%9 = phi double [ %7, %5 ], [ -1.000000e+00, %2 ]
ret double %9
}
void ff_hevc_put_hevc_uni_w_qpel_h12_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_h12_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR56_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR56_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR56_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strdup(char *s) {
  char *rv = malloc(strlen(s) + 1);
  strcpy(rv, s);
  return rv;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ format;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
int get_XImage_format(void *_p) { return (int)((XImage *)_p)->format; }


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

x86 assembly (clang, -O2):
<get_XImage_format>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XImage_format(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XImage_format(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *_malloc(size_t size) {
  void *result = malloc(size);
  if (!result) {
    perror("malloc");
    _exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <_malloc+0x3e>
lea    0xea5(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <_malloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @_exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
int sys$sndopr(void *msgbuf, unsigned short int chan) {
  return ({
    unsigned long resultvar;
    register long int _a2 asm("rsi") = (long)((int)chan);
    register long int _a1 asm("rdi") = (long)(msgbuf);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(107), "r"(_a1), "r"(_a2)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$sndopr>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x6b,%rax
int    $0x81
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$sndopr>:
mov    %esi,%esi
mov    $0x6b,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$sndopr"(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %3
store i16 %1, i16* %4
%9 = load i16, i16* %4
%10 = zext i16 %9 to i32
%11 = sext i32 %10 to i64
store i64 %11, i64* %6
%12 = load i8*, i8** %3
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %7
%14 = load i64, i64* %7
%15 = load i64, i64* %6
%16 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 107, i64 %14, i64 %15)
store i64 %16, i64* %5
%17 = load i64, i64* %5
store i64 %17, i64* %8
%18 = load i64, i64* %8
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @"sys$sndopr"(i8* %0, i16 zeroext %1) {
%3 = zext i16 %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 107, i64 %4, i64 %3)
%6 = trunc i64 %5 to i32
ret i32 %6
}
int test_imm_B3int16_reg(short val) {
  return ((val) & (-0xB3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B3int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff4d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B3int16_reg>:
test   $0xff4d,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B3int16_reg(i16 signext %0) {
%2 = and i16 %0, -179
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PathActionHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void PathActionRequestUpdate() { UAVObjRequestUpdate(PathActionHandle()); }


x86 assembly (clang, -O0):
<PathActionRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PathActionHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PathActionRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <PathActionHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @PathActionRequestUpdate() {
%1 = call i32 (...) @PathActionHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PathActionRequestUpdate() {
%1 = tail call i32 (...) @PathActionHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
double InGamma(long, double);
double cdfErlang(long n, double b, double x) { return (InGamma(n, x / b)); }


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

x86 assembly (clang, -O2):
<cdfErlang>:
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <InGamma@plt>

LLVM IR (-O0):
define double @cdfErlang(i64 %0, double %1, double %2) {
%4 = alloca i64
%5 = alloca double
%6 = alloca double
store i64 %0, i64* %4
store double %1, double* %5
store double %2, double* %6
%7 = load i64, i64* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = fdiv double %8, %9
%11 = call double @InGamma(i64 %7, double %10)
ret double %11
}

LLVM IR (-O2):
define double @cdfErlang(i64 %0, double %1, double %2) {
%4 = fdiv double %2, %1
%5 = tail call double @InGamma(i64 %0, double %4)
ret double %5
}
void g_utf16_to_ucs4() {}


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

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

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

LLVM IR (-O2):
define void @g_utf16_to_ucs4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test21_head() {
  do {
    printf("test21");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test21_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test21_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test21_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test21\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test21_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test21\00"
define void @test21_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_ancs_meta_get_subevent_code(const uint8_t *event) {
  return event[2];
}


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

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

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

LLVM IR (-O2):
define i32 @hci_event_ancs_meta_get_subevent_code(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int tp_mtu(void) {
  fprintf(stderr, "tp_mtu called\n");
  return 1024;
}


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

x86 assembly (clang, -O2):
<tp_mtu>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x400,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"tp_mtu called\0A\00"
define i32 @tp_mtu() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 1024
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"tp_mtu called\0A\00"
define i32 @tp_mtu() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 1024
}
/* Type definitions */
struct evloop {
  int dummy;
};
struct ev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _stop_ev(struct evloop *, struct ev *);
void evsig_stop(struct evloop *loop, struct ev *ev) { _stop_ev(loop, ev); }


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

x86 assembly (clang, -O2):
<evsig_stop>:
jmp    1030 <_stop_ev@plt>

LLVM IR (-O0):
%struct.evloop = type { i32 }
%struct.ev = type { i32 }
define void @evsig_stop(%struct.evloop* %0, %struct.ev* %1) {
%3 = alloca %struct.evloop*
%4 = alloca %struct.ev*
store %struct.evloop* %0, %struct.evloop** %3
store %struct.ev* %1, %struct.ev** %4
%5 = load %struct.evloop*, %struct.evloop** %3
%6 = load %struct.ev*, %struct.ev** %4
%7 = call i32 @_stop_ev(%struct.evloop* %5, %struct.ev* %6)
ret void
}

LLVM IR (-O2):
%struct.evloop = type { i32 }
%struct.ev = type { i32 }
define void @evsig_stop(%struct.evloop* %0, %struct.ev* %1) {
%3 = tail call i32 @_stop_ev(%struct.evloop* %0, %struct.ev* %1)
ret void
}
void w19(void *x, double y) { *(double *)(x + 32749) = y; }


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

x86 assembly (clang, -O2):
<w19>:
movsd  %xmm0,0x7fed(%rdi)
ret

LLVM IR (-O0):
define void @w19(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32749
%8 = bitcast i8* %7 to double*
store double %5, double* %8
ret void
}

LLVM IR (-O2):
define void @w19(i8* nocapture writeonly %0, double %1) {
%3 = getelementptr i8, i8* %0, i64 32749
%4 = bitcast i8* %3 to double*
store double %1, double* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int, char const *, char const *,
                          char const *);
extern void printgnu(const char *pname, int year, const char *dev,
                     const char *email, const char *www) {
  printf("\n"
         "    %s\n\n"
         "    Copyright (C) %i %s <%s>\n\n"
         "        %s\n\n"
         "    This program comes with ABSOLUTELY NO WARRANTY\n"
         "    This is free software, and you are welcome to redistribute it\n"
         "    under certain conditions.\n\n",
         pname, year, dev, email, www);
}


x86 assembly (clang, -O0):
<printgnu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printgnu>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [200 x i8] c"\0A %s\0A\0A Copyright (C) %i %s <%s>\0A\0A %s\0A\0A This program comes with ABSOLUTELY NO WARRANTY\0A This is free software, and you are welcome to redistribute it\0A under certain conditions.\0A\0A\00"
define void @printgnu(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @printf(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i8* %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [200 x i8] c"\0A %s\0A\0A Copyright (C) %i %s <%s>\0A\0A %s\0A\0A This program comes with ABSOLUTELY NO WARRANTY\0A This is free software, and you are welcome to redistribute it\0A under certain conditions.\0A\0A\00"
define void @printgnu(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i8* %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ buildbinarytotrinary();
int /*<<< orphan*/ buildexpandtable();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  buildbinarytotrinary();
  buildexpandtable();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <buildbinarytotrinary@plt>
mov    $0x0,%al
call   1040 <buildexpandtable@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <buildbinarytotrinary@plt>
xor    %eax,%eax
call   1040 <buildexpandtable@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @buildbinarytotrinary()
%7 = call i32 (...) @buildexpandtable()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @buildbinarytotrinary()
%4 = tail call i32 (...) @buildexpandtable()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int, unsigned int);
int main(int argc, char *argv[]) {
  signed char c = 0x80;
  int i = c;
  unsigned u = c;
  printf("%d %d %d\n", c, i, u);
  printf("%u %u %u\n", c, i, u);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x80,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
movsbl -0x11(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x11(%rbp),%al
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xeb8(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x11(%rbp),%al
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xeaa(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [10 x i8] c"%u %u %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 -128, i8* %6
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
store i32 %10, i32* %7
%11 = load i8, i8* %6
%12 = sext i8 %11 to i32
store i32 %12, i32* %8
%13 = load i8, i8* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %13, i32 %14, i32 %15)
%17 = load i8, i8* %6
%18 = load i32, i32* %7
%19 = load i32, i32* %8
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %17, i32 %18, i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [10 x i8] c"%u %u %u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext -128, i32 -128, i32 -128)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext -128, i32 -128, i32 -128)
ret i32 0
}
/* Type definitions */
struct membuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ detach_buffer(struct membuffer *);
int /*<<< orphan*/ free(int /*<<< orphan*/);
void free_buffer(struct membuffer *b) { free(detach_buffer(b)); }


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

x86 assembly (clang, -O2):
<free_buffer>:
push   %rax
call   1040 <detach_buffer@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.membuffer = type { i32 }
define void @free_buffer(%struct.membuffer* %0) {
%2 = alloca %struct.membuffer*
store %struct.membuffer* %0, %struct.membuffer** %2
%3 = load %struct.membuffer*, %struct.membuffer** %2
%4 = call i32 @detach_buffer(%struct.membuffer* %3)
%5 = call i32 @free(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.membuffer = type { i32 }
define void @free_buffer(%struct.membuffer* %0) {
%2 = tail call i32 @detach_buffer(%struct.membuffer* %0)
%3 = tail call i32 @free(i32 %2)
ret void
}
void test_segf() {
  int y = 0;
  int x = 4 / y;
}


x86 assembly (clang, -O0):
<test_segf>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_segf() {
ret void
}
int is_prime(int n) {
  int i = 2, a = 1;
  while (a != 0 && i < n) {
    if (n % i == 0)
      a = 0;
    i++;
  }
  return a;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1130 <is_prime+0x30>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <is_prime+0x40>
jmp    1165 <is_prime+0x65>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1157 <is_prime+0x57>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <is_prime+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%eax
cmp    $0x3,%edi
jl     112c <is_prime+0x2c>
mov    $0x3,%ecx
nop
lea    -0x1(%rcx),%esi
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1125 <is_prime+0x25>
lea    0x1(%rcx),%eax
cmp    %edi,%ecx
mov    %eax,%ecx
jl     1110 <is_prime+0x10>
xor    %eax,%eax
test   %edx,%edx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp ne i32 %5, 0
%7 = add nuw nsw i32 %4, 1
%8 = icmp slt i32 %7, %0
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %3, label %10
10: ; preds = %3
%11 = zext i1 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 1, %1 ], [ %11, %10 ]
ret i32 %13
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int calc_taps(scalar_t__, scalar_t__);
size_t padded_sl_len_offset(uint32_t in_width, uint32_t out_width, uint8_t cmp,
                            size_t *offset) {
  uint64_t taps;
  taps = calc_taps(in_width, out_width);
  *offset = (taps / 2 + 1) * cmp;
  return (size_t)in_width * cmp + *offset * 2;
}


x86 assembly (clang, -O0):
<padded_sl_len_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calc_taps@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
imul   -0x14(%rbp),%eax
movslq %eax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rcx,%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x1,%rcx
add    %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padded_sl_len_offset>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <calc_taps@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
add    $0x1,%ecx
imul   %ebp,%ecx
movslq %ecx,%rax
mov    %rax,(%r14)
movslq %ebp,%rcx
imul   %rbx,%rcx
lea    (%rcx,%rax,2),%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @padded_sl_len_offset(i64 %0, i64 %1, i32 %2, i64* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i64*
%9 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i64* %3, i64** %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = call i32 @calc_taps(i64 %10, i64 %11)
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = sdiv i32 %13, 2
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %7
%17 = mul nsw i32 %15, %16
%18 = sext i32 %17 to i64
%19 = load i64*, i64** %8
store i64 %18, i64* %19
%20 = load i64, i64* %5
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = mul i64 %20, %22
%24 = load i64*, i64** %8
%25 = load i64, i64* %24
%26 = mul i64 %25, 2
%27 = add i64 %23, %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @padded_sl_len_offset(i64 %0, i64 %1, i32 %2, i64* nocapture writeonly %3) {
%5 = tail call i32 @calc_taps(i64 %0, i64 %1)
%6 = sdiv i32 %5, 2
%7 = add nsw i32 %6, 1
%8 = mul nsw i32 %7, %2
%9 = sext i32 %8 to i64
store i64 %9, i64* %3
%10 = sext i32 %2 to i64
%11 = mul i64 %10, %0
%12 = shl nsw i64 %9, 1
%13 = add i64 %12, %11
ret i64 %13
}
/* Type definitions */
struct digest_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ digest_destroy(struct digest_ctx *);
void prf_destroy(struct digest_ctx *ctx) { digest_destroy(ctx); }


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

x86 assembly (clang, -O2):
<prf_destroy>:
jmp    1030 <digest_destroy@plt>

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

LLVM IR (-O2):
%struct.digest_ctx = type { i32 }
define void @prf_destroy(%struct.digest_ctx* %0) {
%2 = tail call i32 @digest_destroy(%struct.digest_ctx* %0)
ret void
}
int pathconN_nm5_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @pathconN_nm5_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @pathconN_nm5_n_out() {
ret i32 2
}
void PEM_read_bio_X509(void) {}


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

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

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

LLVM IR (-O2):
define void @PEM_read_bio_X509() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_disk_usage(int *);
int /*<<< orphan*/ printf(char *, char *);
void print_delete_status(int *disk_usage, int status, char file[]) {
  switch (status) {
  case -2:
    printf("Erro: arquivo nao encontrado %s\n", file);
    break;
  default:
    printf("Arquivo %s deletado\n", file);
    break;
  }
  print_disk_usage(disk_usage);
}


x86 assembly (clang, -O0):
<print_delete_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    $0xfffffffe,%eax
jne    1159 <print_delete_status+0x39>
jmp    1144 <print_delete_status+0x24>
mov    -0x18(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <print_delete_status+0x49>
mov    -0x18(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <print_disk_usage@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_delete_status>:
push   %rbx
mov    %rdi,%rbx
cmp    $0xfffffffe,%esi
lea    0xed2(%rip),%rax
lea    0xeec(%rip),%rdi
cmove  %rax,%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <print_disk_usage@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Erro: arquivo nao encontrado %s\0A\00"
@.str.1 = [21 x i8] c"Arquivo %s deletado\0A\00"
define void @print_delete_status(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
switch i32 %7, label %11 [
i32 -2, label %8
]
8: ; preds = %3
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %14
11: ; preds = %3
%12 = load i8*, i8** %6
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %8
%15 = load i32*, i32** %4
%16 = call i32 @print_disk_usage(i32* %15)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Erro: arquivo nao encontrado %s\0A\00"
@.str.1 = [21 x i8] c"Arquivo %s deletado\0A\00"
define void @print_delete_status(i32* %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, -2
%5 = select i1 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i8* %2)
%7 = tail call i32 @print_disk_usage(i32* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t get16bit(const uint8_t **ptr) {
  uint32_t t16;
  t16 = (*ptr)[1] + 256 * (*ptr)[0];
  (*ptr) += 2;
  return t16;
}


x86 assembly (clang, -O0):
<get16bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    (%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16bit>:
mov    (%rdi),%rcx
mov    (%rcx),%eax
shl    $0x8,%eax
add    0x4(%rcx),%eax
add    $0x8,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @get16bit(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = load i32**, i32*** %2
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = mul nsw i32 256, %11
%13 = add nsw i32 %7, %12
store i32 %13, i32* %3
%14 = load i32**, i32*** %2
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32* %16, i32** %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @get16bit(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 1
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = shl nsw i32 %5, 8
%7 = add nsw i32 %6, %4
%8 = getelementptr inbounds i32, i32* %2, i64 2
store i32* %8, i32** %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ManualControlCommandHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void ManualControlCommandLogging() {
  UAVObjLogging(ManualControlCommandHandle());
}


x86 assembly (clang, -O0):
<ManualControlCommandLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ManualControlCommandHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ManualControlCommandLogging>:
push   %rax
xor    %eax,%eax
call   1040 <ManualControlCommandHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @ManualControlCommandLogging() {
%1 = call i32 (...) @ManualControlCommandHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ManualControlCommandLogging() {
%1 = tail call i32 (...) @ManualControlCommandHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int atoi(char *);
char *conf_get_str(char const *, char const *);
int conf_get_num(const char *section, const char *tag, int def) {
  char *value = conf_get_str(section, tag);
  if (value)
    return atoi(value);
  return def;
}


x86 assembly (clang, -O0):
<conf_get_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <conf_get_str@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1160 <conf_get_num+0x40>
mov    -0x28(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1166 <conf_get_num+0x46>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_get_num>:
push   %rbx
mov    %edx,%ebx
call   1030 <conf_get_str@plt>
test   %rax,%rax
je     1136 <conf_get_num+0x16>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @conf_get_num(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @conf_get_str(i8* %0, i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ %2, %3 ]
ret i32 %9
}
/* Variables and functions */
char *strrchr(const char *s, int c) {
  const char *rc = NULL;
  for (; *s != '\0'; s++) {
    if (*s == c)
      rc = s;
  }
  return (char *)rc;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <strrchr+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    113b <strrchr+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1140 <strrchr+0x40>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ null, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = select i1 %10, i8* %8, i8* %7
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ null, %2 ], [ %11, %5 ]
ret i8* %16
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ page_flag_longname(scalar_t__);
int /*<<< orphan*/ page_flag_name(scalar_t__);
scalar_t__ parse_flag_names(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned long long, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void describe_flags(const char *optarg) {
  uint64_t flags = parse_flag_names(optarg, 0);
  printf("0x%016llx\t%s\t%s\n", (unsigned long long)flags,
         page_flag_name(flags), page_flag_longname(flags));
}


x86 assembly (clang, -O0):
<describe_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <parse_flag_names@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <page_flag_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <page_flag_longname@plt>
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<describe_flags>:
push   %rbp
push   %rbx
push   %rax
xor    %esi,%esi
call   1050 <parse_flag_names@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <page_flag_name@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <page_flag_longname@plt>
lea    0xe9a(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"0x%016llx\09%s\09%s\0A\00"
define void @describe_flags(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @parse_flag_names(i8* %4, i32 0)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = call i32 @page_flag_name(i64 %7)
%9 = load i64, i64* %3
%10 = call i32 @page_flag_longname(i64 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %6, i32 %8, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"0x%016llx\09%s\09%s\0A\00"
define void @describe_flags(i8* %0) {
%2 = tail call i64 @parse_flag_names(i8* %0, i32 0)
%3 = tail call i32 @page_flag_name(i64 %2)
%4 = tail call i32 @page_flag_longname(i64 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %2, i32 %3, i32 %4)
ret void
}