xunge/DecIR huggingface dataset:
/* Variables and functions */
int downInt(int);
int /*<<< orphan*/ make(char *);
int upInt(int);
void produce() {
  int blocked;
  while (1) {
    blocked = downInt(5);
    if (!blocked) {
      blocked = downInt(4);
      if (!blocked) {
        make("product");
        blocked = upInt(4);
        blocked = upInt(6);
      }
    }
  }
}


x86 assembly (clang, -O0):
<produce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1030 <downInt@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1191 <produce+0x61>
mov    $0x4,%edi
call   1030 <downInt@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    118c <produce+0x5c>
lea    0xe93(%rip),%rdi
call   1050 <make@plt>
mov    $0x4,%edi
call   1040 <upInt@plt>
mov    %eax,-0x4(%rbp)
mov    $0x6,%edi
call   1040 <upInt@plt>
mov    %eax,-0x4(%rbp)
jmp    1191 <produce+0x61>
jmp    1138 <produce+0x8>

x86 assembly (clang, -O2):
<produce>:
push   %rbx
lea    0xec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x5,%edi
call   1030 <downInt@plt>
test   %eax,%eax
jne    1140 <produce+0x10>
mov    $0x4,%edi
call   1030 <downInt@plt>
test   %eax,%eax
jne    1140 <produce+0x10>
mov    %rbx,%rdi
call   1050 <make@plt>
mov    $0x4,%edi
call   1040 <upInt@plt>
mov    $0x6,%edi
call   1040 <upInt@plt>
jmp    1140 <produce+0x10>

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

LLVM IR (-O2):
@.str = [8 x i8] c"product\00"
define void @produce() {
br label %1
1: ; preds = %7, %0
%2 = tail call i32 @downInt(i32 5)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @downInt(i32 4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4, %8, %1
br label %1
8: ; preds = %4
%9 = tail call i32 @make(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @upInt(i32 4)
%11 = tail call i32 @upInt(i32 6)
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ ngen2(char *, char *, int, int);
void cgincpl(int a, int v) { ngen2("%s\t$%d,%d(%%rbp)", "addq", v, a); }


x86 assembly (clang, -O0):
<cgincpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xed5(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <ngen2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgincpl>:
mov    %esi,%edx
mov    %edi,%ecx
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <ngen2@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s\09$%d,%d(%%rbp)\00"
@.str.1 = [5 x i8] c"addq\00"
define void @cgincpl(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 = load i32, i32* %3
%7 = call i32 @ngen2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s\09$%d,%d(%%rbp)\00"
@.str.1 = [5 x i8] c"addq\00"
define void @cgincpl(i32 %0, i32 %1) {
%3 = tail call i32 @ngen2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int pow(double, int);
double sqrt(int);
double correlationTTest(double r, int n) {
  return r * sqrt(n - 2) / sqrt(1 - pow(r, 2));
}


x86 assembly (clang, -O0):
<correlationTTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    $0x1,%edi
sub    %eax,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<correlationTTest>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
add    $0xfffffffe,%edi
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    $0x1,%edi
sub    %eax,%edi
call   1040 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @correlationTTest(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 2
%8 = call double @sqrt(i32 %7)
%9 = fmul double %5, %8
%10 = load double, double* %3
%11 = call i32 @pow(double %10, i32 2)
%12 = sub nsw i32 1, %11
%13 = call double @sqrt(i32 %12)
%14 = fdiv double %9, %13
ret double %14
}

LLVM IR (-O2):
define double @correlationTTest(double %0, i32 %1) {
%3 = add nsw i32 %1, -2
%4 = tail call double @sqrt(i32 %3)
%5 = fmul double %4, %0
%6 = tail call i32 @pow(double %0, i32 2)
%7 = sub nsw i32 1, %6
%8 = tail call double @sqrt(i32 %7)
%9 = fdiv double %5, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ onion_poller_stop(void *);
int onion_poller_stop_helper(void *p) {
  onion_poller_stop(p);
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @onion_poller_stop_helper(i8* %0) {
%2 = tail call i32 @onion_poller_stop(i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n, i;
  printf("Entrez la taille de la chaine:\n");
  scanf("%d", &n);
  printf("Entrez les caractères un a un:\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Entrez la taille de la chaine:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"Entrez les caract\C3\A8res un a un:\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [31 x i8] c"Entrez la taille de la chaine:\00"
@str.3 = [32 x i8] c"Entrez les caract\C3\A8res un a un:\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.3, i64 0, i64 0))
ret void
}
int valid_bo_post_v2(long value) {
  if ((value & 0x14) == 0)
    return (value & 0x1) == 0;
  else if ((value & 0x14) == 0x14)
    return value == 0x14;
  else
    return 1;
}


x86 assembly (clang, -O0):
<valid_bo_post_v2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x14,%rax
cmp    $0x0,%rax
jne    1136 <valid_bo_post_v2+0x36>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <valid_bo_post_v2+0x64>
mov    -0x10(%rbp),%rax
and    $0x14,%rax
cmp    $0x14,%rax
jne    115d <valid_bo_post_v2+0x5d>
cmpq   $0x14,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <valid_bo_post_v2+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_bo_post_v2>:
mov    %edi,%ecx
and    $0x14,%ecx
cmp    $0x14,%rcx
je     1118 <valid_bo_post_v2+0x18>
mov    $0x1,%al
test   %rcx,%rcx
jne    111f <valid_bo_post_v2+0x1f>
test   $0x1,%dil
jmp    111c <valid_bo_post_v2+0x1c>
cmp    $0x14,%rdi
sete   %al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @valid_bo_post_v2(i64 %0) {
%2 = and i64 %0, 20
switch i64 %2, label %8 [
i64 0, label %3
i64 20, label %6
]
3: ; preds = %1
%4 = and i64 %0, 1
%5 = icmp eq i64 %4, 0
br label %8
6: ; preds = %1
%7 = icmp eq i64 %0, 20
br label %8
8: ; preds = %1, %6, %3
%9 = phi i1 [ %5, %3 ], [ %7, %6 ], [ true, %1 ]
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(int /*<<< orphan*/, char *);
int gmx_fio_open(char *, char *);
int open_trx(char *outfile, char *filemode) {
  if (filemode[0] != 'w' && filemode[0] != 'a')
    fatal_error(0, "Sorry, write_trx can only write");
  return gmx_fio_open(outfile, filemode);
}


x86 assembly (clang, -O0):
<open_trx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x77,%eax
je     115e <open_trx+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
je     115e <open_trx+0x3e>
xor    %edi,%edi
lea    0xea7(%rip),%rsi
call   1040 <fatal_error@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_fio_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_trx>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%al
cmp    $0x61,%al
je     1142 <open_trx+0x22>
cmp    $0x77,%al
je     1142 <open_trx+0x22>
lea    0xec5(%rip),%rsi
xor    %edi,%edi
call   1040 <fatal_error@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <gmx_fio_open@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Sorry, write_trx can only write\00"
define i32 @open_trx(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 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 119
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 97
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %10, %2
%19 = load i8*, i8** %3
%20 = load i8*, i8** %4
%21 = call i32 @gmx_fio_open(i8* %19, i8* %20)
ret i32 %21
}

LLVM IR (-O2):
@.str = [32 x i8] c"Sorry, write_trx can only write\00"
define i32 @open_trx(i8* %0, i8* %1) {
%3 = load i8, i8* %1
switch i8 %3, label %4 [
i8 119, label %6
i8 97, label %6
]
4: ; preds = %2
%5 = tail call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %2, %2, %4
%7 = tail call i32 @gmx_fio_open(i8* %0, i8* %1)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int syslog_open(void) {
  openlog("LCAPD", LOG_PID, LOG_USER);
  return 0;
}


x86 assembly (clang, -O0):
<syslog_open>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edx
lea    0xed3(%rip),%rdi
call   1030 <openlog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syslog_open>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edx
lea    0xed6(%rip),%rdi
call   1030 <openlog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"LCAPD\00"
@LOG_PID = global i32 0
@LOG_USER = global i32 0
define i32 @syslog_open() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_USER
%3 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"LCAPD\00"
@LOG_PID = global i32 0
@LOG_USER = global i32 0
define i32 @syslog_open() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_USER
%3 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
void tok_rewind(unsigned *cur) { *cur = 0; }


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

x86 assembly (clang, -O2):
<tok_rewind>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @tok_rewind(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ __ptsname_r(int, char *, int);
char *ptsname(int fd) {
  static char buf[9 + sizeof(int) * 3 + 1];
  return __ptsname_r(fd, buf, sizeof buf) < 0 ? 0 : buf;
}


x86 assembly (clang, -O0):
<ptsname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f1b(%rip),%rsi
mov    $0x16,%edx
call   1030 <__ptsname_r@plt>
mov    %rax,%rdx
lea    0x2f07(%rip),%rax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovl  %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptsname>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
mov    $0x16,%edx
call   1030 <__ptsname_r@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmovns %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ptsname.buf = internal global [22 x i8] zeroinitializer
define i8* @ptsname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @__ptsname_r(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @ptsname.buf, i64 0, i64 0), i32 22)
%5 = icmp slt i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* null, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @ptsname.buf, i64 0, i64 0)
ret i8* %7
}

LLVM IR (-O2):
@ptsname.buf = internal global [22 x i8] zeroinitializer
define i8* @ptsname(i32 %0) {
%2 = tail call i64 @__ptsname_r(i32 %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @ptsname.buf, i64 0, i64 0), i32 22)
%3 = icmp slt i64 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @ptsname.buf, i64 0, i64 0)
ret i8* %4
}
int is_prefix_of(const char *prefix, const char *str) {
  while (*prefix) {
    if (*prefix++ != *str++) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prefix_of>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <is_prefix_of+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1151 <is_prefix_of+0x51>
movl   $0x0,-0x4(%rbp)
jmp    115d <is_prefix_of+0x5d>
jmp    110c <is_prefix_of+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prefix_of>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1127 <is_prefix_of+0x27>
lea    0x1(%rax),%rdx
cmp    (%rsi,%rax,1),%cl
mov    %rdx,%rax
je     1110 <is_prefix_of+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prefix_of(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %10, %8 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %5
%12 = icmp eq i8 %6, %11
br i1 %12, label %3, label %13
13: ; preds = %3, %8
%14 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %14
}
void end_async(gc) struct cache *gc;
{
  del_cache(gc);
  async_write_finish(gc);
  free((void *)gc);
}


x86 assembly (clang, -O0):
<end_async>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <del_cache@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <async_write_finish@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_async>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <del_cache@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <async_write_finish@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.cache = type opaque
define void @end_async(%struct.cache* %0) {
%2 = alloca %struct.cache*
store %struct.cache* %0, %struct.cache** %2
%3 = load %struct.cache*, %struct.cache** %2
%4 = call i32 (%struct.cache*, ...) bitcast (i32 (...)* @del_cache to i32 (%struct.cache*, ...)*)(%struct.cache* %3)
%5 = load %struct.cache*, %struct.cache** %2
%6 = call i32 (%struct.cache*, ...) bitcast (i32 (...)* @async_write_finish to i32 (%struct.cache*, ...)*)(%struct.cache* %5)
%7 = load %struct.cache*, %struct.cache** %2
%8 = bitcast %struct.cache* %7 to i8*
ret void
}

LLVM IR (-O2):
%struct.cache = type opaque
define void @end_async(%struct.cache* %0) {
%2 = tail call i32 (%struct.cache*, ...) bitcast (i32 (...)* @del_cache to i32 (%struct.cache*, ...)*)(%struct.cache* %0)
%3 = tail call i32 (%struct.cache*, ...) bitcast (i32 (...)* @async_write_finish to i32 (%struct.cache*, ...)*)(%struct.cache* %0)
%4 = bitcast %struct.cache* %0 to i8*
tail call void @free(i8* %4)
ret void
}
int pos_julian_year_estimate(long n) {
  int y = (int)((4L * n - 6885692L) / 1461L);
  return (y < 1) ? 1 : y;
}


x86 assembly (clang, -O0):
<pos_julian_year_estimate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
sub    $0x69113c,%rax
mov    $0x5b5,%ecx
cqto
idiv   %rcx
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    113a <pos_julian_year_estimate+0x3a>
mov    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1140 <pos_julian_year_estimate+0x40>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_julian_year_estimate>:
lea    -0x69113c(,%rdi,4),%rax
ff
movabs $0xb36d8397914268c9,%rcx
83 6d b3
imul   %rcx
lea    (%rdx,%rdi,4),%rcx
add    $0xffffffffff96eec4,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
shr    $0xa,%rcx
add    %eax,%ecx
test   %ecx,%ecx
mov    $0x1,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @pos_julian_year_estimate(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul nsw i64 4, %4
%6 = sub nsw i64 %5, 6885692
%7 = sdiv i64 %6, 1461
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %1
br label %14
12: ; preds = %1
%13 = load i32, i32* %3
br label %14
14: ; preds = %12, %11
%15 = phi i32 [ 1, %11 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @pos_julian_year_estimate(i64 %0) {
%2 = shl nsw i64 %0, 2
%3 = add nsw i64 %2, -6885692
%4 = sdiv i64 %3, 1461
%5 = trunc i64 %4 to i32
%6 = icmp sgt i32 %5, 1
%7 = select i1 %6, i32 %5, i32 1
ret i32 %7
}
long long long_dec(const void *buf) { return *((long long *)buf); }


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

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

LLVM IR (-O0):
define i64 @long_dec(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @long_dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
__attribute__((always_)) void ftrace_nmi_enter(void) {}


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

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

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

LLVM IR (-O2):
define void @ftrace_nmi_enter() {
ret void
}
void SteamAPI_SetMiniDumpComment(const char *pchMsg) {
  xlogf("%s(pchMsg = %s)\n", __func__, pchMsg);
}


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

x86 assembly (clang, -O2):
<SteamAPI_SetMiniDumpComment>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s(pchMsg = %s)\0A\00"
@__func__.SteamAPI_SetMiniDumpComment = [28 x i8] c"SteamAPI_SetMiniDumpComment\00"
define void @SteamAPI_SetMiniDumpComment(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__func__.SteamAPI_SetMiniDumpComment, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s(pchMsg = %s)\0A\00"
@__func__.SteamAPI_SetMiniDumpComment = [28 x i8] c"SteamAPI_SetMiniDumpComment\00"
define void @SteamAPI_SetMiniDumpComment(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__func__.SteamAPI_SetMiniDumpComment, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Test 2 is running.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Test 2 is running.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void PrtMsgX(mp, pn, f, xv) char *mp;
char *pn;
void (*f)();
int xv;
{
  if (mp)
    PrtMsg(mp, pn);
  if (f)
    (void)(*f)();
  (void)LTlibClean();
  exit(xv);
}


x86 assembly (clang, -O0):
<PrtMsgX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1161 <PrtMsgX+0x31>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <PrtMsg@plt>
cmpq   $0x0,-0x18(%rbp)
je     1171 <PrtMsgX+0x41>
mov    $0x0,%al
call   *-0x18(%rbp)
mov    $0x0,%al
call   1040 <LTlibClean@plt>
mov    -0x1c(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<PrtMsgX>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
test   %rdi,%rdi
je     1144 <PrtMsgX+0x14>
xor    %eax,%eax
call   1030 <PrtMsg@plt>
test   %rbx,%rbx
je     114d <PrtMsgX+0x1d>
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1040 <LTlibClean@plt>
mov    %ebp,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @PrtMsgX(i8* %0, i8* %1, void (...)* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca void (...)*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store void (...)* %2, void (...)** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @PrtMsg to i32 (i8*, i8*, ...)*)(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %4
%16 = load void (...)*, void (...)** %7
%17 = icmp ne void (...)* %16, null
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = load void (...)*, void (...)** %7
br label %20
20: ; preds = %18, %15
%21 = call i32 (...) @LTlibClean()
%22 = load i32, i32* %8
unreachable
}

LLVM IR (-O2):
define void @PrtMsgX(i8* %0, i8* %1, void (...)* %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @PrtMsg to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
br label %8
8: ; preds = %6, %4
%9 = icmp eq void (...)* %2, null
br i1 %9, label %11, label %10
10: ; preds = %8
tail call void (...) %2()
br label %11
11: ; preds = %10, %8
%12 = tail call i32 (...) @LTlibClean()
tail call void @exit(i32 %3)
unreachable
}
/* Type definitions */
struct headerd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ criaHeader(struct headerd **);
int main() {
  struct headerd *header = NULL;
  criaHeader(&header);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <criaHeader@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <criaHeader@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.headerd = type { i32 }
define i32 @main() {
%1 = alloca %struct.headerd*
%2 = bitcast %struct.headerd** %1 to i8*
store %struct.headerd* null, %struct.headerd** %1
%3 = call i32 @criaHeader(%struct.headerd** %1)
ret i32 0
}
main(q) {
  scanf("%d", &q);
  printf("%d\n", t(~(~0 << q), 0, 0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%edi
shl    %cl,%edi
xor    $0xffffffff,%edi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <t@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x4(%rsp),%cl
mov    $0xffffffff,%edi
shl    %cl,%edi
not    %edi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <t@plt>
lea    0xe9c(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = shl nsw i32 -1, %4
%6 = xor i32 %5, -1
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @t to i32 (i32, i32, i32, ...)*)(i32 %6, i32 0, i32 0)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Type definitions */
struct tgl_state {
  int dummy;
};
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int fetch_int();
int /*<<< orphan*/ fetch_long();
void work_new_detailed_info(struct tgl_state *TLS,
                            struct connection *c __attribute__((unused)),
                            long long msg_id __attribute__((unused))) {
  assert(fetch_int() == (int)0x809db6df);
  fetch_long();
  fetch_int();
  fetch_int();
}


x86 assembly (clang, -O0):
<work_new_detailed_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <fetch_int@plt>
cmp    $0x809db6df,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1030 <fetch_long@plt>
mov    $0x0,%al
call   1040 <fetch_int@plt>
mov    $0x0,%al
call   1040 <fetch_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<work_new_detailed_info>:
push   %rax
xor    %eax,%eax
call   1040 <fetch_int@plt>
xor    %edi,%edi
cmp    $0x809db6df,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
call   1030 <fetch_long@plt>
xor    %eax,%eax
call   1040 <fetch_int@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <fetch_int@plt>

LLVM IR (-O0):
%struct.tgl_state = type { i32 }
%struct.connection = type { i32 }
define void @work_new_detailed_info(%struct.tgl_state* %0, %struct.connection* %1, i64 %2) {
%4 = alloca %struct.tgl_state*
%5 = alloca %struct.connection*
%6 = alloca i64
store %struct.tgl_state* %0, %struct.tgl_state** %4
store %struct.connection* %1, %struct.connection** %5
store i64 %2, i64* %6
%7 = call i32 (...) @fetch_int()
%8 = icmp eq i32 %7, -2137147681
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 (...) @fetch_long()
%12 = call i32 (...) @fetch_int()
%13 = call i32 (...) @fetch_int()
ret void
}

LLVM IR (-O2):
%struct.tgl_state = type { i32 }
%struct.connection = type { i32 }
define void @work_new_detailed_info(%struct.tgl_state* nocapture readnone %0, %struct.connection* nocapture readnone %1, i64 %2) {
%4 = tail call i32 (...) @fetch_int()
%5 = icmp eq i32 %4, -2137147681
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 (...) @fetch_long()
%9 = tail call i32 (...) @fetch_int()
%10 = tail call i32 (...) @fetch_int()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "usage: chflags [-fhv] [-R [-H | -L | -P]] flags file ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"usage: chflags [-fhv] [-R [-H | -L | -P]] flags file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"usage: chflags [-fhv] [-R [-H | -L | -P]] flags file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void einfin(x) register unsigned short *x;
{
  register int i;
  for (i = 0; i < 6 - 1; i++)
    *x++ = 0;
  *x |= 32767;
}


x86 assembly (clang, -O0):
<einfin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    113b <einfin+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x8(%rbp)
movw   $0x0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <einfin+0xf>
mov    -0x8(%rbp),%rax
movzwl (%rax),%ecx
or     $0x7fff,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<einfin>:
movw   $0x0,0x8(%rdi)
movq   $0x0,(%rdi)
orw    $0x7fff,0xa(%rdi)
ret

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

LLVM IR (-O2):
define void @einfin(i16* nocapture %0) {
%2 = bitcast i16* %0 to i8*
%3 = getelementptr i16, i16* %0, i64 5
%4 = load i16, i16* %3
%5 = or i16 %4, 32767
store i16 %5, i16* %3
ret void
}
void blankVFSMvalidch(void *info, int seqid, int seqpos, char symbol) {
  return;
}


x86 assembly (clang, -O0):
<blankVFSMvalidch>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @blankVFSMvalidch(i8* nocapture %0, i32 %1, i32 %2, i8 signext %3) {
ret void
}
void bar() {
  static char x[10];
  static char *xend = x + 10;
}


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

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

LLVM IR (-O0):
@bar.x = internal global [10 x i8] zeroinitializer
@bar.xend = internal global i8* getelementptr inbounds ([10 x i8], [10 x i8]* @bar.x, i64 1, i64 0)
define void @bar() {
ret void
}

LLVM IR (-O2):
define void @bar() {
ret void
}
void __cxa_pure_virtual() {}


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

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

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

LLVM IR (-O2):
define void @__cxa_pure_virtual() {
ret void
}
int ft_n_count(unsigned int n, int i) {
  while (n > 9) {
    i++;
    n /= 10;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_n_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x9,-0x4(%rbp)
jbe    1131 <ft_n_count+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
jmp    110a <ft_n_count+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_n_count>:
mov    %esi,%eax
cmp    $0xa,%edi
jb     1124 <ft_n_count+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax)
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x63,%edi
mov    %edx,%edi
ja     1110 <ft_n_count+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_n_count(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, 9
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, 1
%8 = udiv i32 %6, 10
%9 = icmp ugt i32 %6, 99
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi i32 [ %1, %2 ], [ %7, %4 ]
ret i32 %11
}
/* Variables and functions */
size_t rand();
size_t test_rand(size_t start, size_t end) {
  return start + (rand() % (end - start + 1));
}


x86 assembly (clang, -O0):
<test_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x10(%rbp),%rcx
sub    -0x8(%rbp),%rcx
add    $0x1,%rcx
xor    %edx,%edx
div    %rcx
mov    -0x18(%rbp),%rax
add    %rdx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rand>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <rand@plt>
sub    %r14,%rbx
add    $0x1,%rbx
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     113e <test_rand+0x2e>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
jmp    1144 <test_rand+0x34>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @test_rand(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 = call i64 (...) @rand()
%7 = load i64, i64* %4
%8 = load i64, i64* %3
%9 = sub i64 %7, %8
%10 = add i64 %9, 1
%11 = urem i64 %6, %10
%12 = add i64 %5, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @test_rand(i64 %0, i64 %1) {
%3 = tail call i64 (...) @rand()
%4 = sub i64 1, %0
%5 = add i64 %4, %1
%6 = urem i64 %3, %5
%7 = add i64 %6, %0
ret i64 %7
}
unsigned xrop3_149_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_149_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_149_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_149_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_149_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, -256
ret i32 %5
}
/* Type definitions */
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
long ftell(int /*<<< orphan*/);
long my_ftell(struct aFILE *fp) { return ftell(_get_actual_fp(fp)); }


x86 assembly (clang, -O0):
<my_ftell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
call   1040 <ftell@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ftell>:
push   %rax
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ftell@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i64 @my_ftell(%struct.aFILE* %0) {
%2 = alloca %struct.aFILE*
store %struct.aFILE* %0, %struct.aFILE** %2
%3 = load %struct.aFILE*, %struct.aFILE** %2
%4 = call i32 @_get_actual_fp(%struct.aFILE* %3)
%5 = call i64 @ftell(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i64 @my_ftell(%struct.aFILE* %0) {
%2 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%3 = tail call i64 @ftell(i32 %2)
ret i64 %3
}
/* Type definitions */
struct timeval {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int Select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
           struct timeval *timeout) {
  int n;
  if ((n = select(nfds, readfds, writefds, exceptfds, timeout)) < 0) {
    perror("select error");
    exit(1);
  }
  return (n);
}


x86 assembly (clang, -O0):
<Select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <select@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jge    1185 <Select+0x55>
lea    0xe8a(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Select>:
push   %rax
call   1030 <select@plt>
test   %eax,%eax
js     113c <Select+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [13 x i8] c"select error\00"
define i32 @Select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca %struct.timeval*
%11 = alloca i32
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store %struct.timeval* %4, %struct.timeval** %10
%12 = load i32, i32* %6
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = load i32*, i32** %9
%16 = load %struct.timeval*, %struct.timeval** %10
%17 = call i32 @select(i32 %12, i32* %13, i32* %14, i32* %15, %struct.timeval* %16)
store i32 %17, i32* %11
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %5
%20 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %5
%23 = load i32, i32* %11
ret i32 %23
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [13 x i8] c"select error\00"
define i32 @Select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = tail call i32 @select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5
ret i32 %6
}
int module_get_filename_for_symbol(void *addr, char **filename) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @module_get_filename_for_symbol(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  while (1) {
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1112 <main+0x12>

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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
br label %6
6: ; preds = %2, %6
br label %6
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
br label %3
}