xunge/DecIR huggingface dataset:
/* Type definitions */
struct sched_param {
  int /*<<< orphan*/ sched_priority;
};

/* Variables and functions */
int /*<<< orphan*/ SCHED_FIFO;
int /*<<< orphan*/ sched_get_priority_max(int /*<<< orphan*/);
int sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                       struct sched_param *);
int fix_priority(void) {
  struct sched_param sp = {
      .sched_priority = sched_get_priority_max(SCHED_FIFO),
  };
  return sched_setscheduler(0, SCHED_FIFO, &sp);
}


x86 assembly (clang, -O0):
<fix_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1040 <sched_get_priority_max@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_priority>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rbx
mov    (%rbx),%edi
call   1040 <sched_get_priority_max@plt>
mov    %eax,0x8(%rsp)
mov    (%rbx),%esi
lea    0x8(%rsp),%rdx
xor    %edi,%edi
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
define i32 @fix_priority() {
%1 = alloca %struct.sched_param
%2 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i32 0, i32 0
%3 = load i32, i32* @SCHED_FIFO
%4 = call i32 @sched_get_priority_max(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* @SCHED_FIFO
%6 = call i32 @sched_setscheduler(i32 0, i32 %5, %struct.sched_param* %1)
ret i32 %6
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
define i32 @fix_priority() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
%4 = load i32, i32* @SCHED_FIFO
%5 = tail call i32 @sched_get_priority_max(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* @SCHED_FIFO
%7 = call i32 @sched_setscheduler(i32 0, i32 %6, %struct.sched_param* %1)
ret i32 %7
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_quaddobl_random_coefficient_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(470, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_quaddobl_random_coefficient_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1d6,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_quaddobl_random_coefficient_system>:
mov    $0x1d6,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @celcon_quaddobl_random_coefficient_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 470, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_quaddobl_random_coefficient_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 470, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ shm_del();
void sig_clean(int signo) {
  printf("catch %d\n", signo);
  shm_del();
}


x86 assembly (clang, -O0):
<sig_clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <shm_del@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_clean>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <shm_del@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"catch %d\0A\00"
define void @sig_clean(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @shm_del()
ret void
}
/* Variables and functions */
scalar_t__ calloc(scalar_t__, int);
void *strcpy(char *, char *);
scalar_t__ strlen(char *);
void *ParseArg_parseStr(char *str) {
  return strcpy((char *)calloc(strlen(str) + 1, sizeof(char)), str);
}


x86 assembly (clang, -O0):
<ParseArg_parseStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseArg_parseStr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @ParseArg_parseStr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i64 @calloc(i64 %5, i32 1)
%7 = inttoptr i64 %6 to i8*
%8 = load i8*, i8** %2
%9 = call i8* @strcpy(i8* %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @ParseArg_parseStr(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @calloc(i64 %3, i32 1)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
ret i8* %5
}
/* Variables and functions */
int tracepoint_probe_register(char *, void *);
__attribute__((always_)) int
register_trace_mm_pagevec_free(void (*probe)(struct page *page, int cold)) {
  return tracepoint_probe_register("mm_pagevec_free", (void *)probe);
}


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

x86 assembly (clang, -O2):
<register_trace_mm_pagevec_free>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <tracepoint_probe_register@plt>

LLVM IR (-O0):
%struct.page = type opaque
@.str = [16 x i8] c"mm_pagevec_free\00"
define i32 @register_trace_mm_pagevec_free(void (%struct.page*, i32)* %0) {
%2 = alloca void (%struct.page*, i32)*
store void (%struct.page*, i32)* %0, void (%struct.page*, i32)** %2
%3 = load void (%struct.page*, i32)*, void (%struct.page*, i32)** %2
%4 = bitcast void (%struct.page*, i32)* %3 to i8*
%5 = call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.page = type opaque
@.str = [16 x i8] c"mm_pagevec_free\00"
define i32 @register_trace_mm_pagevec_free(void (%struct.page*, i32)* %0) {
%2 = bitcast void (%struct.page*, i32)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __chk_fail();
char *memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *__stpcpy_chk(char *dest, const char *src, size_t destlen) {
  size_t len = strlen(src);
  if (len >= destlen)
    __chk_fail();
  return memcpy(dest, src, len + 1) + len;
}


x86 assembly (clang, -O0):
<__stpcpy_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1166 <__stpcpy_chk+0x36>
mov    $0x0,%al
call   1040 <__chk_fail@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0x1,%rdx
call   1050 <memcpy@plt>
add    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stpcpy_chk>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%r15
cmp    %r12,%rax
jb     1158 <__stpcpy_chk+0x28>
xor    %eax,%eax
call   1040 <__chk_fail@plt>
lea    0x1(%r15),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <memcpy@plt>
add    %r15,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @__stpcpy_chk(i8* writeonly %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (...) @__chk_fail()
br label %8
8: ; preds = %6, %3
%9 = add i64 %4, 1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %9, i1 false)
%10 = getelementptr inbounds i8, i8* %0, i64 %4
ret i8* %10
}
/* Variables and functions */
int abs(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a1;
  int n = 1;
  int S;
  scanf("%d", &a1);
  S = ((a1 + n) * (abs(a1 - n) + n)) / 2;
  printf("%d", S);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ecx
lea    -0x1(%rax),%edx
mov    $0x1,%edi
sub    %eax,%edi
test   %eax,%eax
cmovg  %edx,%edi
add    $0x1,%edi
imul   %ecx,%edi
mov    %edi,%esi
shr    $0x1f,%esi
add    %edi,%esi
sar    %esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = call i32 @abs(i32 %11)
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = mul nsw i32 %8, %14
%16 = sdiv i32 %15, 2
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
%6 = add nsw i32 %4, -1
%7 = icmp slt i32 %4, 1
%8 = sub i32 1, %4
%9 = select i1 %7, i32 %8, i32 %6
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %10, %5
%12 = sdiv i32 %11, 2
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int *);
int /*<<< orphan*/ foo(int /*<<< orphan*/, int);
void baz(void) {
  int a = 42;
  int *b = &a;
  foo(bar(&a), 3);
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2a,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <bar@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1040 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
push   %rax
movl   $0x2a,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <bar@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1040 <foo@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @baz() {
%1 = alloca i32
%2 = alloca i32*
store i32 42, i32* %1
store i32* %1, i32** %2
%3 = call i32 @bar(i32* %1)
%4 = call i32 @foo(i32 %3, i32 3)
ret void
}

LLVM IR (-O2):
define void @baz() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 42, i32* %1
%3 = call i32 @bar(i32* %1)
%4 = call i32 @foo(i32 %3, i32 3)
ret void
}
int main() {
  float variable_local;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ VT_Print_Hex_Val(int);
int /*<<< orphan*/ VT_Transmit(char);
int bin2bcd8(int);
void VT_Move(uint8_t num, char dir) {
  VT_Transmit('\x1B');
  VT_Transmit('[');
  if (num > 1) {
    num = bin2bcd8(num);
    VT_Print_Hex_Val(num);
  }
  VT_Transmit(dir);
}


x86 assembly (clang, -O0):
<VT_Move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x1b,%edi
call   1030 <VT_Transmit@plt>
mov    $0x5b,%edi
call   1030 <VT_Transmit@plt>
cmpl   $0x1,-0x4(%rbp)
jle    1172 <VT_Move+0x42>
mov    -0x4(%rbp),%edi
call   1040 <bin2bcd8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <VT_Print_Hex_Val@plt>
movsbl -0x5(%rbp),%edi
call   1030 <VT_Transmit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VT_Move>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1b,%edi
call   1030 <VT_Transmit@plt>
mov    $0x5b,%edi
call   1030 <VT_Transmit@plt>
cmp    $0x2,%ebp
jl     115e <VT_Move+0x2e>
mov    %ebp,%edi
call   1040 <bin2bcd8@plt>
mov    %eax,%edi
call   1050 <VT_Print_Hex_Val@plt>
movsbl %bl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <VT_Transmit@plt>

LLVM IR (-O0):
define void @VT_Move(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = call i32 @VT_Transmit(i8 signext 27)
%6 = call i32 @VT_Transmit(i8 signext 91)
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %3
%11 = call i32 @bin2bcd8(i32 %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @VT_Print_Hex_Val(i32 %12)
br label %14
14: ; preds = %9, %2
%15 = load i8, i8* %4
%16 = call i32 @VT_Transmit(i8 signext %15)
ret void
}

LLVM IR (-O2):
define void @VT_Move(i32 %0, i8 signext %1) {
%3 = tail call i32 @VT_Transmit(i8 signext 27)
%4 = tail call i32 @VT_Transmit(i8 signext 91)
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @bin2bcd8(i32 %0)
%8 = tail call i32 @VT_Print_Hex_Val(i32 %7)
br label %9
9: ; preds = %6, %2
%10 = tail call i32 @VT_Transmit(i8 signext %1)
ret void
}
OP(ed, e5) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
short __attribute__((no)) vsrt() { return (short)42; }


x86 assembly (clang, -O0):
<vsrt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsrt>:
mov    $0x2a,%ax
ret

LLVM IR (-O0):
define signext i16 @vsrt() {
ret i16 42
}

LLVM IR (-O2):
define signext i16 @vsrt() {
ret i16 42
}
void brcmf_debugfs_create_fws_stats(struct brcmf_pub *drvr,
                                    struct brcmf_fws_stats *stats) {}


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

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

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

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
%struct.brcmf_fws_stats = type opaque
define void @brcmf_debugfs_create_fws_stats(%struct.brcmf_pub* nocapture %0, %struct.brcmf_fws_stats* nocapture %1) {
ret void
}
void RTVfsNewFsStream(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsNewFsStream() {
ret void
}
void av_hash_final_bin() {}


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

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

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

LLVM IR (-O2):
define void @av_hash_final_bin() {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
void *to_nit_file_stat(struct stat *);
void *string_NativeString_NativeString_file_stat_0(char *f) {
  struct stat buff;
  if (stat(f, &buff) != -1)
    return to_nit_file_stat(&buff);
  return 0;
}


x86 assembly (clang, -O0):
<string_NativeString_NativeString_file_stat_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1154 <string_NativeString_NativeString_file_stat_0+0x34>
lea    -0x18(%rbp),%rdi
call   1040 <to_nit_file_stat@plt>
mov    %rax,-0x8(%rbp)
jmp    115c <string_NativeString_NativeString_file_stat_0+0x3c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_NativeString_NativeString_file_stat_0>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1138 <string_NativeString_NativeString_file_stat_0+0x18>
mov    %rsp,%rdi
call   1040 <to_nit_file_stat@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i8* @string_NativeString_NativeString_file_stat_0(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i8* @to_nit_file_stat(%struct.stat* %2)
br label %8
8: ; preds = %1, %6
%9 = phi i8* [ %7, %6 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
size_t xstrlen(char *);
int /*<<< orphan*/ xstrncpy(char *, char const *, size_t);
char *xstrncat(char *restrict dest, const char *restrict src, size_t n) {
  size_t len = xstrlen(dest);
  xstrncpy(dest, src, n);
  return dest;
}


x86 assembly (clang, -O0):
<xstrncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xstrlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <xstrncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <xstrlen@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <xstrncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xstrncat(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i64 @xstrlen(i8* %8)
store i64 %9, i64* %7
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 @xstrncpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @xstrncat(i8* noalias returned %0, i8* noalias %1, i64 %2) {
%4 = tail call i64 @xstrlen(i8* %0)
%5 = tail call i32 @xstrncpy(i8* %0, i8* %1, i64 %2)
ret i8* %0
}
int Media_GetVolume() { return 65535; }


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

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

LLVM IR (-O0):
define i32 @Media_GetVolume() {
ret i32 65535
}

LLVM IR (-O2):
define i32 @Media_GetVolume() {
ret i32 65535
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tqbq_common(int, char **, int);
void bottomq_cmd(int argc, char *argv[]) {
  if (argc < 3) {
    printf("usage: bottomq printer [jobspec ...]\n");
    return;
  }
  --argc;
  ++argv;
  tqbq_common(argc, argv, 2);
}


x86 assembly (clang, -O0):
<bottomq_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    114a <bottomq_cmd+0x2a>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
jmp    1170 <bottomq_cmd+0x50>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <tqbq_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bottomq_cmd>:
cmp    $0x2,%edi
jg     1131 <bottomq_cmd+0x11>
lea    0xed4(%rip),%rdi
jmp    1030 <puts@plt>
add    $0xffffffff,%edi
add    $0x8,%rsi
mov    $0x2,%edx
jmp    1040 <tqbq_common@plt>

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

LLVM IR (-O2):
@str = [37 x i8] c"usage: bottomq printer [jobspec ...]\00"
define void @bottomq_cmd(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = tail call i32 @tqbq_common(i32 %7, i8** %8, i32 2)
br label %10
10: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef int GLenum;

/* Variables and functions */
int GL_NO_ERROR;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int glGetError();
int /*<<< orphan*/ stderr;
void checkError(const char *functionName) {
  GLenum error;
  while ((error = glGetError()) != GL_NO_ERROR) {
    fprintf(stderr, "GL error 0x%X detected in %s\n", error, functionName);
  }
}


x86 assembly (clang, -O0):
<checkError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <glGetError@plt>
mov    %eax,-0xc(%rbp)
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
je     1166 <checkError+0x46>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
jmp    112c <checkError+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkError>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <glGetError@plt>
mov    0x2eaf(%rip),%r15
cmp    (%r15),%eax
je     116d <checkError+0x4d>
mov    0x2e93(%rip),%r12
lea    0xeb4(%rip),%r14
nopl   0x0(%rax)
mov    (%r12),%edi
mov    %r14,%rsi
mov    %eax,%edx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <glGetError@plt>
cmp    (%r15),%eax
jne    1150 <checkError+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@GL_NO_ERROR = global i32 0
@stderr = global i32 0
@.str = [30 x i8] c"GL error 0x%X detected in %s\0A\00"
define void @checkError(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %8, %1
%5 = call i32 (...) @glGetError()
store i32 %5, i32* %3
%6 = load i32, i32* @GL_NO_ERROR
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i32, i32* @stderr
%10 = load i32, i32* %3
%11 = load i8*, i8** %2
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %11)
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@GL_NO_ERROR = global i32 0
@stderr = global i32 0
@.str = [30 x i8] c"GL error 0x%X detected in %s\0A\00"
define void @checkError(i8* %0) {
%2 = tail call i32 (...) @glGetError()
%3 = load i32, i32* @GL_NO_ERROR
%4 = icmp eq i32 %2, %3
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ %2, %1 ]
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %0)
%9 = tail call i32 (...) @glGetError()
%10 = load i32, i32* @GL_NO_ERROR
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %5
12: ; preds = %5, %1
ret void
}
int searchFile(char *fileName, char *search) { char line[512]; }


x86 assembly (clang, -O0):
<searchFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @searchFile(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [512 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @searchFile(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
void zero_fill_from(unsigned char buf[], int from, int to) {
  int i;
  for (i = from; i < to; i++)
    buf[i] = 0;
}


x86 assembly (clang, -O0):
<zero_fill_from>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    113a <zero_fill_from+0x3a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <zero_fill_from+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_fill_from>:
cmp    %edx,%esi
jge    1133 <zero_fill_from+0x23>
push   %rax
mov    %esi,%eax
movslq %esi,%rcx
add    %rcx,%rdi
not    %eax
add    %edx,%eax
add    $0x1,%rax
xor    %esi,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zero_fill_from(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr i8, i8* %0, i64 %6
%8 = xor i32 %1, -1
%9 = add i32 %8, %2
%10 = zext i32 %9 to i64
%11 = add nuw nsw i64 %10, 1
br label %12
12: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 0;
  int j = 0;
  for (i = 0; i < 64; ++i) {
    j = i;
  }
  printf("i = %d, j = %d\n", i, j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jge    1152 <main+0x42>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"i = %d, j = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 64, i32 63)
ret i32 0
}
int compare_ints(const void *v1, const void *v2) {
  int *i1, *i2;
  i1 = (int *)v1;
  i2 = (int *)v2;
  if (*i1 < *i2)
    return -1;
  if (*i1 == *i2)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<compare_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <compare_ints+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <compare_ints+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    1158 <compare_ints+0x58>
movl   $0x0,-0x4(%rbp)
jmp    115f <compare_ints+0x5f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ints>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_ints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp ne i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void setchar(unsigned int line, unsigned int off, unsigned char character) {
  unsigned char *videoram = (unsigned char *)0xB8000;
  videoram[line * 80 * 2 + 2 * off] = character;
  videoram[line * 80 * 2 + 2 * off + 1] = 0x07;
}


x86 assembly (clang, -O0):
<setchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x18(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x18(%rbp),%rax
imul   $0x50,-0x4(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
add    %esi,%ecx
mov    %ecx,%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
imul   $0x50,-0x4(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
movb   $0x7,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setchar>:
lea    (%rdi,%rdi,4),%eax
shl    $0x5,%eax
lea    (%rax,%rsi,2),%eax
mov    %dl,0xb8000(%rax)
movb   $0x7,0xb8001(%rax)
ret

LLVM IR (-O0):
define void @setchar(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
store i8* inttoptr (i64 753664 to i8*), i8** %7
%8 = load i8, i8* %6
%9 = load i8*, i8** %7
%10 = load i32, i32* %4
%11 = mul i32 %10, 80
%12 = mul i32 %11, 2
%13 = load i32, i32* %5
%14 = mul i32 2, %13
%15 = add i32 %12, %14
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %9, i64 %16
store i8 %8, i8* %17
%18 = load i8*, i8** %7
%19 = load i32, i32* %4
%20 = mul i32 %19, 80
%21 = mul i32 %20, 2
%22 = load i32, i32* %5
%23 = mul i32 2, %22
%24 = add i32 %21, %23
%25 = add i32 %24, 1
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %18, i64 %26
store i8 7, i8* %27
ret void
}

LLVM IR (-O2):
define void @setchar(i32 %0, i32 %1, i8 zeroext %2) {
%4 = mul i32 %0, 160
%5 = shl i32 %1, 1
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %7
store i8 %2, i8* %8
%9 = or i32 %6, 1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %10
store i8 7, i8* %11
ret void
}
/* Variables and functions */
float dloglaplace_logscale(float, float, float, float);
float laplace(float, float, float, float);
float dlaplace_logscale(float x, float loc, float sc, float logsc) {
  return laplace(x, loc, sc, logsc) * dloglaplace_logscale(x, loc, sc, logsc);
}


x86 assembly (clang, -O0):
<dlaplace_logscale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <laplace@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1040 <dloglaplace_logscale@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlaplace_logscale>:
sub    $0x18,%rsp
movss  %xmm3,0x10(%rsp)
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
call   1030 <laplace@plt>
movss  %xmm0,0x14(%rsp)
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
call   1040 <dloglaplace_logscale@plt>
mulss  0x14(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @dlaplace_logscale(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
%13 = call float @laplace(float %9, float %10, float %11, float %12)
%14 = load float, float* %5
%15 = load float, float* %6
%16 = load float, float* %7
%17 = load float, float* %8
%18 = call float @dloglaplace_logscale(float %14, float %15, float %16, float %17)
%19 = fmul float %13, %18
ret float %19
}

LLVM IR (-O2):
define float @dlaplace_logscale(float %0, float %1, float %2, float %3) {
%5 = tail call float @laplace(float %0, float %1, float %2, float %3)
%6 = tail call float @dloglaplace_logscale(float %0, float %1, float %2, float %3)
%7 = fmul float %5, %6
ret float %7
}
/* Type definitions */
struct dns_socket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dns_so_closefds(struct dns_socket *, int);
int /*<<< orphan*/ dns_so_reset(struct dns_socket *);
void dns_so_destroy(struct dns_socket *so) {
  dns_so_reset(so);
  dns_so_closefds(so, (0x01 | 0x02 | 0x04));
}


x86 assembly (clang, -O0):
<dns_so_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dns_so_reset@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
call   1030 <dns_so_closefds@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_so_destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <dns_so_reset@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
pop    %rbx
jmp    1030 <dns_so_closefds@plt>

LLVM IR (-O0):
%struct.dns_socket = type { i32 }
define void @dns_so_destroy(%struct.dns_socket* %0) {
%2 = alloca %struct.dns_socket*
store %struct.dns_socket* %0, %struct.dns_socket** %2
%3 = load %struct.dns_socket*, %struct.dns_socket** %2
%4 = call i32 @dns_so_reset(%struct.dns_socket* %3)
%5 = load %struct.dns_socket*, %struct.dns_socket** %2
%6 = call i32 @dns_so_closefds(%struct.dns_socket* %5, i32 7)
ret void
}

LLVM IR (-O2):
%struct.dns_socket = type { i32 }
define void @dns_so_destroy(%struct.dns_socket* %0) {
%2 = tail call i32 @dns_so_reset(%struct.dns_socket* %0)
%3 = tail call i32 @dns_so_closefds(%struct.dns_socket* %0, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strfry(char *);
void secure_clear(void *data, size_t size) {
  char *_data = (char *)data;
  char tmp = _data[size];
  _data[size] = 0;
  strfry(_data);
  _data[size] = tmp;
  return;
}


x86 assembly (clang, -O0):
<secure_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
call   1030 <strfry@plt>
mov    -0x19(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_clear>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,1),%bpl
movb   $0x0,(%rdi,%rsi,1)
call   1030 <strfry@plt>
mov    %bpl,(%rbx,%r14,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @secure_clear(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i64, i64* %4
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %6
%12 = load i8*, i8** %5
%13 = load i64, i64* %4
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %5
%16 = call i32 @strfry(i8* %15)
%17 = load i8, i8* %6
%18 = load i8*, i8** %5
%19 = load i64, i64* %4
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 %17, i8* %20
ret void
}

LLVM IR (-O2):
define void @secure_clear(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
store i8 0, i8* %3
%5 = tail call i32 @strfry(i8* %0)
store i8 %4, i8* %3
ret void
}
void stop() {}


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

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

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

LLVM IR (-O2):
define void @stop() {
ret void
}
void dbg_dump_tnc(struct ubifs_info *c) { return; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define void @dbg_dump_tnc(%struct.ubifs_info* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned char GetByte319();
unsigned char getbyte() { return GetByte319(); }


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

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

LLVM IR (-O0):
define zeroext i8 @getbyte() {
%1 = call zeroext i8 (...) @GetByte319()
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @getbyte() {
%1 = tail call zeroext i8 (...) @GetByte319()
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *checkinput(int c, char *string, int length) {
  if (c == '\003') {
    endwin();
    exit(0);
  }
  return string;
}


x86 assembly (clang, -O0):
<checkinput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    114a <checkinput+0x2a>
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkinput>:
cmp    $0x3,%edi
je     1129 <checkinput+0x9>
mov    %rsi,%rax
ret
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i8* @checkinput(i32 %0, i8* readnone returned %1, i32 %2) {
%4 = icmp eq i32 %0, 3
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = tail call i32 (...) @endwin()
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %3
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("天");
  puts("地");
  puts("人");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"\E5\A4\A9\00"
@.str.1 = [4 x i8] c"\E5\9C\B0\00"
@.str.2 = [4 x i8] c"\E4\BA\BA\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\E5\A4\A9\00"
@.str.1 = [4 x i8] c"\E5\9C\B0\00"
@.str.2 = [4 x i8] c"\E4\BA\BA\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int myGetlineV1(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1024];
  while ((len = myGetlineV1(line, 1024)) > 0) {
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1040 <myGetlineV1@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1167 <main+0x47>
lea    -0x410(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1040 <myGetlineV1@plt>
test   %eax,%eax
jle    116c <main+0x4c>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <myGetlineV1@plt>
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @myGetlineV1(i8* %2, i32 1024)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0, %5
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i32 @myGetlineV1(i8* %2, i32 1024)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5, %0
ret i32 0
}