xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
int uptcp_shutdown(int, int /*<<< orphan*/);
int uptcp_close(int s) { return uptcp_shutdown(s, SHUT_RDWR); }


x86 assembly (clang, -O0):
<uptcp_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ecb(%rip),%rax
mov    (%rax),%esi
call   1030 <uptcp_shutdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uptcp_close>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <uptcp_shutdown@plt>

LLVM IR (-O0):
@SHUT_RDWR = global i32 0
define i32 @uptcp_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SHUT_RDWR
%5 = call i32 @uptcp_shutdown(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
define i32 @uptcp_close(i32 %0) {
%2 = load i32, i32* @SHUT_RDWR
%3 = tail call i32 @uptcp_shutdown(i32 %0, i32 %2)
ret i32 %3
}
void gtk_label_set_label() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_set_label() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, ...);
void print_size(unsigned start, unsigned size) {
  if (!size)
    printf("- start: 0x%08x size: 0x%08x\n", start, size);
  else
    printf("- start: 0x%08x size: 0x%08x last: 0x%08x\n", start, size,
           start + size - 1);
}


x86 assembly (clang, -O0):
<print_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <print_size+0x31>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115e <print_size+0x4e>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
sub    $0x1,%ecx
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_size>:
mov    %esi,%edx
mov    %edi,%esi
test   %edx,%edx
je     112c <print_size+0x1c>
lea    (%rsi,%rdx,1),%ecx
add    $0xffffffff,%ecx
lea    0xef9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xecd(%rip),%rdi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"- start: 0x%08x size: 0x%08x\0A\00"
@.str.1 = [43 x i8] c"- start: 0x%08x size: 0x%08x last: 0x%08x\0A\00"
define void @print_size(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 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %19
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = add i32 %14, %15
%17 = sub i32 %16, 1
%18 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13, i32 %17)
br label %19
19: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"- start: 0x%08x size: 0x%08x\0A\00"
@.str.1 = [43 x i8] c"- start: 0x%08x size: 0x%08x last: 0x%08x\0A\00"
define void @print_size(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0)
br label %10
6: ; preds = %2
%7 = add i32 %0, -1
%8 = add i32 %7, %1
%9 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1, i32 %8)
br label %10
10: ; preds = %6, %4
ret void
}
/* Variables and functions */
bool nrf53_errata_6(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf53_errata_6() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf53_errata_6() {
ret i32 0
}
/* Type definitions */
struct tstat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *procprt_ENTIME_a(struct tstat *curstat, int avgval, int nsecs) {
  static char buf[9];
  strcpy(buf, " active ");
  return buf;
}


x86 assembly (clang, -O0):
<procprt_ENTIME_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0x2f00(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2eed(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_ENTIME_a>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tstat = type { i32 }
@procprt_ENTIME_a.buf = internal global [9 x i8] zeroinitializer
@.str = [9 x i8] c" active \00"
define i8* @procprt_ENTIME_a(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @strcpy(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @procprt_ENTIME_a.buf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @procprt_ENTIME_a.buf, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type { i32 }
@procprt_ENTIME_a.buf = internal global [9 x i8] zeroinitializer
@.str = [9 x i8] c" active \00"
define i8* @procprt_ENTIME_a(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @strcpy(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @procprt_ENTIME_a.buf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @procprt_ENTIME_a.buf, i64 0, i64 0)
}
void proc_args(char **args, int n) {}


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

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

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

LLVM IR (-O2):
define void @proc_args(i8** nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(double);
int main(void) {
  f(-0.0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(double -0.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(double -0.000000e+00)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ cpi_fatalf(char *, int);
int pthread_mutex_lock(int /*<<< orphan*/ *);
void lock_mutex(pthread_mutex_t *mutex) {
  int ec;
  if ((ec = pthread_mutex_lock(mutex))) {
    cpi_fatalf(("Could not lock a mutex due to error %d."), ec);
  }
}


x86 assembly (clang, -O0):
<lock_mutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1150 <lock_mutex+0x30>
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <cpi_fatalf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_mutex>:
push   %rax
call   1040 <pthread_mutex_lock@plt>
test   %eax,%eax
je     1139 <lock_mutex+0x19>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <cpi_fatalf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Could not lock a mutex due to error %d.\00"
define void @lock_mutex(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_lock(i32* %4)
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @cpi_fatalf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Could not lock a mutex due to error %d.\00"
define void @lock_mutex(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @cpi_fatalf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void error_exit(char *msg) {
  perror(msg);
  exit(errno);
}


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

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

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

LLVM IR (-O2):
@errno = global i32 0
define void @error_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @errno
%4 = tail call i32 @exit(i32 %3)
unreachable
}
__float128 from_uns_long_load_4(unsigned long *a) { return (__float128)a[4]; }


x86 assembly (clang, -O0):
<from_uns_long_load_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rdi
call   1120 <__floatunditf>
add    $0x10,%rsp
pop    %rbp
ret
nop

x86 assembly (clang, -O2):
<from_uns_long_load_4>:
push   %rax
mov    0x20(%rdi),%rdi
call   1110 <__floatunditf>
pop    %rax
ret
nopl   0x0(%rax)

LLVM IR (-O0):
define fp128 @from_uns_long_load_4(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 4
%5 = load i64, i64* %4
%6 = uitofp i64 %5 to fp128
ret fp128 %6
}

LLVM IR (-O2):
define fp128 @from_uns_long_load_4(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 4
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to fp128
ret fp128 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ init_test();
int /*<<< orphan*/ print_rdwr(int);
int main() {
  assert(init_test() == 0 && "Could not initialize.");
  print_rdwr(1024);
  print_rdwr(2048);
  print_rdwr(8192);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <init_test@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1162 <main+0x32>
mov    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1162 <main+0x32>
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x400,%edi
call   1050 <print_rdwr@plt>
mov    $0x800,%edi
call   1050 <print_rdwr@plt>
mov    $0x2000,%edi
call   1050 <print_rdwr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init_test@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
mov    $0x400,%edi
call   1050 <print_rdwr@plt>
mov    $0x800,%edi
call   1050 <print_rdwr@plt>
mov    $0x2000,%edi
call   1050 <print_rdwr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Could not initialize.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @init_test()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %5
5: ; preds = %4, %0
%6 = phi i1 [ false, %0 ], [ true, %4 ]
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @print_rdwr(i32 1024)
%10 = call i32 @print_rdwr(i32 2048)
%11 = call i32 @print_rdwr(i32 8192)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @init_test()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @print_rdwr(i32 1024)
%6 = tail call i32 @print_rdwr(i32 2048)
%7 = tail call i32 @print_rdwr(i32 8192)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LatchDrawChar(int, int, int);
scalar_t__ VW_MarkUpdateBlock(int, int, int, int);
void VWB_DrawTile8(int x, int y, int tile) {
  if (VW_MarkUpdateBlock(x, y, x + 7, y + 7))
    LatchDrawChar(x, y, tile);
}


x86 assembly (clang, -O0):
<VWB_DrawTile8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
add    $0x7,%edx
mov    -0x8(%rbp),%ecx
add    $0x7,%ecx
call   1040 <VW_MarkUpdateBlock@plt>
cmp    $0x0,%rax
je     1160 <VWB_DrawTile8+0x40>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <LatchDrawChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VWB_DrawTile8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x7(%rbp),%edx
lea    0x7(%rbx),%ecx
call   1040 <VW_MarkUpdateBlock@plt>
test   %rax,%rax
je     114b <VWB_DrawTile8+0x2b>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <LatchDrawChar@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @VWB_DrawTile8(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 7
%5 = add nsw i32 %1, 7
%6 = tail call i64 @VW_MarkUpdateBlock(i32 %0, i32 %1, i32 %4, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @LatchDrawChar(i32 %0, i32 %1, i32 %2)
br label %10
10: ; preds = %8, %3
ret void
}
unsigned long strlen_max(const char *ptr, unsigned long max) {
  unsigned long n = 0;
  while (ptr[n] && n < max)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<strlen_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113c <strlen_max+0x3c>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <strlen_max+0x4c>
jmp    115d <strlen_max+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strlen_max+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_max>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
je     1122 <strlen_max+0x22>
cmp    %rsi,%rcx
mov    %rax,%rcx
jb     1110 <strlen_max+0x10>
add    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @strlen_max(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = icmp ult i64 %4, %1
%9 = select i1 %7, i1 %8, i1 false
%10 = add nuw i64 %4, 1
br i1 %9, label %3, label %11
11: ; preds = %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
void test_4(void) {
  int i;
  int *p = &i;
  i = 1;
  *p = 2;
  __analyzer_eval(i == 2);
}


x86 assembly (clang, -O0):
<test_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_4>:
mov    $0x1,%edi
jmp    1030 <__analyzer_eval@plt>

LLVM IR (-O0):
define void @test_4() {
%1 = alloca i32
%2 = alloca i32*
store i32* %1, i32** %2
store i32 1, i32* %1
%3 = load i32*, i32** %2
store i32 2, i32* %3
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
%7 = call i32 @__analyzer_eval(i32 %6)
ret void
}

LLVM IR (-O2):
define void @test_4() {
%1 = tail call i32 @__analyzer_eval(i32 1)
ret void
}
/* Variables and functions */
void test_hel_lo() {
  int *s = NULL;
  *s = 42;
}


x86 assembly (clang, -O0):
<test_hel_lo>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @test_hel_lo() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 42, i32* %2
ret void
}

LLVM IR (-O2):
void VIDDummyVdp1SystemClipping(void) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp1SystemClipping() {
ret void
}
/* Variables and functions */
bool nrf52_errata_120(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf52_errata_120() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_120() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ run_exchange_print();
void run_oj(void) { run_exchange_print(); }


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

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

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

LLVM IR (-O2):
define void @run_oj() {
%1 = tail call i32 (...) @run_exchange_print()
ret void
}
void signed_char_shr_signed_char_unsigned_int(signed char *LHS,
                                              unsigned int RHS) {
  (*LHS) >>= RHS;
}


x86 assembly (clang, -O0):
<signed_char_shr_signed_char_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
sar    %cl,%edx
mov    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_shr_signed_char_unsigned_int>:
mov    %esi,%ecx
movsbl (%rdi),%eax
sar    %cl,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_shr_signed_char_unsigned_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = ashr i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @signed_char_shr_signed_char_unsigned_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = ashr i32 %4, %1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %0
ret void
}
int ael1002_intr_noop(struct cphy *phy) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.cphy = type opaque
define i32 @ael1002_intr_noop(%struct.cphy* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int close(int);
int tcpsocket_close(int socketfd) { return close(socketfd); }


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

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

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

LLVM IR (-O2):
define i32 @tcpsocket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int *);
struct tm *localtime(const time_t *t) {
  time_t ti = *t;
  ti -= 0 * 60;
  return gmtime(&ti);
}


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

x86 assembly (clang, -O2):
<localtime>:
push   %rax
mov    (%rdi),%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <gmtime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @localtime(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 0
store i32 %7, i32* %3
%8 = call %struct.tm* @gmtime(i32* %3)
ret %struct.tm* %8
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %0
store i32 %4, i32* %2
%5 = call %struct.tm* @gmtime(i32* %2)
ret %struct.tm* %5
}
/* Variables and functions */
int RGBclamp(int);
int YCrCb2G(int Y, int Cr, int Cb) {
  return RGBclamp(
      (500 + 1164 * (Y - 16) - 813 * (Cr - 128) - 391 * (Cb - 128)) / 1000);
}


x86 assembly (clang, -O0):
<YCrCb2G>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x10,%eax
imul   $0x48c,%eax,%eax
add    $0x1f4,%eax
mov    -0x8(%rbp),%ecx
sub    $0x80,%ecx
imul   $0x32d,%ecx,%ecx
sub    %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    $0x80,%ecx
imul   $0x187,%ecx,%ecx
sub    %ecx,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <RGBclamp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<YCrCb2G>:
imul   $0x48c,%edi,%eax
imul   $0xfffffcd3,%esi,%ecx
add    %eax,%ecx
imul   $0xfffffe79,%edx,%eax
add    %ecx,%eax
add    $0x21334,%eax
cltq
imul   $0x10624dd3,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x26,%rdi
add    %eax,%edi
jmp    1030 <RGBclamp@plt>

LLVM IR (-O0):
define i32 @YCrCb2G(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 = sub nsw i32 %7, 16
%9 = mul nsw i32 1164, %8
%10 = add nsw i32 500, %9
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 128
%13 = mul nsw i32 813, %12
%14 = sub nsw i32 %10, %13
%15 = load i32, i32* %6
%16 = sub nsw i32 %15, 128
%17 = mul nsw i32 391, %16
%18 = sub nsw i32 %14, %17
%19 = sdiv i32 %18, 1000
%20 = call i32 @RGBclamp(i32 %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @YCrCb2G(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %0, 1164
%5 = mul i32 %1, -813
%6 = mul i32 %2, -391
%7 = add i32 %4, 135988
%8 = add i32 %7, %5
%9 = add i32 %8, %6
%10 = sdiv i32 %9, 1000
%11 = tail call i32 @RGBclamp(i32 %10)
ret i32 %11
}
void MakeFullPath(root, filename, pathname) char *root;
char *filename;
char *pathname;
{
  strcpy(pathname, root);
  strcat(pathname, "/");
  strcat(pathname, filename);
}


x86 assembly (clang, -O0):
<MakeFullPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeFullPath>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %rdx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
movw   $0x2f,(%rbx,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <strcat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define void @MakeFullPath(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = call i8* @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %6
%11 = call i8* @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %6
%13 = load i8*, i8** %5
%14 = call i8* @strcat(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @MakeFullPath(i8* nocapture %0, i8* nocapture %1, i8* %2) {
%4 = tail call i8* @strcpy(i8* dereferenceable(1) %2, i8* dereferenceable(1) %0)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%6 = getelementptr i8, i8* %2, i64 %5
%7 = bitcast i8* %6 to i16*
store i16 47, i16* %7
%8 = tail call i8* @strcat(i8* dereferenceable(1) %2, i8* dereferenceable(1) %1)
ret void
}
/* Type definitions */
typedef union vec3 {
  int dummy;
} vec3;

/* Variables and functions */
union vec3 *vec3_sub(union vec3 *, union vec3 *, union vec3 const *);
union vec3 *vec3_sub_self(union vec3 *v1, const union vec3 *v2) {
  return vec3_sub(v1, v1, v2);
}


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

x86 assembly (clang, -O2):
<vec3_sub_self>:
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <vec3_sub@plt>

LLVM IR (-O0):
%union.vec3 = type { i32 }
define %union.vec3* @vec3_sub_self(%union.vec3* %0, %union.vec3* %1) {
%3 = alloca %union.vec3*
%4 = alloca %union.vec3*
store %union.vec3* %0, %union.vec3** %3
store %union.vec3* %1, %union.vec3** %4
%5 = load %union.vec3*, %union.vec3** %3
%6 = load %union.vec3*, %union.vec3** %3
%7 = load %union.vec3*, %union.vec3** %4
%8 = call %union.vec3* @vec3_sub(%union.vec3* %5, %union.vec3* %6, %union.vec3* %7)
ret %union.vec3* %8
}

LLVM IR (-O2):
%union.vec3 = type { i32 }
define %union.vec3* @vec3_sub_self(%union.vec3* %0, %union.vec3* %1) {
%3 = tail call %union.vec3* @vec3_sub(%union.vec3* %0, %union.vec3* %0, %union.vec3* %1)
ret %union.vec3* %3
}
/* Variables and functions */
int StrLength(char *);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  int length = 0;
  char *str = "Hellocpp";
  printf("Please input a string:\n");
  length = StrLength(str);
  printf("The length of the string is %d\n", length);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <StrLength@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1050 <StrLength@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Hellocpp\00"
@.str.1 = [24 x i8] c"Please input a string:\0A\00"
@.str.2 = [32 x i8] c"The length of the string is %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @StrLength(i8* %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Hellocpp\00"
@.str.2 = [32 x i8] c"The length of the string is %d\0A\00"
@str = [23 x i8] c"Please input a string:\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @StrLength(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %2)
ret void
}
int test_imm_A3int16_reg(short val) {
  return ((val) & (0xA3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A3int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xa3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A3int16_reg>:
test   $0xa3,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A3int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 163
%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_A3int16_reg(i16 signext %0) {
%2 = and i16 %0, 163
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_unable_to_open_file_msg(char *filename) {
  fprintf(stderr, "Unable to open file: %s\n", filename);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Unable to open file: %s\0A\00"
define void @print_unable_to_open_file_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Unable to open file: %s\0A\00"
define void @print_unable_to_open_file_msg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct mg_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_context(struct mg_context *);
void mg_quit(struct mg_context *ctx) { free_context(ctx); }


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

x86 assembly (clang, -O2):
<mg_quit>:
jmp    1030 <free_context@plt>

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

LLVM IR (-O2):
%struct.mg_context = type { i32 }
define void @mg_quit(%struct.mg_context* %0) {
%2 = tail call i32 @free_context(%struct.mg_context* %0)
ret void
}
const char *qrVersion(void) { return "0.3.1"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"0.3.1\00"
define i8* @qrVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.3.1\00"
define i8* @qrVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
__attribute__((visibility("default"))) void
gbm_surface_release_buffer(struct gbm_surface *surface, struct gbm_bo *bo) {}


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

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

LLVM IR (-O0):
%struct.gbm_surface = type opaque
%struct.gbm_bo = type opaque
define void @gbm_surface_release_buffer(%struct.gbm_surface* %0, %struct.gbm_bo* %1) {
%3 = alloca %struct.gbm_surface*
%4 = alloca %struct.gbm_bo*
store %struct.gbm_surface* %0, %struct.gbm_surface** %3
store %struct.gbm_bo* %1, %struct.gbm_bo** %4
ret void
}

LLVM IR (-O2):
%struct.gbm_surface = type opaque
%struct.gbm_bo = type opaque
define void @gbm_surface_release_buffer(%struct.gbm_surface* nocapture %0, %struct.gbm_bo* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ YabauseStartSlave();
void SmpcSSHON() { YabauseStartSlave(); }


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

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

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

LLVM IR (-O2):
define void @SmpcSSHON() {
%1 = tail call i32 (...) @YabauseStartSlave()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm getLocalTime() {
  time_t rawtime;
  time(&rawtime);
  return *localtime(&rawtime);
}


x86 assembly (clang, -O0):
<getLocalTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLocalTime>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @getLocalTime() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = call i32 @time(i32* %2)
%4 = call %struct.tm* @localtime(i32* %2)
%5 = bitcast %struct.tm* %1 to i8*
%6 = bitcast %struct.tm* %4 to i8*
%7 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @getLocalTime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
int c019(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @c019() {
ret i32 0
}

LLVM IR (-O2):
define i32 @c019() {
ret i32 0
}
/* Type definitions */
struct lobject {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lobject *lobject_method_call(struct lemon *, struct lobject *, int,
                                    int /*<<< orphan*/, int /*<<< orphan*/ *);
struct lobject *lobject_unop(struct lemon *lemon, int method,
                             struct lobject *a) {
  return lobject_method_call(lemon, a, method, 0, NULL);
}


x86 assembly (clang, -O0):
<lobject_unop>:
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    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <lobject_method_call@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lobject_unop>:
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <lobject_method_call@plt>

LLVM IR (-O0):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lobject_unop(%struct.lemon* %0, i32 %1, %struct.lobject* %2) {
%4 = alloca %struct.lemon*
%5 = alloca i32
%6 = alloca %struct.lobject*
store %struct.lemon* %0, %struct.lemon** %4
store i32 %1, i32* %5
store %struct.lobject* %2, %struct.lobject** %6
%7 = load %struct.lemon*, %struct.lemon** %4
%8 = load %struct.lobject*, %struct.lobject** %6
%9 = load i32, i32* %5
%10 = call %struct.lobject* @lobject_method_call(%struct.lemon* %7, %struct.lobject* %8, i32 %9, i32 0, i32* null)
ret %struct.lobject* %10
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lobject_unop(%struct.lemon* %0, i32 %1, %struct.lobject* %2) {
%4 = tail call %struct.lobject* @lobject_method_call(%struct.lemon* %0, %struct.lobject* %2, i32 %1, i32 0, i32* null)
ret %struct.lobject* %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int system(char *);
void GetOpenCLCode(void) {
  int status;
  status = system("sh get_opencl_code.sh");
  assert(status == 0);
}


x86 assembly (clang, -O0):
<GetOpenCLCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetOpenCLCode>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"sh get_opencl_code.sh\00"
define void @GetOpenCLCode() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"sh get_opencl_code.sh\00"
define void @GetOpenCLCode() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
char toupper(int /*<<< orphan*/);
char skipbl() {
  char c;
  while ((c = toupper(getchar())) == ' ' || c == '\t')
    ;
  return c;
}


x86 assembly (clang, -O0):
<skipbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1157 <skipbl+0x37>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1167 <skipbl+0x47>
jmp    116c <skipbl+0x4c>
jmp    1128 <skipbl+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipbl>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%edi
call   1030 <toupper@plt>
cmp    $0x9,%al
je     1130 <skipbl+0x10>
cmp    $0x20,%al
je     1130 <skipbl+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @skipbl() {
%1 = alloca i8
br label %2
2: ; preds = %13, %0
%3 = call i32 (...) @getchar()
%4 = call signext i8 @toupper(i32 %3)
store i8 %4, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br label %11
11: ; preds = %7, %2
%12 = phi i1 [ true, %2 ], [ %10, %7 ]
br i1 %12, label %13, label %14
13: ; preds = %11
br label %2
14: ; preds = %11
%15 = load i8, i8* %1
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @skipbl() {
br label %1
1: ; preds = %4, %0
%2 = tail call i32 (...) @getchar()
%3 = tail call signext i8 @toupper(i32 %2)
switch i8 %3, label %5 [
i8 32, label %4
i8 9, label %4
]
4: ; preds = %1, %1
br label %1
5: ; preds = %1
ret i8 %3
}
put2d(cp, i, cl, ct) char *cp, cl, ct;
unsigned i;
{
  *cp = ct;
  *--cp = i % 10 + '0';
  if (i /= 10)
    *--cp = i + '0';
  else
    *--cp = cl;
}


x86 assembly (clang, -O0):
<put2d>:
push   %rbp
mov    %rsp,%rbp
mov    %ecx,%eax
mov    %dl,%cl
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %cl,-0x15(%rbp)
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1178 <put2d+0x78>
mov    -0x14(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
jmp    118d <put2d+0x8d>
mov    -0x15(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<put2d>:
mov    %cl,(%rdi)
mov    %esi,%eax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,1),%eax
lea    (%rax,%rax,4),%r8d
mov    %esi,%eax
sub    %r8d,%eax
or     $0x30,%al
mov    %al,-0x1(%rdi)
add    $0x30,%cl
cmp    $0xa,%esi
movzbl %cl,%eax
cmovb  %edx,%eax
mov    %al,-0x2(%rdi)
ret

LLVM IR (-O0):
define i32 @put2d(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = trunc i32 %2 to i8
%11 = trunc i32 %3 to i8
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8 %10, i8* %8
store i8 %11, i8* %9
%12 = load i8, i8* %9
%13 = load i8*, i8** %6
store i8 %12, i8* %13
%14 = load i32, i32* %7
%15 = urem i32 %14, 10
%16 = add i32 %15, 48
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %6
%19 = getelementptr inbounds i8, i8* %18, i32 -1
store i8* %19, i8** %6
store i8 %17, i8* %19
%20 = load i32, i32* %7
%21 = udiv i32 %20, 10
store i32 %21, i32* %7
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %29
23: ; preds = %4
%24 = load i32, i32* %7
%25 = add i32 %24, 48
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %6
%28 = getelementptr inbounds i8, i8* %27, i32 -1
store i8* %28, i8** %6
store i8 %26, i8* %28
br label %33
29: ; preds = %4
%30 = load i8, i8* %8
%31 = load i8*, i8** %6
%32 = getelementptr inbounds i8, i8* %31, i32 -1
store i8* %32, i8** %6
store i8 %30, i8* %32
br label %33
33: ; preds = %29, %23
%34 = load i32, i32* %5
ret i32 %34
}

LLVM IR (-O2):
define i32 @put2d(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = trunc i32 %3 to i8
store i8 %5, i8* %0
%6 = urem i32 %1, 10
%7 = udiv i32 %1, 10
%8 = trunc i32 %6 to i8
%9 = or i8 %8, 48
%10 = getelementptr inbounds i8, i8* %0, i64 -1
store i8 %9, i8* %10
%11 = icmp ult i32 %1, 10
%12 = trunc i32 %2 to i8
%13 = trunc i32 %7 to i8
%14 = add i8 %13, 48
%15 = select i1 %11, i8 %12, i8 %14
%16 = getelementptr inbounds i8, i8* %0, i64 -2
store i8 %15, i8* %16
ret i32 undef
}
void tube_log_performance_counters() { ; }


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

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

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

LLVM IR (-O2):
define void @tube_log_performance_counters() {
ret void
}
/* Variables and functions */
int strlen(char const *);
int write(int, char const *, int);
int serial_puts(int fd, const char *str) {
  int len = strlen(str);
  return write(fd, str, len);
}


x86 assembly (clang, -O0):
<serial_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @serial_puts(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
int debugger_break_match(struct pt_regs *regs) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pt_regs = type opaque
define i32 @debugger_break_match(%struct.pt_regs* nocapture readnone %0) {
ret i32 0
}
int numeric(const int *p1, const int *p2) { return (*p1 - *p2); }


x86 assembly (clang, -O0):
<numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @numeric(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}