xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ data_addcards(int, int, int);
int data_getcards(int, int);
int /*<<< orphan*/ trade_routine_other(int, int, int);
int devcards_monopoly(int player) {
  if (data_getcards(player, 2) >= 1) {
    data_addcards(player, 2, -1);
    trade_routine_other(player, 1, 4);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<devcards_monopoly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <data_getcards@plt>
cmp    $0x1,%eax
jl     1181 <devcards_monopoly+0x51>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
mov    $0xffffffff,%edx
call   1040 <data_addcards@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <trade_routine_other@plt>
movl   $0x1,-0x4(%rbp)
jmp    1188 <devcards_monopoly+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devcards_monopoly>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x2,%esi
call   1030 <data_getcards@plt>
test   %eax,%eax
jle    116c <devcards_monopoly+0x3c>
mov    %ebx,%edi
mov    $0x2,%esi
mov    $0xffffffff,%edx
call   1040 <data_addcards@plt>
mov    $0x1,%ebp
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <trade_routine_other@plt>
jmp    116e <devcards_monopoly+0x3e>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @devcards_monopoly(i32 %0) {
%2 = tail call i32 @data_getcards(i32 %0, i32 2)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @data_addcards(i32 %0, i32 2, i32 -1)
%6 = tail call i32 @trade_routine_other(i32 %0, i32 1, i32 4)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
struct pmd_part {
  int dummy;
};
struct fmdriver_work {
  int dummy;
};
struct driver_pmd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pmd_part_cmdload(struct driver_pmd *, struct pmd_part *);
void pmd_cmd_null_2(struct fmdriver_work *work, struct driver_pmd *pmd,
                    struct pmd_part *part) {
  (void)work;
  for (int i = 0; i < 2; i++) {
    pmd_part_cmdload(pmd, part);
  }
}


x86 assembly (clang, -O0):
<pmd_cmd_null_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    1150 <pmd_cmd_null_2+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <pmd_part_cmdload@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <pmd_cmd_null_2+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmd_cmd_null_2>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <pmd_part_cmdload@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pmd_part_cmdload@plt>

LLVM IR (-O0):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmd_null_2(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = alloca %struct.fmdriver_work*
%5 = alloca %struct.driver_pmd*
%6 = alloca %struct.pmd_part*
%7 = alloca i32
store %struct.fmdriver_work* %0, %struct.fmdriver_work** %4
store %struct.driver_pmd* %1, %struct.driver_pmd** %5
store %struct.pmd_part* %2, %struct.pmd_part** %6
%8 = load %struct.fmdriver_work*, %struct.fmdriver_work** %4
store i32 0, i32* %7
br label %9
9: ; preds = %16, %3
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load %struct.driver_pmd*, %struct.driver_pmd** %5
%14 = load %struct.pmd_part*, %struct.pmd_part** %6
%15 = call i32 @pmd_part_cmdload(%struct.driver_pmd* %13, %struct.pmd_part* %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmd_null_2(%struct.fmdriver_work* nocapture readnone %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = tail call i32 @pmd_part_cmdload(%struct.driver_pmd* %1, %struct.pmd_part* %2)
%5 = tail call i32 @pmd_part_cmdload(%struct.driver_pmd* %1, %struct.pmd_part* %2)
ret void
}
int stringLength(const char *string) {
  const char *cptr = string;
  while (*cptr) {
    ++cptr;
  }
  return cptr - string;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <stringLength+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <stringLength+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <stringLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @stringLength(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ int8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ WriteUint8Le(int /*<<< orphan*/, void *);
int32_t WriteInt8Le(int8_t value, void *out) {
  return WriteUint8Le((uint8_t)value, out);
}


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

x86 assembly (clang, -O2):
<WriteInt8Le>:
jmp    1030 <WriteUint8Le@plt>

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

LLVM IR (-O2):
define i32 @WriteInt8Le(i64 %0, i8* %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @WriteUint8Le(i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void close_daemon(int notused) { exit(0); }


x86 assembly (clang, -O0):
<close_daemon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<close_daemon>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @close_daemon(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @close_daemon(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int callee(int, int, int);
int caller(void) {
  register int ret;
  ret = callee(1, 2, 3);
  ret += 5;
  return ret;
}


x86 assembly (clang, -O0):
<caller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <callee@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caller>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <callee@plt>
add    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @caller() {
%1 = alloca i32
%2 = call i32 @callee(i32 1, i32 2, i32 3)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 5
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @caller() {
%1 = tail call i32 @callee(i32 1, i32 2, i32 3)
%2 = add nsw i32 %1, 5
ret i32 %2
}
void foo625() {}


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

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

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

LLVM IR (-O2):
define void @foo625() {
ret void
}
void irreducible_nest3(char *a, int b, char *z) {
  if (b) {
    goto L0;
  }
  while (*a) {
    a++;
  L0:
    a++;
    while (*z) {
      *z++;
    }
  }
}


x86 assembly (clang, -O0):
<irreducible_nest3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     111e <irreducible_nest3+0x1e>
jmp    113c <irreducible_nest3+0x3c>
jmp    1123 <irreducible_nest3+0x23>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <irreducible_nest3+0x6b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1166 <irreducible_nest3+0x66>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <irreducible_nest3+0x48>
jmp    1123 <irreducible_nest3+0x23>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irreducible_nest3>:
test   %esi,%esi
jne    1113 <irreducible_nest3+0x13>
jmp    110a <irreducible_nest3+0xa>
add    $0x1,%rdi
cmpb   $0x0,(%rdi)
je     112c <irreducible_nest3+0x2c>
add    $0x1,%rdi
add    $0xffffffffffffffff,%rdx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdx)
lea    0x1(%rdx),%rdx
jne    1120 <irreducible_nest3+0x20>
jmp    1106 <irreducible_nest3+0x6>
ret

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

LLVM IR (-O2):
define void @irreducible_nest3(i8* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %14
5: ; preds = %17
%6 = getelementptr inbounds i8, i8* %15, i64 1
br label %7
7: ; preds = %5, %3
%8 = phi i8* [ %0, %3 ], [ %6, %5 ]
%9 = phi i8* [ %2, %3 ], [ %18, %5 ]
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %22, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %8, i64 1
br label %14
14: ; preds = %3, %12
%15 = phi i8* [ %0, %3 ], [ %13, %12 ]
%16 = phi i8* [ %2, %3 ], [ %9, %12 ]
br label %17
17: ; preds = %17, %14
%18 = phi i8* [ %16, %14 ], [ %21, %17 ]
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
%21 = getelementptr inbounds i8, i8* %18, i64 1
br i1 %20, label %5, label %17
22: ; preds = %7
ret void
}
/* Type definitions */
typedef scalar_t__ GLenum;

/* Variables and functions */
scalar_t__ GL_NO_ERROR;
int /*<<< orphan*/ exit(int);
scalar_t__ glGetError();
char *gluErrorString(scalar_t__);
int /*<<< orphan*/ printf(char *, char *);
void errorcheck() {
  GLenum error = glGetError();
  if (error != GL_NO_ERROR) {
    printf("%s\n", gluErrorString(error));
    exit(1);
  }
}


x86 assembly (clang, -O0):
<errorcheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <glGetError@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%rax
je     1189 <errorcheck+0x49>
mov    -0x8(%rbp),%rdi
call   1050 <gluErrorString@plt>
mov    %rax,%rsi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorcheck>:
push   %rax
xor    %eax,%eax
call   1040 <glGetError@plt>
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
jne    1156 <errorcheck+0x16>
pop    %rax
ret
mov    %rax,%rdi
call   1050 <gluErrorString@plt>
lea    0xe9b(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@GL_NO_ERROR = global i64 0
@.str = [4 x i8] c"%s\0A\00"
define void @errorcheck() {
%1 = alloca i64
%2 = call i64 (...) @glGetError()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = load i64, i64* @GL_NO_ERROR
%5 = icmp ne i64 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i64, i64* %1
%8 = call i8* @gluErrorString(i64 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
ret void
}

LLVM IR (-O2):
@GL_NO_ERROR = global i64 0
@.str = [4 x i8] c"%s\0A\00"
define void @errorcheck() {
%1 = tail call i64 (...) @glGetError()
%2 = load i64, i64* @GL_NO_ERROR
%3 = icmp eq i64 %1, %2
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i8* @gluErrorString(i64 %1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
uint64_t sapi_get_time_msec() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return ((uint64_t)tv.tv_sec) * 1000 + (tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<sapi_get_time_msec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sapi_get_time_msec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%ecx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @sapi_get_time_msec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @sapi_get_time_msec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %7, %10
ret i32 %11
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int str_endswith(char *stra, char *strb) {
  int lena = strlen(stra);
  int lenb = strlen(strb);
  if (lenb > lena)
    return 0;
  return strcmp(stra + (lena - lenb), strb) == 0;
}


x86 assembly (clang, -O0):
<str_endswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1160 <str_endswith+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1187 <str_endswith+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_endswith>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%ebp
jl     115d <str_endswith+0x3d>
movslq %ebp,%rax
add    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @str_endswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = sub nsw i32 %3, %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i64 @strcmp(i8* %9, i8* %1)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %2, %6
%14 = phi i32 [ %12, %6 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ toLower(char const);
int cmpChrCommunist(const char a, const char b) {
  return toLower(a) == toLower(b);
}


x86 assembly (clang, -O0):
<cmpChrCommunist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <toLower@plt>
mov    %rax,-0x10(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <toLower@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpChrCommunist>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <toLower@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <toLower@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cmpChrCommunist(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i64 @toLower(i8 signext %5)
%7 = load i8, i8* %4
%8 = call i64 @toLower(i8 signext %7)
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @cmpChrCommunist(i8 signext %0, i8 signext %1) {
%3 = tail call i64 @toLower(i8 signext %0)
%4 = tail call i64 @toLower(i8 signext %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_6Bint16_mem(short *val) {
  return ((*val) & (0x6B << 0)) ? -20 : -40;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @SwapUVRow_Any_SSSE3() {
ret void
}
void foo202() {}


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

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

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

LLVM IR (-O2):
define void @foo202() {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double tvtosec(struct timeval *tv) {
  return (double)tv->tv_sec + ((double)tv->tv_usec) / 1000000;
}


x86 assembly (clang, -O0):
<tvtosec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xedd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tvtosec>:
cvtsi2sdq 0x8(%rdi),%xmm1
cvtsi2sdq (%rdi),%xmm0
divsd  0xeed(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @tvtosec(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %6, %11
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @tvtosec(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %8, %4
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int debug_display_page(int ip) {
  if (ip < 0 || ip >= 128 * 512) {
    printf("Invalid IP\n");
    return 0;
  }
  printf("Page Number: %d \t Offset: %d\n", ip / 512, ip % 512);
  return 1;
}


x86 assembly (clang, -O0):
<debug_display_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1132 <debug_display_page+0x22>
cmpl   $0x10000,-0x8(%rbp)
jl     114c <debug_display_page+0x3c>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1179 <debug_display_page+0x69>
mov    -0x8(%rbp),%eax
mov    $0x200,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x8(%rbp),%eax
mov    $0x200,%ecx
cltd
idiv   %ecx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_display_page>:
push   %rax
cmp    $0x10000,%edi
jb     1139 <debug_display_page+0x19>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    %edi,%edx
mov    %edi,%esi
shr    $0x9,%esi
and    $0x1ff,%edx
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Invalid IP\0A\00"
@.str.1 = [30 x i8] c"Page Number: %d \09 Offset: %d\0A\00"
define i32 @debug_display_page(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 65536
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %17
11: ; preds = %6
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 512
%14 = load i32, i32* %3
%15 = srem i32 %14, 512
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %15)
store i32 1, i32* %2
br label %17
17: ; preds = %11, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"Page Number: %d \09 Offset: %d\0A\00"
@str = [11 x i8] c"Invalid IP\00"
define i32 @debug_display_page(i32 %0) {
%2 = icmp ugt i32 %0, 65535
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %9
5: ; preds = %1
%6 = lshr i32 %0, 9
%7 = and i32 %0, 511
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
br label %9
9: ; preds = %5, %3
%10 = phi i32 [ 0, %3 ], [ 1, %5 ]
ret i32 %10
}
void caller_1_2_1_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_1_2_2_2_1() {
ret void
}
void sg_init_table(struct scatterlist *sg, unsigned int count) {}


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

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

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

LLVM IR (-O2):
%struct.scatterlist = type opaque
define void @sg_init_table(%struct.scatterlist* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};
typedef int int64_t;

/* Variables and functions */
void timespec_from_nsec(struct timespec *a, int64_t b) {
  a->tv_sec = b / 1000000000;
  a->tv_nsec = b % 1000000000;
}


x86 assembly (clang, -O0):
<timespec_from_nsec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_from_nsec>:
movslq %esi,%rax
imul   $0x44b82fa1,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x3c,%rcx
add    %edx,%ecx
mov    %ecx,(%rdi)
imul   $0x3b9aca00,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @timespec_from_nsec(%struct.timespec* %0, i32 %1) {
%3 = alloca %struct.timespec*
%4 = alloca i32
store %struct.timespec* %0, %struct.timespec** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1000000000
%7 = load %struct.timespec*, %struct.timespec** %3
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = srem i32 %9, 1000000000
%11 = load %struct.timespec*, %struct.timespec** %3
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %11, i32 0, i32 1
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @timespec_from_nsec(%struct.timespec* nocapture writeonly %0, i32 %1) {
%3 = sdiv i32 %1, 1000000000
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i32 %3, i32* %4
%5 = srem i32 %1, 1000000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i32 %5, i32* %6
ret void
}
void clr_HasGDS(unsigned char *pds) { pds[7] &= 127; }


x86 assembly (clang, -O0):
<clr_HasGDS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%ecx
and    $0x7f,%ecx
mov    %cl,0x7(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_HasGDS>:
andb   $0x7f,0x7(%rdi)
ret

LLVM IR (-O0):
define void @clr_HasGDS(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 7
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 127
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
ret void
}

LLVM IR (-O2):
define void @clr_HasGDS(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
%3 = load i8, i8* %2
%4 = and i8 %3, 127
store i8 %4, i8* %2
ret void
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 && *s1 == *s2) {
    s1++;
    s2++;
  }
  return *s1 - *s2;
}


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

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

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = sext i8 %18 to i32
%20 = load i8, i8* %17
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int RAND_MAX;
int rand();
void place_lions_and_girl(bool *is_girl) {
  int i;
  for (i = 0; i < 3; i++) {
    is_girl[i] = false;
  }
  is_girl[rand() / (RAND_MAX / 3)] = true;
}


x86 assembly (clang, -O0):
<place_lions_and_girl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    114a <place_lions_and_girl+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <place_lions_and_girl+0x13>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movl   $0x1,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<place_lions_and_girl>:
push   %rbx
mov    %rdi,%rbx
movl   $0x0,0x8(%rdi)
movq   $0x0,(%rdi)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eb8(%rip),%rcx
movslq (%rcx),%rcx
imul   $0x55555556,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
cltd
idiv   %ecx
cltq
movl   $0x1,(%rbx,%rax,4)
pop    %rbx
ret

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

LLVM IR (-O2):
@RAND_MAX = global i32 0
define void @place_lions_and_girl(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 (...) @rand()
%4 = load i32, i32* @RAND_MAX
%5 = sdiv i32 %4, 3
%6 = sdiv i32 %3, %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 1, i32* %8
ret void
}
void swap(int *firstVal, int *secondVal) {
  int temp = *firstVal;
  *firstVal = *secondVal;
  *secondVal = temp;
}


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

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

LLVM IR (-O0):
define void @swap(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void dummy_jac(int *n, double *x, double *y, double *dfy, int *ldfy,
               double *rpar, double *ipar) {}


x86 assembly (clang, -O0):
<dummy_jac>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dummy_jac(i32* %0, double* %1, double* %2, double* %3, i32* %4, double* %5, double* %6) {
%8 = alloca i32*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32*
%13 = alloca double*
%14 = alloca double*
store i32* %0, i32** %8
store double* %1, double** %9
store double* %2, double** %10
store double* %3, double** %11
store i32* %4, i32** %12
store double* %5, double** %13
store double* %6, double** %14
ret void
}

LLVM IR (-O2):
define void @dummy_jac(i32* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, i32* nocapture %4, double* nocapture %5, double* nocapture %6) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutLeaveMainLoop();
int /*<<< orphan*/ printf(char *, unsigned char, int, int, int);
void my_keyboard(unsigned char key, int x, int y, int action) {
  printf("keyboard event: <%d> @ %d %d (action= %d)\n", key, x, y, action);
  switch (key) {
  case 27:
    glutLeaveMainLoop();
    break;
  }
}


x86 assembly (clang, -O0):
<my_keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movzbl -0x1(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    1168 <my_keyboard+0x48>
jmp    1161 <my_keyboard+0x41>
mov    $0x0,%al
call   1030 <glutLeaveMainLoop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_keyboard>:
push   %rbx
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%ebx
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
cmp    $0x1b,%bl
jne    1145 <my_keyboard+0x25>
xor    %eax,%eax
pop    %rbx
jmp    1030 <glutLeaveMainLoop@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"keyboard event: <%d> @ %d %d (action= %d)\0A\00"
define void @my_keyboard(i8 zeroext %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8, i8* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8 zeroext %9, i32 %10, i32 %11, i32 %12)
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
switch i32 %15, label %18 [
i32 27, label %16
]
16: ; preds = %4
%17 = call i32 (...) @glutLeaveMainLoop()
br label %18
18: ; preds = %4, %16
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"keyboard event: <%d> @ %d %d (action= %d)\0A\00"
define void @my_keyboard(i8 zeroext %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8 zeroext %0, i32 %1, i32 %2, i32 %3)
%6 = icmp eq i8 %0, 27
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @glutLeaveMainLoop()
br label %9
9: ; preds = %4, %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ SIOCINQ;
int /*<<< orphan*/ diminuto_ipc_get_control(int, int /*<<< orphan*/);
ssize_t diminuto_ipc_stream_get_available(int fd) {
  return diminuto_ipc_get_control(fd, SIOCINQ);
}


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

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

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

LLVM IR (-O2):
@SIOCINQ = global i32 0
define i32 @diminuto_ipc_stream_get_available(i32 %0) {
%2 = load i32, i32* @SIOCINQ
%3 = tail call i32 @diminuto_ipc_get_control(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int abs(float);
int /*<<< orphan*/ getid(float);
int /*<<< orphan*/ printid(float);
void main() {
  float x, a;
  getid(x);
  a = x;
  printid(a);
  while (abs(x * x - a) > 1e-6)
    x = (x + a / x) / 2;
  printid(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  -0x4(%rbp),%xmm0
call   1040 <getid@plt>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <printid@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <abs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe75(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11be <main+0x8e>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
divss  -0x4(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  0xe58(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1156 <main+0x26>
movss  -0x4(%rbp),%xmm0
call   1050 <printid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <getid@plt>
call   1050 <printid@plt>
nopl   0x0(%rax,%rax,1)
movss  0xeb8(%rip),%xmm0
call   1030 <abs@plt>
test   %eax,%eax
jg     1140 <main+0x10>
movss  0xea7(%rip),%xmm0
pop    %rax
jmp    1050 <printid@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = load float, float* %1
%4 = call i32 @getid(float %3)
%5 = load float, float* %1
store float %5, float* %2
%6 = load float, float* %2
%7 = call i32 @printid(float %6)
br label %8
8: ; preds = %17, %0
%9 = load float, float* %1
%10 = load float, float* %1
%11 = load float, float* %2
%12 = fneg float %11
%13 = call float @llvm.fmuladd.f32(float %9, float %10, float %12)
%14 = call i32 @abs(float %13)
%15 = sitofp i32 %14 to double
%16 = fcmp ogt double %15, 0x3EB0C6F7A0B5ED8D
br i1 %16, label %17, label %24
17: ; preds = %8
%18 = load float, float* %1
%19 = load float, float* %2
%20 = load float, float* %1
%21 = fdiv float %19, %20
%22 = fadd float %18, %21
%23 = fdiv float %22, 2.000000e+00
store float %23, float* %1
br label %8
24: ; preds = %8
%25 = load float, float* %1
%26 = call i32 @printid(float %25)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @getid(float undef)
%2 = tail call i32 @printid(float undef)
br label %3
3: ; preds = %3, %0
%4 = tail call i32 @abs(float 0x7FF8000000000000)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = tail call i32 @printid(float 0x7FF8000000000000)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t get_low_nibble(uint8_t data) { return data & 0x0f; }


x86 assembly (clang, -O0):
<get_low_nibble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_low_nibble>:
mov    %edi,%eax
and    $0xf,%eax
ret

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

LLVM IR (-O2):
define i32 @get_low_nibble(i32 %0) {
%2 = and i32 %0, 15
ret i32 %2
}
unsigned long gt_rmq_block(unsigned long idx) { return ((idx) >> 4); }


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

x86 assembly (clang, -O2):
<gt_rmq_block>:
mov    %rdi,%rax
shr    $0x4,%rax
ret

LLVM IR (-O0):
define i64 @gt_rmq_block(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 4
ret i64 %4
}

LLVM IR (-O2):
define i64 @gt_rmq_block(i64 %0) {
%2 = lshr i64 %0, 4
ret i64 %2
}
int veczsize(char **vec[]) {
  int i;
  char **v = *vec;
  for (i = 1; *v; ++v, ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<veczsize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1147 <veczsize+0x47>
jmp    112d <veczsize+0x2d>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <veczsize+0x1a>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<veczsize>:
mov    (%rdi),%rcx
cmpq   $0x0,(%rcx)
je     111c <veczsize+0x1c>
mov    $0x1,%eax
xchg   %ax,%ax
cmpq   $0x0,(%rcx,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <veczsize+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @veczsize(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i8** [ %8, %5 ], [ %2, %1 ]
%7 = phi i32 [ %9, %5 ], [ 1, %1 ]
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = add nuw nsw i32 %7, 1
%10 = load i8*, i8** %8
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %13
}
int unknown() {
  int x;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @unknown() {
ret i32 undef
}