xunge/DecIR huggingface dataset:
SzToSt(sz, st) char *sz;
char *st;
{
  int cch;
  char *pch;
  pch = st + 1;
  while (*sz)
    *pch++ = *sz++;
  st[0] = pch - st - 1;
}


x86 assembly (clang, -O0):
<SzToSt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <SzToSt+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
jmp    1118 <SzToSt+0x18>
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SzToSt>:
lea    0x1(%rsi),%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <SzToSt+0x21>
add    $0x1,%rdi
xchg   %ax,%ax
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <SzToSt+0x10>
mov    %esi,%ecx
not    %ecx
add    %ecx,%eax
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @SzToSt(i8* nocapture %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %12, %6 ], [ %4, %2 ]
%8 = phi i8* [ %11, %6 ], [ %3, %2 ]
%9 = phi i8* [ %10, %6 ], [ %0, %2 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %7, i8* %8
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = phi i8* [ %3, %2 ], [ %11, %6 ]
%16 = ptrtoint i8* %15 to i64
%17 = ptrtoint i8* %1 to i64
%18 = xor i64 %17, -1
%19 = add i64 %16, %18
%20 = trunc i64 %19 to i8
store i8 %20, i8* %1
ret i32 undef
}
/* Variables and functions */
int netOpenHttpExt(char *, char *, int /*<<< orphan*/ *);
int netGetOpenHttp(char *url) { return netOpenHttpExt(url, "GET", NULL); }


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

x86 assembly (clang, -O2):
<netGetOpenHttp>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
jmp    1030 <netOpenHttpExt@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"GET\00"
define i32 @netGetOpenHttp(i8* %0) {
%2 = tail call i32 @netOpenHttpExt(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 %2
}
double dBStrawhat(double b) { return 15 * b * b - 15; }


x86 assembly (clang, -O0):
<dBStrawhat>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dBStrawhat>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @dBStrawhat(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 1.500000e+01, %3
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double -1.500000e+01)
ret double %6
}

LLVM IR (-O2):
define double @dBStrawhat(double %0) {
%2 = fmul double %0, 1.500000e+01
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double -1.500000e+01)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fn_glutMouseWheelFunc(void *);
void glutMouseWheelFunc(void *fn) { fn_glutMouseWheelFunc(fn); }


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

x86 assembly (clang, -O2):
<glutMouseWheelFunc>:
jmp    1030 <fn_glutMouseWheelFunc@plt>

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

LLVM IR (-O2):
define void @glutMouseWheelFunc(i8* %0) {
%2 = tail call i32 @fn_glutMouseWheelFunc(i8* %0)
ret void
}
/* Variables and functions */
int write_block(int, int, int, int /*<<< orphan*/);
int digitalWrite(int pin, int value) {
  if (value == 0 || value == 1)
    return write_block(12, pin, value, 0);
  else
    return -2;
}


x86 assembly (clang, -O0):
<digitalWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1132 <digitalWrite+0x22>
cmpl   $0x1,-0xc(%rbp)
jne    114c <digitalWrite+0x3c>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0xc,%edi
xor    %ecx,%ecx
call   1030 <write_block@plt>
mov    %eax,-0x4(%rbp)
jmp    1153 <digitalWrite+0x43>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitalWrite>:
mov    %esi,%edx
cmp    $0x1,%esi
ja     1125 <digitalWrite+0x15>
mov    %edi,%esi
mov    $0xc,%edi
xor    %ecx,%ecx
jmp    1030 <write_block@plt>
mov    $0xfffffffe,%eax
ret

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

LLVM IR (-O2):
define i32 @digitalWrite(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @write_block(i32 12, i32 %0, i32 %1, i32 0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -2, %2 ]
ret i32 %7
}
int ini__is_section(const char *str) { return *str == '['; }


x86 assembly (clang, -O0):
<ini__is_section>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini__is_section>:
xor    %eax,%eax
cmpb   $0x5b,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @ini__is_section(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 91
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ini__is_section(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 91
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ out_of_memory();
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t size) {
  p = realloc(p, size ? size : 1);
  if (p == NULL) {
    out_of_memory();
  }
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <xrealloc+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    115e <xrealloc+0x3e>
mov    $0x1,%eax
mov    %rax,-0x20(%rbp)
jmp    115e <xrealloc+0x3e>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1181 <xrealloc+0x61>
mov    $0x0,%al
call   1030 <out_of_memory@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
test   %rsi,%rsi
mov    $0x1,%eax
cmove  %rax,%rsi
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <xrealloc+0x21>
xor    %eax,%eax
call   1030 <out_of_memory@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xrealloc(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 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
br label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %8
%12 = phi i64 [ %9, %8 ], [ 1, %10 ]
%13 = call i8* @realloc(i8* %5, i64 %12)
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 (...) @out_of_memory()
br label %18
18: ; preds = %16, %11
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = select i1 %3, i64 1, i64 %1
%5 = tail call i8* @realloc(i8* %0, i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @out_of_memory()
br label %9
9: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void SLinkedListIteratorDispose(void *Iterator) { free(Iterator); }


x86 assembly (clang, -O0):
<SLinkedListIteratorDispose>:
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):
<SLinkedListIteratorDispose>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @SLinkedListIteratorDispose(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int dbar(double, double);
int dv(double, double);
int sb(double, double);
int ubar(double, double);
double F3_nc_p(double xx, double Q2) {
  return 2 * (dv(xx, Q2) + sb(xx, Q2) + dbar(xx, Q2) - ubar(xx, Q2)) / xx;
}


x86 assembly (clang, -O0):
<F3_nc_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <dv@plt>
mov    %eax,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <sb@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1060 <dbar@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <ubar@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F3_nc_p>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1050 <dv@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <sb@plt>
mov    %eax,%ebp
add    %ebx,%ebp
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1060 <dbar@plt>
mov    %eax,%ebx
add    %ebp,%ebx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <ubar@plt>
sub    %eax,%ebx
add    %ebx,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
divsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @F3_nc_p(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @dv(double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i32 @sb(double %8, double %9)
%11 = add nsw i32 %7, %10
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call i32 @dbar(double %12, double %13)
%15 = add nsw i32 %11, %14
%16 = load double, double* %3
%17 = load double, double* %4
%18 = call i32 @ubar(double %16, double %17)
%19 = sub nsw i32 %15, %18
%20 = mul nsw i32 2, %19
%21 = sitofp i32 %20 to double
%22 = load double, double* %3
%23 = fdiv double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @F3_nc_p(double %0, double %1) {
%3 = tail call i32 @dv(double %0, double %1)
%4 = tail call i32 @sb(double %0, double %1)
%5 = add nsw i32 %4, %3
%6 = tail call i32 @dbar(double %0, double %1)
%7 = add nsw i32 %5, %6
%8 = tail call i32 @ubar(double %0, double %1)
%9 = sub i32 %7, %8
%10 = shl nsw i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, %0
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ i2c_er_handler();
void I2C2_ER_IRQHandler(void) { i2c_er_handler(); }


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

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

LLVM IR (-O0):
define void @I2C2_ER_IRQHandler() {
%1 = call i32 (...) @i2c_er_handler()
ret void
}

LLVM IR (-O2):
define void @I2C2_ER_IRQHandler() {
%1 = tail call i32 (...) @i2c_er_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch(1, 2))) void hp2(void) { printf("hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int tgaReadUShort(FILE *f, unsigned short *us) {
  unsigned char b[2];
  size_t read = fread(b, 2, 1, f);
  *us = b[1] << 8 | b[0];
  return read;
}


x86 assembly (clang, -O0):
<tgaReadUShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %rax,-0x20(%rbp)
movzbl -0x11(%rbp),%eax
shl    $0x8,%eax
movzbl -0x12(%rbp),%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgaReadUShort>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0xe(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movzwl 0xe(%rsp),%ecx
mov    %cx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tgaReadUShort(i32* %0, i16* %1) {
%3 = alloca i32*
%4 = alloca i16*
%5 = alloca [2 x i8]
%6 = alloca i64
store i32* %0, i32** %3
store i16* %1, i16** %4
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%8 = load i32*, i32** %3
%9 = call i64 @fread(i8* %7, i32 2, i32 1, i32* %8)
store i64 %9, i64* %6
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = or i32 %13, %16
%18 = trunc i32 %17 to i16
%19 = load i16*, i16** %4
store i16 %18, i16* %19
%20 = load i64, i64* %6
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @tgaReadUShort(i32* nocapture %0, i16* nocapture writeonly %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = call i64 @fread(i8* %4, i32 2, i32 1, i32* %0)
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = shl nuw i16 %8, 8
%10 = load i8, i8* %4
%11 = zext i8 %10 to i16
%12 = or i16 %9, %11
store i16 %12, i16* %1
%13 = trunc i64 %5 to i32
ret i32 %13
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ width;
};
struct TYPE_4__ {
  TYPE_1__ xgraphicsexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xgraphicsexpose_width(void *_p) {
  return (int)((XEvent *)_p)->xgraphicsexpose.width;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xgraphicsexpose_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void finish_vterm() { endwin(); }


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

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

LLVM IR (-O0):
define void @finish_vterm() {
%1 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @finish_vterm() {
%1 = tail call i32 (...) @endwin()
ret void
}
void foo178(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo178(i32 %0) {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ ENOENT;
int /*<<< orphan*/ abort();
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ lstat(char *, struct stat *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  struct stat buf;
  if (lstat("nonexistent", &buf) == 0 || errno != ENOENT)
    abort();
  printf("pass\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <lstat@plt>
cmp    $0x0,%rax
je     1183 <main+0x43>
mov    0x2e70(%rip),%rax
mov    (%rax),%rax
mov    0x2e56(%rip),%rcx
cmp    (%rcx),%rax
je     118a <main+0x4a>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <lstat@plt>
test   %rax,%rax
je     117e <main+0x3e>
mov    0x2e84(%rip),%rax
mov    (%rax),%rax
mov    0x2e6a(%rip),%rcx
cmp    (%rcx),%rax
jne    117e <main+0x3e>
lea    0xe9a(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [12 x i8] c"nonexistent\00"
@errno = global i64 0
@ENOENT = global i64 0
@.str.1 = [6 x i8] c"pass\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat
store i32 0, i32* %1
%3 = call i64 @lstat(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = load i64, i64* @errno
%7 = load i64, i64* @ENOENT
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5, %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %5
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [12 x i8] c"nonexistent\00"
@errno = global i64 0
@ENOENT = global i64 0
@str = [5 x i8] c"pass\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i64 @lstat(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = load i64, i64* @errno
%7 = load i64, i64* @ENOENT
%8 = icmp eq i64 %6, %7
br i1 %8, label %11, label %9
9: ; preds = %5, %0
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %5
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%13 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_list_names(void *bus, char ***acquired, char ***activatable) {
  return -EINVAL;
}


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

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_list_names(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
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_list_names(i8* nocapture readnone %0, i8*** nocapture readnone %1, i8*** nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
double fequ(double a, double b) { return a == b; }


x86 assembly (clang, -O0):
<fequ>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fequ>:
cmpeqsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fequ(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @fequ(double %0, double %1) {
%3 = fcmp oeq double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() { printf("build your own DFA and test it!\n"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"build your own DFA and test it!\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"build your own DFA and test it!\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_27uint16_mem(unsigned short *val) {
  return ((*val) & (-0x27 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_27uint16_mem>:
movzwl (%rdi),%eax
test   $0xffd9,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_27uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -39
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_final_itemdb();
int /*<<< orphan*/ do_init_itemdb();
void itemdb_reload(void) {
  do_final_itemdb();
  do_init_itemdb();
}


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

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

LLVM IR (-O0):
define void @itemdb_reload() {
%1 = call i32 (...) @do_final_itemdb()
%2 = call i32 (...) @do_init_itemdb()
ret void
}

LLVM IR (-O2):
define void @itemdb_reload() {
%1 = tail call i32 (...) @do_final_itemdb()
%2 = tail call i32 (...) @do_init_itemdb()
ret void
}
int egsy_gcm_csr_hashout0_set(unsigned int dev_id,
                              union egsy_gcm_csr_hashout0_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<egsy_gcm_csr_hashout0_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.egsy_gcm_csr_hashout0_u = type opaque
define i32 @egsy_gcm_csr_hashout0_set(i32 %0, %union.egsy_gcm_csr_hashout0_u* %1) {
%3 = alloca i32
%4 = alloca %union.egsy_gcm_csr_hashout0_u*
store i32 %0, i32* %3
store %union.egsy_gcm_csr_hashout0_u* %1, %union.egsy_gcm_csr_hashout0_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.egsy_gcm_csr_hashout0_u = type opaque
define i32 @egsy_gcm_csr_hashout0_set(i32 %0, %union.egsy_gcm_csr_hashout0_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_read_standard_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(120, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_read_standard_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x78,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_read_standard_Laurent_system>:
mov    $0x78,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_read_standard_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 120, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_read_standard_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 120, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void sig_die_hard(int signo) {
  printf("Caught signal %d, shutting down!\n", signo);
  exit(1);
}


x86 assembly (clang, -O0):
<sig_die_hard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_die_hard>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Caught signal %d, shutting down!\0A\00"
define void @sig_die_hard(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Caught signal %d, shutting down!\0A\00"
define void @sig_die_hard(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct winsize {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ TIOCSWINSZ;
scalar_t__ ioctl(int, int /*<<< orphan*/, struct winsize *);
void console_forward_size(int source, int target) {
  struct winsize ws;
  if (ioctl(source, TIOCGWINSZ, &ws) >= 0)
    ioctl(target, TIOCSWINSZ, &ws);
}


x86 assembly (clang, -O0):
<console_forward_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jl     1152 <console_forward_size+0x42>
mov    -0x8(%rbp),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_forward_size>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1030 <ioctl@plt>
test   %rax,%rax
js     1144 <console_forward_size+0x34>
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
@TIOCSWINSZ = global i32 0
define void @console_forward_size(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.winsize
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @TIOCGWINSZ
%8 = call i64 @ioctl(i32 %6, i32 %7, %struct.winsize* %5)
%9 = icmp sge i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* @TIOCSWINSZ
%13 = call i64 @ioctl(i32 %11, i32 %12, %struct.winsize* %5)
br label %14
14: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
@TIOCSWINSZ = global i32 0
define void @console_forward_size(i32 %0, i32 %1) {
%3 = alloca %struct.winsize
%4 = bitcast %struct.winsize* %3 to i8*
%5 = load i32, i32* @TIOCGWINSZ
%6 = call i64 @ioctl(i32 %0, i32 %5, %struct.winsize* %3)
%7 = icmp sgt i64 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @TIOCSWINSZ
%10 = call i64 @ioctl(i32 %1, i32 %9, %struct.winsize* %3)
br label %11
11: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mj_println(int /*<<< orphan*/);
int /*<<< orphan*/ sample_fun(int, int);
void mj_main() { mj_println(sample_fun(10, 20)); }


x86 assembly (clang, -O0):
<mj_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
mov    $0x14,%esi
call   1030 <sample_fun@plt>
mov    %eax,%edi
call   1040 <mj_println@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mj_main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
call   1030 <sample_fun@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <mj_println@plt>

LLVM IR (-O0):
define void @mj_main() {
%1 = call i32 @sample_fun(i32 10, i32 20)
%2 = call i32 @mj_println(i32 %1)
ret void
}

LLVM IR (-O2):
define void @mj_main() {
%1 = tail call i32 @sample_fun(i32 10, i32 20)
%2 = tail call i32 @mj_println(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ACMP_DriverIRQHandler();
__attribute__((weak)) void ACMP_IRQHandler(void) { ACMP_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @ACMP_IRQHandler() {
%1 = call i32 (...) @ACMP_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ACMP_IRQHandler() {
%1 = tail call i32 (...) @ACMP_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA_lc898122(int, int);
void AfDrvSw_lc898122(unsigned char UcDrvSw) {
  if (UcDrvSw == 0x01) {
    RegWriteA_lc898122(0x0081, 0x20);
    RegWriteA_lc898122(0x00A0, 0x80);
  } else {
    RegWriteA_lc898122(0x00A0, 0x00);
  }
}


x86 assembly (clang, -O0):
<AfDrvSw_lc898122>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    114e <AfDrvSw_lc898122+0x3e>
mov    $0x81,%edi
mov    $0x20,%esi
call   1030 <RegWriteA_lc898122@plt>
mov    $0xa0,%edi
mov    $0x80,%esi
call   1030 <RegWriteA_lc898122@plt>
jmp    115a <AfDrvSw_lc898122+0x4a>
mov    $0xa0,%edi
xor    %esi,%esi
call   1030 <RegWriteA_lc898122@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AfDrvSw_lc898122>:
xor    %esi,%esi
cmp    $0x1,%dil
jne    1131 <AfDrvSw_lc898122+0x21>
push   %rax
mov    $0x81,%edi
mov    $0x20,%esi
call   1030 <RegWriteA_lc898122@plt>
mov    $0x80,%esi
add    $0x8,%rsp
mov    $0xa0,%edi
jmp    1030 <RegWriteA_lc898122@plt>

LLVM IR (-O0):
define void @AfDrvSw_lc898122(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @RegWriteA_lc898122(i32 129, i32 32)
%8 = call i32 @RegWriteA_lc898122(i32 160, i32 128)
br label %11
9: ; preds = %1
%10 = call i32 @RegWriteA_lc898122(i32 160, i32 0)
br label %11
11: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
define void @AfDrvSw_lc898122(i8 zeroext %0) {
%2 = icmp eq i8 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @RegWriteA_lc898122(i32 129, i32 32)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 128, %3 ], [ 0, %1 ]
%7 = tail call i32 @RegWriteA_lc898122(i32 160, i32 %6)
ret void
}
int addenviron(const char *env) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @addenviron(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
#pragma omp parallel
  {
    int ID = omp_get_thread_num();
    printf("hello(%d)", ID);
    printf("world(%d).\n", ID);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"hello(%d)\00"
@.str.1 = [12 x i8] c"world(%d).\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @omp_get_thread_num()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"hello(%d)\00"
@.str.1 = [12 x i8] c"world(%d).\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_shuffle_pi16(int /*<<< orphan*/, int);
__m64 test_shuf2(__m64 a) { return _mm_shuffle_pi16(a, 0xA5); }


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

x86 assembly (clang, -O2):
<test_shuf2>:
mov    $0xa5,%esi
jmp    1030 <_mm_shuffle_pi16@plt>

LLVM IR (-O0):
define i32 @test_shuf2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm_shuffle_pi16(i32 %3, i32 165)
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_shuf2(i32 %0) {
%2 = tail call i32 @_mm_shuffle_pi16(i32 %0, i32 165)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void DCDCOnOff(char x) {
  unsigned char d[] = {0xAD, 0x8A | (x & 0x01)};
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<DCDCOnOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0xad,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x1,%eax
or     $0x8a,%eax
mov    %al,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCDCOnOff>:
push   %rax
movb   $0xad,0x6(%rsp)
and    $0x1,%dil
or     $0x8a,%dil
mov    %dil,0x7(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @DCDCOnOff(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 -83, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = and i32 %7, 1
%9 = or i32 138, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%12 = call i32 @oled_SendCommand(i8* %11, i32 2)
ret void
}

LLVM IR (-O2):
define void @DCDCOnOff(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 -83, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%5 = and i8 %0, 1
%6 = or i8 %5, -118
store i8 %6, i8* %4
%7 = call i32 @oled_SendCommand(i8* %3, i32 2)
ret void
}
int getFortySomething() { return 46; }


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

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

LLVM IR (-O0):
define i32 @getFortySomething() {
ret i32 46
}

LLVM IR (-O2):
define i32 @getFortySomething() {
ret i32 46
}
int do_352() { return 352; }


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

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

LLVM IR (-O0):
define i32 @do_352() {
ret i32 352
}

LLVM IR (-O2):
define i32 @do_352() {
ret i32 352
}
/* Variables and functions */
int /*<<< orphan*/ backtrace_print(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void foo(int unused) {
  (void)unused;
  backtrace_print(stdout);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <backtrace_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <backtrace_print@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stdout
%5 = call i32 @backtrace_print(i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @foo(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @backtrace_print(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RegisterServer();
int /*<<< orphan*/ UnregisterServer();
void ServerName_OnChange(void) {
  UnregisterServer();
  RegisterServer();
}


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

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

LLVM IR (-O0):
define void @ServerName_OnChange() {
%1 = call i32 (...) @UnregisterServer()
%2 = call i32 (...) @RegisterServer()
ret void
}

LLVM IR (-O2):
define void @ServerName_OnChange() {
%1 = tail call i32 (...) @UnregisterServer()
%2 = tail call i32 (...) @RegisterServer()
ret void
}
int getAnne() { return 3; }


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

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

LLVM IR (-O0):
define i32 @getAnne() {
ret i32 3
}

LLVM IR (-O2):
define i32 @getAnne() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, temp = 0;
  scanf("%d", &a);
  scanf("%d", &b);
  temp = (b >> a);
  printf("%d\n", temp % 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%cl
mov    %eax,%esi
sar    %cl,%esi
shr    $0x1f,%eax
add    %esi,%eax
and    $0xfffffffe,%eax
sub    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = ashr i32 %7, %8
%10 = srem i32 %9, 2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
int cudzia(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<cudzia>:
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):
<cudzia>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @cudzia(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 @cudzia(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func1(int i) { printf("%d\n", i); }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @func1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}