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


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

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

LLVM IR (-O0):
define i32 @test_imm_28uint64_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, 40
%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_28uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 171798691840
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void XDrawString() {}


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

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

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

LLVM IR (-O2):
define void @XDrawString() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, void **, int);
int GLUE_RESET_WTP(unsigned char *out, void *ptr) {
  if (out) {
    *out++ = 0xBE;
    memcpy(out, &ptr, sizeof(void *));
    out += sizeof(void *);
  }
  return 1 + sizeof(void *);
}


x86 assembly (clang, -O0):
<GLUE_RESET_WTP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115b <GLUE_RESET_WTP+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0xbe,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    $0x9,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_RESET_WTP>:
push   %rax
mov    %rsi,(%rsp)
test   %rdi,%rdi
je     112e <GLUE_RESET_WTP+0x1e>
movb   $0xbe,(%rdi)
add    $0x1,%rdi
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    $0x9,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @GLUE_RESET_WTP(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 -66, i8* %0
%7 = call i32 @memcpy(i8* %6, i8** %3, i32 8)
br label %8
8: ; preds = %5, %2
ret i32 9
}
__attribute__((always_)) void drawpixel(void *s, char a) { *((char *)(s)) = a; }


x86 assembly (clang, -O0):
<drawpixel>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawpixel>:
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @drawpixel(i8* nocapture writeonly %0, i8 signext %1) {
store i8 %1, i8* %0
ret void
}
void tinf_init(void) {}


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

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

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

LLVM IR (-O2):
define void @tinf_init() {
ret void
}
/* Type definitions */
struct Chabu_Data {
  int dummy;
};

/* Variables and functions */
char const *Chabu_ErrorCodeStr(int /*<<< orphan*/);
int /*<<< orphan*/ Chabu_LastError(struct Chabu_Data *);
const char *Chabu_LastErrorStr(struct Chabu_Data *chabu) {
  return Chabu_ErrorCodeStr(Chabu_LastError(chabu));
}


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

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

LLVM IR (-O0):
%struct.Chabu_Data = type { i32 }
define i8* @Chabu_LastErrorStr(%struct.Chabu_Data* %0) {
%2 = alloca %struct.Chabu_Data*
store %struct.Chabu_Data* %0, %struct.Chabu_Data** %2
%3 = load %struct.Chabu_Data*, %struct.Chabu_Data** %2
%4 = call i32 @Chabu_LastError(%struct.Chabu_Data* %3)
%5 = call i8* @Chabu_ErrorCodeStr(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.Chabu_Data = type { i32 }
define i8* @Chabu_LastErrorStr(%struct.Chabu_Data* %0) {
%2 = tail call i32 @Chabu_LastError(%struct.Chabu_Data* %0)
%3 = tail call i8* @Chabu_ErrorCodeStr(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ core4_swap(char *, int);
void U_EMRFILLPATH_swap(char *record, int torev) { core4_swap(record, torev); }


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

x86 assembly (clang, -O2):
<U_EMRFILLPATH_swap>:
jmp    1030 <core4_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRFILLPATH_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core4_swap(i8* %0, i32 %1)
ret void
}
delim(c) char c;
{
  if (any(c, " \t\n\r"))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<delim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <any@plt>
cmp    $0x0,%eax
je     1145 <delim+0x35>
movl   $0x1,-0x4(%rbp)
jmp    114c <delim+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delim>:
push   %rax
movsbl %dil,%edi
lea    0xee4(%rip),%rsi
xor    %eax,%eax
call   1030 <any@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \09\0A\0D\00"
define i32 @delim(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @any to i32 (i32, i8*, ...)*)(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0A\0D\00"
define i32 @delim(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @any to i32 (i32, i8*, ...)*)(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Report(char *, char const *);
void HttpDebugStr(const char *pString) { Report("%s\n\r", pString); }


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

x86 assembly (clang, -O2):
<HttpDebugStr>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <Report@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0A\0D\00"
define void @HttpDebugStr(i8* %0) {
%2 = tail call i32 @Report(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void rop3_246_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk1 = T | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

x86 assembly (clang, -O2):
<rop3_246_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
xor    %sil,%cl
mov    %edx,%eax
not    %al
and    %cl,%al
or     %dl,%cl
and    %sil,%cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_246_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = or i8 %5, %2
%7 = and i8 %6, %1
%8 = xor i8 %2, -1
%9 = and i8 %5, %8
%10 = xor i8 %1, -1
%11 = and i8 %10, %2
%12 = and i8 %11, %4
%13 = or i8 %9, %12
%14 = or i8 %13, %7
store i8 %14, i8* %0
ret void
}
int main(void) {
  int *a;
  int b[5];
  a = b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
int /*<<< orphan*/ time(long *);
void InitRandSeed(void) {
  long time_now;
  time(&time_now);
  srand((unsigned int)time_now);
}


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

x86 assembly (clang, -O2):
<InitRandSeed>:
push   %rax
mov    %rsp,%rdi
call   1040 <time@plt>
mov    (%rsp),%edi
call   1030 <srand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @InitRandSeed() {
%1 = alloca i64
%2 = call i32 @time(i64* %1)
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = call i32 @srand(i32 %4)
ret void
}

LLVM IR (-O2):
define void @InitRandSeed() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @time(i64* %1)
%4 = load i64, i64* %1
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
ret void
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double erfcl(long double x) { return __infer_nondet_long_double(); }


x86 assembly (clang, -O0):
<erfcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @erfcl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @erfcl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
int fmadd(int a, int b, int c) { return a * b + c; }


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

x86 assembly (clang, -O2):
<fmadd>:
imul   %esi,%edi
lea    (%rdi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @fmadd(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
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @fmadd(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Type definitions */
struct grid_epbase {
  int dummy;
};

/* Variables and functions */
int grid_binproc_create(void *, struct grid_epbase **);
int grid_inproc_bind(void *hint, struct grid_epbase **epbase) {
  return grid_binproc_create(hint, epbase);
}


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

x86 assembly (clang, -O2):
<grid_inproc_bind>:
jmp    1030 <grid_binproc_create@plt>

LLVM IR (-O0):
%struct.grid_epbase = type { i32 }
define i32 @grid_inproc_bind(i8* %0, %struct.grid_epbase** %1) {
%3 = alloca i8*
%4 = alloca %struct.grid_epbase**
store i8* %0, i8** %3
store %struct.grid_epbase** %1, %struct.grid_epbase*** %4
%5 = load i8*, i8** %3
%6 = load %struct.grid_epbase**, %struct.grid_epbase*** %4
%7 = call i32 @grid_binproc_create(i8* %5, %struct.grid_epbase** %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.grid_epbase = type { i32 }
define i32 @grid_inproc_bind(i8* %0, %struct.grid_epbase** %1) {
%3 = tail call i32 @grid_binproc_create(i8* %0, %struct.grid_epbase** %1)
ret i32 %3
}
/* Type definitions */
struct lobject {
  int dummy;
};
struct lframe {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lobject *lvarg_create(struct lemon *, struct lobject *);
struct lobject *machine_varg_callback(struct lemon *lemon, struct lframe *frame,
                                      struct lobject *retval) {
  return lvarg_create(lemon, retval);
}


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

x86 assembly (clang, -O2):
<machine_varg_callback>:
mov    %rdx,%rsi
jmp    1030 <lvarg_create@plt>

LLVM IR (-O0):
%struct.lemon = type { i32 }
%struct.lframe = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @machine_varg_callback(%struct.lemon* %0, %struct.lframe* %1, %struct.lobject* %2) {
%4 = alloca %struct.lemon*
%5 = alloca %struct.lframe*
%6 = alloca %struct.lobject*
store %struct.lemon* %0, %struct.lemon** %4
store %struct.lframe* %1, %struct.lframe** %5
store %struct.lobject* %2, %struct.lobject** %6
%7 = load %struct.lemon*, %struct.lemon** %4
%8 = load %struct.lobject*, %struct.lobject** %6
%9 = call %struct.lobject* @lvarg_create(%struct.lemon* %7, %struct.lobject* %8)
ret %struct.lobject* %9
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lframe = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @machine_varg_callback(%struct.lemon* %0, %struct.lframe* nocapture readnone %1, %struct.lobject* %2) {
%4 = tail call %struct.lobject* @lvarg_create(%struct.lemon* %0, %struct.lobject* %2)
ret %struct.lobject* %4
}
void FLASH_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @FLASH_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  int const ASCII_RANGE = 255;
  for (i = 0; i <= ASCII_RANGE; i++) {
    printf("%c - %d\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xff,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     115a <main+0x4a>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%c - %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 255, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 255
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%c - %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
void qsort(void *base, size_t num, size_t width,
           int (*compare)(const void *, const void *)) {}


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

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

LLVM IR (-O0):
define void @qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
ret void
}

LLVM IR (-O2):
define void @qsort(i8* nocapture %0, i64 %1, i64 %2, i32 (i8*, i8*)* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("rm /etc/hosts");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"rm /etc/hosts\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"rm /etc/hosts\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void vfprintf_newline(FILE *stream, char *format, va_list ap) {
  char *newline = "\n";
  vfprintf(stream, format, ap);
  fprintf(stream, "%s", newline);
}


x86 assembly (clang, -O0):
<vfprintf_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xec6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vfprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfprintf_newline>:
push   %rbx
mov    %rdi,%rbx
call   1040 <vfprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @vfprintf_newline(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i32*, i32** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vfprintf(i32* %8, i8* %9, i32 %10)
%12 = load i32*, i32** %4
%13 = load i8*, i8** %7
%14 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
define void @vfprintf_newline(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vfprintf(i32* %0, i8* %1, i32 %2)
%5 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}
void pgd_free_count(unsigned long addr) {}


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

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

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

LLVM IR (-O2):
define void @pgd_free_count(i64 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ __CONST_SOCKADDR_ARG;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int connect(int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connect>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @connect(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
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @connect(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
void _init_signal(void) {}


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

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

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

LLVM IR (-O2):
define void @_init_signal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo(int _i, int _j) {
  int i;
  int j;
  i = _i;
  j = _j;
  i = 42;
  j = ~~i;
  assert(j < 0);
  return 3;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x2a,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
store i32 %7, i32* %5
%8 = load i32, i32* %4
store i32 %8, i32* %6
store i32 42, i32* %5
%9 = load i32, i32* %5
%10 = xor i32 %9, -1
%11 = xor i32 %10, -1
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret i32 3
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr,
          "Usage: gpmimult2 [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h]\n");
  fprintf(stderr, "\t\t[-pref prefix]  g1 g2 groupname [cosname].\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xef4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefe(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"Usage: gpmimult2 [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h]\0A\00"
@.str.1 = [46 x i8] c"\09\09[-pref prefix] g1 g2 groupname [cosname].\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"Usage: gpmimult2 [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h]\0A\00"
@.str.1 = [46 x i8] c"\09\09[-pref prefix] g1 g2 groupname [cosname].\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
void f() {
  int *abc;
  float *def;
  int **ghi;
  float ***jkl;
}


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

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32*
%2 = alloca float*
%3 = alloca i32**
%4 = alloca float***
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
int abs(int i) { return (i < 0) ? (i * -1) : i; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111d <abs+0x1d>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1123 <abs+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, -1
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void mg_ev_mgr_add_conn(struct mg_connection *nc) { (void)nc; }


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

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

LLVM IR (-O0):
%struct.mg_connection = type opaque
define void @mg_ev_mgr_add_conn(%struct.mg_connection* %0) {
%2 = alloca %struct.mg_connection*
store %struct.mg_connection* %0, %struct.mg_connection** %2
%3 = load %struct.mg_connection*, %struct.mg_connection** %2
ret void
}

LLVM IR (-O2):
%struct.mg_connection = type opaque
define void @mg_ev_mgr_add_conn(%struct.mg_connection* nocapture %0) {
ret void
}
__attribute__((visibility("default"))) void stop_monitor() {}


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

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

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

LLVM IR (-O2):
define void @stop_monitor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinkLed(int);
void blinkFail() { blinkLed(5); }


x86 assembly (clang, -O0):
<blinkFail>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <blinkLed@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkFail>:
mov    $0x5,%edi
jmp    1030 <blinkLed@plt>

LLVM IR (-O0):
define void @blinkFail() {
%1 = call i32 @blinkLed(i32 5)
ret void
}

LLVM IR (-O2):
define void @blinkFail() {
%1 = tail call i32 @blinkLed(i32 5)
ret void
}
/* Variables and functions */
char *malloc(unsigned int);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strsave(char *s) {
  register char *p;
  if ((p = malloc((unsigned)strlen(s) + 1)) != NULL)
    strcpy(p, s);
  return (p);
}


x86 assembly (clang, -O0):
<strsave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     116a <strsave+0x3a>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strsave(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 1
%5 = tail call i8* @malloc(i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Type definitions */
struct lastack {
  int dummy;
};

/* Variables and functions */
float *lastack_allocmatrix(struct lastack *);
int /*<<< orphan*/ memcpy(float *, float const *, int);
void lastack_pushmatrix(struct lastack *LS, const float *mat) {
  float *pmat = lastack_allocmatrix(LS);
  memcpy(pmat, mat, sizeof(float) * 16);
}


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

x86 assembly (clang, -O2):
<lastack_pushmatrix>:
push   %rbx
mov    %rsi,%rbx
call   1030 <lastack_allocmatrix@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
pop    %rbx
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
%struct.lastack = type { i32 }
define void @lastack_pushmatrix(%struct.lastack* %0, float* %1) {
%3 = alloca %struct.lastack*
%4 = alloca float*
%5 = alloca float*
store %struct.lastack* %0, %struct.lastack** %3
store float* %1, float** %4
%6 = load %struct.lastack*, %struct.lastack** %3
%7 = call float* @lastack_allocmatrix(%struct.lastack* %6)
store float* %7, float** %5
%8 = load float*, float** %5
%9 = load float*, float** %4
%10 = call i32 @memcpy(float* %8, float* %9, i32 64)
ret void
}

LLVM IR (-O2):
%struct.lastack = type { i32 }
define void @lastack_pushmatrix(%struct.lastack* %0, float* %1) {
%3 = tail call float* @lastack_allocmatrix(%struct.lastack* %0)
%4 = tail call i32 @memcpy(float* %3, float* %1, i32 64)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ accept_AND_expression();
int /*<<< orphan*/ parse_exclusive_OR_expression();
void accept_exclusive_OR_expression() {
  accept_AND_expression();
  parse_exclusive_OR_expression();
}


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

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

LLVM IR (-O0):
define void @accept_exclusive_OR_expression() {
%1 = call i32 (...) @accept_AND_expression()
%2 = call i32 (...) @parse_exclusive_OR_expression()
ret void
}

LLVM IR (-O2):
define void @accept_exclusive_OR_expression() {
%1 = tail call i32 (...) @accept_AND_expression()
%2 = tail call i32 (...) @parse_exclusive_OR_expression()
ret void
}
long dt_time_to_s(long t) { return t % 60; }


x86 assembly (clang, -O0):
<dt_time_to_s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_time_to_s>:
movabs $0x8888888888888889,%rcx
88 88 88
mov    %rdi,%rax
imul   %rcx
add    %rdi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x5,%rdx
add    %rax,%rdx
imul   $0x3c,%rdx,%rax
sub    %rax,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @dt_time_to_s(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = srem i64 %3, 60
ret i64 %4
}

LLVM IR (-O2):
define i64 @dt_time_to_s(i64 %0) {
%2 = srem i64 %0, 60
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void help(char **argv) {
  printf("%s, Copyright (c) 2013-2015 BuguTian\n", argv[0]);
  printf(""
         "Usage: %s <Options> <-a REQUEST>\n"
         "-h no arg,mean help\n"
         "-v no arg,mean version\n"
         "-a arga\n"
         "-b argb\n",
         argv[0]);
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"%s, Copyright (c) 2013-2015 BuguTian\0A\00"
@.str.1 = [93 x i8] c"Usage: %s <Options> <-a REQUEST>\0A-h no arg,mean help\0A-v no arg,mean version\0A-a arga\0A-b argb\0A\00"
define void @help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8**, i8*** %2
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"%s, Copyright (c) 2013-2015 BuguTian\0A\00"
@.str.1 = [93 x i8] c"Usage: %s <Options> <-a REQUEST>\0A-h no arg,mean help\0A-v no arg,mean version\0A-a arga\0A-b argb\0A\00"
define void @help(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8*, i8** %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int log2(size_t v) {
  int log = 0;
  int value = 1;
  while (value < v) {
    value <<= 1;
    log++;
  }
  return log;
}


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movslq -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    113b <log2+0x3b>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <log2+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     111d <log2+0x1d>
xor    %eax,%eax
mov    $0x1,%ecx
nop
add    %ecx,%ecx
add    $0x1,%eax
movslq %ecx,%rdx
cmp    %rdi,%rdx
jb     1110 <log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @log2(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = shl i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = sext i32 %6 to i64
%9 = icmp ult i64 %8, %0
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ syslog(int, char *, char const *);
void syslog_wrapper(int priority, const char *message) {
  syslog(priority, "%s", message);
}


x86 assembly (clang, -O0):
<syslog_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syslog_wrapper>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <syslog@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @syslog_wrapper(i32 %0, i8* %1) {
%3 = tail call i32 @syslog(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_connect;
int syscall(int /*<<< orphan*/, int, struct sockaddr const *,
            int /*<<< orphan*/);
__attribute__((always_)) int _syscall_connect(int socket,
                                              const struct sockaddr *address,
                                              socklen_t address_len) {
  return syscall(__NR_connect, socket, address, address_len);
}


x86 assembly (clang, -O0):
<_syscall_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_connect>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@__NR_connect = global i32 0
define i32 @_syscall_connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_connect
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, %struct.sockaddr* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@__NR_connect = global i32 0
define i32 @_syscall_connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = load i32, i32* @__NR_connect
%5 = tail call i32 @syscall(i32 %4, i32 %0, %struct.sockaddr* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ get_trigger_mode();
scalar_t__ strcmp(int /*<<< orphan*/, char const *);
int correct_mode(const char *tmode) {
  return (tmode == NULL) || (strcmp(get_trigger_mode(), tmode) == 0);
}


x86 assembly (clang, -O0):
<correct_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1158 <correct_mode+0x38>
mov    $0x0,%al
call   1040 <get_trigger_mode@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<correct_mode>:
test   %rdi,%rdi
je     1147 <correct_mode+0x27>
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <get_trigger_mode@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @correct_mode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = call i32 (...) @get_trigger_mode()
%7 = load i8*, i8** %2
%8 = call i64 @strcmp(i32 %6, i8* %7)
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ true, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @correct_mode(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 (...) @get_trigger_mode()
%5 = tail call i64 @strcmp(i32 %4, i8* %0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Lcd_Out_CP(char *);
void lcd16x2_writecp(char *text) { Lcd_Out_CP(text); }


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

x86 assembly (clang, -O2):
<lcd16x2_writecp>:
jmp    1030 <Lcd_Out_CP@plt>

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

LLVM IR (-O2):
define void @lcd16x2_writecp(i8* %0) {
%2 = tail call i32 @Lcd_Out_CP(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hexdump_indent(int, unsigned char const *, size_t,
                                  int /*<<< orphan*/);
void hexdump(int level, const unsigned char *payload, size_t len) {
  hexdump_indent(level, payload, len, 0);
}


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

x86 assembly (clang, -O2):
<hexdump>:
xor    %ecx,%ecx
jmp    1030 <hexdump_indent@plt>

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

LLVM IR (-O2):
define void @hexdump(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @hexdump_indent(i32 %0, i8* %1, i64 %2, i32 0)
ret void
}
/* Variables and functions */
int GetDataNBlock(int);
int GetDataPeriod(int);
int GetDataSize(int w, int h) { return GetDataNBlock(w) * GetDataPeriod(h); }


x86 assembly (clang, -O0):
<GetDataSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <GetDataNBlock@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <GetDataPeriod@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDataSize>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1040 <GetDataNBlock@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <GetDataPeriod@plt>
imul   %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @GetDataSize(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 = call i32 @GetDataNBlock(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @GetDataPeriod(i32 %7)
%9 = mul nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @GetDataSize(i32 %0, i32 %1) {
%3 = tail call i32 @GetDataNBlock(i32 %0)
%4 = tail call i32 @GetDataPeriod(i32 %1)
%5 = mul nsw i32 %4, %3
ret i32 %5
}