xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putendl(char const *s) {
  if (s) {
    while (*s)
      write(1, s++, 1);
    write(1, "\n", 1);
  }
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116c <ft_putendl+0x5c>
jmp    112c <ft_putendl+0x1c>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <ft_putendl+0x49>
mov    -0x8(%rbp),%rsi
mov    %rsi,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
jmp    112c <ft_putendl+0x1c>
mov    $0x1,%edx
lea    0xe9b(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
test   %rdi,%rdi
je     116c <ft_putendl+0x5c>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     114f <ft_putendl+0x3f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%r14
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
mov    %r14,%rbx
jne    1130 <ft_putendl+0x20>
lea    0xeaa(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @write(i32 1, i8* %7, i32 1)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %14
14: ; preds = %12, %1
ret void
}
void g_queue_find() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_find() {
ret void
}
int xmlUCSIsSupplementalArrowsB(int code) {
  return (((code >= 0x2900) && (code <= 0x297F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsSupplementalArrowsB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2900,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsSupplementalArrowsB+0x26>
cmpl   $0x297f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsSupplementalArrowsB>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x2900,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsSupplementalArrowsB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 10496
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 10623
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsSupplementalArrowsB(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 10496
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _quick_sort(int *, int /*<<< orphan*/, int);
void quick_sort(int nums[], int n) { _quick_sort(nums, 0, n - 1); }


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

x86 assembly (clang, -O2):
<quick_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <_quick_sort@plt>

LLVM IR (-O0):
define void @quick_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @_quick_sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @_quick_sort(i32* %0, i32 0, i32 %3)
ret void
}
OP(fd, de) {
  illegal_1();
  op_de();
}


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_de@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_de()
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t am_util_string_strlen(const char *pcStr) {
  const char *pcS;
  for (pcS = pcStr; *pcS; ++pcS)
    ;
  return (pcS - pcStr);
}


x86 assembly (clang, -O0):
<am_util_string_strlen>:
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     1133 <am_util_string_strlen+0x33>
jmp    1122 <am_util_string_strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <am_util_string_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @am_util_string_strlen(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*/ str;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ func(char **, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
void two() {
  char *str = NULL;
  func(&str, 20);
  printf("str length is %ld\n", sizeof(str));
  strcpy(str, "hello world!");
  printf("%s\n", str);
  free(str);
}


x86 assembly (clang, -O0):
<two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x14,%esi
call   1060 <func@plt>
lea    0xe9b(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
mov    $0x14,%esi
call   1070 <func@plt>
lea    0xe93(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp),%rdi
lea    0xe8f(%rip),%rsi
call   1040 <strcpy@plt>
mov    (%rsp),%rdi
call   1050 <puts@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"str length is %ld\0A\00"
@.str.1 = [13 x i8] c"hello world!\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @two() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i32 @func(i8** %1, i32 20)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 8)
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"str length is %ld\0A\00"
@.str.1 = [13 x i8] c"hello world!\00"
define void @two() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = call i32 @func(i8** %1, i32 20)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 8)
%5 = load i8*, i8** %1
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %1
%8 = call i32 @puts(i8* dereferenceable(1) %7)
%9 = load i8*, i8** %1
%10 = call i32 @free(i8* %9)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
unsigned int bytes_to_uint24(const uint8_t *bytes) {
  return (bytes[0] << 16) | (bytes[1] << 8) | bytes[2];
}


x86 assembly (clang, -O0):
<bytes_to_uint24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x8(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_to_uint24>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%eax
shl    $0x10,%ecx
shl    $0x8,%eax
or     %ecx,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bytes_to_uint24(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @bytes_to_uint24(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 16
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = or i32 %7, %9
ret i32 %10
}
void wq_worker_waking_up(struct task_struct *task, unsigned int cpu) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @wq_worker_waking_up(%struct.task_struct* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_confrms(int, char **);
int main(int argc, char *argv[]) {
  gmx_confrms(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_confrms(i32 %0, i8** %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_add_uint16_t(int /*<<< orphan*/ *, int);
uint16_t atomic_inc_uint16_t(uint16_t *var) {
  return atomic_add_uint16_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_inc_uint16_t>:
mov    $0x1,%esi
jmp    1030 <atomic_add_uint16_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_inc_uint16_t(i32* %0) {
%2 = tail call i32 @atomic_add_uint16_t(i32* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void *shmem_memalign(size_t alignment, size_t size) {
  printf("\nOpenSHMEM Analyzer\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define i8* @shmem_memalign(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define noalias i8* @shmem_memalign(i64 %0, i64 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ gluOrtho2D(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
void setOrthographicProjection() {
  glMatrixMode(GL_PROJECTION);
  glPushMatrix();
  glLoadIdentity();
  gluOrtho2D(0, 800, 0, 600);
  glClearColor(0.0, 0.0, 1.0, 1.0);
  glMatrixMode(GL_MODELVIEW);
}


x86 assembly (clang, -O0):
<setOrthographicProjection>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
xor    %edx,%edx
mov    $0x320,%esi
mov    $0x258,%ecx
mov    %edx,%edi
call   1070 <gluOrtho2D@plt>
xorps  %xmm1,%xmm1
movsd  0xe72(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   1040 <glClearColor@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setOrthographicProjection>:
push   %rax
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
xor    %edi,%edi
mov    $0x320,%esi
xor    %edx,%edx
mov    $0x258,%ecx
call   1070 <gluOrtho2D@plt>
movsd  0xe78(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movaps %xmm2,%xmm3
call   1040 <glClearColor@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glMatrixMode@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @setOrthographicProjection() {
%1 = load i32, i32* @GL_PROJECTION
%2 = call i32 @glMatrixMode(i32 %1)
%3 = call i32 (...) @glPushMatrix()
%4 = call i32 (...) @glLoadIdentity()
%5 = call i32 @gluOrtho2D(i32 0, i32 800, i32 0, i32 600)
%6 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00, double 1.000000e+00)
%7 = load i32, i32* @GL_MODELVIEW
%8 = call i32 @glMatrixMode(i32 %7)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @setOrthographicProjection() {
%1 = load i32, i32* @GL_PROJECTION
%2 = tail call i32 @glMatrixMode(i32 %1)
%3 = tail call i32 (...) @glPushMatrix()
%4 = tail call i32 (...) @glLoadIdentity()
%5 = tail call i32 @gluOrtho2D(i32 0, i32 800, i32 0, i32 600)
%6 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00, double 1.000000e+00)
%7 = load i32, i32* @GL_MODELVIEW
%8 = tail call i32 @glMatrixMode(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(size_t);
void *malloc_or_die(size_t size) {
  void *p = malloc(size);
  if (!p)
    die("Out of memory\n");
  return p;
}


x86 assembly (clang, -O0):
<malloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <malloc_or_die+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_or_die>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <malloc_or_die+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @malloc_or_die(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory\0A\00"
define noalias i8* @malloc_or_die(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int npot(int n) {
  if (n == 0)
    return 0;
  int i = 1;
  while (i < n)
    i <<= 1;
  return i;
}


x86 assembly (clang, -O0):
<npot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <npot+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <npot+0x44>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113e <npot+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <npot+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<npot>:
test   %edi,%edi
je     111a <npot+0x1a>
mov    $0x1,%ecx
nopl   0x0(%rax)
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jl     1110 <npot+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @npot(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %18
8: ; preds = %1
store i32 1, i32* %4
br label %9
9: ; preds = %13, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %4
%15 = shl i32 %14, 1
store i32 %15, i32* %4
br label %9
16: ; preds = %9
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @npot(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = icmp slt i32 %4, %0
%6 = shl i32 %4, 1
br i1 %5, label %3, label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %4, %3 ]
ret i32 %8
}
int mdp4_mddi_pipe_commit(int cndx, int wait) { return 0; }


x86 assembly (clang, -O0):
<mdp4_mddi_pipe_commit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mdp4_mddi_pipe_commit(i32 %0, i32 %1) {
ret i32 0
}
int my_sqrt(int x) {
  int y0 = 0, y1 = x, ym;
  for (; y0 < y1 - 1;) {
    ym = (y0 + y1) / 2;
    if (ym * ym < x)
      y0 = ym;
    else
      y1 = ym;
  }
  return y0;
}


x86 assembly (clang, -O0):
<my_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    115c <my_sqrt+0x5c>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <my_sqrt+0x51>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1157 <my_sqrt+0x57>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <my_sqrt+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sqrt>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1132 <my_sqrt+0x32>
xor    %eax,%eax
mov    %edi,%ecx
jmp    1119 <my_sqrt+0x19>
nopl   (%rax)
mov    %edx,%ecx
lea    -0x1(%rcx),%edx
cmp    %edx,%eax
jge    1132 <my_sqrt+0x32>
lea    (%rax,%rcx,1),%esi
mov    %esi,%edx
shr    $0x1f,%edx
add    %esi,%edx
sar    %edx
mov    %edx,%esi
imul   %edx,%esi
cmp    %edi,%esi
jge    1110 <my_sqrt+0x10>
mov    %edx,%eax
jmp    1112 <my_sqrt+0x12>
ret

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

LLVM IR (-O2):
define i32 @my_sqrt(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %14
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, %5
%7 = sdiv i32 %6, 2
%8 = mul nsw i32 %7, %7
%9 = icmp slt i32 %8, %0
%10 = select i1 %9, i32 %5, i32 %7
%11 = select i1 %9, i32 %7, i32 %4
%12 = add nsw i32 %10, -1
%13 = icmp slt i32 %11, %12
br i1 %13, label %3, label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %11, %3 ]
ret i32 %15
}
int pointerCmpFn(const void *p1, const void *p2) {
  void *v1, *v2;
  v1 = *((void **)p1);
  v2 = *((void **)p2);
  if (v1 == v2)
    return 0;
  return (v1 < v2) ? -1 : +1;
}


x86 assembly (clang, -O0):
<pointerCmpFn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    113c <pointerCmpFn+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1157 <pointerCmpFn+0x57>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointerCmpFn>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setae  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @pointerCmpFn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = icmp eq i8* %4, %6
%8 = icmp ult i8* %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int ALIGN(int, int);
int pad_sg_nents(int sg_nents) { return ALIGN(sg_nents, 4); }


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

x86 assembly (clang, -O2):
<pad_sg_nents>:
mov    $0x4,%esi
jmp    1030 <ALIGN@plt>

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

LLVM IR (-O2):
define i32 @pad_sg_nents(i32 %0) {
%2 = tail call i32 @ALIGN(i32 %0, i32 4)
ret i32 %2
}
void d2i_OCSP_REVOKEDINFO(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
int fstat(int, struct stat *);
int fsize(int fd) {
  struct stat sb;
  if (fstat(fd, &sb) == -1)
    err(1, "fstat");
  return sb.st_size;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
jne    1151 <fsize+0x31>
mov    $0x1,%edi
lea    0xeb4(%rip),%rsi
call   1030 <err@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
jne    113f <fsize+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [6 x i8] c"fstat\00"
define i32 @fsize(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fstat(i32 %4, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @err(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [6 x i8] c"fstat\00"
define i32 @fsize(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
char UART0_GetChar();
int /*<<< orphan*/ UART0_Port_Init();
int /*<<< orphan*/ UART0_PutChar(char);
int /*<<< orphan*/ UART0_SendString(char *);
int /*<<< orphan*/ UART0_Set_BaudRate();
int /*<<< orphan*/ UART0_Set_Format();
int /*<<< orphan*/ leds_OFF_all();
int /*<<< orphan*/ leds_init();
int main() {
  char data;
  leds_init();
  leds_OFF_all();
  UART0_Port_Init();
  UART0_Set_BaudRate();
  UART0_Set_Format();
  UART0_SendString("\n\rHello World!\n\r");
  while (1) {
    data = UART0_GetChar();
    UART0_PutChar(data);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <leds_init@plt>
mov    $0x0,%al
call   1080 <leds_OFF_all@plt>
mov    $0x0,%al
call   1040 <UART0_Port_Init@plt>
mov    $0x0,%al
call   1070 <UART0_Set_BaudRate@plt>
mov    $0x0,%al
call   1090 <UART0_Set_Format@plt>
lea    0xe47(%rip),%rdi
call   1050 <UART0_SendString@plt>
mov    $0x0,%al
call   10a0 <UART0_GetChar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <UART0_PutChar@plt>
jmp    11be <main+0x3e>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <leds_init@plt>
xor    %eax,%eax
call   1080 <leds_OFF_all@plt>
xor    %eax,%eax
call   1040 <UART0_Port_Init@plt>
xor    %eax,%eax
call   1070 <UART0_Set_BaudRate@plt>
xor    %eax,%eax
call   1090 <UART0_Set_Format@plt>
lea    0xe55(%rip),%rdi
call   1050 <UART0_SendString@plt>
xor    %eax,%eax
call   10a0 <UART0_GetChar@plt>
movsbl %al,%edi
call   1030 <UART0_PutChar@plt>
jmp    11b0 <main+0x30>

LLVM IR (-O0):
@.str = [17 x i8] c"\0A\0DHello World!\0A\0D\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (...) @leds_init()
%4 = call i32 (...) @leds_OFF_all()
%5 = call i32 (...) @UART0_Port_Init()
%6 = call i32 (...) @UART0_Set_BaudRate()
%7 = call i32 (...) @UART0_Set_Format()
%8 = call i32 @UART0_SendString(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %0, %9
%10 = call signext i8 (...) @UART0_GetChar()
store i8 %10, i8* %2
%11 = load i8, i8* %2
%12 = call i32 @UART0_PutChar(i8 signext %11)
br label %9
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0A\0DHello World!\0A\0D\00"
define i32 @main() {
%1 = tail call i32 (...) @leds_init()
%2 = tail call i32 (...) @leds_OFF_all()
%3 = tail call i32 (...) @UART0_Port_Init()
%4 = tail call i32 (...) @UART0_Set_BaudRate()
%5 = tail call i32 (...) @UART0_Set_Format()
%6 = tail call i32 @UART0_SendString(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %7, %0
%8 = tail call signext i8 (...) @UART0_GetChar()
%9 = tail call i32 @UART0_PutChar(i8 signext %8)
br label %7
}
int fun928() { return 928; }


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

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

LLVM IR (-O0):
define i32 @fun928() {
ret i32 928
}

LLVM IR (-O2):
define i32 @fun928() {
ret i32 928
}
unsigned char shift_right(unsigned char byte, char offset) {
  if (offset > 0)
    return byte >> offset;
  else
    return byte << -offset;
}


x86 assembly (clang, -O0):
<shift_right>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
cmp    $0x0,%eax
jle    112f <shift_right+0x2f>
movzbl -0x2(%rbp),%eax
movsbl -0x3(%rbp),%ecx
sar    %cl,%eax
mov    %al,-0x1(%rbp)
jmp    1140 <shift_right+0x40>
movzbl -0x2(%rbp),%eax
movsbl -0x3(%rbp),%edx
xor    %ecx,%ecx
sub    %edx,%ecx
shl    %cl,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_right>:
mov    %edi,%eax
mov    %esi,%ecx
shr    %cl,%eax
neg    %cl
shl    %cl,%edi
test   %sil,%sil
cmovle %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @shift_right(i8 zeroext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = ashr i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
br label %24
16: ; preds = %2
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = load i8, i8* %5
%20 = sext i8 %19 to i32
%21 = sub nsw i32 0, %20
%22 = shl i32 %18, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %3
br label %24
24: ; preds = %16, %9
%25 = load i8, i8* %3
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @shift_right(i8 zeroext %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = icmp sgt i8 %1, 0
%5 = zext i8 %0 to i32
%6 = lshr i32 %5, %3
%7 = sub nsw i32 0, %3
%8 = shl i32 %5, %7
%9 = select i1 %4, i32 %6, i32 %8
%10 = trunc i32 %9 to i8
ret i8 %10
}
int dlclose() { return -1; }


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

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

LLVM IR (-O0):
define i32 @dlclose() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @dlclose() {
ret i32 -1
}
void rop3_106_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & S;
  stk1 = *D ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_106_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_106_0_0>:
and    %edx,%esi
xor    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_106_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
store i8 %22, i8* %23
ret void
}

LLVM IR (-O2):
define void @rop3_106_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %4
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PerfCounterHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void PerfCounterLogging() { UAVObjLogging(PerfCounterHandle()); }


x86 assembly (clang, -O0):
<PerfCounterLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <PerfCounterHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PerfCounterLogging>:
push   %rax
xor    %eax,%eax
call   1040 <PerfCounterHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @PerfCounterLogging() {
%1 = call i32 (...) @PerfCounterHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PerfCounterLogging() {
%1 = tail call i32 (...) @PerfCounterHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdr_long(int /*<<< orphan*/ *, long *);
bool_t xdr_int(XDR *xdrs, int *ip) { return xdr_long(xdrs, (long *)ip); }


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

x86 assembly (clang, -O2):
<xdr_int>:
jmp    1030 <xdr_long@plt>

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

LLVM IR (-O2):
define i32 @xdr_int(i32* %0, i32* %1) {
%3 = bitcast i32* %1 to i64*
%4 = tail call i32 @xdr_long(i32* %0, i64* %3)
ret i32 %4
}
int medium_leaf(int arg) {
  int array[20];
  array[arg] = 4;
  return array[arg];
}


x86 assembly (clang, -O0):
<medium_leaf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movl   $0x4,-0x60(%rbp,%rax,4)
movslq -0x4(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @medium_leaf(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 %5
store i32 4, i32* %6
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @medium_leaf(i32 %0) {
ret i32 4
}
void yy_1_XmlReference(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_XmlReference(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ replace(int /*<<< orphan*/);
void op_replace() { replace(0); }


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

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

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

LLVM IR (-O2):
define void @op_replace() {
%1 = tail call i32 @replace(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ pow(int, int);
int get_bit(int num, int position) {
  return (num % (int)(pow(10, position + 1))) / (int)(pow(10, position));
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x1(%rbx),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %edx,%ebp
mov    $0xa,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    %ebp,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i64 @pow(i32 10, i32 %7)
%9 = trunc i64 %8 to i32
%10 = srem i32 %5, %9
%11 = load i32, i32* %4
%12 = call i64 @pow(i32 10, i32 %11)
%13 = trunc i64 %12 to i32
%14 = sdiv i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_bit(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @pow(i32 10, i32 %3)
%5 = trunc i64 %4 to i32
%6 = srem i32 %0, %5
%7 = tail call i64 @pow(i32 10, i32 %1)
%8 = trunc i64 %7 to i32
%9 = sdiv i32 %6, %8
ret i32 %9
}
int test_imm_9Cuint8_mem(unsigned char *val) {
  return ((*val) & (-0x9C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Cuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -156
%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_9Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 100
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
txt_pressure(chan, pitch, press) {
  prtime();
  printf("Pressure, chan=%d pitch=%d press=%d\n", chan + 1, pitch, press);
}


x86 assembly (clang, -O0):
<txt_pressure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_pressure>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <prtime@plt>
add    $0x1,%ebx
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Pressure, chan=%d pitch=%d press=%d\0A\00"
define i32 @txt_pressure(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = call i32 (...) @prtime()
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [37 x i8] c"Pressure, chan=%d pitch=%d press=%d\0A\00"
define i32 @txt_pressure(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @prtime()
%5 = add nsw i32 %0, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1, i32 %2)
ret i32 undef
}
const char *ccnxPortalServerAbout_MiniNotice(void) {
  return "Copyright (c) 2017 Cisco and/or its affiliates.\n";
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @ccnxPortalServerAbout_MiniNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @ccnxPortalServerAbout_MiniNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}
void pe_as_rd_pp_close(struct pe_as_rd_pp *pp) {}


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

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

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

LLVM IR (-O2):
%struct.pe_as_rd_pp = type opaque
define void @pe_as_rd_pp_close(%struct.pe_as_rd_pp* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ busy_wait();
int /*<<< orphan*/ led_config();
int /*<<< orphan*/ led_off();
int /*<<< orphan*/ led_on();
int main(void) {
  led_config();
  for (;;) {
    led_on();
    busy_wait();
    led_off();
    busy_wait();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <led_config@plt>
mov    $0x0,%al
call   1050 <led_on@plt>
mov    $0x0,%al
call   1040 <busy_wait@plt>
mov    $0x0,%al
call   1030 <led_off@plt>
mov    $0x0,%al
call   1040 <busy_wait@plt>
jmp    1156 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <led_config@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <led_on@plt>
xor    %eax,%eax
call   1040 <busy_wait@plt>
xor    %eax,%eax
call   1030 <led_off@plt>
xor    %eax,%eax
call   1040 <busy_wait@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @led_config()
br label %3
3: ; preds = %3, %0
%4 = call i32 (...) @led_on()
%5 = call i32 (...) @busy_wait()
%6 = call i32 (...) @led_off()
%7 = call i32 (...) @busy_wait()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @led_config()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @led_on()
%4 = tail call i32 (...) @busy_wait()
%5 = tail call i32 (...) @led_off()
%6 = tail call i32 (...) @busy_wait()
br label %2
}
/* Variables and functions */
scalar_t__ strtoul(char const *, int /*<<< orphan*/, int);
unsigned int mc_uint32_value(const char *value) {
  return (NULL != value) ? (unsigned int)strtoul(value, 0, 10) : 0;
}


x86 assembly (clang, -O0):
<mc_uint32_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1140 <mc_uint32_value+0x30>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    %eax,-0xc(%rbp)
jmp    114a <mc_uint32_value+0x3a>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <mc_uint32_value+0x3a>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_uint32_value>:
test   %rdi,%rdi
je     1127 <mc_uint32_value+0x17>
push   %rax
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtoul@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mc_uint32_value(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* null, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strtoul(i8* %6, i32 0, i32 10)
%8 = trunc i64 %7 to i32
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %5
%11 = phi i32 [ %8, %5 ], [ 0, %9 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @mc_uint32_value(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @strtoul(i8* %0, i32 0, i32 10)
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}