xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned long, unsigned long);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int c;
  int *p;
  foo((unsigned long)&p, (unsigned long)&c);
  *p = 3;
  test_assert(c == 3);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <foo@plt>
mov    0x10(%rsp),%rax
movl   $0x3,(%rax)
xor    %edi,%edi
cmpl   $0x3,0xc(%rsp)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32** %2 to i8*
%5 = ptrtoint i32** %2 to i64
%6 = ptrtoint i32* %1 to i64
%7 = call i32 @foo(i64 %5, i64 %6)
%8 = load i32*, i32** %2
store i32 3, i32* %8
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
%12 = call i32 @test_assert(i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char buffer[256];
  puts(gets(buffer));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
mov    %rsp,%rdi
call   1040 <gets@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = call i32 @puts(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = call i32 @puts(i32 %5)
ret i32 0
}
int longdouble2doubledouble(long double _longdouble, double *_doubledouble) {
  _doubledouble[0] = (double)_longdouble;
  _doubledouble[1] = (double)(_longdouble - (long double)_doubledouble[0]);
  return 0;
}


x86 assembly (clang, -O0):
<longdouble2doubledouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fstpl  (%rax)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldl   (%rax)
fsubrp %st,%st(1)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble2doubledouble>:
fldt   0x8(%rsp)
fstl   -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
movsd  %xmm0,(%rdi)
movsd  %xmm0,-0x10(%rsp)
fsubl  -0x10(%rsp)
fstpl  0x8(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @longdouble2doubledouble(x86_fp80 %0, double* %1) {
%3 = alloca x86_fp80
%4 = alloca double*
store x86_fp80 %0, x86_fp80* %3
store double* %1, double** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
store double %6, double* %8
%9 = load x86_fp80, x86_fp80* %3
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fpext double %12 to x86_fp80
%14 = fsub x86_fp80 %9, %13
%15 = fptrunc x86_fp80 %14 to double
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 1
store double %15, double* %17
ret i32 0
}

LLVM IR (-O2):
define i32 @longdouble2doubledouble(x86_fp80 %0, double* nocapture writeonly %1) {
%3 = fptrunc x86_fp80 %0 to double
store double %3, double* %1
%4 = fpext double %3 to x86_fp80
%5 = fsub x86_fp80 %0, %4
%6 = fptrunc x86_fp80 %5 to double
%7 = getelementptr inbounds double, double* %1, i64 1
store double %6, double* %7
ret i32 0
}
void val_delete_diphone_db(void *v) { (void)v; }


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

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

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

LLVM IR (-O2):
define void @val_delete_diphone_db(i8* nocapture %0) {
ret void
}
/* Variables and functions */
long long roundl(long double);
long long llroundl(long double x) { return roundl(x); }


x86 assembly (clang, -O0):
<llroundl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <roundl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llroundl>:
jmp    1030 <roundl@plt>

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

LLVM IR (-O2):
define i64 @llroundl(x86_fp80 %0) {
%2 = tail call i64 @roundl(x86_fp80 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ erase();
int ui_clear(void) {
  erase();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @ui_clear() {
%1 = call i32 (...) @erase()
ret i32 0
}

LLVM IR (-O2):
define i32 @ui_clear() {
%1 = tail call i32 (...) @erase()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ message(char *, char *);
void chk(char *fun, int sts) {
  if (sts != 0)
    message("%s failed", fun);
}


x86 assembly (clang, -O0):
<chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1139 <chk+0x29>
mov    -0x8(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk>:
test   %esi,%esi
je     1126 <chk+0x16>
mov    %rdi,%rax
lea    0xee2(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <message@plt>
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s failed\00"
define void @chk(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @message(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void VMCISock_ReleaseAFValueFd(int fd) {
  if (fd >= 0) {
    close(fd);
  }
}


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

x86 assembly (clang, -O2):
<VMCISock_ReleaseAFValueFd>:
test   %edi,%edi
js     1119 <VMCISock_ReleaseAFValueFd+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @VMCISock_ReleaseAFValueFd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
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 @VMCISock_ReleaseAFValueFd(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
void zero_string(char *str, int size) {
  int i;
  for (i = 0; i < size; i++) {
    str[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<zero_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <zero_string+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <zero_string+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_string>:
test   %esi,%esi
jle    1122 <zero_string+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zero_string(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
struct hostent *gethostbyname(char const *);
int /*<<< orphan*/ perror(char *);
struct hostent *std_gethostbyname(const char *name) {
  struct hostent *h_ent;
  if ((h_ent = gethostbyname(name)) == NULL) {
    perror("gethostbyname");
    exit(1);
  }
  return h_ent;
}


x86 assembly (clang, -O0):
<std_gethostbyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gethostbyname@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1169 <std_gethostbyname+0x39>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_gethostbyname>:
push   %rax
call   1030 <gethostbyname@plt>
test   %rax,%rax
je     113d <std_gethostbyname+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
%struct.hostent = type { i32 }
@.str = [14 x i8] c"gethostbyname\00"
define %struct.hostent* @std_gethostbyname(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
%3 = icmp eq %struct.hostent* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret %struct.hostent* %2
}
unsigned int constant_time_ge(unsigned int a, unsigned int b) {
  return ~constant_time_lt(a, b);
}


x86 assembly (clang, -O0):
<constant_time_ge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <constant_time_lt@plt>
xor    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @constant_time_ge(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 = call i32 (i32, i32, ...) bitcast (i32 (...)* @constant_time_lt to i32 (i32, i32, ...)*)(i32 %5, i32 %6)
%8 = xor i32 %7, -1
ret i32 %8
}

LLVM IR (-O2):
define i32 @constant_time_ge(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @constant_time_lt to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%4 = xor i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sdsfree(void *);
void dictSdsDestructor(void *privdata, void *val) { sdsfree(val); }


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

x86 assembly (clang, -O2):
<dictSdsDestructor>:
mov    %rsi,%rdi
jmp    1030 <sdsfree@plt>

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

LLVM IR (-O2):
define void @dictSdsDestructor(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @sdsfree(i8* %1)
ret void
}
int dect_has_b_field(unsigned char *packet) {
  if ((packet[5] & 0x0e) != 0x0e)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<dect_has_b_field>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0xe,%eax
cmp    $0xe,%eax
je     1128 <dect_has_b_field+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <dect_has_b_field+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dect_has_b_field>:
mov    0x5(%rdi),%cl
not    %cl
xor    %eax,%eax
test   $0xe,%cl
setne  %al
ret

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

LLVM IR (-O2):
define i32 @dect_has_b_field(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 5
%3 = load i8, i8* %2
%4 = and i8 %3, 14
%5 = icmp ne i8 %4, 14
%6 = zext i1 %5 to i32
ret i32 %6
}
int func(void) { return 1496; }


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

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

LLVM IR (-O0):
define i32 @func() {
ret i32 1496
}

LLVM IR (-O2):
define i32 @func() {
ret i32 1496
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void exite() { exit(0); }


x86 assembly (clang, -O0):
<exite>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @exite() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @exite() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void *dmc_unrar_io_dummy_open_func(const char *path) {
  (void)path;
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @dmc_unrar_io_dummy_open_func(i8* nocapture readnone %0) {
ret i8* null
}
void MEM0_set_exception(int num, void *handler) {
  unsigned long *exception_ptr = (unsigned long *)((long)0x000000FC - 4 * num);
  *exception_ptr = *((unsigned long *)handler);
}


x86 assembly (clang, -O0):
<MEM0_set_exception>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
movslq %eax,%rcx
mov    $0xfc,%eax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MEM0_set_exception>:
shl    $0x2,%edi
movslq %edi,%rax
mov    $0xfc,%ecx
sub    %rax,%rcx
mov    (%rsi),%rax
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @MEM0_set_exception(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = mul nsw i32 4, %6
%8 = sext i32 %7 to i64
%9 = sub nsw i64 252, %8
%10 = inttoptr i64 %9 to i64*
store i64* %10, i64** %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i64*
%13 = load i64, i64* %12
%14 = load i64*, i64** %5
store i64 %13, i64* %14
ret void
}

LLVM IR (-O2):
define void @MEM0_set_exception(i32 %0, i8* nocapture %1) {
%3 = shl nsw i32 %0, 2
%4 = sext i32 %3 to i64
%5 = sub nsw i64 252, %4
%6 = inttoptr i64 %5 to i64*
%7 = bitcast i8* %1 to i64*
%8 = load i64, i64* %7
store i64 %8, i64* %6
ret void
}
void test2_BlinkMilli2_pollen__reset__E() {}


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

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

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

LLVM IR (-O2):
define void @test2_BlinkMilli2_pollen__reset__E() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f0(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ f1(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ g0(int /*<<< orphan*/, int /*<<< orphan*/);
void test() {
  f0(0, 0);
  g0(0, 0);
  f1(0, 0);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <f0@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <g0@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <f1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <f0@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <g0@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <f1@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 @f0(i32 0, i32 0)
%2 = call i32 @g0(i32 0, i32 0)
%3 = call i32 @f1(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @f0(i32 0, i32 0)
%2 = tail call i32 @g0(i32 0, i32 0)
%3 = tail call i32 @f1(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendfile(char *);
int main() {
  sendfile("simple.c");
  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 <sendfile@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"simple.c\00"
define i32 @main() {
%1 = tail call i32 @sendfile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
char *xmalloc(size)
int size;
{
  char *p = (char *)malloc(size);
  if (!p)
    fatal_error("Not enough memory");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <xmalloc+0x31>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <fatal_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
movslq %edi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xmalloc+0x1f>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <fatal_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Not enough memory\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [18 x i8] c"Not enough memory\00"
define i8* @xmalloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i8* %3
}
int test_imm_D2int16_reg(short val) {
  return ((val) & (-0xD2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D2int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff2e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D2int16_reg>:
test   $0xff2e,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D2int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -210
%6 = icmp ne i32 %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_D2int16_reg(i16 signext %0) {
%2 = and i16 %0, -210
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void rt2x00leds_suspend(struct rt2x00_dev *rt2x00dev) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
define void @rt2x00leds_suspend(%struct.rt2x00_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_quaddobl_container_to_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(264, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_container_to_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x108,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_container_to_start_system>:
mov    $0x108,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_container_to_start_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 264, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_container_to_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 264, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int dns_txt_cmp(const struct dns_txt *a __attribute__((unused)),
                const struct dns_txt *b __attribute__((unused))) {
  return -1;
}


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

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

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

LLVM IR (-O2):
%struct.dns_txt = type opaque
define i32 @dns_txt_cmp(%struct.dns_txt* nocapture readnone %0, %struct.dns_txt* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int chdir(char const *);
int chroot(char const *);
int chroot_to(const char *dirname) {
  if (chdir(dirname) == -1)
    return -1;
  if (chroot(dirname) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<chroot_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <chdir@plt>
cmp    $0xffffffff,%eax
jne    114a <chroot_to+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <chroot_to+0x4f>
mov    -0x10(%rbp),%rdi
call   1030 <chroot@plt>
cmp    $0xffffffff,%eax
jne    1168 <chroot_to+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <chroot_to+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chroot_to>:
push   %rbx
mov    %rdi,%rbx
call   1040 <chdir@plt>
cmp    $0xffffffff,%eax
je     1144 <chroot_to+0x24>
mov    %rbx,%rdi
call   1030 <chroot@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @chroot_to(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @chroot(i8* %0)
%6 = icmp eq i32 %5, -1
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void final_bar() { printf("]\n"); }


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"]\00"
define void @final_bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void badalloc() {
  printf("internal error: bad alloc\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<badalloc>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badalloc>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"internal error: bad alloc\0A\00"
define void @badalloc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"internal error: bad alloc\00"
define void @badalloc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ B4800;
int /*<<< orphan*/ CS8;
scalar_t__ logitech_command(int, char *);
int /*<<< orphan*/ setline(int, int /*<<< orphan*/, int /*<<< orphan*/);
int warrior_init(int fd, unsigned long *id, unsigned long *extra) {
  if (logitech_command(fd, "*S"))
    return -1;
  setline(fd, CS8, B4800);
  return 0;
}


x86 assembly (clang, -O0):
<warrior_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    0xec3(%rip),%rsi
call   1030 <logitech_command@plt>
cmp    $0x0,%rax
je     1158 <warrior_init+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <warrior_init+0x59>
mov    -0x8(%rbp),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
call   1040 <setline@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warrior_init>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
call   1030 <logitech_command@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     113e <warrior_init+0x1e>
pop    %rbx
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
call   1040 <setline@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"*S\00"
@CS8 = global i32 0
@B4800 = global i32 0
define i32 @warrior_init(i32 %0, i64* nocapture readnone %1, i64* nocapture readnone %2) {
%4 = tail call i64 @logitech_command(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @CS8
%8 = load i32, i32* @B4800
%9 = tail call i32 @setline(i32 %0, i32 %7, i32 %8)
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ 0, %6 ], [ -1, %3 ]
ret i32 %11
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
unsigned long xatoull_range_sfx(char const *, unsigned long, unsigned long,
                                struct suffix_mult const *);
__attribute__((always_)) unsigned long
xatoul_range_sfx(const char *str, unsigned long l, unsigned long u,
                 const struct suffix_mult *sfx) {
  return xatoull_range_sfx(str, l, u, sfx);
}


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

x86 assembly (clang, -O2):
<xatoul_range_sfx>:
jmp    1030 <xatoull_range_sfx@plt>

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i64 @xatoul_range_sfx(i8* %0, i64 %1, i64 %2, %struct.suffix_mult* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca %struct.suffix_mult*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store %struct.suffix_mult* %3, %struct.suffix_mult** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load %struct.suffix_mult*, %struct.suffix_mult** %8
%13 = call i64 @xatoull_range_sfx(i8* %9, i64 %10, i64 %11, %struct.suffix_mult* %12)
ret i64 %13
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i64 @xatoul_range_sfx(i8* %0, i64 %1, i64 %2, %struct.suffix_mult* %3) {
%5 = tail call i64 @xatoull_range_sfx(i8* %0, i64 %1, i64 %2, %struct.suffix_mult* %3)
ret i64 %5
}
initb(char_ptr, string) char *char_ptr, *string;
{
  int n;
  while ((n = getval(&string)) != -32760)
    *char_ptr++ = n;
}


x86 assembly (clang, -O0):
<initb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <getval@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffff8008,%eax
je     1154 <initb+0x44>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1120 <initb+0x10>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initb>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <getval@plt>
cmp    $0xffff8008,%eax
je     1147 <initb+0x37>
mov    %rsp,%r14
nop
mov    %al,(%rbx)
add    $0x1,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <getval@plt>
cmp    $0xffff8008,%eax
jne    1130 <initb+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @initb(i8* nocapture writeonly %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 (i8**, ...) bitcast (i32 (...)* @getval to i32 (i8**, ...)*)(i8** %3)
%5 = icmp eq i32 %4, -32760
br i1 %5, label %13, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %11, %6 ], [ %4, %2 ]
%8 = phi i8* [ %10, %6 ], [ %0, %2 ]
%9 = trunc i32 %7 to i8
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %9, i8* %8
%11 = call i32 (i8**, ...) bitcast (i32 (...)* @getval to i32 (i8**, ...)*)(i8** %3)
%12 = icmp eq i32 %11, -32760
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UARTBreakCtl(uint32_t ui32Base, bool bBreakState) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) =
      (bBreakState
           ? ((*((volatile uint32_t *)(ui32Base + 0x0000002C))) | 0x00000001)
           : ((*((volatile uint32_t *)(ui32Base + 0x0000002C))) &
              ~(0x00000001)));
}


x86 assembly (clang, -O0):
<UARTBreakCtl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1129 <UARTBreakCtl+0x29>
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <UARTBreakCtl+0x39>
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%eax
and    $0xfffffffe,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTBreakCtl>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
movslq %edi,%rcx
mov    0x2c(%rcx),%edx
and    $0xfffffffe,%edx
or     %edx,%eax
mov    %eax,0x2c(%rcx)
ret

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

LLVM IR (-O2):
define void @UARTBreakCtl(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = add nsw i32 %0, 44
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -2
%9 = zext i1 %3 to i32
%10 = or i32 %8, %9
store volatile i32 %10, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_hr() {
  for (int i = 0; i < 5; ++i)
    putchar('-');
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_hr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1141 <print_hr+0x31>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <print_hr+0xf>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hr>:
push   %rax
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_hr() {
%1 = tail call i32 @putchar(i8 signext 45)
%2 = tail call i32 @putchar(i8 signext 45)
%3 = tail call i32 @putchar(i8 signext 45)
%4 = tail call i32 @putchar(i8 signext 45)
%5 = tail call i32 @putchar(i8 signext 45)
%6 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  char buf[1024];
  int n;
  while ((n = read(0, buf, 1024)) > 0)
    write(1, buf, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rsi
xor    %edi,%edi
mov    $0x400,%edx
call   1040 <read@plt>
mov    %eax,-0x414(%rbp)
cmp    $0x0,%eax
jle    1170 <main+0x50>
lea    -0x410(%rbp),%rsi
mov    -0x414(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x400,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1162 <main+0x42>
mov    %rsp,%rbx
xchg   %ax,%ax
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
test   %eax,%eax
jg     1140 <main+0x20>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = call i32 @read(i32 0, i8* %5, i32 1024)
store i32 %6, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @write(i32 1, i8* %9, i32 %10)
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 1024)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = phi i32 [ %8, %5 ], [ %3, %0 ]
%7 = call i32 @write(i32 1, i8* %2, i32 %6)
%8 = call i32 @read(i32 0, i8* %2, i32 1024)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
void I400Mirror() {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @I400Mirror() {
ret void
}
void insertNode(struct node *ptr) {}


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

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

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

LLVM IR (-O2):
%struct.node = type opaque
define void @insertNode(%struct.node* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_DANGER(int /*<<< orphan*/);
int gen_DANGER() {
  handle_DANGER(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_DANGER() {
%1 = call i32 @handle_DANGER(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_DANGER() {
%1 = tail call i32 @handle_DANGER(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "Usage: %s [-M shmkey] [-m shmid] [-Q msgkey]\n",
                getprogname());
  (void)fprintf(stderr, "\t[-q msqid] [-S semkey] [-s semid] ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%r14
mov    (%r14),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb4(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: %s [-M shmkey] [-m shmid] [-Q msgkey]\0A\00"
@.str.1 = [40 x i8] c"\09[-q msqid] [-S semkey] [-s semid] ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @stderr
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: %s [-M shmkey] [-m shmid] [-Q msgkey]\0A\00"
@.str.1 = [40 x i8] c"\09[-q msqid] [-S semkey] [-s semid] ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ err(int, char *, int);
void close_or_die(int d) {
  if (close(d) != 0) {
    err(1, "close(2) failed: d=%d", d);
  }
}


x86 assembly (clang, -O0):
<close_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     1151 <close_or_die+0x31>
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xeb4(%rip),%rsi
call   1040 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_or_die>:
push   %rbx
mov    %edi,%ebx
call   1030 <close@plt>
test   %rax,%rax
je     1141 <close_or_die+0x21>
lea    0xecc(%rip),%rsi
mov    $0x1,%edi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <err@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"close(2) failed: d=%d\00"
define void @close_or_die(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @close(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @err(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"close(2) failed: d=%d\00"
define void @close_or_die(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}