xunge/DecIR huggingface dataset:
__attribute__((pure)) _Complex int foo_int(int x) {
  _Complex int r;
  __real r = x + 1;
  __imag r = x - 1;
  return r;
}


x86 assembly (clang, -O0):
<foo_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_int>:
lea    0x1(%rdi),%eax
lea    -0x1(%rdi),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @foo_int(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = add nsw i32 %0, -1
%4 = zext i32 %3 to i64
%5 = shl nuw i64 %4, 32
%6 = zext i32 %2 to i64
%7 = or i64 %5, %6
ret i64 %7
}
/* Variables and functions */
double ceil(double);
double floor(double);
double to_int(double x) { return (x < 0 ? ceil(x) : floor(x)); }


x86 assembly (clang, -O0):
<to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    114f <to_int+0x2f>
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    115e <to_int+0x3e>
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_int>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    112f <to_int+0xf>
jmp    1030 <ceil@plt>
jmp    1040 <floor@plt>

LLVM IR (-O0):
define double @to_int(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = call double @llvm.ceil.f64(double %6)
br label %11
8: ; preds = %1
%9 = load double, double* %2
%10 = call double @llvm.floor.f64(double %9)
br label %11
11: ; preds = %8, %5
%12 = phi double [ %7, %5 ], [ %10, %8 ]
ret double %12
}

LLVM IR (-O2):
define double @to_int(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @llvm.ceil.f64(double %0)
br label %7
5: ; preds = %1
%6 = tail call double @llvm.floor.f64(double %0)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ %6, %5 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *);
void clearbelowmovebox(void) {
  int i;
  move(17, 42);
  printw("*----------------------------------*");
  for (i = 1; i <= 2; i++) {
    move(17 + i, 42);
    printw("                                    ");
  }
}


x86 assembly (clang, -O0):
<clearbelowmovebox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x11,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec2(%rip),%rdi
call   1030 <printw@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jg     117e <clearbelowmovebox+0x5e>
mov    -0x4(%rbp),%edi
add    $0x11,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xeba(%rip),%rdi
call   1030 <printw@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114a <clearbelowmovebox+0x2a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearbelowmovebox>:
push   %rbx
mov    $0x11,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec9(%rip),%rdi
call   1030 <printw@plt>
mov    $0x12,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xed3(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    $0x13,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printw@plt>

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

LLVM IR (-O2):
@.str = [37 x i8] c"*----------------------------------*\00"
@.str.1 = [37 x i8] c" \00"
define void @clearbelowmovebox() {
%1 = tail call i32 @move(i32 17, i32 42)
%2 = tail call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @move(i32 18, i32 42)
%4 = tail call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @move(i32 19, i32 42)
%6 = tail call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Use:\n");
  printf("netsp [interface]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Use:\0A\00"
@.str.1 = [19 x i8] c"netsp [interface]\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [5 x i8] c"Use:\00"
@str.2 = [18 x i8] c"netsp [interface]\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void toggleLeds(char leds, char direction) {
  unsigned int *data = ((unsigned int *)0x50023FFC);
  *data ^= 0x01FE & (leds << 1);
}


x86 assembly (clang, -O0):
<toggleLeds>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x50023ffc,%eax
mov    %rax,-0x10(%rbp)
movsbl -0x1(%rbp),%ecx
shl    $0x1,%ecx
and    $0x1fe,%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggleLeds>:
movzbl %dil,%eax
add    %eax,%eax
xor    %eax,0x50023ffc
ret

LLVM IR (-O0):
define void @toggleLeds(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32*
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32* inttoptr (i64 1342324732 to i32*), i32** %5
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = shl i32 %7, 1
%9 = and i32 510, %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = xor i32 %11, %9
store i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @toggleLeds(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = shl nsw i32 %3, 1
%5 = and i32 %4, 510
%6 = load i32, i32* inttoptr (i64 1342324732 to i32*)
%7 = xor i32 %6, %5
store i32 %7, i32* inttoptr (i64 1342324732 to i32*)
ret void
}
void putbyte(struct _IO_FILE$link42 *outf, unsigned char val) {
  unsigned char buf[1l];
  buf[(signed long int)0] = val;
  fwrite((const void *)buf, (unsigned long int)1, (unsigned long int)1, outf);
}


x86 assembly (clang, -O0):
<putbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xa(%rbp)
lea    -0xa(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putbyte>:
push   %rax
mov    %rdi,%rcx
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
%"struct._IO_FILE$link42" = type opaque
define void @putbyte(%"struct._IO_FILE$link42"* %0, i8 zeroext %1) {
%3 = alloca %"struct._IO_FILE$link42"*
%4 = alloca i8
%5 = alloca [1 x i8]
store %"struct._IO_FILE$link42"* %0, %"struct._IO_FILE$link42"** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%9 = load %"struct._IO_FILE$link42"*, %"struct._IO_FILE$link42"** %3
%10 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...)*)(i8* %8, i64 1, i64 1, %"struct._IO_FILE$link42"* %9)
ret void
}

LLVM IR (-O2):
%"struct._IO_FILE$link42" = type opaque
define void @putbyte(%"struct._IO_FILE$link42"* %0, i8 zeroext %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = call i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...) bitcast (i32 (...)* @fwrite to i32 (i8*, i64, i64, %"struct._IO_FILE$link42"*, ...)*)(i8* %4, i64 1, i64 1, %"struct._IO_FILE$link42"* %0)
ret void
}
int Least(int num, int num2) {
  if (num < num2)
    return num;
  return num2;
}


x86 assembly (clang, -O0):
<Least>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <Least+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <Least+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Least>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @Least(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* %4
%7 = load i32, i32* %5
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @Least(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void foo166() {}


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

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

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

LLVM IR (-O2):
define void @foo166() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ decomposed;

/* Variables and functions */
size_t decomposeCharacter(unsigned char, unsigned char *, int);
unsigned char getBaseCharacter(unsigned char character) {
  unsigned char decomposed[0X10];
  size_t count = decomposeCharacter(character, decomposed, sizeof(decomposed));
  if (count)
    return decomposed[0];
  return 0;
}


x86 assembly (clang, -O0):
<getBaseCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
movzbl %al,%edi
call   1030 <decomposeCharacter@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     114c <getBaseCharacter+0x3c>
mov    -0x20(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1150 <getBaseCharacter+0x40>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBaseCharacter>:
sub    $0x18,%rsp
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <decomposeCharacter@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     112e <getBaseCharacter+0x1e>
mov    (%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define zeroext i8 @getBaseCharacter(i8 zeroext %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i64 @decomposeCharacter(i8 zeroext %0, i8* %3, i32 16)
%5 = icmp eq i64 %4, 0
%6 = load i8, i8* %3
%7 = select i1 %5, i8 0, i8 %6
ret i8 %7
}
/* Type definitions */
typedef int fexcept_t;

/* Variables and functions */
int /*<<< orphan*/ feclearexcept(int const);
int /*<<< orphan*/ feraiseexcept(int const);
int fesetexceptflag(const fexcept_t *f, int m) {
  feclearexcept(~*f & m);
  feraiseexcept(*f & m);
  return 0;
}


x86 assembly (clang, -O0):
<fesetexceptflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    $0xffffffff,%edi
and    -0xc(%rbp),%edi
call   1040 <feclearexcept@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
and    -0xc(%rbp),%edi
call   1030 <feraiseexcept@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetexceptflag>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    (%rdi),%edi
not    %edi
and    %esi,%edi
call   1040 <feclearexcept@plt>
and    (%r14),%ebx
mov    %ebx,%edi
call   1030 <feraiseexcept@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fesetexceptflag(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* %5
%7 = xor i32 %6, -1
%8 = load i32, i32* %4
%9 = and i32 %7, %8
%10 = call i32 @feclearexcept(i32 %9)
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32, i32* %4
%14 = and i32 %12, %13
%15 = call i32 @feraiseexcept(i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @fesetexceptflag(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = xor i32 %3, -1
%5 = and i32 %4, %1
%6 = tail call i32 @feclearexcept(i32 %5)
%7 = load i32, i32* %0
%8 = and i32 %7, %1
%9 = tail call i32 @feraiseexcept(i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void chip_gpio_direction_in(uint8_t which) {}


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

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

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

LLVM IR (-O2):
define void @chip_gpio_direction_in(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void ClearBuffer(void *buf, int nBytes) {
  unsigned char *cbuf = (unsigned char *)buf;
  memset(cbuf, 0, nBytes);
  return;
}


x86 assembly (clang, -O0):
<ClearBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearBuffer>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @ClearBuffer(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, world\n");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello, world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned int vavgu4(unsigned int a, unsigned int b) {
  unsigned int r, c;
  c = a ^ b;
  r = a | b;
  c = c & 0xfefefefe;
  c = c >> 1;
  r = r - c;
  return r;
}


x86 assembly (clang, -O0):
<vavgu4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0xfefefefe,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vavgu4>:
mov    %esi,%eax
mov    %esi,%ecx
xor    %edi,%ecx
or     %edi,%eax
shr    %ecx
and    $0x7f7f7f7f,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @vavgu4(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
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = or i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %6
%14 = and i32 %13, -16843010
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = lshr i32 %15, 1
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = sub i32 %17, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @vavgu4(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = or i32 %1, %0
%5 = lshr i32 %3, 1
%6 = and i32 %5, 2139062143
%7 = sub i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ init_board();
int /*<<< orphan*/ init_data();
int /*<<< orphan*/ init_hash();
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void begin(void) {
  init_hash();
  init_data();
  init_board();
  setbuf(stdout, NULL);
  setbuf(stdin, NULL);
}


x86 assembly (clang, -O0):
<begin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <init_hash@plt>
mov    $0x0,%al
call   1030 <init_data@plt>
mov    $0x0,%al
call   1060 <init_board@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <setbuf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <setbuf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<begin>:
push   %rax
xor    %eax,%eax
call   1050 <init_hash@plt>
xor    %eax,%eax
call   1030 <init_data@plt>
xor    %eax,%eax
call   1060 <init_board@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <setbuf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stdin = global i32 0
define void @begin() {
%1 = call i32 (...) @init_hash()
%2 = call i32 (...) @init_data()
%3 = call i32 (...) @init_board()
%4 = load i32, i32* @stdout
%5 = call i32 @setbuf(i32 %4, i32* null)
%6 = load i32, i32* @stdin
%7 = call i32 @setbuf(i32 %6, i32* null)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stdin = global i32 0
define void @begin() {
%1 = tail call i32 (...) @init_hash()
%2 = tail call i32 (...) @init_data()
%3 = tail call i32 (...) @init_board()
%4 = load i32, i32* @stdout
%5 = tail call i32 @setbuf(i32 %4, i32* null)
%6 = load i32, i32* @stdin
%7 = tail call i32 @setbuf(i32 %6, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PopIndent();
int /*<<< orphan*/ RecursiveReturn();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void EndVERBATIM() {
  PopIndent();
  fputs("@end example\n", stdout);
  RecursiveReturn();
}


x86 assembly (clang, -O0):
<EndVERBATIM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <PopIndent@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x0,%al
call   1050 <RecursiveReturn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EndVERBATIM>:
push   %rax
xor    %eax,%eax
call   1040 <PopIndent@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <RecursiveReturn@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"@end example\0A\00"
@stdout = global i32 0
define void @EndVERBATIM() {
%1 = call i32 (...) @PopIndent()
%2 = load i32, i32* @stdout
%3 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @RecursiveReturn()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"@end example\0A\00"
@stdout = global i32 0
define void @EndVERBATIM() {
%1 = tail call i32 (...) @PopIndent()
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @RecursiveReturn()
ret void
}
int sqllog_isspace(char c) {
  return (c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' ||
          c == '\r');
}


x86 assembly (clang, -O0):
<sqllog_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1171 <sqllog_isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     1171 <sqllog_isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1171 <sqllog_isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xb,%ecx
mov    %al,-0x2(%rbp)
je     1171 <sqllog_isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x2(%rbp)
je     1171 <sqllog_isspace+0x71>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqllog_isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x4,%cl
jae    110e <sqllog_isspace+0xe>
ret
cmp    $0x20,%dil
je     110d <sqllog_isspace+0xd>
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @sqllog_isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 12, label %5
i8 11, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int valor = 0;
  scanf("%d", &valor);
  switch (valor) {
  case 0: {
    int variavel = 1;
    printf("%d", variavel);
    break;
  }
  default: {
    int variavel = 2;
    printf("%d", variavel);
  }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    1171 <main+0x51>
jmp    1156 <main+0x36>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1187 <main+0x67>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
cmpl   $0x1,0xc(%rsp)
mov    $0x2,%esi
sbb    $0x0,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 1, i32 2
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long serial;
};
struct TYPE_4__ {
  TYPE_1__ xproperty;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xproperty_serial(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xproperty.serial = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xproperty_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int usage(char *me) {
  fprintf(stderr, "Usage: %s [-b windows|winui|mess] <filename>\n", me);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: %s [-b windows|winui|mess] <filename>\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: %s [-b windows|winui|mess] <filename>\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
char *str1(void) { return "test01\n"; }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"test01\0A\00"
define i8* @str1() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"test01\0A\00"
define i8* @str1() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
__attribute__((weak)) void fd_nrf8001_set_application_latency_success(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_set_application_latency_success() {
ret void
}
int test_imm_EEuint8_mem(unsigned char *val) {
  return ((*val) & (-0xEE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EEuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -238
%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_EEuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 18
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void my_free(char *x) { free(x); }


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

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

LLVM IR (-O0):
define void @my_free(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 @my_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int emptyfile(char *filename) {
  FILE *chi;
  chi = fopen(filename, "w");
  if (chi == NULL)
    return 0;
  fclose(chi);
  return 1;
}


x86 assembly (clang, -O0):
<emptyfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <emptyfile+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <emptyfile+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emptyfile>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <emptyfile+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @emptyfile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float fromRep32(int);
float makeNaN32(uint32_t rand) {
  return fromRep32(0x7f800000U | (rand & 0x7fffffU));
}


x86 assembly (clang, -O0):
<makeNaN32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0x7fffff,%edi
or     $0x7f800000,%edi
call   1030 <fromRep32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeNaN32>:
and    $0x7fffff,%edi
or     $0x7f800000,%edi
jmp    1030 <fromRep32@plt>

LLVM IR (-O0):
define float @makeNaN32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8388607
%5 = or i32 2139095040, %4
%6 = call float @fromRep32(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @makeNaN32(i32 %0) {
%2 = and i32 %0, 8388607
%3 = or i32 %2, 2139095040
%4 = tail call float @fromRep32(i32 %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ system(char *);
void startWrekavoc(void) {
  char strCommand[255];
  sprintf(strCommand, "wrekavoc -r > /dev/null 2> /dev/null");
  system(strCommand);
  sleep(1);
  sprintf(strCommand, "wrekavoc /tmp/wrekavalid.conf ");
  system(strCommand);
  sleep(5);
}


x86 assembly (clang, -O0):
<startWrekavoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    -0x100(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startWrekavoc>:
push   %rbx
sub    $0x100,%rsp
movups 0xee1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xec5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x6c6c756e2f7665,%rax
mov    %rax,0x1d(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <system@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
movups 0xebb(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xebf(%rip),%xmm0
movups %xmm0,0xf(%rsp)
mov    %rbx,%rdi
call   1030 <system@plt>
mov    $0x5,%edi
add    $0x100,%rsp
pop    %rbx
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"wrekavoc -r > /dev/null 2> /dev/null\00"
@.str.1 = [31 x i8] c"wrekavoc /tmp/wrekavalid.conf \00"
define void @startWrekavoc() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
%6 = call i32 @sleep(i32 1)
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%10 = call i32 @system(i8* %9)
%11 = call i32 @sleep(i32 5)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"wrekavoc -r > /dev/null 2> /dev/null\00"
@.str.1 = [31 x i8] c"wrekavoc /tmp/wrekavalid.conf \00"
define void @startWrekavoc() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @system(i8* %2)
%4 = tail call i32 @sleep(i32 1)
%5 = call i32 @system(i8* %2)
%6 = tail call i32 @sleep(i32 5)
ret void
}
unsigned int desktop_to_tag(unsigned int desktop) {
  return (desktop == 0xffffffff) ? 0 : 1 << desktop;
}


x86 assembly (clang, -O0):
<desktop_to_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    111b <desktop_to_tag+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1128 <desktop_to_tag+0x28>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<desktop_to_tag>:
mov    %edi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
cmp    $0xffffffff,%edi
cmovne %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @desktop_to_tag(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = shl nuw i32 1, %0
%4 = select i1 %2, i32 0, i32 %3
ret i32 %4
}
double dotproduct(double x1, double y1, double z1, double x2, double y2,
                  double z2) {
  return (x1 * x2 + y1 * y2 + z1 * z2);
}


x86 assembly (clang, -O0):
<dotproduct>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotproduct>:
mulsd  %xmm4,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm5,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dotproduct(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %10
%15 = load double, double* %8
%16 = load double, double* %11
%17 = fmul double %15, %16
%18 = call double @llvm.fmuladd.f64(double %13, double %14, double %17)
%19 = load double, double* %9
%20 = load double, double* %12
%21 = call double @llvm.fmuladd.f64(double %19, double %20, double %18)
ret double %21
}

LLVM IR (-O2):
define double @dotproduct(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fmul double %1, %4
%8 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %7)
%9 = tail call double @llvm.fmuladd.f64(double %2, double %5, double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void file_intern(const char *file) { printf("Interning: %s\n", file); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Interning: %s\0A\00"
define void @file_intern(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void logperror(char *s) { perror(s); }


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

x86 assembly (clang, -O2):
<logperror>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @logperror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int ungetc(int, int /*<<< orphan*/ *);
void nocrash_ungetc() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  if (f) {
    int i = ungetc(10, f);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<nocrash_ungetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1174 <nocrash_ungetc+0x44>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1040 <ungetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocrash_ungetc>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1162 <nocrash_ungetc+0x32>
mov    %rax,%rbx
mov    $0xa,%edi
mov    %rax,%rsi
call   1040 <ungetc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @nocrash_ungetc() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = call i32 @ungetc(i32 10, i32* %7)
store i32 %8, i32* %2
%9 = load i32*, i32** %1
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @nocrash_ungetc() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @ungetc(i32 10, i32* %1)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %3, %0
ret void
}
int main() {
  volatile __int128 m = -(((__int128)1) << (8 * 16 / 2));
  m = m * m;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    %rax,%rdi
imul   %rcx,%rdi
mul    %rsi
mov    %rax,%rcx
mov    %rdx,%rax
mov    -0x28(%rbp),%rdx
add    %rdi,%rax
imul   %rsi,%rdx
add    %rdx,%rax
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movq   $0xffffffffffffffff,-0x10(%rsp)
ff ff
movq   $0x0,-0x18(%rsp)
mov    -0x18(%rsp),%rsi
mov    -0x10(%rsp),%rdi
mov    -0x18(%rsp),%rcx
mov    %rcx,%rax
mul    %rsi
imul   %rcx,%rdi
add    %rdi,%rdx
imul   -0x10(%rsp),%rsi
add    %rdx,%rsi
mov    %rax,-0x18(%rsp)
mov    %rsi,-0x10(%rsp)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i128
%2 = bitcast i128* %1 to i8*
store volatile i128 -18446744073709551616, i128* %1
%3 = load volatile i128, i128* %1
%4 = load volatile i128, i128* %1
%5 = mul nsw i128 %4, %3
store volatile i128 %5, i128* %1
ret i32 0
}
/* Type definitions */
typedef void pthread_mutex_t;

/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ pthread_mutex_init(void *, int /*<<< orphan*/ *);
void *OsCreateMutex(char *name) {
  pthread_mutex_t *mtx = malloc(sizeof(pthread_mutex_t));
  if (mtx == NULL) {
    return (NULL);
  }
  pthread_mutex_init(mtx, NULL);
  return (mtx);
}


x86 assembly (clang, -O0):
<OsCreateMutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1152 <OsCreateMutex+0x32>
movq   $0x0,-0x8(%rbp)
jmp    1167 <OsCreateMutex+0x47>
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_mutex_init@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OsCreateMutex>:
push   %rbx
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113d <OsCreateMutex+0x1d>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <pthread_mutex_init@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @OsCreateMutex(i8* nocapture readnone %0) {
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @pthread_mutex_init(i8* %2, i32* null)
br label %6
6: ; preds = %1, %4
ret i8* %2
}