xunge/DecIR huggingface dataset:
int test_imm_6Euint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x6E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Euint64_highword_reg>:
movabs $0x6e00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Euint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 110
%6 = icmp ne i64 %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_6Euint64_highword_reg(i64 %0) {
%2 = and i64 %0, 472446402560
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ qe_isspace(char const);
void skip_spaces(const char **pp) {
  const char *p;
  p = *pp;
  while (qe_isspace(*p))
    p++;
  *pp = p;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <qe_isspace@plt>
cmp    $0x0,%rax
je     114e <skip_spaces+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <skip_spaces+0x17>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
add    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <qe_isspace@plt>
test   %rax,%rax
jne    1120 <skip_spaces+0x10>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @skip_spaces(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = tail call i64 @qe_isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
store i8* %4, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_usage(void) {
  printf("Usage:\n"
         "  -h, --help       show logdb version, usage, and exit\n"
         "\n"
         "  -c, --config=S   assign the config file path\n"
         "\n"
         "  -f  --offset=N   offset time\n"
         "  -s  --syncdb     sync database\n"
         "  -m  --merge      create merge table\n"
         "\n"
         "  -a  --api        generate api\n"
         "\n"
         "  -q  --queue-stat print queue status\n"
         "  -r  --rm-queue   rm all queue shm by call ipcrm\n"
         "\n"
         "Report bugs to <damonyang@tencent.com>\n");
}


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

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

LLVM IR (-O0):
@.str = [376 x i8] c"Usage:\0A -h, --help show logdb version, usage, and exit\0A\0A -c, --config=S assign the config file path\0A\0A -f --offset=N offset time\0A -s --syncdb sync database\0A -m --merge create merge table\0A\0A -a --api generate api\0A\0A -q --queue-stat print queue status\0A -r --rm-queue rm all queue shm by call ipcrm\0A\0AReport bugs to <damonyang@tencent.com>\0A\00"
define void @show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([376 x i8], [376 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [375 x i8] c"Usage:\0A -h, --help show logdb version, usage, and exit\0A\0A -c, --config=S assign the config file path\0A\0A -f --offset=N offset time\0A -s --syncdb sync database\0A -m --merge create merge table\0A\0A -a --api generate api\0A\0A -q --queue-stat print queue status\0A -r --rm-queue rm all queue shm by call ipcrm\0A\0AReport bugs to <damonyang@tencent.com>\00"
define void @show_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([375 x i8], [375 x i8]* @str, i64 0, i64 0))
ret void
}
long double longdouble_ignoring_signedlonglong(long double x,
                                               signed long long y) {
  return x;
}


x86 assembly (clang, -O0):
<longdouble_ignoring_signedlonglong>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_signedlonglong>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @longdouble_ignoring_signedlonglong(x86_fp80 %0, i64 %1) {
%3 = alloca x86_fp80
%4 = alloca i64
store x86_fp80 %0, x86_fp80* %3
store i64 %1, i64* %4
%5 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_signedlonglong(x86_fp80 returned %0, i64 %1) {
ret x86_fp80 %0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((__weak__, __always___)) void softboundcets_abort() { abort(); }


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

x86 assembly (clang, -O2):
<softboundcets_abort>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define weak void @softboundcets_abort() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define weak void @softboundcets_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
void __DELETE_java_security_BasicPermission(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_security_BasicPermission(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int test_pattern(unsigned int base, unsigned int address) {
  address &= 0x0ffff;
  address = address + (address << 16);
  return address;
}


x86 assembly (clang, -O0):
<test_pattern>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pattern>:
movzwl %si,%eax
shl    $0x10,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @test_pattern(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 65535
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 16
%10 = add i32 %7, %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_pattern(i32 %0, i32 %1) {
%3 = and i32 %1, 65535
%4 = shl i32 %1, 16
%5 = or i32 %3, %4
ret i32 %5
}
void bitwise_rel(unsigned i) {
  (void)(i & 0x2 == 0);
  (void)(0 == i & 0x2);
  (void)(i & 0xff < 30);
  (void)((i & 0x2) == 0);
  (void)(i & (0x2 == 0));
  (void)(i == 1 | i == 2 | i == 3);
  (void)(i != 1 & i != 2 & i != 3);
}


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

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

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

LLVM IR (-O2):
define void @bitwise_rel(i32 %0) {
ret void
}
/* Type definitions */
typedef double time_t;
struct timespec {
  double tv_sec;
  long tv_nsec;
};

/* Variables and functions */
scalar_t__ floor(double);
struct timespec wi_dtots(double d) {
  struct timespec ts;
  ts.tv_sec = (time_t)floor(d);
  ts.tv_nsec = (long)((d - ts.tv_sec) * 1000000000.0);
  return ts;
}


x86 assembly (clang, -O0):
<wi_dtots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <floor@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wi_dtots>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xecc(%rip),%xmm1
cvttsd2si %xmm1,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { double, i64 }
define { double, i64 } @wi_dtots(double %0) {
%2 = alloca %struct.timespec
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i64 @floor(double %4)
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store double %6, double* %7
%8 = load double, double* %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = fmul double %11, 1.000000e+09
%13 = fptosi double %12 to i64
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 %13, i64* %14
%15 = bitcast %struct.timespec* %2 to { double, i64 }*
%16 = load { double, i64 }, { double, i64 }* %15
ret { double, i64 } %16
}

LLVM IR (-O2):
define { double, i64 } @wi_dtots(double %0) {
%2 = tail call i64 @floor(double %0)
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fmul double %4, 1.000000e+09
%6 = fptosi double %5 to i64
%7 = insertvalue { double, i64 } poison, double %3, 0
%8 = insertvalue { double, i64 } %7, i64 %6, 1
ret { double, i64 } %8
}
void f(char *a) { __builtin_strcpy(a, "Hi!THE"); }


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

x86 assembly (clang, -O2):
<f>:
movl   $0x454854,0x3(%rdi)
movl   $0x54216948,(%rdi)
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Hi!THE\00"
define void @f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strcpy(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hi!THE\00"
define void @f(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(7) %0, i8* align 1 dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 7, i1 false)
ret void
}
int main() {
  double a = 0, fx(double), foo();
  fx(a);
  if (a != 3)
    foo();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fx@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1163 <main+0x43>
jp     1163 <main+0x43>
jmp    116a <main+0x4a>
mov    $0x0,%al
call   1040 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xorps  %xmm0,%xmm0
call   1030 <fx@plt>
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
%3 = load double, double* %2
%4 = call double @fx(double %3)
%5 = load double, double* %2
%6 = fcmp une double %5, 3.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call double (...) @foo()
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @fx(double 0.000000e+00)
%2 = tail call double (...) @foo()
ret i32 0
}
int sqri(int a) { return a * a; }


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

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

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

LLVM IR (-O2):
define i32 @sqri(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int push_stack(char *stack, int top, char ch) {
  top++;
  if (top >= 128) {
    top = 0;
  }
  stack[top] = ch;
  return top;
}


x86 assembly (clang, -O0):
<push_stack>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jl     112d <push_stack+0x2d>
movl   $0x0,-0xc(%rbp)
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_stack>:
lea    0x1(%rsi),%eax
xor    %ecx,%ecx
cmp    $0x7f,%esi
cmovl  %eax,%ecx
movslq %ecx,%rax
mov    %dl,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define i32 @push_stack(i8* nocapture writeonly %0, i32 %1, i8 signext %2) {
%4 = add nsw i32 %1, 1
%5 = icmp sgt i32 %1, 126
%6 = select i1 %5, i32 0, i32 %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %2, i8* %8
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int lapic_read(int);
uint32_t lapic_id(void) { return lapic_read((0xFEE00000 + 0x020)) >> 24; }


x86 assembly (clang, -O0):
<lapic_id>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfee00020,%edi
call   1030 <lapic_read@plt>
sar    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lapic_id>:
push   %rax
mov    $0xfee00020,%edi
call   1030 <lapic_read@plt>
sar    $0x18,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lapic_id() {
%1 = call i32 @lapic_read(i32 -18874336)
%2 = ashr i32 %1, 24
ret i32 %2
}

LLVM IR (-O2):
define i32 @lapic_id() {
%1 = tail call i32 @lapic_read(i32 -18874336)
%2 = ashr i32 %1, 24
ret i32 %2
}
const char *unqlite_lib_signature(void) { return "unqlite/1.1.6"; }


x86 assembly (clang, -O0):
<unqlite_lib_signature>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unqlite_lib_signature>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"unqlite/1.1.6\00"
define i8* @unqlite_lib_signature() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"unqlite/1.1.6\00"
define i8* @unqlite_lib_signature() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Msp430UartP__0__Counter__overflow();
int /*<<< orphan*/ TransformCounterC__0__CounterFrom__overflow();
int /*<<< orphan*/ TransformCounterC__1__CounterFrom__overflow();
void Msp430CounterC__0__Counter__overflow(void) {
  Msp430UartP__0__Counter__overflow();
  TransformCounterC__1__CounterFrom__overflow();
  TransformCounterC__0__CounterFrom__overflow();
}


x86 assembly (clang, -O0):
<Msp430CounterC__0__Counter__overflow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <Msp430UartP__0__Counter__overflow@plt>
mov    $0x0,%al
call   1040 <TransformCounterC__1__CounterFrom__overflow@plt>
mov    $0x0,%al
call   1030 <TransformCounterC__0__CounterFrom__overflow@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Msp430CounterC__0__Counter__overflow>:
push   %rax
xor    %eax,%eax
call   1050 <Msp430UartP__0__Counter__overflow@plt>
xor    %eax,%eax
call   1040 <TransformCounterC__1__CounterFrom__overflow@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <TransformCounterC__0__CounterFrom__overflow@plt>

LLVM IR (-O0):
define void @Msp430CounterC__0__Counter__overflow() {
%1 = call i32 (...) @Msp430UartP__0__Counter__overflow()
%2 = call i32 (...) @TransformCounterC__1__CounterFrom__overflow()
%3 = call i32 (...) @TransformCounterC__0__CounterFrom__overflow()
ret void
}

LLVM IR (-O2):
define void @Msp430CounterC__0__Counter__overflow() {
%1 = tail call i32 (...) @Msp430UartP__0__Counter__overflow()
%2 = tail call i32 (...) @TransformCounterC__1__CounterFrom__overflow()
%3 = tail call i32 (...) @TransformCounterC__0__CounterFrom__overflow()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ Nokia5110_SetCursor(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ lcddatawrite(int /*<<< orphan*/ const);
void Nokia5110_DrawFullImage(const uint8_t *ptr) {
  int i;
  Nokia5110_SetCursor(0, 0);
  for (i = 0; i < (84 * 48 / 8); i = i + 1) {
    lcddatawrite(ptr[i]);
  }
}


x86 assembly (clang, -O0):
<Nokia5110_DrawFullImage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <Nokia5110_SetCursor@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1f8,-0xc(%rbp)
jge    1167 <Nokia5110_DrawFullImage+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <lcddatawrite@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <Nokia5110_DrawFullImage+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Nokia5110_DrawFullImage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <Nokia5110_SetCursor@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%edi
call   1030 <lcddatawrite@plt>
add    $0x1,%rbx
cmp    $0x1f8,%rbx
jne    1140 <Nokia5110_DrawFullImage+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @Nokia5110_DrawFullImage(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @Nokia5110_SetCursor(i32 0, i32 0)
store i32 0, i32* %3
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 504
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = call i32 @lcddatawrite(i32 %13)
br label %15
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @Nokia5110_DrawFullImage(i32* nocapture %0) {
%2 = tail call i32 @Nokia5110_SetCursor(i32 0, i32 0)
br label %3
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @lcddatawrite(i32 %6)
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 504
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
int sum(int x, int y) { return (x + y); }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct gpio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gpio_mode(struct gpio *, int, int);
void gpio_timer(void) { gpio_mode((struct gpio *)0x40010800, 15, 3 | 8); }


x86 assembly (clang, -O0):
<gpio_timer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40010800,%edi
mov    $0xf,%esi
mov    $0xb,%edx
call   1030 <gpio_mode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_timer>:
mov    $0x40010800,%edi
mov    $0xf,%esi
mov    $0xb,%edx
jmp    1030 <gpio_mode@plt>

LLVM IR (-O0):
%struct.gpio = type { i32 }
define void @gpio_timer() {
%1 = call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 15, i32 11)
ret void
}

LLVM IR (-O2):
%struct.gpio = type { i32 }
define void @gpio_timer() {
%1 = tail call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 15, i32 11)
ret void
}
/* Variables and functions */
int cos(double);
double cosineInterpolate(double y1, double y2, double x) {
  double mu2;
  mu2 = (1 - cos(x * 3.14159624)) / 2;
  return (y1 * (1 - mu2) + y2 * mu2);
}


x86 assembly (clang, -O0):
<cosineInterpolate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed9(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea0(%rip),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosineInterpolate>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mulsd  0xed8(%rip),%xmm2
movapd %xmm2,%xmm0
call   1030 <cos@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xeb8(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm2
mulsd  %xmm1,%xmm2
mulsd  0x10(%rsp),%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @cosineInterpolate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = fmul double %8, 0x400921FD35A04AE4
%10 = call i32 @cos(double %9)
%11 = sub nsw i32 1, %10
%12 = sdiv i32 %11, 2
%13 = sitofp i32 %12 to double
store double %13, double* %7
%14 = load double, double* %4
%15 = load double, double* %7
%16 = fsub double 1.000000e+00, %15
%17 = load double, double* %5
%18 = load double, double* %7
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %14, double %16, double %19)
ret double %20
}

LLVM IR (-O2):
define double @cosineInterpolate(double %0, double %1, double %2) {
%4 = fmul double %2, 0x400921FD35A04AE4
%5 = tail call i32 @cos(double %4)
%6 = sub nsw i32 1, %5
%7 = sdiv i32 %6, 2
%8 = sitofp i32 %7 to double
%9 = fsub double 1.000000e+00, %8
%10 = fmul double %8, %1
%11 = tail call double @llvm.fmuladd.f64(double %0, double %9, double %10)
ret double %11
}
void bar() {}


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

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

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

LLVM IR (-O2):
define void @bar() {
ret void
}
int main() {
  char *s = "atcg";
  printf("%s\n", *(s + 1));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 116)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_add_match(void *bus, void **slot, const char *match, void *callback,
                 void *userdata) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_add_match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
mov    0x2ebf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_add_match>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_add_match(i8* %0, i8** %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* @EINVAL
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_add_match(i8* nocapture readnone %0, i8** nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
%6 = load i32, i32* @EINVAL
%7 = sub nsw i32 0, %6
ret i32 %7
}
unsigned int f50(unsigned int x, unsigned long int y) {
  return (x << (8 * 4 - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f50>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f50>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f50(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub i64 32, %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %5, %8
%10 = load i32, i32* %3
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = lshr i32 %10, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f50(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 32, %3
%5 = shl i32 %0, %4
%6 = lshr i32 %0, %3
%7 = xor i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ p(int *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int i;
  scanf("%d", &i);
  p(&i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    -0x4(%rbp),%rdi
call   1030 <p@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <p@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = call i32 @p(i32* %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @p(i32* %1)
ret i32 0
}
/* Type definitions */
struct nlmsg {
  int dummy;
};

/* Variables and functions */
int nla_put(struct nlmsg *, int, char const *, scalar_t__);
scalar_t__ strlen(char const *);
extern int nla_put_string(struct nlmsg *nlmsg, int attr, const char *string) {
  return nla_put(nlmsg, attr, string, strlen(string) + 1);
}


x86 assembly (clang, -O0):
<nla_put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
add    $0x1,%rcx
call   1040 <nla_put@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_put_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rcx
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <nla_put@plt>

LLVM IR (-O0):
%struct.nlmsg = type { i32 }
define i32 @nla_put_string(%struct.nlmsg* %0, i32 %1, i8* %2) {
%4 = alloca %struct.nlmsg*
%5 = alloca i32
%6 = alloca i8*
store %struct.nlmsg* %0, %struct.nlmsg** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.nlmsg*, %struct.nlmsg** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i32 @nla_put(%struct.nlmsg* %7, i32 %8, i8* %9, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.nlmsg = type { i32 }
define i32 @nla_put_string(%struct.nlmsg* %0, i32 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = add nsw i64 %4, 1
%6 = tail call i32 @nla_put(%struct.nlmsg* %0, i32 %1, i8* %2, i64 %5)
ret i32 %6
}
/* Variables and functions */
float f();
int main(void) {
  float x;
  x = f();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
movss  %xmm0,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float (...) @f()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_put_nbr(int);
int /*<<< orphan*/ my_putchar(char);
void my_aff_tab(int tab[], int len) {
  int compteur;
  for (compteur = 0; compteur < len; compteur++) {
    my_put_nbr(tab[compteur]);
    my_putchar('\n');
  }
}


x86 assembly (clang, -O0):
<my_aff_tab>:
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    116a <my_aff_tab+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <my_put_nbr@plt>
mov    $0xa,%edi
call   1040 <my_putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <my_aff_tab+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_aff_tab>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    115c <my_aff_tab+0x3c>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <my_put_nbr@plt>
mov    $0xa,%edi
call   1040 <my_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <my_aff_tab+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @my_aff_tab(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 = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
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 @my_put_nbr(i32 %15)
%17 = call i32 @my_putchar(i8 signext 10)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @my_aff_tab(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @my_put_nbr(i32 %9)
%11 = tail call i32 @my_putchar(i8 signext 10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int sqlite_get_permissions(int /*<<< orphan*/ *, char *);
int mode_list(sqlite3 *db, int argc, char **argv) {
  char *filter = "%";
  if (argc > 1) {
    filter = argv[1];
  }
  return sqlite_get_permissions(db, filter);
}


x86 assembly (clang, -O0):
<mode_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1144 <mode_list+0x34>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <sqlite_get_permissions@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_list>:
cmp    $0x2,%esi
jl     111e <mode_list+0xe>
mov    0x8(%rdx),%rsi
jmp    1030 <sqlite_get_permissions@plt>
lea    0xedb(%rip),%rsi
jmp    1030 <sqlite_get_permissions@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"%\00"
define i32 @mode_list(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %7
br label %14
14: ; preds = %10, %3
%15 = load i32*, i32** %4
%16 = load i8*, i8** %7
%17 = call i32 @sqlite_get_permissions(i32* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"%\00"
define i32 @mode_list(i32* %0, i32 %1, i8** nocapture %2) {
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = getelementptr inbounds i8*, i8** %2, i64 1
%7 = load i8*, i8** %6
br label %8
8: ; preds = %5, %3
%9 = phi i8* [ %7, %5 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %3 ]
%10 = tail call i32 @sqlite_get_permissions(i32* %0, i8* %9)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
void irc_ban_list(char *channel) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s +b", "MODE", channel);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_ban_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    $0x1fd,%esi
lea    0xeba(%rip),%rdx
lea    0xebc(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_ban_list>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%r8
lea    0xece(%rip),%rdx
lea    0xed0(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s %s +b\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_ban_list(i8* %0) {
%2 = alloca i8*
%3 = alloca [509 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%8 = call i32 @net_send(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s %s +b\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_ban_list(i8* %0) {
%2 = alloca [509 x i8]
%3 = getelementptr inbounds [509 x i8], [509 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 509, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i32 @net_send(i8* %3)
ret void
}
/* Type definitions */
struct fb_cmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FBIOGETCMAP;
scalar_t__ ioctl(int, int /*<<< orphan*/, struct fb_cmap *);
int /*<<< orphan*/ print_strerror_and_exit(char *);
void tfbm_get_cmap(int fh, struct fb_cmap *cmap) {
  if (ioctl(fh, FBIOGETCMAP, cmap)) {
    print_strerror_and_exit("ioctl FBIOGETCMAP");
  }
}


x86 assembly (clang, -O0):
<tfbm_get_cmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
je     115a <tfbm_get_cmap+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <print_strerror_and_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfbm_get_cmap>:
push   %rax
mov    %rsi,%rdx
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
call   1040 <ioctl@plt>
test   %rax,%rax
je     1144 <tfbm_get_cmap+0x24>
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1030 <print_strerror_and_exit@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.fb_cmap = type { i32 }
@FBIOGETCMAP = global i32 0
@.str = [18 x i8] c"ioctl FBIOGETCMAP\00"
define void @tfbm_get_cmap(i32 %0, %struct.fb_cmap* %1) {
%3 = alloca i32
%4 = alloca %struct.fb_cmap*
store i32 %0, i32* %3
store %struct.fb_cmap* %1, %struct.fb_cmap** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @FBIOGETCMAP
%7 = load %struct.fb_cmap*, %struct.fb_cmap** %4
%8 = call i64 @ioctl(i32 %5, i32 %6, %struct.fb_cmap* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @print_strerror_and_exit(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.fb_cmap = type { i32 }
@FBIOGETCMAP = global i32 0
@.str = [18 x i8] c"ioctl FBIOGETCMAP\00"
define void @tfbm_get_cmap(i32 %0, %struct.fb_cmap* %1) {
%3 = load i32, i32* @FBIOGETCMAP
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.fb_cmap* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @print_strerror_and_exit(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
unsigned long SSLEAY_VERSION_NUMBER;
unsigned long SSLeay(void) { return (SSLEAY_VERSION_NUMBER); }


x86 assembly (clang, -O0):
<SSLeay>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSLeay>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@SSLEAY_VERSION_NUMBER = global i64 0
define i64 @SSLeay() {
%1 = load i64, i64* @SSLEAY_VERSION_NUMBER
ret i64 %1
}

LLVM IR (-O2):
@SSLEAY_VERSION_NUMBER = global i64 0
define i64 @SSLeay() {
%1 = load i64, i64* @SSLEAY_VERSION_NUMBER
ret i64 %1
}
int omapvout_force_rotation(int plane, int enable, int rotation) { return 0; }


x86 assembly (clang, -O0):
<omapvout_force_rotation>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @omapvout_force_rotation(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
int ptrCompare(const void *pKey1, int n1, const void *pKey2, int n2) {
  if (pKey1 == pKey2)
    return 0;
  if (pKey1 < pKey2)
    return -1;
  return 1;
}


x86 assembly (clang, -O0):
<ptrCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    112c <ptrCompare+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    114d <ptrCompare+0x4d>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1146 <ptrCompare+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <ptrCompare+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrCompare>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %rdx,%rdi
setae  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ptrCompare(i8* readnone %0, i32 %1, i8* readnone %2, i32 %3) {
%5 = icmp eq i8* %0, %2
%6 = icmp ult i8* %0, %2
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printSentence();
int /*<<< orphan*/ printVerbLine();
int /*<<< orphan*/ printVerse();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  int i;
  printVerse();
  printf("\n");
  printVerse();
  printf("\n");
  printSentence();
  printSentence();
  printVerbLine();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1080 <printVerse@plt>
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <printVerse@plt>
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <printSentence@plt>
mov    $0x0,%al
call   1070 <printSentence@plt>
mov    $0x0,%al
call   1030 <printVerbLine@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1080 <printVerse@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1080 <printVerse@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1070 <printSentence@plt>
xor    %eax,%eax
call   1070 <printSentence@plt>
xor    %eax,%eax
call   1040 <printVerbLine@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @printVerse()
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @printVerse()
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @printSentence()
%10 = call i32 (...) @printSentence()
%11 = call i32 (...) @printVerbLine()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @printVerse()
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (...) @printVerse()
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 (...) @printSentence()
%8 = tail call i32 (...) @printSentence()
%9 = tail call i32 (...) @printVerbLine()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ absolute();
int /*<<< orphan*/ adc8(int /*<<< orphan*/);
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
void adcAbs8(void) { adc8(readmem65816(absolute())); }


x86 assembly (clang, -O0):
<adcAbs8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <absolute@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <adc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcAbs8>:
push   %rax
xor    %eax,%eax
call   1040 <absolute@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <adc8@plt>

LLVM IR (-O0):
define void @adcAbs8() {
%1 = call i32 (...) @absolute()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @adc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcAbs8() {
%1 = tail call i32 (...) @absolute()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @adc8(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fatal(const char *s) {
  fprintf(stderr, "Error: %s\n", s);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}