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

/* Variables and functions */
int /*<<< orphan*/ p264_pixel_avg_w4_mmxext(int /*<<< orphan*/ *, int,
                                            int /*<<< orphan*/ *, int,
                                            int /*<<< orphan*/ *, int, int);
void p264_pixel_avg_4x4_mmxext(uint8_t *dst, int i_dst, uint8_t *src,
                               int i_src) {
  p264_pixel_avg_w4_mmxext(dst, i_dst, dst, i_dst, src, i_src, 4);
}


x86 assembly (clang, -O0):
<p264_pixel_avg_4x4_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
movl   $0x4,(%rsp)
call   1030 <p264_pixel_avg_w4_mmxext@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p264_pixel_avg_4x4_mmxext>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
movl   $0x4,(%rsp)
mov    %rdi,%rdx
mov    %esi,%ecx
call   1030 <p264_pixel_avg_w4_mmxext@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @p264_pixel_avg_4x4_mmxext(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @p264_pixel_avg_w4_mmxext(i32* %0, i32 %1, i32* %0, i32 %1, i32* %2, i32 %3, i32 4)
ret void
}
int test_imm_A1int64_lowword_reg(long long val) {
  return ((val) & (0xA1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A1int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xa1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A1int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 161
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_51uint32_mem(unsigned int *val) {
  return ((*val) & (0x51 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_51uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 81
%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_51uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 81
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t timer_get(void) {
  uint64_t ret;
  struct timeval t;
  gettimeofday(&t, NULL);
  ret = 1000000 * ((uint64_t)t.tv_sec);
  ret += (uint64_t)t.tv_usec;
  return ret;
}


x86 assembly (clang, -O0):
<timer_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_get>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @timer_get() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 1000000, %6
store i32 %7, i32* %1
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = load i32, i32* %1
%12 = add nsw i32 %11, %10
store i32 %12, i32* %1
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @timer_get() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
ret i32 %11
}
/* Variables and functions */
void *malloc(size_t);
void *default_alloc(void *ctx, size_t size) {
  (void)ctx;
  return (malloc(size));
}


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

x86 assembly (clang, -O2):
<default_alloc>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @default_alloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
void test_cse_generic_ptr(void) {}


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

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

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

LLVM IR (-O2):
define void @test_cse_generic_ptr() {
ret void
}
/* Variables and functions */
int send(int, void const *, int, int);
int tcp_send(int skt, const void *ptr, int len, int flags) {
  return send(skt, ptr, len, flags);
}


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

x86 assembly (clang, -O2):
<tcp_send>:
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i32 @tcp_send(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
double evaluate(int apparitions, int inputLength, int sequenceLength) {
  double value =
      ((double)apparitions) / ((double)inputLength) * ((double)sequenceLength);
  return value;
}


x86 assembly (clang, -O0):
<evaluate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<evaluate>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @evaluate(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = fdiv double %9, %11
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to double
%15 = fmul double %12, %14
store double %15, double* %7
%16 = load double, double* %7
ret double %16
}

LLVM IR (-O2):
define double @evaluate(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fdiv double %4, %5
%7 = sitofp i32 %2 to double
%8 = fmul double %6, %7
ret double %8
}
/* Variables and functions */
void setEnvAtkClkLength(int *p, double u) {
  if (p != NULL) {
    if ((0.0 <= u) && (u <= 1.0)) {
      *p = (int)(((double)128) * u);
    }
  }
}


x86 assembly (clang, -O0):
<setEnvAtkClkLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <setEnvAtkClkLength+0x59>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1154 <setEnvAtkClkLength+0x54>
movsd  0xece(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1154 <setEnvAtkClkLength+0x54>
movsd  0xec3(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    1159 <setEnvAtkClkLength+0x59>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setEnvAtkClkLength>:
test   %rdi,%rdi
je     112b <setEnvAtkClkLength+0x2b>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <setEnvAtkClkLength+0x2b>
movsd  0xee9(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     112b <setEnvAtkClkLength+0x2b>
mulsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @setEnvAtkClkLength(i32* %0, double %1) {
%3 = alloca i32*
%4 = alloca double
store i32* %0, i32** %3
store double %1, double* %4
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = load double, double* %4
%9 = fcmp ole double 0.000000e+00, %8
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load double, double* %4
%12 = fcmp ole double %11, 1.000000e+00
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load double, double* %4
%15 = fmul double 1.280000e+02, %14
%16 = fptosi double %15 to i32
%17 = load i32*, i32** %3
store i32 %16, i32* %17
br label %18
18: ; preds = %13, %10, %7
br label %19
19: ; preds = %18, %2
ret void
}

LLVM IR (-O2):
define void @setEnvAtkClkLength(i32* writeonly %0, double %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = fcmp oge double %1, 0.000000e+00
%6 = fcmp ole double %1, 1.000000e+00
%7 = and i1 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = fmul double %1, 1.280000e+02
%10 = fptosi double %9 to i32
store i32 %10, i32* %0
br label %11
11: ; preds = %4, %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ t1_abort(char *, int);
int xiStub(void) {
  printf("xiStub called\n");
  t1_abort("xiStub called", 48);
  return (0);
}


x86 assembly (clang, -O0):
<xiStub>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x30,%esi
call   1030 <t1_abort@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xiStub>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x30,%esi
call   1040 <t1_abort@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"xiStub called\0A\00"
@.str.1 = [14 x i8] c"xiStub called\00"
define i32 @xiStub() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @t1_abort(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 48)
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"xiStub called\00"
define i32 @xiStub() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @t1_abort(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0), i32 48)
ret i32 0
}
int g(void (*ptr)()) { return 0; }


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

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

LLVM IR (-O0):
define i32 @g(void (...)* %0) {
%2 = alloca void (...)*
store void (...)* %0, void (...)** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @g(void (...)* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_apcmd_uap_stats(void) {
  printf("Usage: uap_stats \n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"Usage: uap_stats \00"
define void @print_apcmd_uap_stats() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("No FIPS SHAXXX support\n");
  return (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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"No FIPS SHAXXX support\0A\00"
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 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"No FIPS SHAXXX support\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XConfigureEvent;

/* Variables and functions */
void set_XConfigureEvent_window(void *_p, unsigned long _v) {
  ((XConfigureEvent *)_p)->window = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XConfigureEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int /*<<< orphan*/);
int matches(char *line, char *search) {
  return !strncmp(line, search, strlen(search));
}


x86 assembly (clang, -O0):
<matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matches>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @matches(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @matches(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
char removeblanks(char c) {
  if ((c == ' ') || (c == '\n') || (c == '\t')) {
    c = '-';
  }
  return c;
}


x86 assembly (clang, -O0):
<removeblanks>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
je     1131 <removeblanks+0x31>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1131 <removeblanks+0x31>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jne    1135 <removeblanks+0x35>
movb   $0x2d,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeblanks>:
lea    -0x9(%rdi),%eax
cmp    $0x2,%al
mov    $0x2d,%eax
mov    %edi,%ecx
cmovb  %eax,%ecx
cmp    $0x20,%dil
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @removeblanks(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = add i8 %0, -9
%4 = icmp ult i8 %3, 2
%5 = or i1 %2, %4
%6 = select i1 %5, i8 45, i8 %0
ret i8 %6
}
/* Type definitions */
typedef unsigned char __u32;

/* Variables and functions */
__u32 __cpu_to_be32(__u32 x) {
  register unsigned char *p = (unsigned char *)&x;
  return (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3];
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @__cpu_to_be32(i8 zeroext %0) {
ret i8 poison
}
/* Type definitions */
struct cfg_search {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cfg_search *);
void cfg_search_free(struct cfg_search *s) { free(s); }


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

x86 assembly (clang, -O2):
<cfg_search_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.cfg_search = type { i32 }
define void @cfg_search_free(%struct.cfg_search* nocapture %0) {
%2 = tail call i32 @free(%struct.cfg_search* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_contextaction_callback(int32_t session, int32_t channel_id,
                                   char *action, void *user_data) {
  printf("contextaction_callback\n");
}


x86 assembly (clang, -O0):
<mumble_contextaction_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"contextaction_callback\0A\00"
define void @mumble_contextaction_callback(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"contextaction_callback\00"
define void @mumble_contextaction_callback(i32 %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char ssize_t;

/* Variables and functions */
ssize_t countChar(ssize_t c, char *s) {
  char *p;
  ssize_t count;
  count = 0;
  for (p = s; *p != '\0'; p++) {
    if (*p == c)
      count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<countChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x19(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115b <countChar+0x5b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    1145 <countChar+0x45>
mov    -0x19(%rbp),%al
add    $0x1,%al
mov    %al,-0x19(%rbp)
jmp    114a <countChar+0x4a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <countChar+0x1a>
movsbl -0x19(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countChar>:
mov    (%rsi),%cl
test   %cl,%cl
je     1124 <countChar+0x24>
add    $0x1,%rsi
xor    %eax,%eax
nopl   0x0(%rax)
cmp    %dil,%cl
sete   %cl
add    %cl,%al
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <countChar+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @countChar(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%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 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %1, %2 ]
%9 = icmp eq i8 %6, %0
%10 = zext i1 %9 to i8
%11 = add i8 %7, %10
%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 [ 0, %2 ], [ %11, %5 ]
ret i8 %16
}
void process_header_content_type(void *vp_hdr, void *vp_val, void *vp_msg) {}


x86 assembly (clang, -O0):
<process_header_content_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @process_header_content_type(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @process_header_content_type(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
char *strnrev(char *, int /*<<< orphan*/);
char *strrev(char *str) { return strnrev(str, strlen(str)); }


x86 assembly (clang, -O0):
<strrev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <strnrev@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strrev(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @strnrev(i8* %0, i32 %2)
ret i8* %3
}
extern unsigned int __inb(unsigned short port) {
  unsigned int _v;
  __asm__ __volatile__("in"
                       "b"
                       " %"
                       "w"
                       "1,%"
                       "b"
                       "0"
                       : "=a"(_v)
                       : "d"(port), "0"(0));
  return _v;
}


x86 assembly (clang, -O0):
<__inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
xor    %eax,%eax
in     (%dx),%al
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inb>:
mov    %edi,%edx
xor    %eax,%eax
in     (%dx),%al
ret

LLVM IR (-O0):
define i32 @__inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 asm sideeffect "inb ${1:w},${0:b}", "={ax},{dx},0,~{dirflag},~{fpsr},~{flags}"(i16 %4, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @__inb(i16 zeroext %0) {
%2 = tail call i32 asm sideeffect "inb ${1:w},${0:b}", "={ax},{dx},0,~{dirflag},~{fpsr},~{flags}"(i16 %0, i32 0)
ret i32 %2
}
int writemask_x(const int writemask) { return (writemask == 0x1); }


x86 assembly (clang, -O0):
<writemask_x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<writemask_x>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @writemask_x(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ b64enc_buf(unsigned char const *, int, char *);
scalar_t__ malloc(int);
char *b64enc(const unsigned char *data, int len) {
  char *dest;
  dest = (char *)malloc(4 * len / 3 + 4);
  b64enc_buf(data, len, dest);
  return (dest);
}


x86 assembly (clang, -O0):
<b64enc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <b64enc_buf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64enc>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x0(,%r15,4),%eax
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
shr    $0x3f,%rax
lea    (%rcx,%rax,1),%edi
add    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rax,%rdx
call   1030 <b64enc_buf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @b64enc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 4, %6
%8 = sdiv i32 %7, 3
%9 = add nsw i32 %8, 4
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = call i32 @b64enc_buf(i8* %12, i32 %13, i8* %14)
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @b64enc(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = sdiv i32 %3, 3
%5 = add nsw i32 %4, 4
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @b64enc_buf(i8* %0, i32 %1, i8* %7)
ret i8* %7
}
void stradd(unsigned char *str1, unsigned char *str2) {
  while (*str2 != 0)
    str2++;
  asm("2:		lodsb;		or %%al,%%al;		jz 1f;	"
      "	stosb;		jmp 2b;		1:mov $0,%%al;stosb" ::"S"(
          (unsigned long)str1),
      "D"((unsigned long)str2));
}


x86 assembly (clang, -O0):
<stradd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     112d <stradd+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <stradd+0xc>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
lods   %ds:(%rsi),%al
or     %al,%al
je     1144 <stradd+0x44>
stos   %al,%es:(%rdi)
jmp    1135 <stradd+0x35>
mov    $0x0,%al
stos   %al,%es:(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stradd>:
lea    -0x1(%rsi),%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rax
cmpb   $0x0,(%rsi)
lea    0x1(%rsi),%rsi
jne    1110 <stradd+0x10>
mov    %rdi,%rsi
mov    %rax,%rdi
lods   %ds:(%rsi),%al
or     %al,%al
je     112b <stradd+0x2b>
stos   %al,%es:(%rdi)
jmp    1123 <stradd+0x23>
mov    $0x0,%al
stos   %al,%es:(%rdi)
ret

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

LLVM IR (-O2):
define void @stradd(i8* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %0 to i64
%10 = ptrtoint i8* %4 to i64
tail call void asm sideeffect "2:\09\09lodsb;\09\09or %al,%al;\09\09jz 1f;\09\09stosb;\09\09jmp 2b;\09\091:mov $$0,%al;stosb", "{si},{di},~{dirflag},~{fpsr},~{flags}"(i64 %9, i64 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("Usage: sortidx [OPTIONS] <INDEX>\n\n"
         "Options:\n"
         "-r n      'n' is the sort buffer size (memory) in megabytes\n");
}


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

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

LLVM IR (-O0):
@.str = [104 x i8] c"Usage: sortidx [OPTIONS] <INDEX>\0A\0AOptions:\0A-r n 'n' is the sort buffer size (memory) in megabytes\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [103 x i8] c"Usage: sortidx [OPTIONS] <INDEX>\0A\0AOptions:\0A-r n 'n' is the sort buffer size (memory) in megabytes\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([103 x i8], [103 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("This is a \"post/bin\" target.\n");
  return 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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"This is a \22post/bin\22 target.\0A\00"
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 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"This is a \22post/bin\22 target.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int FILE_SIZE_VALID(scalar_t__);
bool FILE_SIZE_VALID_OR_INFINITY(uint64_t l) {
  if (l == (uint64_t)-1)
    return true;
  return FILE_SIZE_VALID(l);
}


x86 assembly (clang, -O0):
<FILE_SIZE_VALID_OR_INFINITY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1133 <FILE_SIZE_VALID_OR_INFINITY+0x23>
movl   $0x1,-0x4(%rbp)
jmp    113f <FILE_SIZE_VALID_OR_INFINITY+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <FILE_SIZE_VALID@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FILE_SIZE_VALID_OR_INFINITY>:
cmp    $0xffffffffffffffff,%rdi
je     111b <FILE_SIZE_VALID_OR_INFINITY+0xb>
jmp    1030 <FILE_SIZE_VALID@plt>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @FILE_SIZE_VALID_OR_INFINITY(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %3
%9 = call i32 @FILE_SIZE_VALID(i64 %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @FILE_SIZE_VALID_OR_INFINITY(i64 %0) {
%2 = icmp eq i64 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @FILE_SIZE_VALID(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int toupper(char);
char *strupr(char *s) {
  while (*s) {
    int c = toupper(*s);
    *s++ = c;
  }
  return s;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <strupr+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111c <strupr+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%cl
test   %cl,%cl
je     113d <strupr+0x2d>
nopw   0x0(%rax,%rax,1)
movsbl %cl,%edi
call   1030 <toupper@plt>
mov    %eax,%ecx
lea    0x1(%rbx),%rax
mov    %cl,(%rbx)
movzbl 0x1(%rbx),%ecx
mov    %rax,%rbx
test   %cl,%cl
jne    1120 <strupr+0x10>
pop    %rbx
ret
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strupr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
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 i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @toupper(i8 signext %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
store i8 %13, i8* %14
br label %4
16: ; preds = %4
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @strupr(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @toupper(i8 signext %5)
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %8, i8* %6
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i8* [ %0, %1 ], [ %9, %4 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ strrchr(char *, int);
void uninitvar_strrchr(void) {
  char *str;
  int c;
  (void)strrchr(str, c);
}


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

x86 assembly (clang, -O2):
<uninitvar_strrchr>:
jmp    1030 <strrchr@plt>

LLVM IR (-O0):
define void @uninitvar_strrchr() {
%1 = alloca i8*
%2 = alloca i32
%3 = load i8*, i8** %1
%4 = load i32, i32* %2
%5 = call i32 @strrchr(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strrchr() {
%1 = tail call i32 @strrchr(i8* undef, i32 undef)
ret void
}
int _calculate_audio_address(int channels, int quality, int protection,
                             int mode, int index) {
  int addr;
  addr = 1 << 7;
  addr |= (channels & 1) << 6;
  addr |= (quality & 1) << 5;
  addr |= (protection & 1) << 4;
  addr |= (mode & 1) << 3;
  addr |= index & 7;
  return (addr);
}


x86 assembly (clang, -O0):
<_calculate_audio_address>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
movl   $0x80,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x6,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
shl    $0x5,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
shl    $0x4,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1,%eax
shl    $0x3,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    $0x7,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_calculate_audio_address>:
shl    $0x6,%edi
movzbl %dil,%eax
shl    $0x5,%esi
and    $0x20,%esi
or     %eax,%esi
shl    $0x4,%edx
and    $0x10,%edx
or     %esi,%edx
and    $0x1,%ecx
and    $0x7,%r8d
lea    (%rdx,%rcx,8),%eax
or     %r8d,%eax
or     $0x80,%eax
ret

LLVM IR (-O0):
define i32 @_calculate_audio_address(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
store i32 128, i32* %11
%12 = load i32, i32* %6
%13 = and i32 %12, 1
%14 = shl i32 %13, 6
%15 = load i32, i32* %11
%16 = or i32 %15, %14
store i32 %16, i32* %11
%17 = load i32, i32* %7
%18 = and i32 %17, 1
%19 = shl i32 %18, 5
%20 = load i32, i32* %11
%21 = or i32 %20, %19
store i32 %21, i32* %11
%22 = load i32, i32* %8
%23 = and i32 %22, 1
%24 = shl i32 %23, 4
%25 = load i32, i32* %11
%26 = or i32 %25, %24
store i32 %26, i32* %11
%27 = load i32, i32* %9
%28 = and i32 %27, 1
%29 = shl i32 %28, 3
%30 = load i32, i32* %11
%31 = or i32 %30, %29
store i32 %31, i32* %11
%32 = load i32, i32* %10
%33 = and i32 %32, 7
%34 = load i32, i32* %11
%35 = or i32 %34, %33
store i32 %35, i32* %11
%36 = load i32, i32* %11
ret i32 %36
}

LLVM IR (-O2):
define i32 @_calculate_audio_address(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = shl i32 %0, 6
%7 = and i32 %6, 64
%8 = shl i32 %1, 5
%9 = and i32 %8, 32
%10 = shl i32 %2, 4
%11 = and i32 %10, 16
%12 = shl i32 %3, 3
%13 = and i32 %12, 8
%14 = and i32 %4, 7
%15 = or i32 %7, %9
%16 = or i32 %15, %11
%17 = or i32 %16, %13
%18 = or i32 %17, %14
%19 = or i32 %18, 128
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *, int, int);
int main() {
  int x[2];
  foo(x, 2, 1);
#pragma omp taskwait
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%3 = call i32 @foo(i32* %2, i32 2, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3, i32 2, i32 1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int registers_read_byte(int);
int /*<<< orphan*/ registers_write_byte(int, int);
void motion_disable(void) {
  uint8_t flags_lo = registers_read_byte(0x05);
  registers_write_byte(0x05, flags_lo & ~(1 << 0x02));
}


x86 assembly (clang, -O0):
<motion_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1040 <registers_read_byte@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
and    $0xfffffffb,%esi
mov    $0x5,%edi
call   1030 <registers_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<motion_disable>:
push   %rax
mov    $0x5,%edi
call   1040 <registers_read_byte@plt>
and    $0xfffffffb,%eax
mov    $0x5,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <registers_write_byte@plt>

LLVM IR (-O0):
define void @motion_disable() {
%1 = alloca i32
%2 = call i32 @registers_read_byte(i32 5)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -5
%5 = call i32 @registers_write_byte(i32 5, i32 %4)
ret void
}

LLVM IR (-O2):
define void @motion_disable() {
%1 = tail call i32 @registers_read_byte(i32 5)
%2 = and i32 %1, -5
%3 = tail call i32 @registers_write_byte(i32 5, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ec_method_decode_matrix_init(int, int);
int main(void) { ec_method_decode_matrix_init(5, 3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <ec_method_decode_matrix_init@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <ec_method_decode_matrix_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @ec_method_decode_matrix_init(i32 5, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ec_method_decode_matrix_init(i32 5, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: pngtochr [-hv] [-b <bbp>] [-o <f>] [-t <NxM>] [file ...]\n");
  fprintf(stderr, "-b <bbp>    bits per pixel for output file (default "
                  "2"
                  ").\n"
                  "-o <f>      output file (default '"
                  "out.chr"
                  "').\n"
                  "-t <NxM>    size of tile (default "
                  "8"
                  "x"
                  "8"
                  ").\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf12(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"usage: pngtochr [-hv] [-b <bbp>] [-o <f>] [-t <NxM>] [file ...]\0A\00"
@.str.1 = [142 x i8] c"-b <bbp> bits per pixel for output file (default 2).\0A-o <f> output file (default 'out.chr').\0A-t <NxM> size of tile (default 8x8).\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"usage: pngtochr [-hv] [-b <bbp>] [-o <f>] [-t <NxM>] [file ...]\0A\00"
@.str.1 = [142 x i8] c"-b <bbp> bits per pixel for output file (default 2).\0A-o <f> output file (default 'out.chr').\0A-t <NxM> size of tile (default 8x8).\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char const *);
int /*<<< orphan*/ zwm_view_set(int);
void goto_view(const char *arg) {
  int v = atoi(arg);
  zwm_view_set(v);
}


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

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

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

LLVM IR (-O2):
define void @goto_view(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = tail call i32 @zwm_view_set(i32 %2)
ret void
}