xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_seq_tick(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_seq_tick>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_seq_tick(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_seq_tick(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
int assert_param(void *v) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @assert_param(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
bool nandg(bool s, bool c) { return !(s && c); }


x86 assembly (clang, -O0):
<nandg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1123 <nandg+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nandg>:
test   %edi,%edi
sete   %al
test   %esi,%esi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @nandg(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 ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @nandg(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void __attribute__((section(".after_vectors"), weak)) PendSV_Handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<PendSV_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PendSV_Handler+0x9>
jmp    1109 <PendSV_Handler+0x9>

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

LLVM IR (-O0):
define weak void @PendSV_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @PendSV_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ copy_file(char const *, char const *);
int /*<<< orphan*/ printf(char *);
int test_copy_file(const char *from, const char *to) {
  printf("Testing copy_file().\n");
  copy_file(from, to);
  printf("Done!\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_copy_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <copy_file@plt>
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_copy_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <copy_file@plt>
lea    0xecd(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Testing copy_file().\0A\00"
@.str.1 = [8 x i8] c"Done!\0A\0A\00"
define i32 @test_copy_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @copy_file(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"Testing copy_file().\00"
@str.2 = [7 x i8] c"Done!\0A\00"
define i32 @test_copy_file(i8* %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @copy_file(i8* %0, i8* %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void hang(void) {
  puts("### ERROR ### Please RESET the board ###\n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<hang>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
jmp    1120 <hang+0x10>

x86 assembly (clang, -O2):
<hang>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <hang+0x10>

LLVM IR (-O0):
@.str = [42 x i8] c"### ERROR ### Please RESET the board ###\0A\00"
define void @hang() {
%1 = call i32 @puts(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@.str = [42 x i8] c"### ERROR ### Please RESET the board ###\0A\00"
define void @hang() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}
void foo_short(signed short x, unsigned short y) {
  short t = (((x) >= 0) ? (x) : -(x));
  if (t != y)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<foo_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
jl     113f <foo_short+0x2f>
movswl -0x2(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114a <foo_short+0x3a>
movswl -0x2(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
movzwl -0x4(%rbp),%ecx
cmp    %ecx,%eax
je     1166 <foo_short+0x56>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_short>:
mov    %edi,%eax
neg    %ax
cmovs  %di,%ax
cwtl
cmp    %esi,%eax
jne    111f <foo_short+0xf>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo_short(i16 signext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i16, i16* %3
%11 = sext i16 %10 to i32
br label %16
12: ; preds = %2
%13 = load i16, i16* %3
%14 = sext i16 %13 to i32
%15 = sub nsw i32 0, %14
br label %16
16: ; preds = %12, %9
%17 = phi i32 [ %11, %9 ], [ %15, %12 ]
%18 = trunc i32 %17 to i16
store i16 %18, i16* %5
%19 = load i16, i16* %5
%20 = sext i16 %19 to i32
%21 = load i16, i16* %4
%22 = zext i16 %21 to i32
%23 = icmp ne i32 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %16
unreachable
25: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @foo_short(i16 signext %0, i16 zeroext %1) {
%3 = tail call i16 @llvm.abs.i16(i16 %0, i1 false)
%4 = sext i16 %3 to i32
%5 = zext i16 %1 to i32
%6 = icmp eq i32 %4, %5
br i1 %6, label %8, label %7
7: ; preds = %2
tail call void @abort()
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
unsigned long UARTIntNumberGet(unsigned long);
void UARTIntUnregister(unsigned long ulBase) {
  unsigned long ulInt;
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  ulInt = UARTIntNumberGet(ulBase);
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<UARTIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <UARTBaseValid@plt>
mov    %eax,%edi
call   1050 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1030 <UARTIntNumberGet@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <IntDisable@plt>
mov    -0x10(%rbp),%rdi
call   1070 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntUnregister>:
push   %rbx
mov    %rdi,%rbx
call   1060 <UARTBaseValid@plt>
mov    %eax,%edi
call   1050 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
call   1030 <UARTIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1070 <IntUnregister@plt>

LLVM IR (-O0):
define void @UARTIntUnregister(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @UARTBaseValid(i64 %4)
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = call i64 @UARTIntNumberGet(i64 %7)
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i32 @IntDisable(i64 %9)
%11 = load i64, i64* %3
%12 = call i32 @IntUnregister(i64 %11)
ret void
}

LLVM IR (-O2):
define void @UARTIntUnregister(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = tail call i64 @UARTIntNumberGet(i64 %0)
%5 = tail call i32 @IntDisable(i64 %4)
%6 = tail call i32 @IntUnregister(i64 %4)
ret void
}
int dirlist(const char *dir, char ***namesp, int *cntp) { return (0); }


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

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

LLVM IR (-O0):
define i32 @dirlist(i8* %0, i8*** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8***
%6 = alloca i32*
store i8* %0, i8** %4
store i8*** %1, i8**** %5
store i32* %2, i32** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @dirlist(i8* nocapture readnone %0, i8*** nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 0
}
RX0I1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
cmp    $0x21,%eax
jg     1140 <RX0I1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <RX0I1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0I1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpw   $0x22,(%r8,%rcx,2)
setb   %al
ret

LLVM IR (-O0):
define i32 @RX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i16, i16* %16, i64 %18
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = icmp sle i32 %21, 33
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @RX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = icmp ult i16 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ chop(char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strlen(char *);
int main() {
  char str[] = "The quick, brown fox jumps over the lazy dog.";
  while (strlen(str) > 0) {
    printf("%s\n", str);
    chop(str);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x2e,%edx
call   1060 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    1195 <main+0x55>
lea    -0x40(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <chop@plt>
jmp    1164 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0x1e(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
jle    11a0 <main+0x70>
lea    0xec0(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <chop@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
jg     1180 <main+0x50>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str = [46 x i8] c"The quick, brown fox jumps over the lazy dog.\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [46 x i8]
store i32 0, i32* %1
%3 = bitcast [46 x i8]* %2 to i8*
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [46 x i8], [46 x i8]* %2, i64 0, i64 0
%6 = call i64 @strlen(i8* %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds [46 x i8], [46 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [46 x i8], [46 x i8]* %2, i64 0, i64 0
%12 = call i32 @chop(i8* %11)
br label %4
13: ; preds = %4
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@__const.main.str = [46 x i8] c"The quick, brown fox jumps over the lazy dog.\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [46 x i8]
%2 = getelementptr inbounds [46 x i8], [46 x i8]* %1, i64 0, i64 0
%3 = call i64 @strlen(i8* %2)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i32 @chop(i8* %2)
%8 = call i64 @strlen(i8* %2)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int atoi(char *);
char *conffile_param(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int conffile_param_int(char *name) {
  char *s = conffile_param(name);
  if (!s) {
    fprintf(stderr, "ERROR: parameter %s does not exist\n", name);
    exit(52);
  }
  return (atoi(s));
}


x86 assembly (clang, -O0):
<conffile_param_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <conffile_param@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1187 <conffile_param_int+0x47>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe88(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x34,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conffile_param_int>:
push   %rbx
mov    %rdi,%rbx
call   1060 <conffile_param@plt>
test   %rax,%rax
je     1157 <conffile_param_int+0x17>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x34,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"ERROR: parameter %s does not exist\0A\00"
define i32 @conffile_param_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @conffile_param(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 52)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = call i32 @atoi(i8* %14)
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"ERROR: parameter %s does not exist\0A\00"
define i32 @conffile_param_int(i8* %0) {
%2 = tail call i8* @conffile_param(i8* %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 ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 52)
unreachable
8: ; preds = %1
%9 = tail call i32 @atoi(i8* %2)
ret i32 %9
}
void foo4(void *v, void *w) {
  if (v == v) {
  }
  if (v == w) {
  }
}


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    111f <foo4+0x1f>
jmp    111f <foo4+0x1f>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1132 <foo4+0x32>
jmp    1132 <foo4+0x32>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo4(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void screen_wait(void) {}


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

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

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

LLVM IR (-O2):
define void @screen_wait() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_tx_string(char const *);
void print_spew(const char *str) { console_tx_string(str); }


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

x86 assembly (clang, -O2):
<print_spew>:
jmp    1030 <console_tx_string@plt>

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

LLVM IR (-O2):
define void @print_spew(i8* %0) {
%2 = tail call i32 @console_tx_string(i8* %0)
ret void
}
void test_35_2(int *mem) { __atomic_fetch_xor(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_35_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
xor    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test_35_2+0x4b>
jmp    1122 <test_35_2+0x22>
mov    -0x24(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_35_2>:
lock xorl $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test_35_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw xor i32* %5, i32 %6 acq_rel
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test_35_2(i32* nocapture %0) {
%2 = atomicrmw xor i32* %0, i32 1 acq_rel
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_open(int, char **);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int len;
  my_open(argc, argv);
  printf("httpd server\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"httpd server\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @my_open(i32 %7, i8** %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"httpd server\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @my_open(i32 %0, i8** %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int core5_swap(char *, int);
int U_EMRABORTPATH_swap(char *record, int torev) {
  return (core5_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRABORTPATH_swap>:
jmp    1030 <core5_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRABORTPATH_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ be32_lget(int /*<<< orphan*/ const *);
uint32_t be_iget(const uint8_t *addr) { return (uint32_t)be32_lget(addr); }


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

x86 assembly (clang, -O2):
<be_iget>:
jmp    1030 <be32_lget@plt>

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

LLVM IR (-O2):
define i32 @be_iget(i32* %0) {
%2 = tail call i32 @be32_lget(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
void sys_info(void) {
  system("echo \"System: `uname -a`\"");
  putchar('\n');
  fflush(stdout);
}


x86 assembly (clang, -O0):
<sys_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <system@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_info>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <system@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"echo \22System: `uname -a`\22\00"
@stdout = global i32 0
define void @sys_info() {
%1 = call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @putchar(i8 signext 10)
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"echo \22System: `uname -a`\22\00"
@stdout = global i32 0
define void @sys_info() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i8 signext 10)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ timer_t;
struct itimerspec {
  int dummy;
};

/* Variables and functions */
int timer_gettime(int /*<<< orphan*/, struct itimerspec *);
int main(void) {
  timer_t timerid = 0;
  struct itimerspec value;
  return timer_gettime(timerid, &value);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <timer_gettime@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.itimerspec = type { i32 }
define i32 @main() {
%1 = alloca %struct.itimerspec
%2 = bitcast %struct.itimerspec* %1 to i8*
%3 = call i32 @timer_gettime(i32 0, %struct.itimerspec* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ajResourceinExit();
int /*<<< orphan*/ ajResourceoutExit();
void ajResourceExit(void) {
  ajResourceinExit();
  ajResourceoutExit();
  return;
}


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

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

LLVM IR (-O0):
define void @ajResourceExit() {
%1 = call i32 (...) @ajResourceinExit()
%2 = call i32 (...) @ajResourceoutExit()
ret void
}

LLVM IR (-O2):
define void @ajResourceExit() {
%1 = tail call i32 (...) @ajResourceinExit()
%2 = tail call i32 (...) @ajResourceoutExit()
ret void
}
/* Variables and functions */
int __atoi(char const *);
extern __attribute__((always_, gnu_)) int atoi(const char *x) {
  return __atoi(x);
}


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

x86 assembly (clang, -O2):
<atoi>:
jmp    1030 <__atoi@plt>

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

LLVM IR (-O2):
define i32 @atoi(i8* %0) {
%2 = tail call i32 @__atoi(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ M_UNDEFINED();
void ento_clk(void) { M_UNDEFINED(); }


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

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

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

LLVM IR (-O2):
define void @ento_clk() {
%1 = tail call i32 (...) @M_UNDEFINED()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ thFreeMutex(void *);
void thFreeFastMutex(void *p) { thFreeMutex(p); }


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

x86 assembly (clang, -O2):
<thFreeFastMutex>:
jmp    1030 <thFreeMutex@plt>

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

LLVM IR (-O2):
define void @thFreeFastMutex(i8* %0) {
%2 = tail call i32 @thFreeMutex(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void _print_info() {
  printf("DEBUG: last build on %s at %s\n", "Mar 15 2022", "20:20:27");
}


x86 assembly (clang, -O0):
<_print_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xefd(%rip),%rsi
lea    0xf02(%rip),%rdx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_print_info>:
lea    0xee9(%rip),%rdi
lea    0xf01(%rip),%rsi
lea    0xf06(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"DEBUG: last build on %s at %s\0A\00"
@.str.1 = [12 x i8] c"Mar 15 2022\00"
@.str.2 = [9 x i8] c"20:20:27\00"
define void @_print_info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"DEBUG: last build on %s at %s\0A\00"
@.str.1 = [12 x i8] c"Mar 15 2022\00"
@.str.2 = [9 x i8] c"20:20:27\00"
define void @_print_info() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage:\n"
                  "\tcopylas src dest\n"
                  "\n"
                  "Copies an ASPRS LAS file from src to dest.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"Usage:\0A\09copylas src dest\0A\0ACopies an ASPRS LAS file from src to dest.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"Usage:\0A\09copylas src dest\0A\0ACopies an ASPRS LAS file from src to dest.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
regx0adrreg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
mov    -0x20(%rbp),%rcx
movswl 0x87a22(%rcx),%ecx
cmp    %ecx,%eax
jg     114a <regx0adrreg1+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <regx0adrreg1+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adrreg1>:
movslq %edx,%rax
movzwl (%r8,%rax,2),%ecx
xor    %eax,%eax
cmp    0x87a22(%r9),%cx
setle  %al
ret

LLVM IR (-O0):
define i32 @regx0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i16, i16* %16, i64 %18
%20 = load i16, i16* %19
%21 = sext i16 %20 to i32
%22 = load i16*, i16** %13
%23 = getelementptr inbounds i16, i16* %22, i64 277777
%24 = load i16, i16* %23
%25 = sext i16 %24 to i32
%26 = icmp sle i32 %21, %25
br i1 %26, label %27, label %28
27: ; preds = %6
store i32 1, i32* %7
br label %29
28: ; preds = %6
store i32 0, i32* %7
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %7
ret i32 %30
}

LLVM IR (-O2):
define i32 @regx0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = getelementptr inbounds i16, i16* %5, i64 277777
%11 = load i16, i16* %10
%12 = icmp sle i16 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int pr_indent(FILE *fp, int n) {
  int i;
  for (i = 0; i < n; i++)
    (void)fprintf(fp, " ");
  return n;
}


x86 assembly (clang, -O0):
<pr_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <pr_indent+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <pr_indent+0x16>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_indent>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
test   %esi,%esi
jle    1142 <pr_indent+0x32>
mov    %rdi,%rbx
mov    %r14d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1130 <pr_indent+0x20>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @pr_indent(i32* nocapture %0, i32 returned %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @fputc(i32 32, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 %1
}
float adjustMotorPower(float motorPower) { return ((motorPower / 100) * 80); }


x86 assembly (clang, -O0):
<adjustMotorPower>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeee(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xede(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjustMotorPower>:
divss  0xef8(%rip),%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @adjustMotorPower(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 1.000000e+02
%5 = fmul float %4, 8.000000e+01
ret float %5
}

LLVM IR (-O2):
define float @adjustMotorPower(float %0) {
%2 = fdiv float %0, 1.000000e+02
%3 = fmul float %2, 8.000000e+01
ret float %3
}
double Ddiv(double x, double y) { return x / y; }


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

x86 assembly (clang, -O2):
<Ddiv>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @Ddiv(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ _dictPanic(char *);
void *zmalloc(int);
void *_dictAlloc(int size) {
  void *p = zmalloc(size);
  if (p == NULL)
    _dictPanic("Out of memory");
  return p;
}


x86 assembly (clang, -O0):
<_dictAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <zmalloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <_dictAlloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <_dictPanic@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dictAlloc>:
push   %rbx
call   1030 <zmalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <_dictAlloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <_dictPanic@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define i8* @_dictAlloc(i32 %0) {
%2 = tail call i8* @zmalloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @_dictPanic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int encode_voltage(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int v = 0;
  while (v < 15000) {
    printf("%d --> %04x | %d\n", v, encode_voltage(v), encode_voltage(v));
    v += 125;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3a98,-0x8(%rbp)
jge    117e <main+0x5e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <encode_voltage@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <encode_voltage@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x7d,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0xffffff83,%ebx
lea    0xed0(%rip),%r14
add    $0x7d,%ebx
mov    %ebx,%edi
call   1040 <encode_voltage@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <encode_voltage@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
cmp    $0x3a1b,%ebx
jb     1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%d --> %04x | %d\0A\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 = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 15000
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @encode_voltage(i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @encode_voltage(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %11)
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 125
store i32 %14, i32* %2
br label %3
15: ; preds = %3
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [18 x i8] c"%d --> %04x | %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 @encode_voltage(i32 %2)
%4 = tail call i32 @encode_voltage(i32 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %4)
%6 = add nuw nsw i32 %2, 125
%7 = icmp ult i32 %2, 14875
br i1 %7, label %1, label %8
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_msg(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void log_packetSent(int packet) {
  char buffer[50];
  sprintf(buffer, "NET: packet %d sent", packet);
  log_msg(buffer);
}


x86 assembly (clang, -O0):
<log_packetSent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <log_msg@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_packetSent>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <log_msg@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"NET: packet %d sent\00"
define void @log_packetSent(i32 %0) {
%2 = alloca i32
%3 = alloca [50 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%8 = call i32 @log_msg(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"NET: packet %d sent\00"
define void @log_packetSent(i32 %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @log_msg(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jsll_gen();
int /*<<< orphan*/ jsll_gen_shift();
int main() {
  jsll_gen();
  jsll_gen_shift();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <jsll_gen@plt>
xor    %eax,%eax
call   1040 <jsll_gen_shift@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @jsll_gen()
%3 = call i32 (...) @jsll_gen_shift()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @jsll_gen()
%2 = tail call i32 (...) @jsll_gen_shift()
ret i32 0
}
main() { int a = 1 / 0; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 poison, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *__strtok_r(char *, char const *, char **, int);
char *strtok_r(register char *s, register const char *delim, char **lasts) {
  return __strtok_r(s, delim, lasts, 1);
}


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

x86 assembly (clang, -O2):
<strtok_r>:
mov    $0x1,%ecx
jmp    1030 <__strtok_r@plt>

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

LLVM IR (-O2):
define i8* @strtok_r(i8* %0, i8* %1, i8** %2) {
%4 = tail call i8* @__strtok_r(i8* %0, i8* %1, i8** %2, i32 1)
ret i8* %4
}
void strc(char a[], char b[]) {
  while (*a)
    a++;
  for (; *a++ = *b++;)
    ;
}


x86 assembly (clang, -O0):
<strc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <strc+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strc+0xc>
jmp    112f <strc+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115e <strc+0x5e>
jmp    112f <strc+0x2f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strc>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strc>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strc+0x10>
ret

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

LLVM IR (-O2):
define void @strc(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}