xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void TimerSynchronize(uint32_t ui32Base, uint32_t ui32Timers) {
  ASSERT(ui32Base == 0x40030000);
  (*((volatile uint32_t *)(ui32Base + 0x00000010))) = ui32Timers;
}


x86 assembly (clang, -O0):
<TimerSynchronize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x40030000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerSynchronize>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x40030000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,0x10(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @TimerSynchronize(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 = icmp eq i32 %5, 1073938432
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 16
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 %9, i32* %13
ret void
}

LLVM IR (-O2):
define void @TimerSynchronize(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1073938432
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 16
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %1, i32* %8
ret void
}
void test_RETLW() {}


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

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

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

LLVM IR (-O2):
define void @test_RETLW() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                       int);
void sstrerr(void) { die(10, "sstr internal failure. Exiting", 0, 0, -1); }


x86 assembly (clang, -O0):
<sstrerr>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
lea    0xee0(%rip),%rsi
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
mov    %ecx,%edx
call   1030 <die@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstrerr>:
lea    0xee9(%rip),%rsi
mov    $0xa,%edi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"sstr internal failure. Exiting\00"
define void @sstrerr() {
%1 = call i32 @die(i32 10, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 -1)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"sstr internal failure. Exiting\00"
define void @sstrerr() {
%1 = tail call i32 @die(i32 10, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 -1)
ret void
}
int isMF(int nodetype) {
  return (nodetype % 2 == 1) && nodetype >= 0 && nodetype <= 41;
}


x86 assembly (clang, -O0):
<isMF>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x1,%edx
mov    %al,-0x5(%rbp)
jne    1139 <isMF+0x39>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1139 <isMF+0x39>
cmpl   $0x29,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isMF>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
mov    %edi,%ecx
sub    %eax,%ecx
cmp    $0x1,%ecx
sete   %al
cmp    $0x2a,%edi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isMF(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 41
br label %12
12: ; preds = %9, %6, %1
%13 = phi i1 [ false, %6 ], [ false, %1 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isMF(i32 %0) {
%2 = srem i32 %0, 2
%3 = icmp eq i32 %2, 1
%4 = icmp ult i32 %0, 42
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ retire();
void ejected() {
  printf("Due to this extreme mismanagement you have not only\n");
  printf("been impeached and thrown out of office but you have\n");
  printf("also been declared 'National Fink' !!\n");
  retire();
}


x86 assembly (clang, -O0):
<ejected>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xefe(%rip),%rdi
call   1040 <printf@plt>
lea    0xf28(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <retire@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ejected>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xf29(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <retire@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Due to this extreme mismanagement you have not only\0A\00"
@.str.1 = [54 x i8] c"been impeached and thrown out of office but you have\0A\00"
@.str.2 = [39 x i8] c"also been declared 'National Fink' !!\0A\00"
define void @ejected() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (...) @retire()
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"Due to this extreme mismanagement you have not only\00"
@str.3 = [53 x i8] c"been impeached and thrown out of office but you have\00"
@str.4 = [38 x i8] c"also been declared 'National Fink' !!\00"
define void @ejected() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 (...) @retire()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int n;
  for (n = 0; n < 5; n++) {
    printf("Hello");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void FixedDiv_X86() {}


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

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

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

LLVM IR (-O2):
define void @FixedDiv_X86() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int f7(long long x) {
  printf("f7: %lld\n", x);
  return 1234;
}


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

x86 assembly (clang, -O2):
<f7>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4d2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"f7: %lld\0A\00"
define i32 @f7(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 1234
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set_dir_with_mask(int, int);
int /*<<< orphan*/ gpio_write_data_with_mask(int, int);
int /*<<< orphan*/ set_gpio_pad_with_mask(int, int);
int /*<<< orphan*/ unfreeze_gpio_out();
void operation_i2c_start() {
  gpio_write_data_with_mask((1 << 7) | (1 << 6), (1 << 7) | (1 << 6));
  set_gpio_pad_with_mask((1 << 7) | (1 << 6), (1 << 7) | (1 << 6));
  gpio_set_dir_with_mask((1 << 7) | (1 << 6), (1 << 7) | (1 << 6));
  unfreeze_gpio_out();
  gpio_write_data_with_mask((1 << 7) | (1 << 6), (0 << 7) | (1 << 6));
  gpio_write_data_with_mask((1 << 7) | (1 << 6), (0 << 7) | (0 << 6));
}


x86 assembly (clang, -O0):
<operation_i2c_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc0,%esi
mov    %esi,%edi
call   1030 <gpio_write_data_with_mask@plt>
mov    $0xc0,%esi
mov    %esi,%edi
call   1060 <set_gpio_pad_with_mask@plt>
mov    $0xc0,%esi
mov    %esi,%edi
call   1050 <gpio_set_dir_with_mask@plt>
mov    $0x0,%al
call   1040 <unfreeze_gpio_out@plt>
mov    $0xc0,%edi
mov    $0x40,%esi
call   1030 <gpio_write_data_with_mask@plt>
mov    $0xc0,%edi
xor    %esi,%esi
call   1030 <gpio_write_data_with_mask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation_i2c_start>:
push   %rax
mov    $0xc0,%edi
mov    $0xc0,%esi
call   1030 <gpio_write_data_with_mask@plt>
mov    $0xc0,%edi
mov    $0xc0,%esi
call   1060 <set_gpio_pad_with_mask@plt>
mov    $0xc0,%edi
mov    $0xc0,%esi
call   1050 <gpio_set_dir_with_mask@plt>
xor    %eax,%eax
call   1040 <unfreeze_gpio_out@plt>
mov    $0xc0,%edi
mov    $0x40,%esi
call   1030 <gpio_write_data_with_mask@plt>
mov    $0xc0,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <gpio_write_data_with_mask@plt>

LLVM IR (-O0):
define void @operation_i2c_start() {
%1 = call i32 @gpio_write_data_with_mask(i32 192, i32 192)
%2 = call i32 @set_gpio_pad_with_mask(i32 192, i32 192)
%3 = call i32 @gpio_set_dir_with_mask(i32 192, i32 192)
%4 = call i32 (...) @unfreeze_gpio_out()
%5 = call i32 @gpio_write_data_with_mask(i32 192, i32 64)
%6 = call i32 @gpio_write_data_with_mask(i32 192, i32 0)
ret void
}

LLVM IR (-O2):
define void @operation_i2c_start() {
%1 = tail call i32 @gpio_write_data_with_mask(i32 192, i32 192)
%2 = tail call i32 @set_gpio_pad_with_mask(i32 192, i32 192)
%3 = tail call i32 @gpio_set_dir_with_mask(i32 192, i32 192)
%4 = tail call i32 (...) @unfreeze_gpio_out()
%5 = tail call i32 @gpio_write_data_with_mask(i32 192, i32 64)
%6 = tail call i32 @gpio_write_data_with_mask(i32 192, i32 0)
ret void
}
/* Type definitions */
struct in6_addr {
  int /*<<< orphan*/ s6_addr;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, int /*<<< orphan*/, int);
unsigned char *serialize_ip_address(unsigned char *buffer,
                                    struct in6_addr *ip_address) {
  memcpy(buffer, ip_address->s6_addr, sizeof(struct in6_addr));
  return buffer + sizeof(struct in6_addr);
}


x86 assembly (clang, -O0):
<serialize_ip_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_ip_address>:
push   %rbx
mov    %rdi,%rbx
mov    (%rsi),%esi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x4,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define i8* @serialize_ip_address(i8* %0, %struct.in6_addr* %1) {
%3 = alloca i8*
%4 = alloca %struct.in6_addr*
store i8* %0, i8** %3
store %struct.in6_addr* %1, %struct.in6_addr** %4
%5 = load i8*, i8** %3
%6 = load %struct.in6_addr*, %struct.in6_addr** %4
%7 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @memcpy(i8* %5, i32 %8, i32 4)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 4
ret i8* %11
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i8* @serialize_ip_address(i8* %0, %struct.in6_addr* nocapture %1) {
%3 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @memcpy(i8* %0, i32 %4, i32 4)
%6 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ editor_cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ file_save(char *);
int /*<<< orphan*/ klog(char *);
void kodapa_exit() {
  editor_cleanup();
  file_save("testsave.file.o");
  klog("== kodapa end ==");
  exit(0);
}


x86 assembly (clang, -O0):
<kodapa_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <editor_cleanup@plt>
lea    0xeae(%rip),%rdi
call   1040 <file_save@plt>
lea    0xeb2(%rip),%rdi
call   1030 <klog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<kodapa_exit>:
push   %rax
xor    %eax,%eax
call   1060 <editor_cleanup@plt>
lea    0xeb1(%rip),%rdi
call   1040 <file_save@plt>
lea    0xeb5(%rip),%rdi
call   1030 <klog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"testsave.file.o\00"
@.str.1 = [17 x i8] c"== kodapa end ==\00"
define void @kodapa_exit() {
%1 = call i32 (...) @editor_cleanup()
%2 = call i32 @file_save(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @klog(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"testsave.file.o\00"
@.str.1 = [17 x i8] c"== kodapa end ==\00"
define void @kodapa_exit() {
%1 = tail call i32 (...) @editor_cleanup()
%2 = tail call i32 @file_save(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @klog(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
double ARCTAN(statlink, x)
int *statlink;
double x;
{ return (_atn(x)); }


x86 assembly (clang, -O0):
<ARCTAN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <_atn@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ARCTAN>:
push   %rax
mov    $0x1,%al
call   1030 <_atn@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ARCTAN(i32* %0, double %1) {
%3 = alloca i32*
%4 = alloca double
store i32* %0, i32** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call i32 (double, ...) bitcast (i32 (...)* @_atn to i32 (double, ...)*)(double %5)
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @ARCTAN(i32* nocapture readnone %0, double %1) {
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @_atn to i32 (double, ...)*)(double %1)
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
double sqrt(double);
double point_distance_2d(double x1, double y1, double x2, double y2) {
  return (sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
}


x86 assembly (clang, -O0):
<point_distance_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm3
subsd  -0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_distance_2d>:
subsd  %xmm2,%xmm0
subsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <point_distance_2d+0x23>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @point_distance_2d(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = fsub double %1, %3
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
%9 = tail call double @sqrt(double %8)
ret double %9
}
int len(char *s) {
  int i;
  for (i = 0; *s != '\0'; s++, ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113e <len+0x3e>
jmp    1124 <len+0x24>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len>:
cmpb   $0x0,(%rdi)
je     111c <len+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ **);
uint16_t read_u16_from_buf(uint8_t **ptr) {
  uint16_t val;
  assert(ptr);
  val = *(*ptr)++;
  val <<= 8;
  val |= *(*ptr)++;
  return val;
}


x86 assembly (clang, -O0):
<read_u16_from_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,(%rcx)
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,(%rcx)
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_u16_from_buf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx),%rcx
mov    (%rcx),%eax
shl    $0x8,%eax
lea    0x8(%rcx),%rdx
mov    %rdx,(%rbx)
or     0x4(%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_u16_from_buf(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = call i32 @assert(i32** %4)
%6 = load i32**, i32*** %2
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %6
%9 = load i32, i32* %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = shl i32 %10, 8
store i32 %11, i32* %3
%12 = load i32**, i32*** %2
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i32 1
store i32* %14, i32** %12
%15 = load i32, i32* %13
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @read_u16_from_buf(i32** %0) {
%2 = tail call i32 @assert(i32** %0)
%3 = load i32*, i32** %0
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %3
%6 = shl i32 %5, 8
%7 = getelementptr inbounds i32, i32* %3, i64 2
store i32* %7, i32** %0
%8 = load i32, i32* %4
%9 = or i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main() {
  putc(350, stderr);
  putc('\n', stderr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    $0x5e,%edi
call   1030 <putc@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
mov    $0x5e,%edi
call   1030 <putc@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = call i32 @putc(i8 signext 94, i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @putc(i8 signext 10, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @putc(i8 signext 94, i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @putc(i8 signext 10, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("In the beginning...\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"In the beginning...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double geom_dA3_cart(double *x, double dx1, double dx2) { return dx1 * dx2; }


x86 assembly (clang, -O0):
<geom_dA3_cart>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_dA3_cart>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @geom_dA3_cart(double* %0, double %1, double %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %6
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @geom_dA3_cart(double* nocapture readnone %0, double %1, double %2) {
%4 = fmul double %1, %2
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ clean_up();
void handleSigInt(int i) { clean_up(); }


x86 assembly (clang, -O0):
<handleSigInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clean_up@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @handleSigInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @clean_up()
ret void
}

LLVM IR (-O2):
define void @handleSigInt(i32 %0) {
%2 = tail call i32 (...) @clean_up()
ret void
}
int maior(int a, int b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @maior(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int slow_bitmap_and(unsigned long *, unsigned long const *,
                    unsigned long const *, int);
int bitmap_and(unsigned long *dst, const unsigned long *src1,
               const unsigned long *src2, int nbits) {
  if (((nbits) <= (sizeof(unsigned long) * 8))) {
    return (*dst = *src1 & *src2) != 0;
  }
  return slow_bitmap_and(dst, src1, src2, nbits);
}


x86 assembly (clang, -O0):
<bitmap_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x40,%rax
ja     115e <bitmap_and+0x4e>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
and    (%rcx),%rax
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <bitmap_and+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <slow_bitmap_and@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_and>:
cmp    $0x40,%ecx
ja     1124 <bitmap_and+0x14>
mov    (%rdx),%rcx
xor    %eax,%eax
and    (%rsi),%rcx
mov    %rcx,(%rdi)
setne  %al
ret
jmp    1030 <slow_bitmap_and@plt>

LLVM IR (-O0):
define i32 @bitmap_and(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i32
store i64* %0, i64** %6
store i64* %1, i64** %7
store i64* %2, i64** %8
store i32 %3, i32* %9
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = icmp ule i64 %11, 64
br i1 %12, label %13, label %22
13: ; preds = %4
%14 = load i64*, i64** %7
%15 = load i64, i64* %14
%16 = load i64*, i64** %8
%17 = load i64, i64* %16
%18 = and i64 %15, %17
%19 = load i64*, i64** %6
store i64 %18, i64* %19
%20 = icmp ne i64 %18, 0
%21 = zext i1 %20 to i32
store i32 %21, i32* %5
br label %28
22: ; preds = %4
%23 = load i64*, i64** %6
%24 = load i64*, i64** %7
%25 = load i64*, i64** %8
%26 = load i32, i32* %9
%27 = call i32 @slow_bitmap_and(i64* %23, i64* %24, i64* %25, i32 %26)
store i32 %27, i32* %5
br label %28
28: ; preds = %22, %13
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @bitmap_and(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = icmp ult i32 %3, 65
br i1 %5, label %6, label %12
6: ; preds = %4
%7 = load i64, i64* %1
%8 = load i64, i64* %2
%9 = and i64 %8, %7
store i64 %9, i64* %0
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %14
12: ; preds = %4
%13 = tail call i32 @slow_bitmap_and(i64* %0, i64* %1, i64* %2, i32 %3)
br label %14
14: ; preds = %12, %6
%15 = phi i32 [ %11, %6 ], [ %13, %12 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ PR_SET_NAME;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int prctl(int /*<<< orphan*/, char const *);
void change_pname(const char *new_name) {
  int ret;
  ret = prctl(PR_SET_NAME, new_name);
  if (ret == -1) {
    perror("prctl set_name");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<change_pname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <prctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1171 <change_pname+0x41>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_pname>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <prctl@plt>
cmp    $0xffffffff,%eax
je     1149 <change_pname+0x19>
pop    %rax
ret
lea    0xeb0(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@PR_SET_NAME = global i32 0
@.str = [15 x i8] c"prctl set_name\00"
define void @change_pname(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @PR_SET_NAME
%5 = load i8*, i8** %2
%6 = call i32 @prctl(i32 %4, i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@PR_SET_NAME = global i32 0
@.str = [15 x i8] c"prctl set_name\00"
define void @change_pname(i8* %0) {
%2 = load i32, i32* @PR_SET_NAME
%3 = tail call i32 @prctl(i32 %2, i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ms_sleep(int);
int /*<<< orphan*/ mysignal(int /*<<< orphan*/, int, int /*<<< orphan*/, int,
                            int /*<<< orphan*/, int, int, int /*<<< orphan*/,
                            int);
int main() {
  int i;
  int j;
  j = 0;
  i = 0;
  for (j = 200; j < 4095; j += 50) {
    mysignal(0, 1, 0, j, 0, 4095 - j, 1000, 0, 1000);
    ms_sleep(100);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xc8,-0xc(%rbp)
cmpl   $0xfff,-0xc(%rbp)
jge    11a0 <main+0x80>
mov    -0xc(%rbp),%ecx
mov    $0xfff,%r9d
sub    -0xc(%rbp),%r9d
xor    %r8d,%r8d
mov    $0x1,%esi
mov    %r8d,%edi
mov    %r8d,%edx
movl   $0x3e8,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x3e8,0x10(%rsp)
call   1040 <mysignal@plt>
mov    $0x64,%edi
call   1030 <ms_sleep@plt>
mov    -0xc(%rbp),%eax
add    $0x32,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x96,%ebx
mov    $0xf37,%ebp
nopl   (%rax)
add    $0x32,%ebx
sub    $0x8,%rsp
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    %ebx,%ecx
xor    %r8d,%r8d
mov    %ebp,%r9d
push   $0x3e8
push   $0x0
push   $0x3e8
call   1040 <mysignal@plt>
add    $0x20,%rsp
mov    $0x64,%edi
call   1030 <ms_sleep@plt>
add    $0xffffffce,%ebp
cmp    $0xfcd,%ebx
jb     1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
store i32 200, i32* %3
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 4095
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = sub nsw i32 4095, %9
%11 = call i32 @mysignal(i32 0, i32 1, i32 0, i32 %8, i32 0, i32 %10, i32 1000, i32 0, i32 1000)
%12 = call i32 @ms_sleep(i32 100)
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 50
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 200, %0 ], [ %6, %1 ]
%3 = sub nuw nsw i32 4095, %2
%4 = tail call i32 @mysignal(i32 0, i32 1, i32 0, i32 %2, i32 0, i32 %3, i32 1000, i32 0, i32 1000)
%5 = tail call i32 @ms_sleep(i32 100)
%6 = add nuw nsw i32 %2, 50
%7 = icmp ult i32 %2, 4045
br i1 %7, label %1, label %8
8: ; preds = %1
ret i32 0
}
long rclhdr(char *hdr) {
  long l;
  l = (hdr[3] & 0377);
  l = (l << 8) | (hdr[2] & 0377);
  l = (l << 8) | (hdr[1] & 0377);
  l = (l << 8) | (hdr[0] & 0377);
  return l;
}


x86 assembly (clang, -O0):
<rclhdr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
and    $0xff,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @rclhdr(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 3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %7, 255
%9 = sext i32 %8 to i64
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = shl i64 %10, 8
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = and i32 %15, 255
%17 = sext i32 %16 to i64
%18 = or i64 %11, %17
store i64 %18, i64* %3
%19 = load i64, i64* %3
%20 = shl i64 %19, 8
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = and i32 %24, 255
%26 = sext i32 %25 to i64
%27 = or i64 %20, %26
store i64 %27, i64* %3
%28 = load i64, i64* %3
%29 = shl i64 %28, 8
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i64 0
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = and i32 %33, 255
%35 = sext i32 %34 to i64
%36 = or i64 %29, %35
store i64 %36, i64* %3
%37 = load i64, i64* %3
ret i64 %37
}

LLVM IR (-O2):
define i64 @rclhdr(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %4, 16
%9 = shl nuw nsw i64 %7, 8
%10 = or i64 %9, %8
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = or i64 %10, %13
%15 = shl nuw nsw i64 %14, 8
%16 = load i8, i8* %0
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ R_ADC_Get_Result(void *);
int /*<<< orphan*/ R_ADC_Start();
char adcSget(void *parameters) {
  R_ADC_Start();
  R_ADC_Get_Result(parameters);
  return 0;
}


x86 assembly (clang, -O0):
<adcSget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <R_ADC_Start@plt>
mov    -0x8(%rbp),%rdi
call   1030 <R_ADC_Get_Result@plt>
xor    %eax,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcSget>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <R_ADC_Start@plt>
mov    %rbx,%rdi
call   1030 <R_ADC_Get_Result@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @adcSget(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @R_ADC_Start()
%4 = load i8*, i8** %2
%5 = call i32 @R_ADC_Get_Result(i8* %4)
ret i8 0
}

LLVM IR (-O2):
define signext i8 @adcSget(i8* %0) {
%2 = tail call i32 (...) @R_ADC_Start()
%3 = tail call i32 @R_ADC_Get_Result(i8* %0)
ret i8 0
}
int sub(int arg1, int arg2) { return arg1 - arg2; }


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

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

LLVM IR (-O0):
define i32 @sub(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int main() {
  int x;
  int p = 1;
  for (x = 10; x > 0; x--) {
    if (p != 1)
      __VERIFIER_error();
    if (x == 1) {
      if (p != 1)
        __VERIFIER_error();
      p = 0;
    }
  }
  if (p != 0)
    __VERIFIER_error();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    117d <main+0x6d>
cmpl   $0x1,-0xc(%rbp)
je     1148 <main+0x38>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
cmpl   $0x1,-0x8(%rbp)
jne    116a <main+0x5a>
cmpl   $0x1,-0xc(%rbp)
je     1163 <main+0x53>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
movl   $0x0,-0xc(%rbp)
jmp    116f <main+0x5f>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x0,-0xc(%rbp)
je     118e <main+0x7e>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
store i32 10, i32* %2
br label %4
4: ; preds = %22, %0
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @__VERIFIER_error()
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp ne i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (...) @__VERIFIER_error()
br label %20
20: ; preds = %18, %15
store i32 0, i32* %3
br label %21
21: ; preds = %20, %12
br label %22
22: ; preds = %21
%23 = load i32, i32* %2
%24 = add nsw i32 %23, -1
store i32 %24, i32* %2
br label %4
25: ; preds = %4
%26 = load i32, i32* %3
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (...) @__VERIFIER_error()
br label %30
30: ; preds = %28, %25
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
char *dgettext__(domainname, msgid) const char *domainname;
const char *msgid;
{ return dcgettext__(domainname, msgid, (-1)); }


x86 assembly (clang, -O0):
<dgettext__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%edx
mov    $0x0,%al
call   1030 <dcgettext__@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgettext__>:
push   %rax
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1030 <dcgettext__@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @dgettext__(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 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dcgettext__ to i32 (i8*, i8*, i32, ...)*)(i8* %5, i8* %6, i32 -1)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @dgettext__(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dcgettext__ to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 -1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int stripexhaust(int, int, int, int);
int lineexhaust(int d, int c, int upd) {
  return stripexhaust(d, c, c + 1, upd);
}


x86 assembly (clang, -O0):
<lineexhaust>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0xc(%rbp),%ecx
call   1030 <stripexhaust@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineexhaust>:
mov    %edx,%ecx
lea    0x1(%rsi),%edx
jmp    1030 <stripexhaust@plt>

LLVM IR (-O0):
define i32 @lineexhaust(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %6
%12 = call i32 @stripexhaust(i32 %7, i32 %8, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @lineexhaust(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = tail call i32 @stripexhaust(i32 %0, i32 %1, i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
long double fromRep128(int, int);
long double makeQNaN128() { return fromRep128(0x7fff800000000000UL, 0x0UL); }


x86 assembly (clang, -O0):
<makeQNaN128>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <fromRep128@plt>
fld    %st(0)
fstp   %st(0)
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeQNaN128>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <fromRep128@plt>

LLVM IR (-O0):
define x86_fp80 @makeQNaN128() {
%1 = call x86_fp80 @fromRep128(i32 0, i32 0)
ret x86_fp80 %1
}

LLVM IR (-O2):
define x86_fp80 @makeQNaN128() {
%1 = tail call x86_fp80 @fromRep128(i32 0, i32 0)
ret x86_fp80 %1
}
int gkIsPathRelative(char *path) {
  if (path[1] == ':' || path[0] == '/')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<gkIsPathRelative>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3a,%eax
je     1129 <gkIsPathRelative+0x29>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1135 <gkIsPathRelative+0x35>
movl   $0x0,-0x4(%rbp)
jmp    113c <gkIsPathRelative+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gkIsPathRelative>:
xor    %eax,%eax
cmpb   $0x3a,0x1(%rdi)
je     1110 <gkIsPathRelative+0x10>
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @gkIsPathRelative(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 58
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 47
br i1 %14, label %15, label %16
15: ; preds = %9, %1
store i32 0, i32* %2
br label %17
16: ; preds = %9
store i32 1, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @gkIsPathRelative(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 58
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp ne i8 %6, 47
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
int match_hints(const char *value, int level, const char *match_name,
                int match_level) {
  if (strcasecmp(value, match_name))
    return 0;
  if (match_level != (-1) && level != match_level)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<match_hints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     1149 <match_hints+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1172 <match_hints+0x62>
cmpl   $0xffffffff,-0x24(%rbp)
je     116b <match_hints+0x5b>
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     116b <match_hints+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1172 <match_hints+0x62>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_hints>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %esi,%ebp
mov    %rdx,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
sete   %al
cmp    $0xffffffff,%ebx
sete   %cl
cmp    %ebx,%ebp
sete   %dl
or     %cl,%dl
and    %al,%dl
movzbl %dl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @match_hints(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = load i8*, i8** %6
%11 = load i8*, i8** %8
%12 = call i64 @strcasecmp(i8* %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %4
store i32 0, i32* %5
br label %24
15: ; preds = %4
%16 = load i32, i32* %9
%17 = icmp ne i32 %16, -1
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32, i32* %7
%20 = load i32, i32* %9
%21 = icmp ne i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 0, i32* %5
br label %24
23: ; preds = %18, %15
store i32 1, i32* %5
br label %24
24: ; preds = %23, %22, %14
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @match_hints(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i64 @strcasecmp(i8* %0, i8* %2)
%6 = icmp eq i64 %5, 0
%7 = icmp eq i32 %3, -1
%8 = icmp eq i32 %1, %3
%9 = or i1 %7, %8
%10 = and i1 %9, %6
%11 = zext i1 %10 to i32
ret i32 %11
}