xunge/DecIR huggingface dataset:
unsigned long hash_csum2(char *str) {
  unsigned long hash = 0;
  char c;
  while (str && *str != '\0') {
    hash = c + (hash << 16) + (hash << 6) - hash;
    str++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_csum2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x12(%rbp)
je     1130 <hash_csum2+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1140 <hash_csum2+0x40>
jmp    1174 <hash_csum2+0x74>
movsbq -0x11(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <hash_csum2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @hash_csum2(i8* %0) {
ret i64 0
}
unsigned char v_unsigned_char_func() { return (0); }


x86 assembly (clang, -O0):
<v_unsigned_char_func>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @v_unsigned_char_func() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @v_unsigned_char_func() {
ret i8 0
}
unsigned long lword(const unsigned char *p) {
  unsigned long n;
  n = p[1];
  n = (n << 8) + p[0];
  return n;
}


x86 assembly (clang, -O0):
<lword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lword>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i64 @lword(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = shl i64 %8, 8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = add i64 %9, %13
store i64 %14, i64* %3
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @lword(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = shl nuw nsw i64 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i64
%8 = or i64 %5, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ test_xml_comment_entities();
int /*<<< orphan*/ test_xml_comments();
void all_xml_tests() {
  test_xml_comments();
  test_xml_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_xml_tests() {
%1 = call i32 (...) @test_xml_comments()
%2 = call i32 (...) @test_xml_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_xml_tests() {
%1 = tail call i32 (...) @test_xml_comments()
%2 = tail call i32 (...) @test_xml_comment_entities()
ret void
}
void av_frame_get_qp_table() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_get_qp_table() {
ret void
}
int fun524() { return 524; }


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

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

LLVM IR (-O0):
define i32 @fun524() {
ret i32 524
}

LLVM IR (-O2):
define i32 @fun524() {
ret i32 524
}
void RTPathAppPrivateArch(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathAppPrivateArch() {
ret void
}
unsigned long SSIClockSourceGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000FC8))));
}


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

x86 assembly (clang, -O2):
<SSIClockSourceGet>:
mov    0xfc8(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @SSIClockSourceGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 4040
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @SSIClockSourceGet(i64 %0) {
%2 = add i64 %0, 4040
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ invalid_checksum_test();
int /*<<< orphan*/ invalid_header_test();
int /*<<< orphan*/ invalid_message_length_test();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ simple_multiple_invocation_test();
int /*<<< orphan*/ simple_test();
void scanner_test() {
  puts("# Scanner tests:");
  simple_test();
  simple_multiple_invocation_test();
  invalid_header_test();
  invalid_checksum_test();
  invalid_message_length_test();
}


x86 assembly (clang, -O0):
<scanner_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xe95(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1070 <simple_test@plt>
mov    $0x0,%al
call   1030 <simple_multiple_invocation_test@plt>
mov    $0x0,%al
call   1060 <invalid_header_test@plt>
mov    $0x0,%al
call   1080 <invalid_checksum_test@plt>
mov    $0x0,%al
call   1050 <invalid_message_length_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanner_test>:
push   %rax
lea    0xe98(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <simple_test@plt>
xor    %eax,%eax
call   1030 <simple_multiple_invocation_test@plt>
xor    %eax,%eax
call   1060 <invalid_header_test@plt>
xor    %eax,%eax
call   1080 <invalid_checksum_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <invalid_message_length_test@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"# Scanner tests:\00"
define void @scanner_test() {
%1 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @simple_test()
%3 = call i32 (...) @simple_multiple_invocation_test()
%4 = call i32 (...) @invalid_header_test()
%5 = call i32 (...) @invalid_checksum_test()
%6 = call i32 (...) @invalid_message_length_test()
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"# Scanner tests:\00"
define void @scanner_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @simple_test()
%3 = tail call i32 (...) @simple_multiple_invocation_test()
%4 = tail call i32 (...) @invalid_header_test()
%5 = tail call i32 (...) @invalid_checksum_test()
%6 = tail call i32 (...) @invalid_message_length_test()
ret void
}
/* Variables and functions */
unsigned long BITMAP_MASK(unsigned long);
size_t BITMAP_OFFSET(unsigned long);
void bitmap_set_bit(unsigned long *bitmap, unsigned long bit) {
  bitmap[BITMAP_OFFSET(bit)] |= BITMAP_MASK(bit);
}


x86 assembly (clang, -O0):
<bitmap_set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <BITMAP_MASK@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <BITMAP_OFFSET@plt>
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_set_bit>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <BITMAP_MASK@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <BITMAP_OFFSET@plt>
or     %r15,(%r14,%rax,8)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @bitmap_set_bit(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i64 @BITMAP_MASK(i64 %5)
%7 = load i64*, i64** %3
%8 = load i64, i64* %4
%9 = call i64 @BITMAP_OFFSET(i64 %8)
%10 = getelementptr inbounds i64, i64* %7, i64 %9
%11 = load i64, i64* %10
%12 = or i64 %11, %6
store i64 %12, i64* %10
ret void
}

LLVM IR (-O2):
define void @bitmap_set_bit(i64* nocapture %0, i64 %1) {
%3 = tail call i64 @BITMAP_MASK(i64 %1)
%4 = tail call i64 @BITMAP_OFFSET(i64 %1)
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = or i64 %6, %3
store i64 %7, i64* %5
ret void
}
int test_imm_76int16_mem(short *val) {
  return ((*val) & (0x76 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_76int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 118
%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_76int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 118
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int wait(int *);
void fin_hijo(int sno) {
  int ec;
  pid_t pid = wait(&ec);
  printf("The child has finished %i\n", pid);
}


x86 assembly (clang, -O0):
<fin_hijo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <wait@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fin_hijo>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <wait@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"The child has finished %i\0A\00"
define void @fin_hijo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @wait(i32* %3)
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"The child has finished %i\0A\00"
define void @fin_hijo(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int strLen(char *);
int /*<<< orphan*/ swap(char *, int, int);
void myreverse(char s[]) {
  int i = 0;
  int j = strLen(s) - 1;
  for (; i < j; i++, j--)
    swap(s, i, j);
}


x86 assembly (clang, -O0):
<myreverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strLen@plt>
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <myreverse+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <swap@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <myreverse+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myreverse>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strLen@plt>
cmp    $0x2,%eax
jl     1159 <myreverse+0x39>
mov    %eax,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%esi
mov    %r14,%rdi
mov    %ebp,%edx
call   1040 <swap@plt>
add    $0xffffffff,%ebp
lea    0x1(%rbx),%eax
cmp    %ebp,%ebx
mov    %eax,%ebx
jl     1140 <myreverse+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @myreverse(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @strLen(i8* %5)
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %4
br label %8
8: ; preds = %17, %1
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @swap(i8* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = add nsw i32 %20, -1
store i32 %21, i32* %4
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @myreverse(i8* %0) {
%2 = tail call i32 @strLen(i8* %0)
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = add nsw i32 %2, -1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %11, %6 ], [ %5, %4 ]
%8 = phi i32 [ %10, %6 ], [ 0, %4 ]
%9 = tail call i32 @swap(i8* %0, i32 %8, i32 %7)
%10 = add nuw nsw i32 %8, 1
%11 = add nsw i32 %7, -1
%12 = icmp slt i32 %10, %11
br i1 %12, label %6, label %13
13: ; preds = %6, %1
ret void
}
void apu_powerup(struct APU *apu) { (void)apu; }


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

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

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

LLVM IR (-O2):
%struct.APU = type opaque
define void @apu_powerup(%struct.APU* nocapture %0) {
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
int _div_mulhi64(int, unsigned long long);
uint64_t div_u64_by_15625(uint64_t val) {
  if (val > 16383999997ull) {
    return (_div_mulhi64(0x431bde82d7b634dbull, val) >> 12);
  }
  return (val * 0x431bde83ul) >> (12 + 32);
}


x86 assembly (clang, -O0):
<div_u64_by_15625>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
movabs $0x3d08ffffd,%rax
cmp    %rax,-0x10(%rbp)
jbe    114c <div_u64_by_15625+0x3c>
mov    -0x10(%rbp),%rsi
mov    $0xd7b634db,%edi
call   1030 <_div_mulhi64@plt>
sar    $0xc,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    115c <div_u64_by_15625+0x4c>
imul   $0x431bde83,-0x10(%rbp),%rax
43
shr    $0x2c,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_u64_by_15625>:
mov    %rdi,%rsi
movabs $0x3d08ffffe,%rax
cmp    %rax,%rdi
jb     1137 <div_u64_by_15625+0x27>
push   %rax
mov    $0xd7b634db,%edi
call   1030 <_div_mulhi64@plt>
sar    $0xc,%eax
cltq
add    $0x8,%rsp
ret
imul   $0x431bde83,%rsi,%rax
shr    $0x2c,%rax
ret

LLVM IR (-O0):
define i64 @div_u64_by_15625(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ugt i64 %4, 16383999997
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i64, i64* %3
%8 = call i32 @_div_mulhi64(i32 -675924773, i64 %7)
%9 = ashr i32 %8, 12
%10 = sext i32 %9 to i64
store i64 %10, i64* %2
br label %15
11: ; preds = %1
%12 = load i64, i64* %3
%13 = mul i64 %12, 1125899907
%14 = lshr i64 %13, 44
store i64 %14, i64* %2
br label %15
15: ; preds = %11, %6
%16 = load i64, i64* %2
ret i64 %16
}

LLVM IR (-O2):
define i64 @div_u64_by_15625(i64 %0) {
%2 = icmp ugt i64 %0, 16383999997
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @_div_mulhi64(i32 -675924773, i64 %0)
%5 = ashr i32 %4, 12
%6 = sext i32 %5 to i64
br label %10
7: ; preds = %1
%8 = mul nuw i64 %0, 1125899907
%9 = lshr i64 %8, 44
br label %10
10: ; preds = %7, %3
%11 = phi i64 [ %6, %3 ], [ %9, %7 ]
ret i64 %11
}
/* Variables and functions */
int file_write_len(char const *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int file_write(const char *fname, const char *contents) {
  return file_write_len(fname, contents, strlen(contents));
}


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

x86 assembly (clang, -O2):
<file_write>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <file_write_len@plt>

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

LLVM IR (-O2):
define i32 @file_write(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @file_write_len(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
int clamp_val(int i) { return ~i >> 31; }


x86 assembly (clang, -O0):
<clamp_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
sar    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_val>:
mov    %edi,%eax
sar    $0x1f,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @clamp_val(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = ashr i32 %4, 31
ret i32 %5
}

LLVM IR (-O2):
define i32 @clamp_val(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, -1
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_anl_data(char *str, uint8_t data) {
  sprintf(str,
          "ANL   A, #"
          "0x%02X"
          "                  ",
          data);
}


x86 assembly (clang, -O0):
<sprint_anl_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_anl_data>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [35 x i8] c"ANL A,x%02X \00"
define void @sprint_anl_data(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void foo_1_1_2_1_2_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_1_2_1_1() {
ret void
}
/* Variables and functions */
int mkstemp(char *);
void resourceLeak_mkstemp(char *template) { int fp = mkstemp(template); }


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

x86 assembly (clang, -O2):
<resourceLeak_mkstemp>:
jmp    1030 <mkstemp@plt>

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

LLVM IR (-O2):
define void @resourceLeak_mkstemp(i8* %0) {
%2 = tail call i32 @mkstemp(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ programme();
int main(int argc, char *argv[]) {
  programme();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <programme@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <programme@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @programme()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @programme()
%4 = tail call i32 @exit(i32 0)
unreachable
}
int atoi(const char *c) {
  int res = 0;
  while (*c >= '0' && *c <= '9')
    res = res * 10 + *c++ - '0';
  return res;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1134 <atoi+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <atoi+0x44>
jmp    1167 <atoi+0x67>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <atoi+0x20>
ret

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %25
16: ; preds = %14
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 10
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
%21 = load i8, i8* %19
%22 = sext i8 %21 to i32
%23 = add nsw i32 %18, %22
%24 = sub nsw i32 %23, 48
store i32 %24, i32* %3
br label %4
25: ; preds = %14
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %13, %5 ], [ 0, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add i32 %10, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %11
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
int test_imm_40int8_mem(signed char *val) {
  return ((*val) & (-0x40 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_40int8_mem>:
cmpb   $0x40,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_40int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -64
%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_40int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 64
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
long random();
int get_random() {
  long random_number = random();
  long randon_mask = random();
  return ((randon_mask & 1) == 0 ? random_number : -random_number);
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    114d <get_random+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1157 <get_random+0x47>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %rbx
xor    %eax,%eax
call   1030 <random@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <random@plt>
mov    %ebx,%ecx
neg    %ecx
test   $0x1,%al
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_random() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @random()
store i64 %3, i64* %1
%4 = call i64 (...) @random()
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = and i64 %5, 1
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i64, i64* %1
br label %13
10: ; preds = %0
%11 = load i64, i64* %1
%12 = sub nsw i64 0, %11
br label %13
13: ; preds = %10, %8
%14 = phi i64 [ %9, %8 ], [ %12, %10 ]
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_random() {
%1 = tail call i64 (...) @random()
%2 = tail call i64 (...) @random()
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
%5 = sub nsw i64 0, %1
%6 = select i1 %4, i64 %1, i64 %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *smalloc(size_t bytes) {
  void *ptr = malloc(bytes);
  if (ptr == NULL) {
    fprintf(stderr, "Problema al reservar memoria\n");
    exit(0);
  } else {
    return ptr;
  }
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <smalloc+0x40>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <smalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Problema al reservar memoria\0A\00"
define i8* @smalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Problema al reservar memoria\0A\00"
define noalias i8* @smalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int errno;
int ws_errno() { return errno; }


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

x86 assembly (clang, -O2):
<ws_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @ws_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @ws_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
print_ar(int a[], int n) {
  while (n-- > 0)
    printf("%d\n", *a++);
}


x86 assembly (clang, -O0):
<print_ar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    1155 <print_ar+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <print_ar+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ar>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <print_ar+0x36>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
add    $0x4,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <print_ar+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @print_ar(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %6
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = icmp ugt i32 %5, 1
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void make_welcome(char *module_name) {
  printf("\n");
  printf("^_^ Ok . Now you have create nginx module %s \n", module_name);
  printf("Ok . Now you have create nginx module %s \n", module_name);
  printf("\n");
}


x86 assembly (clang, -O0):
<make_welcome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xf0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_welcome>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [47 x i8] c"^_^ Ok . Now you have create nginx module %s \0A\00"
@.str.2 = [43 x i8] c"Ok . Now you have create nginx module %s \0A\00"
define void @make_welcome(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [47 x i8] c"^_^ Ok . Now you have create nginx module %s \0A\00"
@.str.2 = [43 x i8] c"Ok . Now you have create nginx module %s \0A\00"
define void @make_welcome(i8* %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned int *);
void thread_index_destroy(void *i) { free((unsigned *)i); }


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

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

LLVM IR (-O2):
define void @thread_index_destroy(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @free(i32* %2)
ret void
}
int f(int x) {
  switch (x) {
  case 1:
    x = x + 1;
    break;
  case 2:
  case 3:
    x = x + 2;
    return x;
  default:
    x = x * 2;
    break;
  }
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     112f <f+0x2f>
jmp    111b <f+0x1b>
mov    -0xc(%rbp),%eax
add    $0xfffffffe,%eax
sub    $0x2,%eax
jb     113d <f+0x3d>
jmp    1151 <f+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <f+0x5a>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <f+0x60>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
lea    -0x1(%rax),%ecx
cmp    $0x3,%ecx
jae    1118 <f+0x18>
movslq %ecx,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 1, label %5
i32 2, label %8
i32 3, label %8
]
5: ; preds = %1
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
br label %15
8: ; preds = %1, %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 2
store i32 %10, i32* %3
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %17
12: ; preds = %1
%13 = load i32, i32* %3
%14 = mul nsw i32 %13, 2
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %5
%16 = load i32, i32* %3
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@switch.table.f = [3 x i32] [i32 2, i32 4, i32 5]
define i32 @f(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = shl nsw i32 %0, 1
br label %10
6: ; preds = %1
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.f, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %5, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ hybris_device_backlight_quit();
void mce_hybris_backlight_quit(void) { hybris_device_backlight_quit(); }


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

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

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

LLVM IR (-O2):
define void @mce_hybris_backlight_quit() {
%1 = tail call i32 (...) @hybris_device_backlight_quit()
ret void
}
void main() {
  int i = 0;
  int j = 0;
  if ((++i) > 0 || (++j > 0)) {
    printf("i=%d,j=%d", i, j);
  }
  j = 0x01 << 2 + 3;
  printf("\n0x01<<2+3:%d\n", j);
  char a[10] = {"abcde"};
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jg     114a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    115e <main+0x4e>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x20,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xe9c(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xe99(%rip),%ax
mov    %ax,-0xa(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"i=%d,j=%d\00"
@.str.1 = [15 x i8] c"\0A0x01<<2+3:%d\0A\00"
@__const.main.a = [10 x i8] c"abcde\00\00\00\00\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %0
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
br label %15
15: ; preds = %11, %7
store i32 32, i32* %2
%16 = load i32, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = bitcast [10 x i8]* %3 to i8*
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"i=%d,j=%d\00"
@.str.1 = [15 x i8] c"\0A0x01<<2+3:%d\0A\00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 32)
ret void
}
char *RCSid() {
  return RCSid("$Id: doc2hlp.c,v 1.17 2007/10/24 00:47:51 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"$Id: doc2hlp.c,v 1.17 2007/10/24 00:47:51 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
float M_PI;
float sinf(float);
float LFOsin(float step, float period) {
  return sinf(2.0f * M_PI * (step / period));
}


x86 assembly (clang, -O0):
<LFOsin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xed6(%rip),%xmm0
mov    0x2eb7(%rip),%rax
mulss  (%rax),%xmm0
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
call   1030 <sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LFOsin>:
mov    0x2ed1(%rip),%rax
movss  (%rax),%xmm2
addss  %xmm2,%xmm2
divss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
jmp    1030 <sinf@plt>

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @LFOsin(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* @M_PI
%6 = fmul float 2.000000e+00, %5
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fdiv float %7, %8
%10 = fmul float %6, %9
%11 = call float @sinf(float %10)
ret float %11
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @LFOsin(float %0, float %1) {
%3 = load float, float* @M_PI
%4 = fmul float %3, 2.000000e+00
%5 = fdiv float %0, %1
%6 = fmul float %5, %4
%7 = tail call float @sinf(float %6)
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, char const *const, char const *const);
scalar_t__ strcmp(char const *const, char const *const);
int string_equal_display_error(const char *const left,
                               const char *const right) {
  if (strcmp(left, right) == 0) {
    return 1;
  }
  print_error("\"%s\" != \"%s\"\n", left, right);
  return 0;
}


x86 assembly (clang, -O0):
<string_equal_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1153 <string_equal_display_error+0x33>
movl   $0x1,-0x4(%rbp)
jmp    116e <string_equal_display_error+0x4e>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe9e(%rip),%rdi
call   1030 <print_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_equal_display_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strcmp@plt>
test   %rax,%rax
je     114a <string_equal_display_error+0x2a>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <print_error@plt>
xor    %eax,%eax
jmp    114f <string_equal_display_error+0x2f>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"\22%s\22 != \22%s\22\0A\00"
define i32 @string_equal_display_error(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @print_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(int);
char random_char();
char *generate_char_array(int size) {
  char *random_char_array;
  random_char_array = (char *)malloc(sizeof(char) * size);
  for (int i = 0; i < size; ++i) {
    random_char_array[i] = random_char();
  }
  return (char *)random_char_array;
}


x86 assembly (clang, -O0):
<generate_char_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1173 <generate_char_array+0x53>
mov    $0x0,%al
call   1030 <random_char@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <generate_char_array+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_char_array>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebp,%ebp
jle    1154 <generate_char_array+0x34>
mov    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random_char@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <generate_char_array+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @generate_char_array(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
store i32 0, i32* %4
br label %11
11: ; preds = %21, %1
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = call signext i8 (...) @random_char()
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
br label %21
21: ; preds = %15
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %11
24: ; preds = %11
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @generate_char_array(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = zext i32 %0 to i64
br label %8
7: ; preds = %8, %1
ret i8* %3
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %12, %8 ]
%10 = tail call signext i8 (...) @random_char()
%11 = getelementptr inbounds i8, i8* %3, i64 %9
store i8 %10, i8* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %7, label %8
}