xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ uart0_putc(int /*<<< orphan*/);
void uart0_puts(char *s) {
  while (*s) {
    uart0_putc(*s++);
  }
}


x86 assembly (clang, -O0):
<uart0_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <uart0_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uart0_putc@plt>
jmp    111c <uart0_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart0_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart0_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart0_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart0_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart0_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @uart0_putc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *sds_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<sds_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @sds_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @sds_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int bio_hw_segments(struct request_queue *x, struct bio *y) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.request_queue = type opaque
%struct.bio = type opaque
define i32 @bio_hw_segments(%struct.request_queue* %0, %struct.bio* %1) {
%3 = alloca %struct.request_queue*
%4 = alloca %struct.bio*
%5 = alloca i32
store %struct.request_queue* %0, %struct.request_queue** %3
store %struct.bio* %1, %struct.bio** %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.request_queue = type opaque
%struct.bio = type opaque
define i32 @bio_hw_segments(%struct.request_queue* nocapture readnone %0, %struct.bio* nocapture readnone %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dump_addr(int /*<<< orphan*/ *, char *, int *);
void fun2(FILE *p) {
  int f2;
  dump_addr(p, "&f2", &f2);
}


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

x86 assembly (clang, -O2):
<fun2>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <dump_addr@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"&f2\00"
define void @fun2(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @dump_addr(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  int fd = open("/dev/led", O_RDWR);
  if (fd < 0) {
    return -1;
  }
  write(fd, "20", 2);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    116d <main+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <main+0x60>
mov    -0x8(%rbp),%edi
lea    0xe92(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <open@plt>
test   %eax,%eax
js     116a <main+0x3a>
mov    %eax,%ebx
lea    0xeb6(%rip),%rsi
mov    %eax,%edi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/led\00"
@O_RDWR = global i32 0
@.str.1 = [3 x i8] c"20\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %13
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @write(i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%11 = load i32, i32* %2
%12 = call i32 @close(i32 %11)
store i32 0, i32* %1
br label %13
13: ; preds = %8, %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/led\00"
@O_RDWR = global i32 0
@.str.1 = [3 x i8] c"20\00"
define i32 @main() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = tail call i32 @close(i32 %2)
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ 0, %4 ], [ -1, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  bool x = true;
  assert(x);
  assert(!false);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @assert(i32 %3)
%5 = call i32 @assert(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
double DSConvertZUnitsToM(int z, int zUnits) { return z * zUnits / 1000000.0; }


x86 assembly (clang, -O0):
<DSConvertZUnitsToM>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSConvertZUnitsToM>:
imul   %esi,%edi
cvtsi2sd %edi,%xmm0
divsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @DSConvertZUnitsToM(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+06
ret double %9
}

LLVM IR (-O2):
define double @DSConvertZUnitsToM(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+06
ret double %5
}
unsigned int hta_test_linear_hash(void *key) { return *(unsigned int *)key; }


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

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

LLVM IR (-O0):
define i32 @hta_test_linear_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hta_test_linear_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void M40Reset(void) {}


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

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

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

LLVM IR (-O2):
define void @M40Reset() {
ret void
}
unsigned long ffz(unsigned long word) {
  int b = 0, s;
  word = ~word;
  return b;
}


x86 assembly (clang, -O0):
<ffz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
movslq -0xc(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @ffz(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
%5 = load i64, i64* %2
%6 = xor i64 %5, -1
store i64 %6, i64* %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @ffz(i64 %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void unix_error(const char *err_msg) { perror(err_msg); }


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

LLVM IR (-O0):
define void @unix_error(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 @unix_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add16(int const *, int *, int *);
void inc16(const int *in, int *out) {
  int one[16] = {0};
  one[15] = 1;
  add16(in, one, out);
}


x86 assembly (clang, -O0):
<inc16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <add16@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc16>:
sub    $0x48,%rsp
mov    %rsi,%rdx
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x1,0x3c(%rsp)
mov    %rsp,%rsi
call   1030 <add16@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @inc16(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [16 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = bitcast [16 x i32]* %5 to i8*
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 15
store i32 1, i32* %7
%8 = load i32*, i32** %3
%9 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%10 = load i32*, i32** %4
%11 = call i32 @add16(i32* %8, i32* %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @inc16(i32* %0, i32* %1) {
%3 = alloca [16 x i32]
%4 = bitcast [16 x i32]* %3 to i8*
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 15
store i32 1, i32* %5
%6 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%7 = call i32 @add16(i32* %0, i32* %6, i32* %1)
ret void
}
/* Variables and functions */
int log(double);
int convertfunction(int in) {
  return (int)((log(1193181.0 / (440.0 * (float)in)) / log(2.0)) * 0x1000) +
         0x4000;
}


x86 assembly (clang, -O0):
<convertfunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee4(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xed0(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <log@plt>
mov    %eax,-0x8(%rbp)
movsd  0xeb4(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
shl    $0xc,%eax
add    $0x4000,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertfunction>:
push   %rbx
cvtsi2ss %edi,%xmm0
cvtss2sd %xmm0,%xmm1
mulsd  0xedf(%rip),%xmm1
movsd  0xedf(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <log@plt>
mov    %eax,%ebx
movsd  0xed4(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
shl    $0xc,%eax
add    $0x4000,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @convertfunction(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
%5 = fpext float %4 to double
%6 = fmul double 4.400000e+02, %5
%7 = fdiv double 0x413234DD00000000, %6
%8 = call i32 @log(double %7)
%9 = call i32 @log(double 2.000000e+00)
%10 = sdiv i32 %8, %9
%11 = mul nsw i32 %10, 4096
%12 = add nsw i32 %11, 16384
ret i32 %12
}

LLVM IR (-O2):
define i32 @convertfunction(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = fpext float %2 to double
%4 = fmul double %3, 4.400000e+02
%5 = fdiv double 0x413234DD00000000, %4
%6 = tail call i32 @log(double %5)
%7 = tail call i32 @log(double 2.000000e+00)
%8 = sdiv i32 %6, %7
%9 = shl nsw i32 %8, 12
%10 = add nsw i32 %9, 16384
ret i32 %10
}
int test_imm_A8uint16_reg(unsigned short val) {
  return ((val) & (0xA8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A8uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xa8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A8uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 168
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void perr_exit(const char *s) {
  perror(s);
  exit(-1);
}


x86 assembly (clang, -O0):
<perr_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perr_exit>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @perr_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @perr_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bt_delete_all_macros();
int /*<<< orphan*/ zzs_done();
void done_macros(void) {
  bt_delete_all_macros();
  zzs_done();
}


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

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

LLVM IR (-O0):
define void @done_macros() {
%1 = call i32 (...) @bt_delete_all_macros()
%2 = call i32 (...) @zzs_done()
ret void
}

LLVM IR (-O2):
define void @done_macros() {
%1 = tail call i32 (...) @bt_delete_all_macros()
%2 = tail call i32 (...) @zzs_done()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ protect_mem(char *, int, int);
void stub1();
int main() {
  static char buf[] = {0x90, 0x90, 0x90, 0xc3};
  void (*func)(void) = (void (*)(void))buf;
  protect_mem(buf, sizeof(buf), 0x01 | 0x02 | 0x04);
  (*func)();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x2f02(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0x2ef7(%rip),%rdi
mov    $0x4,%esi
mov    $0x7,%edx
call   1030 <protect_mem@plt>
call   *-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x2f10(%rip),%rdi
mov    $0x4,%esi
mov    $0x7,%edx
call   1030 <protect_mem@plt>
call   4028 <main.buf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@main.buf = internal global [4 x i8] c"\90\90\90\C3"
define i32 @main() {
%1 = alloca i32
%2 = alloca void ()*
store i32 0, i32* %1
store void ()* bitcast ([4 x i8]* @main.buf to void ()*), void ()** %2
%3 = call i32 @protect_mem(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @main.buf, i64 0, i64 0), i32 4, i32 7)
%4 = load void ()*, void ()** %2
ret i32 0
}

LLVM IR (-O2):
@main.buf = internal global [4 x i8] c"\90\90\90\C3"
define i32 @main() {
%1 = tail call i32 @protect_mem(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @main.buf, i64 0, i64 0), i32 4, i32 7)
tail call void bitcast ([4 x i8]* @main.buf to void ()*)()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ new_block_basis_s(int /*<<< orphan*/);
void free_basis_s_storage(void) { new_block_basis_s(0); }


x86 assembly (clang, -O0):
<free_basis_s_storage>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <new_block_basis_s@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_basis_s_storage>:
xor    %edi,%edi
jmp    1030 <new_block_basis_s@plt>

LLVM IR (-O0):
define void @free_basis_s_storage() {
%1 = call i32 @new_block_basis_s(i32 0)
ret void
}

LLVM IR (-O2):
define void @free_basis_s_storage() {
%1 = tail call i32 @new_block_basis_s(i32 0)
ret void
}
int main(void) {
  int var;
lol:
  ++var;
  goto lol;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
void quat2rpy_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @quat2rpy_terminate() {
ret void
}
int test_imm_67uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x67 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_67uint64_midword_reg>:
test   $0x670000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_67uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 103
%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_67uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 6750208
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int foo() {}


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
double blargg_max(double x, double y) {
  if (x < y)
    x = y;
  return x;
}


x86 assembly (clang, -O0):
<blargg_max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    112c <blargg_max+0x2c>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<blargg_max>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @blargg_max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %4
store double %9, double* %3
br label %10
10: ; preds = %8, %2
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
define double @blargg_max(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
int pot(int, int);
int somatorio(int r, int e) { return 1 + (r * (pot(r, e) - 1) / (r - 1)); }


x86 assembly (clang, -O0):
<somatorio>:
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    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <pot@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    $0x1,%ecx
imul   %ecx,%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<somatorio>:
push   %rbx
mov    %edi,%ebx
call   1030 <pot@plt>
add    $0xffffffff,%eax
imul   %ebx,%eax
add    $0xffffffff,%ebx
cltd
idiv   %ebx
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @somatorio(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* %3
%7 = load i32, i32* %4
%8 = call i32 @pot(i32 %6, i32 %7)
%9 = sub nsw i32 %8, 1
%10 = mul nsw i32 %5, %9
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = sdiv i32 %10, %12
%14 = add nsw i32 1, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @somatorio(i32 %0, i32 %1) {
%3 = tail call i32 @pot(i32 %0, i32 %1)
%4 = add nsw i32 %3, -1
%5 = mul nsw i32 %4, %0
%6 = add nsw i32 %0, -1
%7 = sdiv i32 %5, %6
%8 = add nsw i32 %7, 1
ret i32 %8
}
/* Type definitions */
struct plugin_option {
  int dummy;
};

/* Variables and functions */
struct plugin_option *find_registered_option(char const *, char const *);
int update_option_value(struct plugin_option *, char const *);
int process_option(const char *plugin, const char *option, const char *val) {
  struct plugin_option *op;
  op = find_registered_option(plugin, option);
  if (!op)
    return 0;
  return update_option_value(op, val);
}


x86 assembly (clang, -O0):
<process_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <find_registered_option@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115c <process_option+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    116c <process_option+0x4c>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <update_option_value@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_option>:
push   %rbx
mov    %rdx,%rbx
call   1040 <find_registered_option@plt>
test   %rax,%rax
je     113a <process_option+0x1a>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <update_option_value@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.plugin_option = type { i32 }
define i32 @process_option(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca %struct.plugin_option*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call %struct.plugin_option* @find_registered_option(i8* %9, i8* %10)
store %struct.plugin_option* %11, %struct.plugin_option** %8
%12 = load %struct.plugin_option*, %struct.plugin_option** %8
%13 = icmp ne %struct.plugin_option* %12, null
br i1 %13, label %15, label %14
14: ; preds = %3
store i32 0, i32* %4
br label %19
15: ; preds = %3
%16 = load %struct.plugin_option*, %struct.plugin_option** %8
%17 = load i8*, i8** %7
%18 = call i32 @update_option_value(%struct.plugin_option* %16, i8* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %15, %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.plugin_option = type { i32 }
define i32 @process_option(i8* %0, i8* %1, i8* %2) {
%4 = tail call %struct.plugin_option* @find_registered_option(i8* %0, i8* %1)
%5 = icmp eq %struct.plugin_option* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @update_option_value(%struct.plugin_option* %4, i8* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ asm_sig_print(int, int /*<<< orphan*/ *, void *);
void sigfn_segv(int signum, siginfo_t *siginfo, void *puctx) {
  asm_sig_print(signum, siginfo, puctx);
}


x86 assembly (clang, -O0):
<sigfn_segv>:
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
call   1030 <asm_sig_print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigfn_segv>:
jmp    1030 <asm_sig_print@plt>

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

LLVM IR (-O2):
define void @sigfn_segv(i32 %0, i32* %1, i8* %2) {
%4 = tail call i32 @asm_sig_print(i32 %0, i32* %1, i8* %2)
ret void
}
void printUnicode() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ log_add(char *, char *);
int /*<<< orphan*/ socket_release(struct socket *);
void release_operation(struct socket *sock, int error, int transfered,
                       void *udata) {
  log_add("INFO", "release operation");
  socket_release(sock);
}


x86 assembly (clang, -O0):
<release_operation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
lea    0xec3(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1040 <log_add@plt>
mov    -0x8(%rbp),%rdi
call   1030 <socket_release@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<release_operation>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1040 <log_add@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <socket_release@plt>

LLVM IR (-O0):
%struct.socket = type { i32 }
@.str = [5 x i8] c"INFO\00"
@.str.1 = [18 x i8] c"release operation\00"
define void @release_operation(%struct.socket* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.socket*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.socket* %0, %struct.socket** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = call i32 @log_add(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%10 = load %struct.socket*, %struct.socket** %5
%11 = call i32 @socket_release(%struct.socket* %10)
ret void
}

LLVM IR (-O2):
%struct.socket = type { i32 }
@.str = [5 x i8] c"INFO\00"
@.str.1 = [18 x i8] c"release operation\00"
define void @release_operation(%struct.socket* %0, i32 %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 @log_add(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @socket_release(%struct.socket* %0)
ret void
}
void bn_lshift(unsigned int *bn, unsigned int shift, unsigned int or_val) {
  int i;
  unsigned int v;
  for (i = 0; i < 2; i++) {
    v = bn[i];
    bn[i] = (v << shift) | or_val;
    or_val = v >> (32 - shift);
  }
}


x86 assembly (clang, -O0):
<bn_lshift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1161 <bn_lshift+0x61>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edx
mov    -0xc(%rbp),%ecx
shl    %cl,%edx
or     -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <bn_lshift+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn_lshift>:
mov    %esi,%ecx
mov    (%rdi),%eax
mov    %eax,%esi
shl    %cl,%esi
or     %edx,%esi
mov    %esi,(%rdi)
shld   %cl,%eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @bn_lshift(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %9
9: ; preds = %31, %3
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %34
12: ; preds = %9
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
store i32 %17, i32* %8
%18 = load i32, i32* %8
%19 = load i32, i32* %5
%20 = shl i32 %18, %19
%21 = load i32, i32* %6
%22 = or i32 %20, %21
%23 = load i32*, i32** %4
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
%27 = load i32, i32* %8
%28 = load i32, i32* %5
%29 = sub i32 32, %28
%30 = lshr i32 %27, %29
store i32 %30, i32* %6
br label %31
31: ; preds = %12
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %9
34: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @bn_lshift(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sub i32 32, %1
%5 = load i32, i32* %0
%6 = shl i32 %5, %1
%7 = or i32 %6, %2
store i32 %7, i32* %0
%8 = lshr i32 %5, %4
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, %1
%12 = or i32 %11, %8
store i32 %12, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TxDByte_DXL(unsigned char);
int dxl_hal_tx(unsigned char *pPacket, int numPacket) {
  unsigned char i;
  for (i = 0; i < numPacket; i++)
    TxDByte_DXL(pPacket[i]);
  return numPacket;
}


x86 assembly (clang, -O0):
<dxl_hal_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114e <dxl_hal_tx+0x3e>
mov    -0x8(%rbp),%rax
movzbl -0xd(%rbp),%ecx
movzbl (%rax,%rcx,1),%edi
call   1030 <TxDByte_DXL@plt>
mov    -0xd(%rbp),%al
add    $0x1,%al
mov    %al,-0xd(%rbp)
jmp    1123 <dxl_hal_tx+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dxl_hal_tx>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
test   %esi,%esi
jle    1137 <dxl_hal_tx+0x27>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movzbl %bl,%ebx
movzbl (%r14,%rbx,1),%edi
call   1030 <TxDByte_DXL@plt>
add    $0x1,%bl
movzbl %bl,%eax
cmp    %ebp,%eax
jl     1120 <dxl_hal_tx+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dxl_hal_tx(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8 0, i8* %5
br label %6
6: ; preds = %18, %2
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %5
%14 = zext i8 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @TxDByte_DXL(i8 zeroext %16)
br label %18
18: ; preds = %11
%19 = load i8, i8* %5
%20 = add i8 %19, 1
store i8 %20, i8* %5
br label %6
21: ; preds = %6
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @dxl_hal_tx(i8* nocapture %0, i32 returned %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i8 [ %10, %4 ], [ 0, %2 ]
%6 = zext i8 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @TxDByte_DXL(i8 zeroext %8)
%10 = add i8 %5, 1
%11 = zext i8 %10 to i32
%12 = icmp slt i32 %11, %1
br i1 %12, label %4, label %13
13: ; preds = %4, %2
ret i32 %1
}
/* Type definitions */
struct _mgmt_sysinfo_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _mgmt_sysinfo_req *);
void mgmt_sysinfo_req_free(struct _mgmt_sysinfo_req *ptr) { free(ptr); }


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

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

LLVM IR (-O2):
%struct._mgmt_sysinfo_req = type { i32 }
define void @mgmt_sysinfo_req_free(%struct._mgmt_sysinfo_req* nocapture %0) {
%2 = tail call i32 @free(%struct._mgmt_sysinfo_req* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void destroy(int *board, int *newboard) {
  free(board);
  free(newboard);
}


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

x86 assembly (clang, -O2):
<destroy>:
push   %rbx
mov    %rsi,%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @destroy(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 @free(i32* %5)
%7 = load i32*, i32** %4
%8 = call i32 @free(i32* %7)
ret void
}

LLVM IR (-O2):
define void @destroy(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @free(i32* %0)
%4 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
int isalnumde(int);
int isalnum_0(int c) { return (c == '0') ? 0 : isalnumde(c); }


x86 assembly (clang, -O0):
<isalnum_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jne    112f <isalnum_0+0x1f>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <isalnum_0+0x2a>
mov    -0x4(%rbp),%edi
call   1030 <isalnumde@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum_0>:
cmp    $0x30,%edi
jne    1118 <isalnum_0+0x8>
xor    %eax,%eax
ret
jmp    1030 <isalnumde@plt>

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

LLVM IR (-O2):
define i32 @isalnum_0(i32 %0) {
%2 = icmp eq i32 %0, 48
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @isalnumde(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
double pow(double, int);
double myPow(double x, int n) { return pow(x, n); }


x86 assembly (clang, -O0):
<myPow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myPow>:
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @myPow(double %0, i32 %1) {
%3 = tail call double @pow(double %0, i32 %1)
ret double %3
}
void f(void) {
#pragma css wait on(a)
}


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() {
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
void X509_REQ_get1_email(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_get1_email() {
ret void
}
int main() {
  unsigned long test = 1;
  return -test + 10;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 0, %3
%5 = add i64 %4, 10
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 9
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ jesus(int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(int argc, char *argv[]) {
  int num, start, gap;
  scanf("%d%d%d", &num, &start, &gap);
  jesus(num, start, gap);
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <jesus@plt>
mov    $0x0,%al
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1030 <jesus@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @jesus(i32 %10, i32 %11, i32 %12)
%14 = call i32 (...) @getch()
ret i32 0
}
void init_heap(void) {}


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

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

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

LLVM IR (-O2):
define void @init_heap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void showsig(int sig) { printf("signal=%d\n", sig); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"signal=%d\0A\00"
define void @showsig(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int toupper(int c) { return (96 < c && c < 123) ? c - 32 : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x60,%eax
cmp    -0x4(%rbp),%eax
jge    112d <toupper+0x2d>
cmpl   $0x7b,-0x4(%rbp)
jge    112d <toupper+0x2d>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <toupper+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void *err(char *str_err) {
  fprintf(stderr, "Err.(%s) - %s\n", strerror(errno), str_err);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
mov    -0x8(%rbp),%rcx
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Err.(%s) - %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define i8* @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Err.(%s) - %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define noalias i8* @err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *mem_double(void *ptr, int size) {
  void *newptr;
  newptr = calloc(2 * size, 1);
  memcpy(newptr, ptr, size);
  free(ptr);
  return newptr;
}


x86 assembly (clang, -O0):
<mem_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
shl    $0x1,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_double>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    (%r15,%r15,1),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1050 <memcpy@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mem_double(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 2, %6
%8 = call i8* @calloc(i32 %7, i32 1)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i32 %11)
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @mem_double(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = tail call i8* @calloc(i32 %3, i32 1)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%6 = tail call i32 @free(i8* %0)
ret i8* %4
}
/* Type definitions */
struct fdi {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ track_pc(struct fdi *, int);
void track_pc_9(struct fdi *fdi) { track_pc(fdi, 9); }


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

x86 assembly (clang, -O2):
<track_pc_9>:
mov    $0x9,%esi
jmp    1030 <track_pc@plt>

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

LLVM IR (-O2):
%struct.fdi = type { i32 }
define void @track_pc_9(%struct.fdi* %0) {
%2 = tail call i32 @track_pc(%struct.fdi* %0, i32 9)
ret void
}