xunge/DecIR huggingface dataset:
char *sdup(s)
register const char *s;
{
  int n = strlen(s) + 1;
  char *cp = newchunk(n);
  (strncpy((cp), (s), (n)), ((n) <= 0 ? 0 : ((cp)[(n)-1] = '\0')), strlen((s)));
  return (cp);
}


x86 assembly (clang, -O0):
<sdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1050 <newchunk@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
call   1030 <strncpy@plt>
cmpl   $0x0,-0xc(%rbp)
jg     117c <sdup+0x4c>
jmp    118d <sdup+0x5d>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdup>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%r14
lea    0x1(%rax),%ebp
mov    %ebp,%edi
xor    %eax,%eax
call   1050 <newchunk@plt>
movslq %eax,%rbx
movslq %ebp,%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strncpy@plt>
cmp    $0x7ffffffe,%r14d
ja     116f <sdup+0x3f>
mov    %r14d,%eax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @sdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @newchunk to i32 (i32, ...)*)(i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = sext i32 %4 to i64
%9 = tail call i8* @strncpy(i8* dereferenceable(1) %7, i8* %0, i64 %8)
%10 = icmp ugt i32 %3, 2147483646
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = and i64 %2, 4294967295
%13 = getelementptr inbounds i8, i8* %7, i64 %12
store i8 0, i8* %13
br label %14
14: ; preds = %1, %11
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Host_WriteDataToSoundBuffer(unsigned char *pData, unsigned long Length) {
  fprintf(stderr, ".\n");
}


x86 assembly (clang, -O0):
<Host_WriteDataToSoundBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c".\0A\00"
define void @Host_WriteDataToSoundBuffer(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c".\0A\00"
define void @Host_WriteDataToSoundBuffer(i8* nocapture readnone %0, i64 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
void xmlvm_init_native_java_lang_Runtime() {}


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

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

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

LLVM IR (-O2):
define void @xmlvm_init_native_java_lang_Runtime() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rpgp_is_newline(char);
void rpgp_skip_to_newline(char **p) {
  while (!rpgp_is_newline(**p)) {
    (*p)++;
  }
}


x86 assembly (clang, -O0):
<rpgp_skip_to_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <rpgp_is_newline@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1140 <rpgp_skip_to_newline+0x30>
jmp    1153 <rpgp_skip_to_newline+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <rpgp_skip_to_newline+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpgp_skip_to_newline>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <rpgp_is_newline@plt>
test   %eax,%eax
jne    1139 <rpgp_skip_to_newline+0x29>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1120 <rpgp_skip_to_newline+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @rpgp_skip_to_newline(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %10, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = call i32 @rpgp_is_newline(i8 signext %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %11
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @rpgp_skip_to_newline(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i32 @rpgp_is_newline(i8 signext %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1, %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = tail call i32 @rpgp_is_newline(i8 signext %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %6, label %12
12: ; preds = %6, %1
ret void
}
toupper(c) char c;
{ return ((c >= 'a' && c <= 'z') ? c -= '\040' : c); }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1139 <toupper+0x39>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1139 <toupper+0x39>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <toupper+0x40>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    0xe0(%rdi),%ecx
movsbl %dil,%eax
mov    %edi,%edx
shl    $0x18,%edx
add    $0x9fffffff,%edx
cmp    $0x1affffff,%edx
movzbl %cl,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
%16 = sext i8 %15 to i32
br label %20
17: ; preds = %7, %1
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
br label %20
20: ; preds = %17, %11
%21 = phi i32 [ %16, %11 ], [ %19, %17 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1610612737
%4 = icmp ult i32 %3, 452984831
%5 = add i32 %0, 224
%6 = and i32 %5, 255
%7 = ashr exact i32 %2, 24
%8 = select i1 %4, i32 %6, i32 %7
ret i32 %8
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int _dl_stat(const char *path, struct stat *buf) { return stat(path, buf); }


x86 assembly (clang, -O0):
<_dl_stat>:
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 <stat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dl_stat>:
jmp    1030 <stat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_dl_stat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @stat(i8* %0, %struct.stat* %1)
ret i32 %3
}
void rop3_32_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = *D & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_32_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 -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %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_32_0_0>:
not    %sil
and    %dl,%sil
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_32_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
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_32_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
%6 = load i8, i8* %0
%7 = and i8 %5, %6
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void mergeSort(int *A, int p, int r) {
  if (p < r) {
    int q = (p + r) / 2;
    mergeSort(A, p, q);
    mergeSort(A, (q + 1), r);
    merge(A, p, q, r);
  }
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergeSort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    %edx,%esi
jge    1172 <mergeSort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <mergeSort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <mergeSort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

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

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergeSort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergeSort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
char pop(char *buff, int *top) {
  if (*top == 0)
    return -1;
  return buff[--(*top)];
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1122 <pop+0x22>
movb   $0xff,-0x1(%rbp)
jmp    113a <pop+0x3a>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
mov    (%rdx),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
movslq (%rsi),%rax
test   %rax,%rax
je     1113 <pop+0x13>
lea    -0x1(%rax),%rcx
mov    %ecx,(%rsi)
mov    -0x1(%rdi,%rax,1),%al
ret
mov    $0xff,%al
ret

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

LLVM IR (-O2):
define signext i8 @pop(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = add nsw i32 %3, -1
store i32 %6, i32* %1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
br label %10
10: ; preds = %2, %5
%11 = phi i8 [ %9, %5 ], [ -1, %2 ]
ret i8 %11
}
void RTMemTmpAllocZTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemTmpAllocZTag() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ITEM_rptr(int /*<<< orphan*/);
int /*<<< orphan*/ *ASN1_item_d2i_bio(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ **);
int /*<<< orphan*/ RSAPublicKey;
RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa) {
  return ASN1_item_d2i_bio(ASN1_ITEM_rptr(RSAPublicKey), bp, rsa);
}


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

x86 assembly (clang, -O2):
<d2i_RSAPublicKey_bio>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ASN1_item_d2i_bio@plt>

LLVM IR (-O0):
@RSAPublicKey = global i32 0
define i32* @d2i_RSAPublicKey_bio(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = load i32, i32* @RSAPublicKey
%6 = call i32 @ASN1_ITEM_rptr(i32 %5)
%7 = load i32*, i32** %3
%8 = load i32**, i32*** %4
%9 = call i32* @ASN1_item_d2i_bio(i32 %6, i32* %7, i32** %8)
ret i32* %9
}

LLVM IR (-O2):
@RSAPublicKey = global i32 0
define i32* @d2i_RSAPublicKey_bio(i32* %0, i32** %1) {
%3 = load i32, i32* @RSAPublicKey
%4 = tail call i32 @ASN1_ITEM_rptr(i32 %3)
%5 = tail call i32* @ASN1_item_d2i_bio(i32 %4, i32* %0, i32** %1)
ret i32* %5
}
/* Variables and functions */
double qfrmiq_(int *);
double qfrmiq(int iq) {
  iq++;
  return qfrmiq_(&iq);
}


x86 assembly (clang, -O0):
<qfrmiq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <qfrmiq_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qfrmiq>:
push   %rax
add    $0x1,%edi
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <qfrmiq_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @qfrmiq(i32 %0) {
%2 = alloca i32
%3 = add nsw i32 %0, 1
store i32 %3, i32* %2
%4 = call double @qfrmiq_(i32* %2)
ret double %4
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t vid_to_data_oid(uint32_t vid, uint32_t idx) {
  return ((uint64_t)vid << 32) | idx;
}


x86 assembly (clang, -O0):
<vid_to_data_oid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vid_to_data_oid(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 = shl i32 %5, 32
%7 = load i32, i32* %4
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @vid_to_data_oid(i32 %0, i32 %1) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(void *dados) {
  int *ptr = (int *)dados;
  printf("(%d) ", *ptr);
}


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

x86 assembly (clang, -O2):
<print>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"(%d) \00"
define void @print(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"(%d) \00"
define void @print(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cleanup(void) { printf("In the cleanup function now..\n"); }


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"In the cleanup function now..\0A\00"
define void @cleanup() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"In the cleanup function now..\00"
define void @cleanup() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_chars(void *data) { printf("%s ", ((char *)((void *)(data)))); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @print_chars(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void i2d_PKCS8_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_PKCS8_bio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
char *strerror(int);
void MyErr(int error) {
  printf("error : %s with errno : %d\n", strerror(error), error);
}


x86 assembly (clang, -O0):
<MyErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strerror@plt>
mov    %rax,%rsi
mov    -0x4(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyErr>:
push   %rbx
mov    %edi,%ebx
call   1040 <strerror@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"error : %s with errno : %d\0A\00"
define void @MyErr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @strerror(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"error : %s with errno : %d\0A\00"
define void @MyErr(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %0)
ret void
}
int XwcTextPropertyToTextList() {}


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

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

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

LLVM IR (-O2):
define i32 @XwcTextPropertyToTextList() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
long gethostid(void) {
  fprintf(stderr, "XXX: gethostid() returns a constant\n");
  return (0xba33e1f1);
}


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

x86 assembly (clang, -O2):
<gethostid>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xba33e1f1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"XXX: gethostid() returns a constant\0A\00"
define i64 @gethostid() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i64 3123962353
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"XXX: gethostid() returns a constant\0A\00"
define i64 @gethostid() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i64 3123962353
}
/* Variables and functions */
int /*<<< orphan*/ testDH();
int /*<<< orphan*/ testHMAC();
int /*<<< orphan*/ testPBKDF2();
int /*<<< orphan*/ testPRNG();
int /*<<< orphan*/ testRSA();
int main(int argc, char *argv[]) {
  testHMAC();
  testRSA();
  testDH();
  testPRNG();
  testPBKDF2();
  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    $0x0,%al
call   1040 <testHMAC@plt>
mov    $0x0,%al
call   1030 <testRSA@plt>
mov    $0x0,%al
call   1070 <testDH@plt>
mov    $0x0,%al
call   1060 <testPRNG@plt>
mov    $0x0,%al
call   1050 <testPBKDF2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <testHMAC@plt>
xor    %eax,%eax
call   1030 <testRSA@plt>
xor    %eax,%eax
call   1070 <testDH@plt>
xor    %eax,%eax
call   1060 <testPRNG@plt>
xor    %eax,%eax
call   1050 <testPBKDF2@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 = call i32 (...) @testHMAC()
%7 = call i32 (...) @testRSA()
%8 = call i32 (...) @testDH()
%9 = call i32 (...) @testPRNG()
%10 = call i32 (...) @testPBKDF2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testHMAC()
%4 = tail call i32 (...) @testRSA()
%5 = tail call i32 (...) @testDH()
%6 = tail call i32 (...) @testPRNG()
%7 = tail call i32 (...) @testPBKDF2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ private_core_vfs_file_obj_init();
void core_vfs_init() {
  private_core_vfs_file_obj_init();
  return;
}


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

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

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

LLVM IR (-O2):
define void @core_vfs_init() {
%1 = tail call i32 (...) @private_core_vfs_file_obj_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version() {
  printf("The Hydrogen Programming Language\n"
         "Version "
         "0.1.0"
         "\n"
         "Hydrogen is a toy programming language by Ben Anderson.\n");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [105 x i8] c"The Hydrogen Programming Language\0AVersion 0.1.0\0AHydrogen is a toy programming language by Ben Anderson.\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [104 x i8] c"The Hydrogen Programming Language\0AVersion 0.1.0\0AHydrogen is a toy programming language by Ben Anderson.\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_79int64_highword_reg(long long val) {
  return ((val >> 32) & (0x79 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_79int64_highword_reg>:
movabs $0x7900000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_79int64_highword_reg(i64 %0) {
%2 = and i64 %0, 519691042816
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ buildbinarytotrinary();
int /*<<< orphan*/ buildexpandtable();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  buildbinarytotrinary();
  buildexpandtable();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <buildbinarytotrinary@plt>
mov    $0x0,%al
call   1040 <buildexpandtable@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <buildbinarytotrinary@plt>
xor    %eax,%eax
call   1040 <buildexpandtable@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @buildbinarytotrinary()
%3 = call i32 (...) @buildexpandtable()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @buildbinarytotrinary()
%2 = tail call i32 (...) @buildexpandtable()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int INT_MAX;
void *__mingw_aligned_realloc(void *, unsigned int, int);
void *av_realloc(void *ptr, unsigned int size) {
  if (size > (INT_MAX - 16))
    return NULL;
  return __mingw_aligned_realloc(ptr, size, 16);
}


x86 assembly (clang, -O0):
<av_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ebf(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x10,%ecx
cmp    %ecx,%eax
jbe    1143 <av_realloc+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1158 <av_realloc+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x10,%edx
call   1030 <__mingw_aligned_realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_realloc>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
add    $0xfffffff0,%eax
cmp    %esi,%eax
jae    1123 <av_realloc+0x13>
xor    %eax,%eax
ret
mov    $0x10,%edx
jmp    1030 <__mingw_aligned_realloc@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define i8* @av_realloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* @INT_MAX
%8 = sub nsw i32 %7, 16
%9 = icmp ugt i32 %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i8* null, i8** %3
br label %15
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = call i8* @__mingw_aligned_realloc(i8* %12, i32 %13, i32 16)
store i8* %14, i8** %3
br label %15
15: ; preds = %11, %10
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i8* @av_realloc(i8* %0, i32 %1) {
%3 = load i32, i32* @INT_MAX
%4 = add nsw i32 %3, -16
%5 = icmp ult i32 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @__mingw_aligned_realloc(i8* %0, i32 %1, i32 16)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %9
}
int add(int a, int b, ...) { return a + b; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add(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 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1, ...) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ i2c_SCL_set(int);
int /*<<< orphan*/ i2c_SDA_set(int);
void i2c_stop_cond(void) {
  i2c_SDA_set(0);
  i2c_SCL_set(0);
  i2c_SCL_set(1);
  i2c_SDA_set(1);
}


x86 assembly (clang, -O0):
<i2c_stop_cond>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <i2c_SDA_set@plt>
xor    %edi,%edi
call   1040 <i2c_SCL_set@plt>
mov    $0x1,%edi
call   1040 <i2c_SCL_set@plt>
mov    $0x1,%edi
call   1030 <i2c_SDA_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_stop_cond>:
push   %rax
xor    %edi,%edi
call   1030 <i2c_SDA_set@plt>
xor    %edi,%edi
call   1040 <i2c_SCL_set@plt>
mov    $0x1,%edi
call   1040 <i2c_SCL_set@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <i2c_SDA_set@plt>

LLVM IR (-O0):
define void @i2c_stop_cond() {
%1 = call i32 @i2c_SDA_set(i32 0)
%2 = call i32 @i2c_SCL_set(i32 0)
%3 = call i32 @i2c_SCL_set(i32 1)
%4 = call i32 @i2c_SDA_set(i32 1)
ret void
}

LLVM IR (-O2):
define void @i2c_stop_cond() {
%1 = tail call i32 @i2c_SDA_set(i32 0)
%2 = tail call i32 @i2c_SCL_set(i32 0)
%3 = tail call i32 @i2c_SCL_set(i32 1)
%4 = tail call i32 @i2c_SDA_set(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_program_out(int, int);
int /*<<< orphan*/ io_usleep(int);
void pic12_begin_programming(void) {
  io_program_out(0x08, 6);
  io_usleep((2000));
}


x86 assembly (clang, -O0):
<pic12_begin_programming>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x6,%esi
call   1040 <io_program_out@plt>
mov    $0x7d0,%edi
call   1030 <io_usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic12_begin_programming>:
push   %rax
mov    $0x8,%edi
mov    $0x6,%esi
call   1040 <io_program_out@plt>
mov    $0x7d0,%edi
pop    %rax
jmp    1030 <io_usleep@plt>

LLVM IR (-O0):
define void @pic12_begin_programming() {
%1 = call i32 @io_program_out(i32 8, i32 6)
%2 = call i32 @io_usleep(i32 2000)
ret void
}

LLVM IR (-O2):
define void @pic12_begin_programming() {
%1 = tail call i32 @io_program_out(i32 8, i32 6)
%2 = tail call i32 @io_usleep(i32 2000)
ret void
}
unsigned long max_ul(unsigned long val1, unsigned long val2) {
  return (val1 > val2) ? val1 : val2;
}


x86 assembly (clang, -O0):
<max_ul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <max_ul+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max_ul+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_ul>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max_ul(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 ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max_ul(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ conf_report();
int /*<<< orphan*/ connection_report();
int /*<<< orphan*/ exchange_report();
int /*<<< orphan*/ sa_report();
int /*<<< orphan*/ timer_report();
int /*<<< orphan*/ transport_report();
void ui_report(char *cmd) {
  sa_report();
  exchange_report();
  transport_report();
  connection_report();
  timer_report();
  conf_report();
}


x86 assembly (clang, -O0):
<ui_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <sa_report@plt>
mov    $0x0,%al
call   1040 <exchange_report@plt>
mov    $0x0,%al
call   1080 <transport_report@plt>
mov    $0x0,%al
call   1030 <connection_report@plt>
mov    $0x0,%al
call   1070 <timer_report@plt>
mov    $0x0,%al
call   1060 <conf_report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui_report>:
push   %rax
xor    %eax,%eax
call   1050 <sa_report@plt>
xor    %eax,%eax
call   1040 <exchange_report@plt>
xor    %eax,%eax
call   1080 <transport_report@plt>
xor    %eax,%eax
call   1030 <connection_report@plt>
xor    %eax,%eax
call   1070 <timer_report@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <conf_report@plt>

LLVM IR (-O0):
define void @ui_report(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @sa_report()
%4 = call i32 (...) @exchange_report()
%5 = call i32 (...) @transport_report()
%6 = call i32 (...) @connection_report()
%7 = call i32 (...) @timer_report()
%8 = call i32 (...) @conf_report()
ret void
}

LLVM IR (-O2):
define void @ui_report(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @sa_report()
%3 = tail call i32 (...) @exchange_report()
%4 = tail call i32 (...) @transport_report()
%5 = tail call i32 (...) @connection_report()
%6 = tail call i32 (...) @timer_report()
%7 = tail call i32 (...) @conf_report()
ret void
}
/* Variables and functions */
double pow(double, double);
double convert_it_3(double x) { return pow(x, -7.0 / 3.0); }


x86 assembly (clang, -O0):
<convert_it_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_it_3>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @convert_it_3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0xC002AAAAAAAAAAAB)
ret double %4
}

LLVM IR (-O2):
define double @convert_it_3(double %0) {
%2 = tail call double @pow(double %0, double 0xC002AAAAAAAAAAAB)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ print_char(char);
int /*<<< orphan*/ print_combination_4();
int main(void) {
  print_combination_4();
  print_char('\n');
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @print_combination_4()
%3 = call i32 @print_char(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_combination_4()
%2 = tail call i32 @print_char(i8 signext 10)
ret i32 0
}
int ZBarcode_Version() { return (2 * 10000) + (6 * 100) + 2; }


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

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

LLVM IR (-O0):
define i32 @ZBarcode_Version() {
ret i32 20602
}

LLVM IR (-O2):
define i32 @ZBarcode_Version() {
ret i32 20602
}
/* Variables and functions */
int /*<<< orphan*/ func(int, int);
int /*<<< orphan*/ funcd();
int main() {
  func(1, 2);
  funcd();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <func@plt>
mov    $0x0,%al
call   1040 <funcd@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @func(i32 1, i32 2)
%2 = call i32 (...) @funcd()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 1, i32 2)
%2 = tail call i32 (...) @funcd()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void write_padded(char *s, int c, FILE *out) {
  while (0 < c) {
    fputc(s[0], out);
    if (0 != s[0])
      s = s + 1;
    c = c - 1;
  }
}


x86 assembly (clang, -O0):
<write_padded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jge    116b <write_padded+0x5b>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     115d <write_padded+0x4d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <write_padded+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_padded>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <write_padded+0x3a>
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rbx),%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
cmpb   $0x1,(%rbx)
sbb    $0xffffffffffffffff,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <write_padded+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @write_padded(i8* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %16
5: ; preds = %3, %5
%6 = phi i8* [ %13, %5 ], [ %0, %3 ]
%7 = phi i32 [ %14, %5 ], [ %1, %3 ]
%8 = load i8, i8* %6
%9 = tail call i32 @fputc(i8 signext %8, i32* %2)
%10 = load i8, i8* %6
%11 = icmp ne i8 %10, 0
%12 = zext i1 %11 to i64
%13 = getelementptr i8, i8* %6, i64 %12
%14 = add nsw i32 %7, -1
%15 = icmp ugt i32 %7, 1
br i1 %15, label %5, label %16
16: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void date_now(char *date_str) {
  time_t t = time(NULL);
  struct tm *timeinfo;
  timeinfo = localtime(&t);
  strftime(date_str, 20, "%F", timeinfo);
}


x86 assembly (clang, -O0):
<date_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x14,%esi
lea    0xe97(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_now>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%F\00"
define void @date_now(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%F\00"
define void @date_now(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}
const char *get_system_type(void) { return "TANBAC TB0229"; }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"TANBAC TB0229\00"
define i8* @get_system_type() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"TANBAC TB0229\00"
define i8* @get_system_type() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
long long longlong_id(long long x) { return x; }


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

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

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

LLVM IR (-O2):
define i64 @longlong_id(i64 returned %0) {
ret i64 %0
}
void pcp_print_fchost_stats(struct activity *a, int curr) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_fchost_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
int m_max(int a, int b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<m_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <m_max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <m_max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @m_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}