xunge/DecIR huggingface dataset:
/* Variables and functions */
int sockgetstatus(int);
int unixgetstatus(int sock) { return sockgetstatus(sock); }


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

x86 assembly (clang, -O2):
<unixgetstatus>:
jmp    1030 <sockgetstatus@plt>

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

LLVM IR (-O2):
define i32 @unixgetstatus(i32 %0) {
%2 = tail call i32 @sockgetstatus(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ foo(int *);
int main(void) {
  int j = 0;
#pragma omp parallel num_threads(2)
  foo(&j);
  if (j)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <foo@plt>
cmpl   $0x0,-0x8(%rbp)
je     1150 <main+0x30>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <foo@plt>
cmpl   $0x0,0x4(%rsp)
jne    113e <main+0x1e>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @foo(i32* %2)
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @foo(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led1Toggle();
void TestM__Leds__led1Toggle(void) { LedsP__Leds__led1Toggle(); }


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

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

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

LLVM IR (-O2):
define void @TestM__Leds__led1Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led1Toggle()
ret void
}
int test_imm_68uint16_mem(unsigned short *val) {
  return ((*val) & (-0x68 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_68uint16_mem>:
movzwl (%rdi),%eax
test   $0xff98,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_68uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -104
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void puts1(s) char *s;
{
  register int len = strlen(s);
  if (len <= 0)
    return;
  if (write(1, s, len) != len)
    ;
}


x86 assembly (clang, -O0):
<puts1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1147 <puts1+0x27>
jmp    1168 <puts1+0x48>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <write@plt>
cmp    -0xc(%rbp),%eax
je     1168 <puts1+0x48>
jmp    1168 <puts1+0x48>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts1>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
test   %eax,%eax
jle    113f <puts1+0x1f>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <write@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @puts1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %17
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %11, i32 %12)
%14 = load i32, i32* %3
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %10
br label %17
17: ; preds = %9, %16, %10
ret void
}

LLVM IR (-O2):
define void @puts1(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp slt i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %0, i32 %3)
br label %7
7: ; preds = %1, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
int /*<<< orphan*/ sclp_setup();
int /*<<< orphan*/ virtio_setup();
int /*<<< orphan*/ zipl_load();
int main(void) {
  sclp_setup();
  virtio_setup();
  zipl_load();
  panic("Failed to load OS from hard disk\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <sclp_setup@plt>
mov    $0x0,%al
call   1060 <virtio_setup@plt>
mov    $0x0,%al
call   1050 <zipl_load@plt>
lea    0xe95(%rip),%rdi
call   1030 <panic@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <sclp_setup@plt>
xor    %eax,%eax
call   1060 <virtio_setup@plt>
xor    %eax,%eax
call   1050 <zipl_load@plt>
lea    0xea3(%rip),%rdi
call   1030 <panic@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Failed to load OS from hard disk\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @sclp_setup()
%3 = call i32 (...) @virtio_setup()
%4 = call i32 (...) @zipl_load()
%5 = call i32 @panic(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Failed to load OS from hard disk\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @sclp_setup()
%2 = tail call i32 (...) @virtio_setup()
%3 = tail call i32 (...) @zipl_load()
%4 = tail call i32 @panic(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void _M2_testpy_finish(__attribute__((unused)) int argc,
                       __attribute__((unused)) char *argv[]) {}


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

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

LLVM IR (-O0):
define void @_M2_testpy_finish(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @_M2_testpy_finish(i32 %0, i8** nocapture %1) {
ret void
}
int clip_f15(int v) { return v < -32767 ? -32767 : v > 32767 ? 32767 : v; }


x86 assembly (clang, -O0):
<clip_f15>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffff8001,-0x4(%rbp)
jge    1121 <clip_f15+0x21>
mov    $0xffff8001,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <clip_f15+0x47>
cmpl   $0x7fff,-0x4(%rbp)
jle    113b <clip_f15+0x3b>
mov    $0x7fff,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <clip_f15+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip_f15>:
cmp    $0x7fff,%edi
mov    $0x7fff,%ecx
cmovl  %edi,%ecx
cmp    $0xffff8002,%ecx
mov    $0xffff8001,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clip_f15(i32 %0) {
%2 = icmp slt i32 %0, 32767
%3 = select i1 %2, i32 %0, i32 32767
%4 = icmp sgt i32 %3, -32767
%5 = select i1 %4, i32 %3, i32 -32767
ret i32 %5
}
void XkbKeysymToModifiers() {}


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

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

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

LLVM IR (-O2):
define void @XkbKeysymToModifiers() {
ret void
}
const char *Ref_Description(void) {
  return "The `Ref` type is a basic wrapper around a C pointer. It can be used "
         "as a type argument to collections to allow them to store generic "
         "types. "
         "It may also be useful in various circumstances where another level "
         "of "
         "indirection or mutability is required.";
}


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

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

LLVM IR (-O0):
@.str = [250 x i8] c"The `Ref` type is a basic wrapper around a C pointer. It can be used as a type argument to collections to allow them to store generic types. It may also be useful in various circumstances where another level of indirection or mutability is required.\00"
define i8* @Ref_Description() {
ret i8* getelementptr inbounds ([250 x i8], [250 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [250 x i8] c"The `Ref` type is a basic wrapper around a C pointer. It can be used as a type argument to collections to allow them to store generic types. It may also be useful in various circumstances where another level of indirection or mutability is required.\00"
define i8* @Ref_Description() {
ret i8* getelementptr inbounds ([250 x i8], [250 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int close(int);
int spiClose(int fd) {
  int ret = close(fd);
  return ret;
}


x86 assembly (clang, -O0):
<spiClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spiClose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @spiClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void sys_getversion(int *major, int *minor, int *bugfix) {
  if (major)
    *major = 0;
  if (minor)
    *minor = 49;
  if (bugfix)
    *bugfix = 0;
}


x86 assembly (clang, -O0):
<sys_getversion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1125 <sys_getversion+0x25>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113a <sys_getversion+0x3a>
mov    -0x10(%rbp),%rax
movl   $0x31,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     114f <sys_getversion+0x4f>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_getversion>:
test   %rdi,%rdi
je     110b <sys_getversion+0xb>
movl   $0x0,(%rdi)
test   %rsi,%rsi
je     1116 <sys_getversion+0x16>
movl   $0x31,(%rsi)
test   %rdx,%rdx
je     1121 <sys_getversion+0x21>
movl   $0x0,(%rdx)
ret

LLVM IR (-O0):
define void @sys_getversion(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 = icmp ne i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i32*, i32** %4
store i32 0, i32* %10
br label %11
11: ; preds = %9, %3
%12 = load i32*, i32** %5
%13 = icmp ne i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32*, i32** %5
store i32 49, i32* %15
br label %16
16: ; preds = %14, %11
%17 = load i32*, i32** %6
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load i32*, i32** %6
store i32 0, i32* %20
br label %21
21: ; preds = %19, %16
ret void
}

LLVM IR (-O2):
define void @sys_getversion(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2) {
%4 = icmp eq i32* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i32 0, i32* %0
br label %6
6: ; preds = %5, %3
%7 = icmp eq i32* %1, null
br i1 %7, label %9, label %8
8: ; preds = %6
store i32 49, i32* %1
br label %9
9: ; preds = %8, %6
%10 = icmp eq i32* %2, null
br i1 %10, label %12, label %11
11: ; preds = %9
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
ret void
}
int test_imm_AEint32_mem(int *val) {
  return ((*val) & (0xAE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AEint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 174
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gtk_init_check() {}


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

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

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

LLVM IR (-O2):
define void @gtk_init_check() {
ret void
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 && (*s1 == *s2)) {
    s1++;
    s2++;
  }
  return *(unsigned char *)s1 - *(unsigned char *)s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(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 = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
int nth_position(unsigned int num, int position) {
  return ((num >> position) & 1U);
}


x86 assembly (clang, -O0):
<nth_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_position>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nth_position(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 = lshr i32 %5, %6
%8 = and i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @nth_position(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
void g_io_channel_set_encoding() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_set_encoding() {
ret void
}
/* Type definitions */
struct msghdr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int PTHREAD_CANCEL_ASYNCHRONOUS;
int /*<<< orphan*/ __libc_recvmsg(int, struct msghdr *, int);
int /*<<< orphan*/ pthread_setcanceltype(int, int *);
ssize_t __attribute__((weak))
recvmsg(int fd, struct msghdr *message, int flags) {
  ssize_t result;
  int oldtype;
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
  result = __libc_recvmsg(fd, message, flags);
  pthread_setcanceltype(oldtype, NULL);
  return result;
}


x86 assembly (clang, -O0):
<recvmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    -0x1c(%rbp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <__libc_recvmsg@plt>
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_setcanceltype@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recvmsg>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <__libc_recvmsg@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.msghdr = type { i32 }
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msghdr*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store %struct.msghdr* %1, %struct.msghdr** %5
store i32 %2, i32* %6
%9 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* %8)
%11 = load i32, i32* %4
%12 = load %struct.msghdr*, %struct.msghdr** %5
%13 = load i32, i32* %6
%14 = call i32 @__libc_recvmsg(i32 %11, %struct.msghdr* %12, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @pthread_setcanceltype(i32 %15, i32* null)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
%struct.msghdr = type { i32 }
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%7 = call i32 @pthread_setcanceltype(i32 %6, i32* %4)
%8 = call i32 @__libc_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2)
%9 = load i32, i32* %4
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* null)
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t DPORT_REG_READ(uint32_t reg) { return (*(volatile uint32_t *)(reg)); }


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

x86 assembly (clang, -O2):
<DPORT_REG_READ>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    (%rax),%rax
ret

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

LLVM IR (-O2):
define i64 @DPORT_REG_READ(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int __string_encoded_array_size(char *const *, int);
int __string_encoded_size(char *const *s) {
  return sizeof(int64_t) + __string_encoded_array_size(s, 1);
}


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

x86 assembly (clang, -O2):
<__string_encoded_size>:
push   %rax
mov    $0x1,%esi
call   1030 <__string_encoded_array_size@plt>
add    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__string_encoded_size(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i32 @__string_encoded_array_size(i8** %3, i32 1)
%5 = sext i32 %4 to i64
%6 = add i64 4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @__string_encoded_size(i8** %0) {
%2 = tail call i32 @__string_encoded_array_size(i8** %0, i32 1)
%3 = add i32 %2, 4
ret i32 %3
}
int test_imm_31int8_mem(signed char *val) {
  return ((*val) & (-0x31 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_31int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -49
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void do_some_work() {
  int i;
  for (i = 0; i < 0x2000000; i++)
    i = i * 10.0 / 5 / 2;
}


x86 assembly (clang, -O0):
<do_some_work>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2000000,-0x4(%rbp)
jge    1156 <do_some_work+0x56>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeeb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <do_some_work+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_some_work() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 33554432
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 1.000000e+01
%9 = fdiv double %8, 5.000000e+00
%10 = fdiv double %9, 2.000000e+00
%11 = fptosi double %10 to i32
store i32 %11, i32* %1
br label %12
12: ; preds = %5
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @do_some_work() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void long_range(void) {
  unsigned long max = -1;
  signed long min = (max - 1) / 2 + 1;
  printf("\tlong:\n");
  printf("\t\tSigned minimum = %ld\n", min);
  printf("\t\tUnsigned maximum = %lu\n", max);
}


x86 assembly (clang, -O0):
<long_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
shr    $0x1,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_range>:
push   %rax
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
movabs $0x8000000000000000,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0xffffffffffffffff,%rsi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\09long:\0A\00"
@.str.1 = [24 x i8] c"\09\09Signed minimum = %ld\0A\00"
@.str.2 = [26 x i8] c"\09\09Unsigned maximum = %lu\0A\00"
define void @long_range() {
%1 = alloca i64
%2 = alloca i64
store i64 -1, i64* %1
%3 = load i64, i64* %1
%4 = sub i64 %3, 1
%5 = udiv i64 %4, 2
%6 = add i64 %5, 1
store i64 %6, i64* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = load i64, i64* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i64 %8)
%10 = load i64, i64* %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i64 %10)
ret void
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"\09\09Signed minimum = %ld\0A\00"
@.str.2 = [26 x i8] c"\09\09Unsigned maximum = %lu\0A\00"
@str = [7 x i8] c"\09long:\00"
define void @long_range() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i64 -9223372036854775808)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i64 -1)
ret void
}
void PWM0Generator1_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define void @PWM0Generator1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @PWM0Generator1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int child(void *arg) {
  write(1, "clone\n", 6);
  return 0;
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
lea    0xed8(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"clone\0A\00"
define i32 @child(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"clone\0A\00"
define i32 @child(i8* nocapture readnone %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rffti1(int, double *, int *);
void rffti(int n, double wsave[]) {
  if (n == 1)
    return;
  rffti1(n, wsave + n, (int *)(wsave + 2 * n));
}


x86 assembly (clang, -O0):
<rffti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    112e <rffti+0x1e>
jmp    1158 <rffti+0x48>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
call   1030 <rffti1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rffti>:
cmp    $0x1,%edi
jne    1116 <rffti+0x6>
ret
movslq %edi,%rax
lea    (%rsi,%rax,8),%rax
lea    (%rdi,%rdi,1),%ecx
movslq %ecx,%rcx
lea    (%rsi,%rcx,8),%rdx
mov    %rax,%rsi
jmp    1030 <rffti1@plt>

LLVM IR (-O0):
define void @rffti(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %3
store double* %1, double** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %2
br label %21
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load double*, double** %4
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
%14 = load double*, double** %4
%15 = load i32, i32* %3
%16 = mul nsw i32 2, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %14, i64 %17
%19 = bitcast double* %18 to i32*
%20 = call i32 @rffti1(i32 %9, double* %13, i32* %19)
br label %21
21: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @rffti(i32 %0, double* %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds double, double* %1, i64 %5
%7 = shl nsw i32 %0, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds double, double* %1, i64 %8
%10 = bitcast double* %9 to i32*
%11 = tail call i32 @rffti1(i32 %0, double* %6, i32* %10)
br label %12
12: ; preds = %2, %4
ret void
}
/* Variables and functions */
const char *cli_verify_help(bool full) {
  const char *fullmsg =
      ""
      "asignify [global_opts] verify - verifies signature\n\n"
      "Usage: asignify verify <pubkey> <signature>\n"
      "\tpubkey        Path to a public key file to check signature against\n"
      "\tsignature     Path to signature file to check\n";
  if (!full) {
    return ("verify pubkey signature");
  }
  return (fullmsg);
}


x86 assembly (clang, -O0):
<cli_verify_help>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
lea    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112c <cli_verify_help+0x2c>
lea    0xfb1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1134 <cli_verify_help+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_verify_help>:
test   %edi,%edi
lea    0xfcb(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [212 x i8] c"asignify [global_opts] verify - verifies signature\0A\0AUsage: asignify verify <pubkey> <signature>\0A\09pubkey Path to a public key file to check signature against\0A\09signature Path to signature file to check\0A\00"
@.str.1 = [24 x i8] c"verify pubkey signature\00"
define i8* @cli_verify_help(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* getelementptr inbounds ([212 x i8], [212 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
%9 = load i8*, i8** %4
store i8* %9, i8** %2
br label %10
10: ; preds = %8, %7
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [212 x i8] c"asignify [global_opts] verify - verifies signature\0A\0AUsage: asignify verify <pubkey> <signature>\0A\09pubkey Path to a public key file to check signature against\0A\09signature Path to signature file to check\0A\00"
@.str.1 = [24 x i8] c"verify pubkey signature\00"
define i8* @cli_verify_help(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([212 x i8], [212 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
long f(long x) {
  if (x == 0 || x == 1) {
    return x;
  } else
    return f(x - 1) + f(x - 2);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1132 <f+0x22>
cmpq   $0x1,-0x10(%rbp)
jne    113f <f+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <f+0x5b>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <f@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <f@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %r14d,%r14d
cmp    $0x2,%rdi
jb     1136 <f+0x26>
lea    -0x1(%rbx),%rdi
call   1030 <f@plt>
add    $0xfffffffffffffffe,%rbx
add    %rax,%r14
cmp    $0x1,%rbx
ja     1120 <f+0x10>
add    %rbx,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i64 %4, -1
%7 = tail call i64 @f(i64 %6)
%8 = add nsw i64 %4, -2
%9 = add nsw i64 %7, %5
%10 = icmp ult i64 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %9, %3 ]
%13 = phi i64 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i64 %13, %12
ret i64 %14
}
int main(int argc, char **argv) {
  argv[0] = argc;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movslq %edi,%rax
mov    %rax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
store i8* %8, i8** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture writeonly %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ Cvar_InfoString(int);
int /*<<< orphan*/ Info_Print(int /*<<< orphan*/);
void SV_Serverinfo_f(void) {
  Com_Printf("Server info settings:\n");
  Info_Print(Cvar_InfoString(0x0004));
}


x86 assembly (clang, -O0):
<SV_Serverinfo_f>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <Com_Printf@plt>
mov    $0x4,%edi
call   1030 <Cvar_InfoString@plt>
mov    %eax,%edi
call   1050 <Info_Print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_Serverinfo_f>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <Com_Printf@plt>
mov    $0x4,%edi
call   1030 <Cvar_InfoString@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <Info_Print@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Server info settings:\0A\00"
define void @SV_Serverinfo_f() {
%1 = call i32 @Com_Printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Cvar_InfoString(i32 4)
%3 = call i32 @Info_Print(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Server info settings:\0A\00"
define void @SV_Serverinfo_f() {
%1 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Cvar_InfoString(i32 4)
%3 = tail call i32 @Info_Print(i32 %2)
ret void
}
void g_slist_foreach() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_foreach() {
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t RDTSC() { __asm__("RDTSC\n"); }


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

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

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

LLVM IR (-O2):
define i8* @RDTSC() {
tail call void asm sideeffect "RDTSC\0A", "~{dirflag},~{fpsr},~{flags}"()
ret i8* undef
}
/* Variables and functions */
bool nrf_drv_usbd_errata_166(void) { return (1 && true); }


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

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

LLVM IR (-O0):
define i32 @nrf_drv_usbd_errata_166() {
ret i32 1
}

LLVM IR (-O2):
define i32 @nrf_drv_usbd_errata_166() {
ret i32 1
}
int main(void) {
  int vector[] = {23, 54, 54, 65, 6, 7};
  printf("\nSizeof vector = %lu and sizeof vector[0] = %lu\n", sizeof vector,
         sizeof vector[0]);
  char array[] = {"Hello"};
  printf("Sizeof array = %lu and sizeof array[0] = %lu\n\n", sizeof array,
         sizeof array[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x18,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xeeb(%rip),%eax
mov    %eax,-0x26(%rbp)
mov    0xee5(%rip),%ax
mov    %ax,-0x22(%rbp)
lea    0xedc(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.vector = [6 x i32] [i32 23, i32 54, i32 54, i32 65, i32 6, i32 7]
@.str = [49 x i8] c"\0ASizeof vector = %lu and sizeof vector[0] = %lu\0A\00"
@__const.main.array = [6 x i8] c"Hello\00"
@.str.1 = [47 x i8] c"Sizeof array = %lu and sizeof array[0] = %lu\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = bitcast [6 x i32]* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i64 24, i64 4)
%6 = bitcast [6 x i8]* %3 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i64 6, i64 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"\0ASizeof vector = %lu and sizeof vector[0] = %lu\0A\00"
@.str.1 = [47 x i8] c"Sizeof array = %lu and sizeof array[0] = %lu\0A\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i64 24, i64 4)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i64 6, i64 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ calldll();
void calldllmain() { calldll(); }


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

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

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

LLVM IR (-O2):
define void @calldllmain() {
%1 = tail call i32 (...) @calldll()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int tempexit() {
  clear();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<tempexit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clear@plt>
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tempexit() {
%1 = call i32 (...) @clear()
%2 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @tempexit() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @endwin()
ret i32 0
}
void TMTimerR0Ptr(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerR0Ptr() {
ret void
}
void ab5500_setup_debugfs(struct ab5500 *ab) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.ab5500 = type opaque
define void @ab5500_setup_debugfs(%struct.ab5500* nocapture %0) {
ret void
}
int test_imm_2Aint64_lowword_mem(long long *val) {
  return ((*val) & (0x2A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Aint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 42
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ box_unsigned_8(int /*<<< orphan*/);
int /*<<< orphan*/ double_bits(int /*<<< orphan*/);
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ untag_float(int /*<<< orphan*/);
void primitive_double_bits(void) {
  box_unsigned_8(double_bits(untag_float(dpop())));
}


x86 assembly (clang, -O0):
<primitive_double_bits>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float@plt>
mov    %eax,%edi
call   1040 <double_bits@plt>
mov    %eax,%edi
call   1060 <box_unsigned_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_double_bits>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float@plt>
mov    %eax,%edi
call   1040 <double_bits@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <box_unsigned_8@plt>

LLVM IR (-O0):
define void @primitive_double_bits() {
%1 = call i32 (...) @dpop()
%2 = call i32 @untag_float(i32 %1)
%3 = call i32 @double_bits(i32 %2)
%4 = call i32 @box_unsigned_8(i32 %3)
ret void
}

LLVM IR (-O2):
define void @primitive_double_bits() {
%1 = tail call i32 (...) @dpop()
%2 = tail call i32 @untag_float(i32 %1)
%3 = tail call i32 @double_bits(i32 %2)
%4 = tail call i32 @box_unsigned_8(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ star(int);
int main() {
  star(6);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @star(i32 6)
ret i32 0
}
int charLoc(char chr, char *str) {
  int loc = 0;
  while (1) {
    if (*(str + loc) == chr) {
      break;
    } else {
      loc++;
    }
  }
  return loc;
}


x86 assembly (clang, -O0):
<charLoc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    1132 <charLoc+0x32>
jmp    1140 <charLoc+0x40>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <charLoc+0x15>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charLoc>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
lea    0x1(%rsi),%rcx
cmp    %dil,(%rsi)
mov    %rcx,%rsi
jne    1110 <charLoc+0x10>
ret

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

LLVM IR (-O2):
define i32 @charLoc(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
ret i32 %10
}