xunge/DecIR huggingface dataset:
void mem_a(a, N) int **a;
const int N;
{ *a = (int *)malloc(N * sizeof(int)); }


x86 assembly (clang, -O0):
<mem_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rdi
shl    $0x2,%rdi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_a>:
push   %rbx
mov    %rdi,%rbx
movslq %esi,%rdi
shl    $0x2,%rdi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @mem_a(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 = sext i32 %5 to i64
%7 = mul i64 %6, 4
%8 = call i8* @malloc(i64 %7)
%9 = bitcast i8* %8 to i32*
%10 = load i32**, i32*** %3
store i32* %9, i32** %10
ret void
}

LLVM IR (-O2):
define void @mem_a(i32** nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = shl nsw i64 %3, 2
%5 = tail call i8* @malloc(i64 %4)
%6 = bitcast i32** %0 to i8**
store i8* %5, i8** %6
ret void
}
void DRM_free(file, line, func, ptr) char *file, *func;
int line;
void *ptr;
{
  DRM_del(ptr);
  free(ptr);
}


x86 assembly (clang, -O0):
<DRM_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <DRM_del@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DRM_free>:
push   %rbx
mov    %rcx,%rbx
mov    %rcx,%rdi
xor    %eax,%eax
call   1040 <DRM_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @DRM_free(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @DRM_del to i32 (i8*, ...)*)(i8* %9)
%11 = load i8*, i8** %8
ret void
}

LLVM IR (-O2):
define void @DRM_free(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DRM_del to i32 (i8*, ...)*)(i8* %3)
tail call void @free(i8* %3)
ret void
}
int uadd_ok(unsigned x, unsigned y) {
  unsigned result = x + y;
  return result >= x;
}


x86 assembly (clang, -O0):
<uadd_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uadd_ok>:
not    %edi
xor    %eax,%eax
cmp    %esi,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @uadd_ok(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp uge i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @uadd_ok(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = icmp uge i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
extern size_t vec_cap(void *vec) {
  return (*(size_t *)(((char *)vec - (sizeof(size_t) * 3))));
}


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

x86 assembly (clang, -O2):
<vec_cap>:
mov    -0x18(%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @vec_cap(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -24
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
int shell_status(result)
int result;
{
  return ((((*(int *)&(result)) & 0xFF) == 0))
             ? (((*(int *)&(result)) >> 8) & 0xFF)
             : -1;
}


x86 assembly (clang, -O0):
<shell_status>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
jne    112b <shell_status+0x2b>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <shell_status+0x38>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <shell_status+0x38>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_status>:
mov    %edi,%eax
movzbl %ah,%ecx
neg    %al
sbb    %eax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @shell_status(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ -1, %10 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @shell_status(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 0
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = select i1 %3, i32 %5, i32 -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  unsigned x = 3;
  signed y = 4;
  assert((0 ? x : y) == 4);
  assert((1 ? x : y) == 3);
  assert((0 ? &x : NULL) == NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x3,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 4, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 @assert(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ show_help(char *);
int mainreadhelp() {
  show_help("help/mainreadhelp");
  return 1;
}


x86 assembly (clang, -O0):
<mainreadhelp>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <show_help@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainreadhelp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <show_help@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"help/mainreadhelp\00"
define i32 @mainreadhelp() {
%1 = call i32 @show_help(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [18 x i8] c"help/mainreadhelp\00"
define i32 @mainreadhelp() {
%1 = tail call i32 @show_help(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
int test_imm_ACint64_lowword_mem(long long *val) {
  return ((*val) & (0xAC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ACint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 172
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ put_word(int, int);
__attribute__((always_)) void patch_CAS_3_1_0_392_extra(void) {
  put_word(0x100B19EC, 0xEAFFFFFE);
}


x86 assembly (clang, -O0):
<patch_CAS_3_1_0_392_extra>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100b19ec,%edi
mov    $0xeafffffe,%esi
call   1030 <put_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<patch_CAS_3_1_0_392_extra>:
mov    $0x100b19ec,%edi
mov    $0xeafffffe,%esi
jmp    1030 <put_word@plt>

LLVM IR (-O0):
define void @patch_CAS_3_1_0_392_extra() {
%1 = call i32 @put_word(i32 269162988, i32 -352321538)
ret void
}

LLVM IR (-O2):
define void @patch_CAS_3_1_0_392_extra() {
%1 = tail call i32 @put_word(i32 269162988, i32 -352321538)
ret void
}
unsigned int fiolSReadChar(const char *src, char *dst) {
  if (src[0] != '\0') {
    if (dst)
      (*dst) = src[0];
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fiolSReadChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113f <fiolSReadChar+0x3f>
cmpq   $0x0,-0x18(%rbp)
je     1133 <fiolSReadChar+0x33>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1146 <fiolSReadChar+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiolSReadChar>:
mov    (%rdi),%cl
test   %cl,%cl
je     1113 <fiolSReadChar+0x13>
mov    $0x1,%eax
test   %rsi,%rsi
je     1112 <fiolSReadChar+0x12>
mov    %cl,(%rsi)
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fiolSReadChar(i8* nocapture %0, i8* writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = icmp eq i8* %1, null
br i1 %6, label %8, label %7
7: ; preds = %5
store i8 %3, i8* %1
br label %8
8: ; preds = %2, %5, %7
%9 = phi i32 [ 1, %7 ], [ 1, %5 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ASRT_Mark(char *, int, char *);
scalar_t__ ASRT_True(int);
int test_TrueFail() {
  do {
    ASRT_Mark("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/"
              "src/asrt_tests.c",
              51, "0");
    if (ASRT_True(!!(0))) {
      return 1;
    };
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_TrueFail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x33,%esi
lea    0xf55(%rip),%rdx
call   1040 <ASRT_Mark@plt>
xor    %edi,%edi
call   1030 <ASRT_True@plt>
cmp    $0x0,%rax
je     115d <test_TrueFail+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1169 <test_TrueFail+0x49>
jmp    1162 <test_TrueFail+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_TrueFail>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf61(%rip),%rdx
mov    $0x33,%esi
call   1040 <ASRT_Mark@plt>
xor    %edi,%edi
call   1030 <ASRT_True@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @test_TrueFail() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i64 @ASRT_True(i32 0)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 1, i32* %1
br label %9
7: ; preds = %2
br label %8
8: ; preds = %7
store i32 0, i32* %1
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @test_TrueFail() {
%1 = tail call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @ASRT_True(i32 0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t EPINonBlockingReadAvail(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x0000006C))));
}


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

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

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

LLVM IR (-O2):
define i64 @EPINonBlockingReadAvail(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 108
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Type definitions */
struct itimerval {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, struct itimerval *);
int getitimer(int which, struct itimerval *old) {
  return syscall(105, which, old);
}


x86 assembly (clang, -O0):
<getitimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x69,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getitimer>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x69,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
%struct.itimerval = type { i32 }
define i32 @getitimer(i32 %0, %struct.itimerval* %1) {
%3 = tail call i32 @syscall(i32 105, i32 %0, %struct.itimerval* %1)
ret i32 %3
}
/* Type definitions */
struct sched_param {
  int /*<<< orphan*/ sched_priority;
};
typedef int /*<<< orphan*/ sched;

/* Variables and functions */
int /*<<< orphan*/ SCHED_FIFO;
int /*<<< orphan*/ memset(struct sched_param *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sched_get_priority_max(int /*<<< orphan*/);
int /*<<< orphan*/ sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                                      struct sched_param *);
void setMaximumPriority() {
  struct sched_param sched;
  memset(&sched, 0, sizeof(sched));
  sched.sched_priority = sched_get_priority_max(SCHED_FIFO);
  sched_setscheduler(0, SCHED_FIFO, &sched);
}


x86 assembly (clang, -O0):
<setMaximumPriority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <sched_get_priority_max@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e88(%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):
<setMaximumPriority>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e9b(%rip),%rbx
mov    (%rbx),%edi
call   1050 <sched_get_priority_max@plt>
mov    %eax,(%rsp)
mov    (%rbx),%esi
xor    %edi,%edi
mov    %r14,%rdx
call   1030 <sched_setscheduler@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
define void @setMaximumPriority() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = call i32 @memset(%struct.sched_param* %1, i32 0, i32 4)
%4 = load i32, i32* @SCHED_FIFO
%5 = call i32 @sched_get_priority_max(i32 %4)
%6 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* @SCHED_FIFO
%8 = call i32 @sched_setscheduler(i32 0, i32 %7, %struct.sched_param* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  int p = 1;
  for (i = 1; i <= 9; i++) {
    p *= i;
  }
  printf("%d\n", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     114f <main+0x3f>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 362880)
ret i32 0
}
void initialize_phasefields() {
  long i, j, z;
  double r;
}


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

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

LLVM IR (-O0):
define void @initialize_phasefields() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca double
ret void
}

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

/* Variables and functions */
void *allocator_realloc(struct lemon *, void *, long);
void *lemon_allocator_realloc(struct lemon *lemon, void *ptr, long size) {
  return allocator_realloc(lemon, ptr, size);
}


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

x86 assembly (clang, -O2):
<lemon_allocator_realloc>:
jmp    1030 <allocator_realloc@plt>

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

LLVM IR (-O2):
%struct.lemon = type { i32 }
define i8* @lemon_allocator_realloc(%struct.lemon* %0, i8* %1, i64 %2) {
%4 = tail call i8* @allocator_realloc(%struct.lemon* %0, i8* %1, i64 %2)
ret i8* %4
}
void HangOnBadRead() {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @HangOnBadRead() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned int unicode_code_point_byte_requirement_utf16(uint32_t code_point) {
  if (code_point <= 0xFFFF)
    return 2;
  else
    return 4;
}


x86 assembly (clang, -O0):
<unicode_code_point_byte_requirement_utf16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffff,-0x8(%rbp)
jg     1120 <unicode_code_point_byte_requirement_utf16+0x20>
movl   $0x2,-0x4(%rbp)
jmp    1127 <unicode_code_point_byte_requirement_utf16+0x27>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_code_point_byte_requirement_utf16>:
xor    %eax,%eax
cmp    $0x10000,%edi
setge  %al
add    %eax,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @unicode_code_point_byte_requirement_utf16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 65535
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 2, i32* %2
br label %8
7: ; preds = %1
store i32 4, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @unicode_code_point_byte_requirement_utf16(i32 %0) {
%2 = icmp slt i32 %0, 65536
%3 = select i1 %2, i32 2, i32 4
ret i32 %3
}
/* Type definitions */
struct usernewkey_args_info {
  int dummy;
};

/* Variables and functions */
int usernewkey_cmdline_parser2(int, char **, struct usernewkey_args_info *,
                               int /*<<< orphan*/, int, int);
int usernewkey_cmdline_parser(int argc, char **argv,
                              struct usernewkey_args_info *args_info) {
  return usernewkey_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<usernewkey_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <usernewkey_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usernewkey_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <usernewkey_cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.usernewkey_args_info = type { i32 }
define i32 @usernewkey_cmdline_parser(i32 %0, i8** %1, %struct.usernewkey_args_info* %2) {
%4 = tail call i32 @usernewkey_cmdline_parser2(i32 %0, i8** %1, %struct.usernewkey_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
double subtract_doubles(double a, double b) { return a - b; }


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

x86 assembly (clang, -O2):
<subtract_doubles>:
subsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @subtract_doubles(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ qux(int /*<<< orphan*/);
void test_qux() { qux(0); }


x86 assembly (clang, -O0):
<test_qux>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <qux@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_qux() {
%1 = call i32 @qux(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_qux() {
%1 = tail call i32 @qux(i32 0)
ret void
}
void palm27x_pm_init(unsigned long str_base) {}


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

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

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

LLVM IR (-O2):
define void @palm27x_pm_init(i64 %0) {
ret void
}
/* Variables and functions */
int __mib_content_write_from_raw(unsigned char *, int);
int _mib_update_from_raw(unsigned char *ptr, int len) {
  return __mib_content_write_from_raw(ptr, len);
}


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

x86 assembly (clang, -O2):
<_mib_update_from_raw>:
jmp    1030 <__mib_content_write_from_raw@plt>

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

LLVM IR (-O2):
define i32 @_mib_update_from_raw(i8* %0, i32 %1) {
%3 = tail call i32 @__mib_content_write_from_raw(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ g_assert(char const *);
extern const char *PastWord(const char *pWord, int size) {
  g_assert(pWord);
  return pWord + size;
}


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

x86 assembly (clang, -O2):
<PastWord>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <g_assert@plt>
movslq %ebp,%rax
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @PastWord(i8* %0, i32 %1) {
%3 = tail call i32 @g_assert(i8* %0)
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
ret i8* %5
}
void fu(void) { int x; }


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

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

LLVM IR (-O0):
define void @fu() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @fu() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_TTIN(int /*<<< orphan*/);
int gen_TTIN() { handle_TTIN(0); }


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

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

LLVM IR (-O0):
define i32 @gen_TTIN() {
%1 = alloca i32
%2 = call i32 @handle_TTIN(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_TTIN() {
%1 = tail call i32 @handle_TTIN(i32 0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int /*<<< orphan*/ uint8_t;
struct pkt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ pkt_put(struct pkt *, int);
uint8_t pkt_put_extract_u8(struct pkt *p) {
  uint8_t val;
  memcpy(&val, pkt_put(p, sizeof(val)), sizeof(val));
  return val;
}


x86 assembly (clang, -O0):
<pkt_put_extract_u8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <pkt_put@plt>
mov    %eax,%esi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pkt_put_extract_u8>:
push   %rax
mov    $0x4,%esi
call   1040 <pkt_put@plt>
lea    0x4(%rsp),%rdi
mov    %eax,%esi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pkt = type { i32 }
define i32 @pkt_put_extract_u8(%struct.pkt* %0) {
%2 = alloca %struct.pkt*
%3 = alloca i32
store %struct.pkt* %0, %struct.pkt** %2
%4 = load %struct.pkt*, %struct.pkt** %2
%5 = call i32 @pkt_put(%struct.pkt* %4, i32 4)
%6 = call i32 @memcpy(i32* %3, i32 %5, i32 4)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
%struct.pkt = type { i32 }
define i32 @pkt_put_extract_u8(%struct.pkt* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @pkt_put(%struct.pkt* %0, i32 4)
%5 = call i32 @memcpy(i32* %2, i32 %4, i32 4)
%6 = load i32, i32* %2
ret i32 %6
}
int pick2(int n, int *i, int *j) {
  double ran1();
  *i = n * ran1();
  while ((*j = n * ran1()) == *i)
    ;
  return (0);
}


x86 assembly (clang, -O0):
<pick2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <ran1@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x0,%al
call   1030 <ran1@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    -0x18(%rbp),%rcx
mov    %eax,(%rcx)
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    1182 <pick2+0x72>
jmp    114a <pick2+0x3a>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pick2>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <ran1@plt>
mulsd  (%rsp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%rbx)
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <ran1@plt>
mulsd  (%rsp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%r14)
cmp    %eax,(%rbx)
je     1140 <pick2+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @pick2(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 = sitofp i32 %7 to double
%9 = call double (...) @ran1()
%10 = fmul double %8, %9
%11 = fptosi double %10 to i32
%12 = load i32*, i32** %5
store i32 %11, i32* %12
br label %13
13: ; preds = %23, %3
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to double
%16 = call double (...) @ran1()
%17 = fmul double %15, %16
%18 = fptosi double %17 to i32
%19 = load i32*, i32** %6
store i32 %18, i32* %19
%20 = load i32*, i32** %5
%21 = load i32, i32* %20
%22 = icmp eq i32 %18, %21
br i1 %22, label %23, label %24
23: ; preds = %13
br label %13
24: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @pick2(i32 %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = sitofp i32 %0 to double
%5 = tail call double (...) @ran1()
%6 = fmul double %5, %4
%7 = fptosi double %6 to i32
store i32 %7, i32* %1
br label %8
8: ; preds = %8, %3
%9 = tail call double (...) @ran1()
%10 = fmul double %9, %4
%11 = fptosi double %10 to i32
store i32 %11, i32* %2
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, %11
br i1 %13, label %8, label %14
14: ; preds = %8
ret i32 0
}
void my_init(int *i, int *c, int *charac) {
  *i = 0;
  *c = 0;
  *charac = 0;
}


x86 assembly (clang, -O0):
<my_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_init>:
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
movl   $0x0,(%rdx)
ret

LLVM IR (-O0):
define void @my_init(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
store i32 0, i32* %7
%8 = load i32*, i32** %5
store i32 0, i32* %8
%9 = load i32*, i32** %6
store i32 0, i32* %9
ret void
}

LLVM IR (-O2):
define void @my_init(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 0, i32* %0
store i32 0, i32* %1
store i32 0, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ shlib_second(int /*<<< orphan*/);
void shlib_first(void) { shlib_second(0); }


x86 assembly (clang, -O0):
<shlib_first>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <shlib_second@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @shlib_first() {
%1 = call i32 @shlib_second(i32 0)
ret void
}

LLVM IR (-O2):
define void @shlib_first() {
%1 = tail call i32 @shlib_second(i32 0)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __adjtime(const struct timeval *delta, struct timeval *olddelta) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__adjtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__adjtime>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
define i32 @__adjtime(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
define i32 @__adjtime(%struct.timeval* nocapture readnone %0, %struct.timeval* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showSuccess(int id) {
  switch (id) {
  case 0: {
    printf("\nnode added!\n");
    break;
  }
  }
}


x86 assembly (clang, -O0):
<showSuccess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    1137 <showSuccess+0x27>
jmp    112b <showSuccess+0x1b>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showSuccess>:
test   %edi,%edi
je     1115 <showSuccess+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\0Anode added!\0A\00"
define void @showSuccess(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 0, label %4
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"\0Anode added!\00"
define void @showSuccess(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
ret void
}
I0A1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if (22 <= (*((unsigned char *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0xa98ac7,%eax
movzbl (%rax),%ecx
mov    $0x16,%eax
cmp    %ecx,%eax
jg     113f <I0A1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <I0A1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0A1>:
xor    %eax,%eax
cmpb   $0x16,0xa98ac7
16
setae  %al
ret

LLVM IR (-O0):
define i32 @I0A1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8, i8* inttoptr (i64 11111111 to i8*)
%17 = zext i8 %16 to i32
%18 = icmp sle i32 22, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @I0A1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = load i8, i8* inttoptr (i64 11111111 to i8*)
%8 = icmp ugt i8 %7, 21
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ des(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ desm1(unsigned char *, unsigned char *, unsigned char *);
void TriUnDes(unsigned char *s, unsigned char *o, unsigned char *Key) {
  unsigned char TmpBuff[16];
  desm1(s, o, Key);
  des(o, TmpBuff, Key + 8);
  desm1(TmpBuff, o, Key);
}


x86 assembly (clang, -O0):
<TriUnDes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <desm1@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
call   1030 <des@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <desm1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TriUnDes>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <desm1@plt>
lea    0x8(%r14),%rdx
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <des@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <desm1@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @TriUnDes(i8* %0, i8* %1, i8* %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @desm1(i8* %0, i8* %1, i8* %2)
%7 = getelementptr inbounds i8, i8* %2, i64 8
%8 = call i32 @des(i8* %1, i8* %5, i8* %7)
%9 = call i32 @desm1(i8* %5, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
unsigned int *calloc(int /*<<< orphan*/, int);
int /*<<< orphan*/ free(unsigned int *);
unsigned int gcd(unsigned int u, unsigned int v) {
  if (v != 0) {
    unsigned int *res = calloc(0, sizeof(unsigned int));
    unsigned int res_val = 0;
    *res = gcd(v, u % v);
    res_val = *res;
    free(res);
    return res_val;
  }
  return u;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1196 <gcd+0x66>
xor    %edi,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%esi
call   1050 <gcd@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119c <gcd+0x6c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
je     1167 <gcd+0x37>
mov    %esi,%ebp
xor    %edi,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%r14
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
mov    %ebp,%edi
mov    %edx,%esi
call   1050 <gcd@plt>
mov    %eax,%ebx
mov    %eax,(%r14)
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi i32 [ %9, %6 ], [ %0, %2 ]
ret i32 %5
6: ; preds = %2
%7 = tail call i32* @calloc(i32 0, i32 4)
%8 = urem i32 %0, %1
%9 = tail call i32 @gcd(i32 %1, i32 %8)
store i32 %9, i32* %7
%10 = tail call i32 @free(i32* %7)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ reset();
void audio_pause(void) { reset(); }


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

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

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

LLVM IR (-O2):
define void @audio_pause() {
%1 = tail call i32 (...) @reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void stb_tempfree(void *b, void *p) {
  if (p != b)
    free(p);
}


x86 assembly (clang, -O0):
<stb_tempfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1137 <stb_tempfree+0x27>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_tempfree>:
cmp    %rdi,%rsi
je     111d <stb_tempfree+0xd>
mov    %rsi,%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @stb_tempfree(i8* readnone %0, i8* %1) {
%3 = icmp eq i8* %1, %0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ branchless(int, int const);
scalar_t__ naive(int, int const);
void compare() {
  const uint32_t mask = 0x01010101;
  for (int i = 0; i < 16; i++) {
    assert(naive(i, mask) == branchless(i, mask));
  }
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1010101,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1193 <compare+0x63>
mov    -0x8(%rbp),%edi
mov    $0x1010101,%esi
call   1040 <naive@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1010101,%esi
call   1050 <branchless@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <compare+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    $0x1010101,%esi
call   1040 <naive@plt>
mov    %rax,%r14
mov    %ebx,%edi
mov    $0x1010101,%esi
call   1050 <branchless@plt>
xor    %edi,%edi
cmp    %rax,%r14
sete   %dil
call   1030 <assert@plt>
add    $0x1,%ebx
cmp    $0x10,%ebx
jne    1140 <compare+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @compare() {
%1 = alloca i32
%2 = alloca i32
store i32 16843009, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i64 @naive(i32 %7, i32 16843009)
%9 = load i32, i32* %2
%10 = call i64 @branchless(i32 %9, i32 16843009)
%11 = icmp eq i64 %8, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
br label %14
14: ; preds = %6
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %3
17: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @compare() {
br label %2
1: ; preds = %2
ret void
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %9, %2 ]
%4 = tail call i64 @naive(i32 %3, i32 16843009)
%5 = tail call i64 @branchless(i32 %3, i32 16843009)
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 16
br i1 %10, label %1, label %2
}