xunge/DecIR huggingface dataset:
void _start(void) {
  *(volatile unsigned long *)0x01c208b4 = 0x00444444;
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c208b4,%eax
movq   $0x444444,(%rax)
jmp    1110 <_start+0x10>

x86 assembly (clang, -O2):
<_start>:
movq   $0x444444,0x1c208b4
nopl   0x0(%rax)
jmp    1110 <_start+0x10>

LLVM IR (-O0):
define void @_start() {
store volatile i64 4473924, i64* inttoptr (i64 29493428 to i64*)
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @_start() {
store volatile i64 4473924, i64* inttoptr (i64 29493428 to i64*)
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
do_stuff() { echo("hi"); }


x86 assembly (clang, -O0):
<do_stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <echo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_stuff>:
lea    0xee9(%rip),%rdi
jmp    1030 <echo@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"hi\00"
define i32 @do_stuff() {
%1 = alloca i32
%2 = call i32 @echo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"hi\00"
define i32 @do_stuff() {
%1 = tail call i32 @echo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void connect_alarm() { return; }


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

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

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

LLVM IR (-O2):
define void @connect_alarm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void stop_usage(int code) {
  fprintf(stderr,
          "Stops a started honeycomb managed VM instance.\n"
          "\n"
          "Usage: %s stop [-i instance] [-f]\n"
          "\n"
          "	-f: Force stop the VM instance\n"
          "	-i: Name of the VM instance\n"
          "\n",
          "hc");
  exit(code);
}


x86 assembly (clang, -O0):
<stop_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
lea    0xf50(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stop_usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
lea    0xf58(%rip),%rdx
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [146 x i8] c"Stops a started honeycomb managed VM instance.\0A\0AUsage: %s stop [-i instance] [-f]\0A\0A\09-f: Force stop the VM instance\0A\09-i: Name of the VM instance\0A\0A\00"
@.str.1 = [3 x i8] c"hc\00"
define void @stop_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [146 x i8] c"Stops a started honeycomb managed VM instance.\0A\0AUsage: %s stop [-i instance] [-f]\0A\0A\09-f: Force stop the VM instance\0A\09-i: Name of the VM instance\0A\0A\00"
@.str.1 = [3 x i8] c"hc\00"
define void @stop_usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
char *strrchr(const char *s, int c) {
  char *last = NULL;
  char cb = c;
  while (*s != 0) {
    if (*s == cb)
      last = (char *)s;
    s += 1;
  }
  return last;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <strrchr+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    1144 <strrchr+0x44>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1119 <strrchr+0x19>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <strrchr+0x26>
movsbl %sil,%edx
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %8
%9 = phi i8 [ %3, %5 ], [ %16, %8 ]
%10 = phi i8* [ %0, %5 ], [ %15, %8 ]
%11 = phi i8* [ null, %5 ], [ %14, %8 ]
%12 = sext i8 %9 to i32
%13 = icmp eq i32 %7, %12
%14 = select i1 %13, i8* %10, i8* %11
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8* [ null, %2 ], [ %14, %8 ]
ret i8* %19
}
int do_463() { return 463; }


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

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

LLVM IR (-O0):
define i32 @do_463() {
ret i32 463
}

LLVM IR (-O2):
define i32 @do_463() {
ret i32 463
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int stbi_is_hdr_from_file(int /*<<< orphan*/ *);
extern int stbi_is_hdr(char *filename) {
  FILE *f = fopen(filename, "rb");
  int result = 0;
  if (f) {
    result = stbi_is_hdr_from_file(f);
    fclose(f);
  }
  return result;
}


x86 assembly (clang, -O0):
<stbi_is_hdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1177 <stbi_is_hdr+0x47>
mov    -0x10(%rbp),%rdi
call   1050 <stbi_is_hdr_from_file@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi_is_hdr>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     115d <stbi_is_hdr+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <stbi_is_hdr_from_file@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
jmp    115f <stbi_is_hdr+0x2f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @stbi_is_hdr(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @stbi_is_hdr_from_file(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, int);
void *test(void *ptr) {
  void *newPtr = realloc(ptr, 4);
  if (newPtr == 0) {
    if (ptr)
      free(ptr);
  }
  return newPtr;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1162 <test+0x42>
cmpq   $0x0,-0x8(%rbp)
je     115d <test+0x3d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
jmp    1162 <test+0x42>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x4,%esi
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1146 <test+0x26>
test   %r14,%r14
jne    1146 <test+0x26>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @test(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @realloc(i8* %4, i32 4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i8*, i8** %2
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %11, %8
br label %15
15: ; preds = %14, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @test(i8* %0) {
%2 = tail call i8* @realloc(i8* %0, i32 4)
%3 = icmp eq i8* %2, null
%4 = icmp ne i8* %0, null
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @free(i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %2
}
int decr(int val) { return val - 1; }


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

x86 assembly (clang, -O2):
<decr>:
lea    -0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @decr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @decr(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_rwlock_timedwrlock(pthread_rwlock_t *a, const struct timespec *b) {
  assert(0);
}


x86 assembly (clang, -O0):
<pthread_rwlock_timedwrlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @pthread_rwlock_timedwrlock(i32* %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.timespec*
store i32* %0, i32** %4
store %struct.timespec* %1, %struct.timespec** %5
%6 = call i32 @assert(i32 0)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @pthread_rwlock_timedwrlock(i32* nocapture readnone %0, %struct.timespec* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int a = 17;
  int b = -24;
  printf("%d*%d = %d\n", a, b, a * b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
movl   $0xffffffe8,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x11,%esi
mov    $0xffffffe8,%edx
mov    $0xfffffe68,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d*%d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 17, i32* %2
store i32 -24, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d*%d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 17, i32 -24, i32 -408)
ret i32 0
}
isincdec(sym) { return sym == 321 ? 1 : (sym == 309 ? -1 : 0); }


x86 assembly (clang, -O0):
<isincdec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x141,-0x4(%rbp)
jne    1121 <isincdec+0x21>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <isincdec+0x37>
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x135,%edx
cmove  %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isincdec>:
xor    %ecx,%ecx
cmp    $0x135,%edi
sete   %cl
neg    %ecx
cmp    $0x141,%edi
mov    $0x1,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isincdec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 321
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 309
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 0
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 1, %5 ], [ %10, %6 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @isincdec(i32 %0) {
%2 = icmp eq i32 %0, 321
%3 = icmp eq i32 %0, 309
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
__attribute__((always_)) void nop(void) { __asm__ __volatile__("nop"); }


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

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

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

LLVM IR (-O2):
define void @nop() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RsaTest();
void main() { RsaTest(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @RsaTest()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zfree(void *);
void sds_free(void *ptr) { zfree(ptr); }


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

x86 assembly (clang, -O2):
<sds_free>:
jmp    1030 <zfree@plt>

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

LLVM IR (-O2):
define void @sds_free(i8* %0) {
%2 = tail call i32 @zfree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  long int n;
  scanf("%ld", &n);
  printf("%lX", n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [4 x i8] c"%lX\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [4 x i8] c"%lX\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %4)
ret i32 0
}
void fixnum(int min, int max, int *n) {
  if (*n < min)
    *n = min;
  if (*n > max)
    *n = max;
}


x86 assembly (clang, -O0):
<fixnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jge    1126 <fixnum+0x26>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jle    113e <fixnum+0x3e>
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixnum>:
mov    (%rdx),%eax
cmp    %edi,%eax
cmovl  %edi,%eax
jl     110e <fixnum+0xe>
cmp    %esi,%eax
jg     110e <fixnum+0xe>
ret
cmp    %esi,%eax
cmovg  %esi,%eax
mov    %eax,(%rdx)
ret

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

LLVM IR (-O2):
define void @fixnum(i32 %0, i32 %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, %0
%6 = select i1 %5, i32 %0, i32 %4
%7 = icmp sgt i32 %6, %1
%8 = or i1 %5, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = select i1 %7, i32 %1, i32 %6
store i32 %10, i32* %2
br label %11
11: ; preds = %3, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, char *, int *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
int isRunningSync(char *psName) {
  int ret;
  int80(41, psName, &ret, 0, 0, 0);
  return ret;
}


x86 assembly (clang, -O0):
<isRunningSync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x29,%edi
lea    -0xc(%rbp),%rdx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <int80@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRunningSync>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdx
mov    $0x29,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isRunningSync(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @int80(i32 41, i8* %0, i32* %2, i32 0, i32 0, i32 0)
%5 = load i32, i32* %2
ret i32 %5
}
char *crypt_err() { return 0; }


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

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

LLVM IR (-O0):
define i8* @crypt_err() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @crypt_err() {
ret i8* null
}
int security_sb_alloc(struct super_block *sb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @security_sb_alloc(%struct.super_block* nocapture readnone %0) {
ret i32 0
}
void platform_intr_clear_irq(unsigned irq __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @platform_intr_clear_irq(i32 %0) {
ret void
}
void cpu_get_switches(unsigned long *p1, unsigned long *p2) {}


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

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

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

LLVM IR (-O2):
define void @cpu_get_switches(i64* nocapture %0, i64* nocapture %1) {
ret void
}
unsigned long long int getReverse(unsigned long long int sequence) {
  unsigned long long int MASK = 0x3;
  unsigned long long int nucleotide;
  unsigned long long int reverse = 0x0;
  for (int i = 0; i < 32; i++) {
    nucleotide = (sequence >> (i * 2)) & MASK;
    reverse = reverse | (nucleotide << ((32 - i - 1) * 2));
  }
  return reverse;
}


x86 assembly (clang, -O0):
<getReverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x20,-0x24(%rbp)
jge    1173 <getReverse+0x73>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rdx
mov    $0x20,%ecx
sub    -0x24(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x1,%ecx
mov    %ecx,%ecx
shl    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111f <getReverse+0x1f>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getReverse>:
mov    $0x2,%r8d
mov    $0x3c,%r9d
xor    %eax,%eax
xchg   %ax,%ax
lea    -0x2(%r8),%ecx
mov    %rdi,%rdx
shr    %cl,%rdx
and    $0x3,%edx
lea    0x2(%r9),%ecx
shl    %cl,%rdx
mov    %rdi,%rsi
mov    %r8d,%ecx
shr    %cl,%rsi
and    $0x3,%esi
mov    %r9d,%ecx
shl    %cl,%rsi
or     %rsi,%rax
or     %rdx,%rax
add    $0x4,%r8
add    $0xfffffffffffffffc,%r9
cmp    $0xfffffffffffffffc,%r9
jne    1110 <getReverse+0x10>
ret

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

LLVM IR (-O2):
define i64 @getReverse(i64 %0) {
br label %3
2: ; preds = %3
ret i64 %20
3: ; preds = %3, %1
%4 = phi i64 [ 0, %1 ], [ %21, %3 ]
%5 = phi i64 [ 0, %1 ], [ %20, %3 ]
%6 = shl nuw nsw i64 %4, 1
%7 = lshr i64 %0, %6
%8 = and i64 %7, 3
%9 = mul nsw i64 %4, -2
%10 = add nsw i64 %9, 62
%11 = shl nuw i64 %8, %10
%12 = or i64 %11, %5
%13 = or i64 %4, 1
%14 = shl nuw nsw i64 %13, 1
%15 = lshr i64 %0, %14
%16 = and i64 %15, 3
%17 = mul nsw i64 %13, -2
%18 = add nsw i64 %17, 62
%19 = shl nuw i64 %16, %18
%20 = or i64 %19, %12
%21 = add nuw nsw i64 %4, 2
%22 = icmp eq i64 %21, 32
br i1 %22, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *, char const *);
void log_bad_delay(const char *opt) {
  report(LOG_ERR, "Bad value \"%s\" for delay", opt);
}


x86 assembly (clang, -O0):
<log_bad_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_bad_delay>:
mov    %rdi,%rdx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <report@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [25 x i8] c"Bad value \22%s\22 for delay\00"
define void @log_bad_delay(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_ERR
%4 = load i8*, i8** %2
%5 = call i32 @report(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [25 x i8] c"Bad value \22%s\22 for delay\00"
define void @log_bad_delay(i8* %0) {
%2 = load i32, i32* @LOG_ERR
%3 = tail call i32 @report(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void help(void) {
  printf("geoip "
         "1.00"
         " compiled at "
         "Mar 16 2022"
         " "
         "06:50:21"
         " by gcc "
         "9.4.0"
         " (%d-bit) after commit "
         ""
         "\n"
         "[-i input_file] file with database in csv-format\n"
         "[-o output_file] file to write result. Default - stdout\n"
         "[-v] increase verbosity\n"
         "[-s] number of lines to skip\n",
         (int)sizeof(void *) * 8);
}


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

x86 assembly (clang, -O2):
<help>:
lea    0xee9(%rip),%rdi
mov    $0x40,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [239 x i8] c"geoip 1.00 compiled at Mar 16 2022 06:50:21 by gcc 9.4.0 (%d-bit) after commit \0A[-i input_file] file with database in csv-format\0A[-o output_file] file to write result. Default - stdout\0A[-v] increase verbosity\0A[-s] number of lines to skip\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([239 x i8], [239 x i8]* @.str, i64 0, i64 0), i32 64)
ret void
}

LLVM IR (-O2):
@.str = [239 x i8] c"geoip 1.00 compiled at Mar 16 2022 06:50:21 by gcc 9.4.0 (%d-bit) after commit \0A[-i input_file] file with database in csv-format\0A[-o output_file] file to write result. Default - stdout\0A[-v] increase verbosity\0A[-s] number of lines to skip\0A\00"
define void @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([239 x i8], [239 x i8]* @.str, i64 0, i64 0), i32 64)
ret void
}
/* Variables and functions */
int set_setting(char *, int);
int set_csum(int value) {
  return set_setting("/proc/sys/net/mptcp/mptcp_checksum", value);
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"/proc/sys/net/mptcp/mptcp_checksum\00"
define i32 @set_csum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @set_setting(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [35 x i8] c"/proc/sys/net/mptcp/mptcp_checksum\00"
define i32 @set_csum(i32 %0) {
%2 = tail call i32 @set_setting(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void exit_fn(char *msg) {
  perror(msg);
  exit(1);
}


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

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

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

LLVM IR (-O2):
define void @exit_fn(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int keyzen_self_add_keys(char const **, int);
int keyzen_self_add_key(const char *key) {
  return keyzen_self_add_keys(&key, 1);
}


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

x86 assembly (clang, -O2):
<keyzen_self_add_key>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <keyzen_self_add_keys@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @keyzen_self_add_key(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @keyzen_self_add_keys(i8** %2, i32 1)
ret i32 %3
}

LLVM IR (-O2):
define i32 @keyzen_self_add_key(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @keyzen_self_add_keys(i8** %2, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pruebas_vector();
int main() {
  pruebas_vector();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pruebas_vector()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void semantico_tdb() { printf("TODO\n"); }


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

x86 assembly (clang, -O2):
<semantico_tdb>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"TODO\0A\00"
define void @semantico_tdb() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"TODO\00"
define void @semantico_tdb() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_info;
struct user_desc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct user_desc *, int /*<<< orphan*/, int);
int main(void) {
  struct user_desc u_info;
  (void)memset(&u_info, 0, sizeof(u_info));
  (void)u_info;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.user_desc = type { i32 }
define i32 @main() {
%1 = alloca %struct.user_desc
%2 = bitcast %struct.user_desc* %1 to i8*
%3 = call i32 @memset(%struct.user_desc* %1, i32 0, i32 4)
ret i32 0
}
/* Type definitions */
struct lfr_param {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct lfr_param *);
void lfr_param_free(struct lfr_param *param) { free(param); }


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

x86 assembly (clang, -O2):
<lfr_param_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.lfr_param = type { i32 }
define void @lfr_param_free(%struct.lfr_param* nocapture %0) {
%2 = tail call i32 @free(%struct.lfr_param* %0)
ret void
}
void PWMGenFaultClear(unsigned long ulBase, unsigned long ulGen,
                      unsigned long ulGroup, unsigned long ulFaultTriggers) {
  ;
  ;
  ;
  ;

  ;

  ;
  if (ulGroup == 0) {
    (*((volatile unsigned long *)(((ulBase) + 0x00000800 +
                                   ((ulGen)-0x00000040) * 2) +
                                  0x00000004))) = ulFaultTriggers;
  } else {
    (*((volatile unsigned long *)(((ulBase) + 0x00000800 +
                                   ((ulGen)-0x00000040) * 2) +
                                  0x00000008))) = ulFaultTriggers;
  }
}


x86 assembly (clang, -O0):
<PWMGenFaultClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1145 <PWMGenFaultClear+0x45>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x800,%rax
mov    -0x10(%rbp),%rdx
sub    $0x40,%rdx
shl    $0x1,%rdx
add    %rdx,%rax
mov    %rcx,0x4(%rax)
jmp    1166 <PWMGenFaultClear+0x66>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x800,%rax
mov    -0x10(%rbp),%rdx
sub    $0x40,%rdx
shl    $0x1,%rdx
add    %rdx,%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenFaultClear>:
xor    %eax,%eax
test   %rdx,%rdx
setne  %al
lea    (%rdi,%rax,4),%rax
mov    %rcx,0x784(%rax,%rsi,2)
ret

LLVM IR (-O0):
define void @PWMGenFaultClear(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %4
%12 = load i64, i64* %8
%13 = load i64, i64* %5
%14 = add i64 %13, 2048
%15 = load i64, i64* %6
%16 = sub i64 %15, 64
%17 = mul i64 %16, 2
%18 = add i64 %14, %17
%19 = add i64 %18, 4
%20 = inttoptr i64 %19 to i64*
store volatile i64 %12, i64* %20
br label %31
21: ; preds = %4
%22 = load i64, i64* %8
%23 = load i64, i64* %5
%24 = add i64 %23, 2048
%25 = load i64, i64* %6
%26 = sub i64 %25, 64
%27 = mul i64 %26, 2
%28 = add i64 %24, %27
%29 = add i64 %28, 8
%30 = inttoptr i64 %29 to i64*
store volatile i64 %22, i64* %30
br label %31
31: ; preds = %21, %11
ret void
}

LLVM IR (-O2):
define void @PWMGenFaultClear(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, 0
%6 = shl i64 %1, 1
%7 = select i1 %5, i64 1924, i64 1928
%8 = add i64 %7, %0
%9 = add i64 %8, %6
%10 = inttoptr i64 %9 to i64*
store volatile i64 %3, i64* %10
ret void
}
void XtDestroyWidget() {}


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

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

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

LLVM IR (-O2):
define void @XtDestroyWidget() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
char *fgets_or_exit(char *buffer, int size, FILE *stream) {
  if (fgets(buffer, size, stream) == NULL)
    exit(1);
  return buffer;
}


x86 assembly (clang, -O0):
<fgets_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%rax
jne    1157 <fgets_or_exit+0x37>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_or_exit>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fgets@plt>
test   %rax,%rax
je     1133 <fgets_or_exit+0x13>
mov    %rbx,%rax
pop    %rbx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @fgets_or_exit(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32* @fgets(i8* %7, i32 %8, i32* %9)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %3
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @fgets_or_exit(i8* returned %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3
ret i8* %0
}
/* Type definitions */
struct imgImage {
  int dummy;
};

/* Variables and functions */
int read_tga(char const *, struct imgImage *, int);
int imgReadImgTga(const char *filename, struct imgImage *img_data) {
  int err = read_tga(filename, img_data, 1);
  return err;
}


x86 assembly (clang, -O0):
<imgReadImgTga>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read_tga@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imgReadImgTga>:
mov    $0x1,%edx
jmp    1030 <read_tga@plt>

LLVM IR (-O0):
%struct.imgImage = type { i32 }
define i32 @imgReadImgTga(i8* %0, %struct.imgImage* %1) {
%3 = alloca i8*
%4 = alloca %struct.imgImage*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.imgImage* %1, %struct.imgImage** %4
%6 = load i8*, i8** %3
%7 = load %struct.imgImage*, %struct.imgImage** %4
%8 = call i32 @read_tga(i8* %6, %struct.imgImage* %7, i32 1)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.imgImage = type { i32 }
define i32 @imgReadImgTga(i8* %0, %struct.imgImage* %1) {
%3 = tail call i32 @read_tga(i8* %0, %struct.imgImage* %1, i32 1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void *runner(void *param) {
  int *p;
  FILE *f;
  p = (int *)param;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @runner(i8* nocapture readnone %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void output_color_cyan() { printf("\033[1;36m"); }


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

x86 assembly (clang, -O2):
<output_color_cyan>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[1;36m\00"
define void @output_color_cyan() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[1;36m\00"
define void @output_color_cyan() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int event_trigger(int pi, unsigned event) {
  return pigpio_command(pi, 115, event, 0, 1);
}


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

x86 assembly (clang, -O2):
<event_trigger>:
mov    %esi,%edx
mov    $0x73,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @event_trigger(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 = call i32 @pigpio_command(i32 %5, i32 115, i32 %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @event_trigger(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 115, i32 %1, i32 0, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SCLKHigh();
int /*<<< orphan*/ SCLKLow();
scalar_t__ fSDATACheck();
unsigned char bReceiveBit(void) {
  SCLKLow();
  SCLKHigh();
  if (fSDATACheck()) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<bReceiveBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <SCLKLow@plt>
mov    $0x0,%al
call   1030 <SCLKHigh@plt>
mov    $0x0,%al
call   1050 <fSDATACheck@plt>
cmp    $0x0,%rax
je     1160 <bReceiveBit+0x30>
movb   $0x1,-0x1(%rbp)
jmp    1164 <bReceiveBit+0x34>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bReceiveBit>:
push   %rax
xor    %eax,%eax
call   1040 <SCLKLow@plt>
xor    %eax,%eax
call   1030 <SCLKHigh@plt>
xor    %eax,%eax
call   1050 <fSDATACheck@plt>
test   %rax,%rax
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @bReceiveBit() {
%1 = alloca i8
%2 = call i32 (...) @SCLKLow()
%3 = call i32 (...) @SCLKHigh()
%4 = call i64 (...) @fSDATACheck()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i8 1, i8* %1
br label %8
7: ; preds = %0
store i8 0, i8* %1
br label %8
8: ; preds = %7, %6
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @bReceiveBit() {
%1 = tail call i32 (...) @SCLKLow()
%2 = tail call i32 (...) @SCLKHigh()
%3 = tail call i64 (...) @fSDATACheck()
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
int gintxor(int x, int y) {
  x ^= y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<gintxor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <gintxor+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gintxor>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%ebx
jne    111e <gintxor+0xe>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @gintxor(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
char *FindPointer(char *);
int atoi(char *);
int FindIntegerValue(char *yytext) {
  char *punt;
  int integer_value;
  punt = FindPointer(yytext);
  integer_value = atoi(punt);
  return integer_value;
}


x86 assembly (clang, -O0):
<FindIntegerValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <FindPointer@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FindIntegerValue>:
push   %rax
call   1030 <FindPointer@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>

LLVM IR (-O0):
define i32 @FindIntegerValue(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @FindPointer(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @atoi(i8* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @FindIntegerValue(i8* %0) {
%2 = tail call i8* @FindPointer(i8* %0)
%3 = tail call i32 @atoi(i8* %2)
ret i32 %3
}
int IntersectionContents(int c1, int c2) {
  int out;
  out = c1 | c2;
  if (out & 1)
    out = 1;
  return out;
}


x86 assembly (clang, -O0):
<IntersectionContents>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1129 <IntersectionContents+0x29>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntersectionContents>:
or     %esi,%edi
test   $0x1,%dil
mov    $0x1,%eax
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @IntersectionContents(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 %3, i32 1
ret i32 %6
}