xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t packer_uint16_hton(uint16_t value) {
  return ((value >> 8) & 0x00FF) | ((value << 8) & 0xFF00);
}


x86 assembly (clang, -O0):
<packer_uint16_hton>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<packer_uint16_hton>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @packer_uint16_hton(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
%8 = and i32 %7, 65280
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @packer_uint16_hton(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ derror(char *);
int yyerror(char *s) {
  derror(s);
  return -1;
}


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

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
call   1030 <derror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @yyerror(i8* %0) {
%2 = tail call i32 @derror(i8* %0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void deallocate(void *v, size_t sz) {
  (void)&(sz);
  free(v);
}


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

x86 assembly (clang, -O2):
<deallocate>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @deallocate(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
void foo755(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo755(i32 %0) {
ret void
}
int is_leap_year(int year) {
  return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <is_leap_year+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <is_leap_year+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <is_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
void ex_nstrncpy(char *target, char *source, int maxlen) {
  while (maxlen-- && *source != ' ')
    *target++ = *source++;
  *target = '\0';
}


x86 assembly (clang, -O0):
<ex_nstrncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1138 <ex_nstrncpy+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1148 <ex_nstrncpy+0x48>
jmp    116f <ex_nstrncpy+0x6f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110f <ex_nstrncpy+0xf>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_nstrncpy>:
test   %edx,%edx
je     1127 <ex_nstrncpy+0x27>
mov    %edx,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%edx
cmp    $0x20,%dl
je     1124 <ex_nstrncpy+0x24>
mov    %dl,(%rdi,%rax,1)
add    $0x1,%rax
cmp    %eax,%ecx
jne    1110 <ex_nstrncpy+0x10>
add    %rax,%rdi
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @ex_nstrncpy(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3, %12
%6 = phi i32 [ %9, %12 ], [ %2, %3 ]
%7 = phi i8* [ %13, %12 ], [ %1, %3 ]
%8 = phi i8* [ %14, %12 ], [ %0, %3 ]
%9 = add nsw i32 %6, -1
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 32
br i1 %11, label %16, label %12
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %10, i8* %8
%15 = icmp eq i32 %9, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %12, %3
%17 = phi i8* [ %0, %3 ], [ %14, %12 ], [ %8, %5 ]
store i8 0, i8* %17
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const int64_t;

/* Variables and functions */
__attribute__((always_)) const int64_t doubleToRawLongBits(double d) {
  union {
    double f;
    int64_t i;
  } tmp;
  tmp.f = d;
  return tmp.i;
}


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

x86 assembly (clang, -O2):
<doubleToRawLongBits>:
movq   %xmm0,%rax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @doubleToRawLongBits(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast %union.anon* %3 to double*
store double %4, double* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @doubleToRawLongBits(double %0) {
%2 = bitcast double %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
int nsize(int n) {
  int i = 0;
  do
    i++;
  while (n /= 10);
  return i;
}


x86 assembly (clang, -O0):
<nsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    110e <nsize+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsize>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <nsize+0x10>
ret

LLVM IR (-O0):
define i32 @nsize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 10
store i32 %9, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %7
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @nsize(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = sdiv i32 %3, 10
%7 = add i32 %3, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 %5
}
/* Variables and functions */
int japi_getcurpos(int);
int j_getcurpos(int arg0) { return (japi_getcurpos(arg0)); }


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

x86 assembly (clang, -O2):
<j_getcurpos>:
jmp    1030 <japi_getcurpos@plt>

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

LLVM IR (-O2):
define i32 @j_getcurpos(i32 %0) {
%2 = tail call i32 @japi_getcurpos(i32 %0)
ret i32 %2
}
int _falwcDefaultTextExtents() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_falwcDefaultTextExtents() {
ret i32 0
}
/* Variables and functions */
scalar_t__ stroscmp(char const *, char const *);
int is_trash_directory_traverser(const char path[], const char trash_dir[],
                                 void *arg) {
  if (stroscmp(path, trash_dir) == 0) {
    int *const result = arg;
    *result = 1;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_trash_directory_traverser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <stroscmp@plt>
cmp    $0x0,%rax
jne    1159 <is_trash_directory_traverser+0x49>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1160 <is_trash_directory_traverser+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_trash_directory_traverser>:
push   %rbx
mov    %rdx,%rbx
call   1030 <stroscmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1125 <is_trash_directory_traverser+0x15>
pop    %rbx
ret
movl   $0x1,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_trash_directory_traverser(i8* %0, i8* %1, i8* nocapture writeonly %2) {
%4 = tail call i64 @stroscmp(i8* %0, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = bitcast i8* %2 to i32*
store i32 1, i32* %7
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %9
}
double bar(const char *x, long y) { return 0.0; }


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

x86 assembly (clang, -O2):
<bar>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @bar(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @bar(i8* nocapture readnone %0, i64 %1) {
ret double 0.000000e+00
}
/* Variables and functions */
int allocate_pid();
int /*<<< orphan*/ print_map();
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
int /*<<< orphan*/ release_pid(int);
int /*<<< orphan*/ sleep(int);
void *thread_task(void *param) {
  int pid = allocate_pid();
  print_map();
  sleep(3);
  release_pid(pid);
  pthread_exit(0);
}


x86 assembly (clang, -O0):
<thread_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <allocate_pid@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <print_map@plt>
mov    $0x3,%edi
call   1070 <sleep@plt>
mov    -0x14(%rbp),%edi
call   1060 <release_pid@plt>
xor    %edi,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_task>:
push   %rbx
xor    %eax,%eax
call   1030 <allocate_pid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <print_map@plt>
mov    $0x3,%edi
call   1070 <sleep@plt>
mov    %ebx,%edi
call   1060 <release_pid@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @thread_task(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = call i32 (...) @allocate_pid()
store i32 %5, i32* %4
%6 = call i32 (...) @print_map()
%7 = call i32 @sleep(i32 3)
%8 = load i32, i32* %4
%9 = call i32 @release_pid(i32 %8)
%10 = call i32 @pthread_exit(i32 0)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @thread_task(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @allocate_pid()
%3 = tail call i32 (...) @print_map()
%4 = tail call i32 @sleep(i32 3)
%5 = tail call i32 @release_pid(i32 %2)
%6 = tail call i32 @pthread_exit(i32 0)
ret i8* undef
}
void g_thread_pool_unprocessed() {}


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

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

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

LLVM IR (-O2):
define void @g_thread_pool_unprocessed() {
ret void
}
int *f(int *array) { return &array[10]; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x28,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x28(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 10
ret i32* %4
}

LLVM IR (-O2):
define i32* @f(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 10
ret i32* %2
}
void UART4_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @UART4_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(double const, double const, int /*<<< orphan*/,
                                 int);
void glWindowPos2dv(const double v[2]) { glWindowPos4f(v[0], v[1], 0, 1); }


x86 assembly (clang, -O0):
<glWindowPos2dv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos2dv>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos2dv(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = call i32 @glWindowPos4f(double %5, double %8, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @glWindowPos2dv(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = tail call i32 @glWindowPos4f(double %2, double %4, i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myphell();
int main() {
  myphell();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @myphell()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void KEYBRD_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @KEYBRD_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @KEYBRD_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("First OSS Code");
  printf("Second OSS Code");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"First OSS Code\00"
@.str.1 = [16 x i8] c"Second OSS Code\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"First OSS Code\00"
@.str.1 = [16 x i8] c"Second OSS Code\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ noise();
int /*<<< orphan*/ randPoolStir();
void trueRandFlush(void) {
  noise();
  randPoolStir();
  randPoolStir();
  randPoolStir();
  randPoolStir();
}


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

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

LLVM IR (-O0):
define void @trueRandFlush() {
%1 = call i32 (...) @noise()
%2 = call i32 (...) @randPoolStir()
%3 = call i32 (...) @randPoolStir()
%4 = call i32 (...) @randPoolStir()
%5 = call i32 (...) @randPoolStir()
ret void
}

LLVM IR (-O2):
define void @trueRandFlush() {
%1 = tail call i32 (...) @noise()
%2 = tail call i32 (...) @randPoolStir()
%3 = tail call i32 (...) @randPoolStir()
%4 = tail call i32 (...) @randPoolStir()
%5 = tail call i32 (...) @randPoolStir()
ret void
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
uid_t getuid(void) { return 100; }


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

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

LLVM IR (-O0):
define i32 @getuid() {
ret i32 100
}

LLVM IR (-O2):
define i32 @getuid() {
ret i32 100
}
/* Variables and functions */
float Round(float);
float MatrixTrace(float mat[3][3]) {
  return Round(mat[0][0] + mat[1][1] + mat[2][2]);
}


x86 assembly (clang, -O0):
<MatrixTrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x20(%rax),%xmm0
call   1030 <Round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatrixTrace>:
movss  (%rdi),%xmm0
addss  0x10(%rdi),%xmm0
addss  0x20(%rdi),%xmm0
jmp    1030 <Round@plt>

LLVM IR (-O0):
define float @MatrixTrace([3 x float]* %0) {
%2 = alloca [3 x float]*
store [3 x float]* %0, [3 x float]** %2
%3 = load [3 x float]*, [3 x float]** %2
%4 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0
%5 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
%6 = load float, float* %5
%7 = load [3 x float]*, [3 x float]** %2
%8 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 1
%9 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 1
%10 = load float, float* %9
%11 = fadd float %6, %10
%12 = load [3 x float]*, [3 x float]** %2
%13 = getelementptr inbounds [3 x float], [3 x float]* %12, i64 2
%14 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 2
%15 = load float, float* %14
%16 = fadd float %11, %15
%17 = call float @Round(float %16)
ret float %17
}

LLVM IR (-O2):
define float @MatrixTrace([3 x float]* nocapture %0) {
%2 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 0, i64 0
%3 = load float, float* %2
%4 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 1, i64 1
%5 = load float, float* %4
%6 = fadd float %3, %5
%7 = getelementptr inbounds [3 x float], [3 x float]* %0, i64 2, i64 2
%8 = load float, float* %7
%9 = fadd float %6, %8
%10 = tail call float @Round(float %9)
ret float %10
}
/* Variables and functions */
int atoi(char *);
int main(void) { return atoi("5"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"5\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @atoi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
int my_showmem(char *str, int size) {
  str[0] += 48;
  size--;
  return (0);
}


x86 assembly (clang, -O0):
<my_showmem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x30,%ecx
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_showmem>:
addb   $0x30,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @my_showmem(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, 48
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
%11 = load i32, i32* %4
%12 = add nsw i32 %11, -1
store i32 %12, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @my_showmem(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 48
store i8 %4, i8* %0
ret i32 0
}
int myLibFunction() { return 42; }


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

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

LLVM IR (-O0):
define i32 @myLibFunction() {
ret i32 42
}

LLVM IR (-O2):
define i32 @myLibFunction() {
ret i32 42
}
/* Type definitions */
typedef scalar_t__ uint_least16_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_uint_least16_t(uint_least16_t const k1,
                                           uint_least16_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_uint_least16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_uint_least16_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_uint_least16_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_uint_least16_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
fun3() { printf("Iam in function 3\n"); }


x86 assembly (clang, -O0):
<fun3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"Iam in function 3\0A\00"
define i32 @fun3() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [18 x i8] c"Iam in function 3\00"
define i32 @fun3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int bitwiseAdditionRecursive(int n, int m) {
  if (m == 0)
    return n;
  else {
    int carry = n & m;
    return bitwiseAdditionRecursive(n ^ m, carry << 1);
  }
}


x86 assembly (clang, -O0):
<bitwiseAdditionRecursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <bitwiseAdditionRecursive+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <bitwiseAdditionRecursive+0x40>
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
xor    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
shl    $0x1,%esi
call   1030 <bitwiseAdditionRecursive@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitwiseAdditionRecursive>:
mov    %edi,%eax
test   %esi,%esi
je     111a <bitwiseAdditionRecursive+0x1a>
mov    %esi,%ecx
nopl   0x0(%rax,%rax,1)
and    %eax,%ecx
xor    %esi,%eax
add    %ecx,%ecx
mov    %ecx,%esi
jne    1110 <bitwiseAdditionRecursive+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitwiseAdditionRecursive(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = phi i32 [ %8, %4 ], [ %0, %2 ]
%7 = and i32 %5, %6
%8 = xor i32 %5, %6
%9 = shl i32 %7, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ %0, %2 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int pract6();
int main() {
  int ret_status;
  ret_status = pract6();
  return ret_status;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pract6()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_help() {
  fprintf(stdout, "\nSYNTAX\n");
  fprintf(stdout, "  extrae-loader [OPTIONS] <binary> [args ...]\n\n");
  fprintf(stdout, "OPTIONS\n");
  fprintf(stdout, "\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeeb(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeda(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeec(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"\0ASYNTAX\0A\00"
@.str.1 = [48 x i8] c" extrae-loader [OPTIONS] <binary> [args ...]\0A\0A\00"
@.str.2 = [9 x i8] c"OPTIONS\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @print_help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"\0ASYNTAX\0A\00"
@.str.1 = [48 x i8] c" extrae-loader [OPTIONS] <binary> [args ...]\0A\0A\00"
@.str.2 = [9 x i8] c"OPTIONS\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @print_help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_inet6_tx_sock(int sock_fd) {
  {};
  if (sock_fd != -1) {
    close(sock_fd);
  }
  {};
}


x86 assembly (clang, -O0):
<close_inet6_tx_sock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     112d <close_inet6_tx_sock+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_inet6_tx_sock>:
cmp    $0xffffffff,%edi
je     111a <close_inet6_tx_sock+0xa>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @close_inet6_tx_sock(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
void os_fill(int x, int y, int colour1, int colour2) {}


x86 assembly (clang, -O0):
<os_fill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @os_fill(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @os_fill(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EI();
int /*<<< orphan*/ RET();
void RETI() {
  RET();
  EI();
}


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

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

LLVM IR (-O0):
define void @RETI() {
%1 = call i32 (...) @RET()
%2 = call i32 (...) @EI()
ret void
}

LLVM IR (-O2):
define void @RETI() {
%1 = tail call i32 (...) @RET()
%2 = tail call i32 (...) @EI()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void my_exit2(void) {
  fprintf(stderr, "I entered the second destructor function \n");
}


x86 assembly (clang, -O0):
<my_exit2>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_exit2>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"I entered the second destructor function \0A\00"
define void @my_exit2() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"I entered the second destructor function \0A\00"
define void @my_exit2() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
int do_009() { return 9; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x9,%eax
ret

LLVM IR (-O0):
define i32 @do_009() {
ret i32 9
}

LLVM IR (-O2):
define i32 @do_009() {
ret i32 9
}
int jac_chain_nm4_alloc(void **mem, const int *idata, const double *rdata) {
  if (mem)
    *mem = 0;
  (void)idata;
  (void)rdata;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm4_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <jac_chain_nm4_alloc+0x26>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm4_alloc>:
test   %rdi,%rdi
je     110c <jac_chain_nm4_alloc+0xc>
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jac_chain_nm4_alloc(i8** writeonly %0, i32* nocapture readnone %1, double* nocapture readnone %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* null, i8** %0
br label %6
6: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ runAllTests_aggregate();
int main(void) {
  runAllTests_aggregate();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runAllTests_aggregate()
ret i32 0
}
void const_mem_pool_dealloc(void *cc, void *mem) {}


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

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

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

LLVM IR (-O2):
define void @const_mem_pool_dealloc(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void foo(x, fn) void (*fn)();
{
  int a = baz((void *)0, x);
  (*fn)(x, 0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
mov    $0x0,%al
call   1030 <baz@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x0,%al
call   *%rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
xor    %edi,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <baz@plt>
mov    %ebx,%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rcx

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

LLVM IR (-O2):
define void @foo(i32 %0, void (...)* nocapture %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @baz to i32 (i8*, i32, ...)*)(i8* null, i32 %0)
%4 = bitcast void (...)* %1 to void (i32, i32, ...)*
tail call void (i32, i32, ...) %4(i32 %0, i32 0)
ret void
}
char *tmpnam(s)
char *s;
{
  static char name[50];
  char *mktemp();
  if (!s)
    s = name;
  (void)sprintf(s, "%s/XXXXXX", "/tmp");
  return (mktemp(s));
}


x86 assembly (clang, -O0):
<tmpnam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1142 <tmpnam+0x22>
lea    0x2f02(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb3(%rip),%rsi
lea    0xeb6(%rip),%rdx
mov    $0x0,%al
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <mktemp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpnam>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
lea    0x2f12(%rip),%rax
cmove  %rax,%rbx
lea    0xec7(%rip),%rsi
lea    0xeca(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <mktemp@plt>

LLVM IR (-O0):
@tmpnam.name = internal global [50 x i8] zeroinitializer
@.str = [10 x i8] c"%s/XXXXXX\00"
@.str.1 = [5 x i8] c"/tmp\00"
define i8* @tmpnam(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 %6, label %5
5: ; preds = %1
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @tmpnam.name, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = call i8* (i8*, ...) bitcast (i8* (...)* @mktemp to i8* (i8*, ...)*)(i8* %9)
ret i8* %10
}

LLVM IR (-O2):
@tmpnam.name = internal global [50 x i8] zeroinitializer
@.str = [10 x i8] c"%s/XXXXXX\00"
@.str.1 = [5 x i8] c"/tmp\00"
define i8* @tmpnam(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @tmpnam.name, i64 0, i64 0), i8* %0
%4 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i8* (i8*, ...) bitcast (i8* (...)* @mktemp to i8* (i8*, ...)*)(i8* %3)
ret i8* %5
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *f_strdup(const char *src) {
  char *dest = NULL;
  if (src) {
    dest = malloc(strlen(src) + 1);
    if (dest) {
      strcpy(dest, src);
    }
  }
  return dest;
}


x86 assembly (clang, -O0):
<f_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1185 <f_strdup+0x55>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1180 <f_strdup+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1185 <f_strdup+0x55>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <f_strdup+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <f_strdup+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <f_strdup+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @f_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %10
10: ; preds = %3, %8, %1
%11 = phi i8* [ %6, %8 ], [ null, %3 ], [ null, %1 ]
ret i8* %11
}
void case3() {}


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

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

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

LLVM IR (-O2):
define void @case3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n, tri_num = 0;
  for (n = 1; n <= 200; n = n + 1) {
    tri_num = tri_num + n;
  }
  printf("The 200th triangular number is %i\n", tri_num);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [35 x i8] c"The 200th triangular number is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 20100)
ret i32 0
}