xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ IAPuissance4Difficile();
int /*<<< orphan*/ IAPuissance4Facile();
int /*<<< orphan*/ IAPuissance4Normal();
void IAPuissance4(int niveauDifficulte) {
  switch (niveauDifficulte) {
  case 1:
    IAPuissance4Facile();
    break;
  case 2:
    IAPuissance4Normal();
    break;
  case 3:
    IAPuissance4Difficile();
    break;
  }
}


x86 assembly (clang, -O0):
<IAPuissance4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1171 <IAPuissance4+0x41>
jmp    114f <IAPuissance4+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     117d <IAPuissance4+0x4d>
jmp    1160 <IAPuissance4+0x30>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     1189 <IAPuissance4+0x59>
jmp    1190 <IAPuissance4+0x60>
mov    $0x0,%al
call   1040 <IAPuissance4Facile@plt>
jmp    1190 <IAPuissance4+0x60>
mov    $0x0,%al
call   1030 <IAPuissance4Normal@plt>
jmp    1190 <IAPuissance4+0x60>
mov    $0x0,%al
call   1050 <IAPuissance4Difficile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IAPuissance4>:
cmp    $0x3,%edi
je     1146 <IAPuissance4+0x16>
cmp    $0x2,%edi
je     114d <IAPuissance4+0x1d>
cmp    $0x1,%edi
jne    1154 <IAPuissance4+0x24>
xor    %eax,%eax
jmp    1040 <IAPuissance4Facile@plt>
xor    %eax,%eax
jmp    1050 <IAPuissance4Difficile@plt>
xor    %eax,%eax
jmp    1030 <IAPuissance4Normal@plt>
ret

LLVM IR (-O0):
define void @IAPuissance4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %1
%5 = call i32 (...) @IAPuissance4Facile()
br label %10
6: ; preds = %1
%7 = call i32 (...) @IAPuissance4Normal()
br label %10
8: ; preds = %1
%9 = call i32 (...) @IAPuissance4Difficile()
br label %10
10: ; preds = %1, %8, %6, %4
ret void
}

LLVM IR (-O2):
define void @IAPuissance4(i32 %0) {
switch i32 %0, label %8 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
]
2: ; preds = %1
%3 = tail call i32 (...) @IAPuissance4Facile()
br label %8
4: ; preds = %1
%5 = tail call i32 (...) @IAPuissance4Normal()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @IAPuissance4Difficile()
br label %8
8: ; preds = %1, %6, %4, %2
ret void
}
int __fixdfsi(double a __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__fixdfsi(double %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int create_new_version_generic(char const *, int, int /*<<< orphan*/,
                               int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int create_new_subversion(const char *vpath, mode_t mode, uid_t uid,
                          gid_t gid) {
  return create_new_version_generic(vpath, 1, 0, mode, uid, gid);
}


x86 assembly (clang, -O0):
<create_new_subversion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <create_new_version_generic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_new_subversion>:
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %esi,%ecx
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <create_new_version_generic@plt>

LLVM IR (-O0):
define i32 @create_new_subversion(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @create_new_version_generic(i8* %9, i32 1, i32 0, i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @create_new_subversion(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @create_new_version_generic(i8* %0, i32 1, i32 0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
void kotlinclib_print_long(long long message) { printf("%lld", message); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define void @kotlinclib_print_long(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRA3_get(void) { return U_WMRCORENONE_get("U_WMRA3"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA3\00"
define i32 @U_WMRA3_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA3\00"
define i32 @U_WMRA3_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int OSI_Enet2GetHWAddr__(unsigned long *);
int OSI_Enet2GetHWAddr(unsigned char *addr) {
  int ret;
  unsigned long buf[2];
  ret = OSI_Enet2GetHWAddr__(buf);
  ((unsigned long *)addr)[0] = buf[0];
  ((unsigned short *)addr)[2] = (buf[1] >> 16);
  return ret;
}


x86 assembly (clang, -O0):
<OSI_Enet2GetHWAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <OSI_Enet2GetHWAddr__@plt>
mov    %eax,-0xc(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
shr    $0x10,%rax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,0x4(%rax)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSI_Enet2GetHWAddr>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1030 <OSI_Enet2GetHWAddr__@plt>
mov    (%rsp),%rcx
mov    %rcx,(%rbx)
movzwl 0xa(%rsp),%ecx
mov    %cx,0x4(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @OSI_Enet2GetHWAddr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [2 x i64]
store i8* %0, i8** %2
%5 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
%6 = call i32 @OSI_Enet2GetHWAddr__(i64* %5)
store i32 %6, i32* %3
%7 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 0
%8 = load i64, i64* %7
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to i64*
%11 = getelementptr inbounds i64, i64* %10, i64 0
store i64 %8, i64* %11
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %4, i64 0, i64 1
%13 = load i64, i64* %12
%14 = lshr i64 %13, 16
%15 = trunc i64 %14 to i16
%16 = load i8*, i8** %2
%17 = bitcast i8* %16 to i16*
%18 = getelementptr inbounds i16, i16* %17, i64 2
store i16 %15, i16* %18
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @OSI_Enet2GetHWAddr(i8* nocapture writeonly %0) {
%2 = alloca [2 x i64]
%3 = bitcast [2 x i64]* %2 to i8*
%4 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 0
%5 = call i32 @OSI_Enet2GetHWAddr__(i64* %4)
%6 = load i64, i64* %4
%7 = bitcast i8* %0 to i64*
store i64 %6, i64* %7
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 1
%9 = load i64, i64* %8
%10 = lshr i64 %9, 16
%11 = trunc i64 %10 to i16
%12 = getelementptr inbounds i8, i8* %0, i64 4
%13 = bitcast i8* %12 to i16*
store i16 %11, i16* %13
ret i32 %5
}
int fits_bits(int x, int n) {
  int mask = ~((1 << (n - 1)) - 1);
  x &= mask;
  return !x || x == mask;
}


x86 assembly (clang, -O0):
<fits_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
je     1144 <fits_bits+0x44>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fits_bits>:
lea    -0x1(%rsi),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
and    %eax,%edi
sete   %cl
cmp    %eax,%edi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @fits_bits(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nsw i32 -1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = icmp eq i32 %5, %4
%8 = or i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void useLocal(void) {
  int x = 25;
  printf("\nlocal x in useLocal is %d after entering useLocal\n", x);
  ++x;
  printf("\nlocal x in useLocal is %d before exiting useLocal\n", x);
}


x86 assembly (clang, -O0):
<useLocal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x19,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xef3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<useLocal>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x19,%esi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
mov    $0x1a,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"\0Alocal x in useLocal is %d after entering useLocal\0A\00"
@.str.1 = [52 x i8] c"\0Alocal x in useLocal is %d before exiting useLocal\0A\00"
define void @useLocal() {
%1 = alloca i32
store i32 25, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"\0Alocal x in useLocal is %d after entering useLocal\0A\00"
@.str.1 = [52 x i8] c"\0Alocal x in useLocal is %d before exiting useLocal\0A\00"
define void @useLocal() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 25)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i32 26)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int equal_string(void *s1, void *s2) {
  return strcmp((char *)s1, (char *)s2) == 0;
}


x86 assembly (clang, -O0):
<equal_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_string>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @equal_string(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void pthread_rwlockattr_setpshared() {}


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

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

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

LLVM IR (-O2):
define void @pthread_rwlockattr_setpshared() {
ret void
}
/* Type definitions */
struct sequence {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sequence *);
void sequence_free(struct sequence *s) { free(s); }


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

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

LLVM IR (-O0):
%struct.sequence = type { i32 }
define void @sequence_free(%struct.sequence* %0) {
%2 = alloca %struct.sequence*
store %struct.sequence* %0, %struct.sequence** %2
%3 = load %struct.sequence*, %struct.sequence** %2
%4 = call i32 @free(%struct.sequence* %3)
ret void
}

LLVM IR (-O2):
%struct.sequence = type { i32 }
define void @sequence_free(%struct.sequence* nocapture %0) {
%2 = tail call i32 @free(%struct.sequence* %0)
ret void
}
char *agcanonhtmlstr(char *arg, char *buf) {
  char *s, *p;
  s = arg;
  p = buf;
  *p++ = '<';
  while (*s)
    *p++ = *s++;
  *p++ = '>';
  *p = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<agcanonhtmlstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x3c,(%rax)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <agcanonhtmlstr+0x62>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    112e <agcanonhtmlstr+0x2e>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x3e,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<agcanonhtmlstr>:
mov    %rsi,%rax
movb   $0x3c,(%rsi)
lea    0x1(%rsi),%rcx
mov    (%rdi),%dl
test   %dl,%dl
je     1137 <agcanonhtmlstr+0x37>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %dl,(%rcx)
add    $0x1,%rcx
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1120 <agcanonhtmlstr+0x20>
lea    -0x1(%rcx),%rdx
jmp    113a <agcanonhtmlstr+0x3a>
mov    %rax,%rdx
movb   $0x3e,(%rcx)
movb   $0x0,0x2(%rdx)
ret

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

LLVM IR (-O2):
define i8* @agcanonhtmlstr(i8* nocapture %0, i8* returned writeonly %1) {
store i8 60, i8* %1
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %12, %6 ], [ %4, %2 ]
%8 = phi i8* [ %11, %6 ], [ %3, %2 ]
%9 = phi i8* [ %10, %6 ], [ %0, %2 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %7, i8* %8
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = phi i8* [ %1, %2 ], [ %8, %6 ]
%16 = phi i8* [ %3, %2 ], [ %11, %6 ]
%17 = getelementptr inbounds i8, i8* %15, i64 2
store i8 62, i8* %16
store i8 0, i8* %17
ret i8* %1
}
double p3(double x) { return -6.0 + x * (6.0 + x * (-3.0 + x)); }


x86 assembly (clang, -O0):
<p3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xef5(%rip),%xmm2
addsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xedc(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec4(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<p3>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @p3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fadd double -3.000000e+00, %5
%7 = call double @llvm.fmuladd.f64(double %4, double %6, double 6.000000e+00)
%8 = call double @llvm.fmuladd.f64(double %3, double %7, double -6.000000e+00)
ret double %8
}

LLVM IR (-O2):
define double @p3(double %0) {
%2 = fadd double %0, -3.000000e+00
%3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double 6.000000e+00)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %3, double -6.000000e+00)
ret double %4
}
/* Variables and functions */
int EOF;
scalar_t__ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int puts(const char *s) {
  if (fputs(s, stdout) < 0)
    goto err;
  if (fputs("\n", stdout) < 0)
    goto err;
  return 0;
err:
  return EOF;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
cmp    $0x0,%rax
jge    113d <puts+0x2d>
jmp    116d <puts+0x5d>
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1030 <fputs@plt>
cmp    $0x0,%rax
jge    1161 <puts+0x51>
jmp    116d <puts+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1179 <puts+0x69>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    0x2ec0(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
test   %rax,%rax
js     113e <puts+0x2e>
mov    (%rbx),%esi
lea    0xed3(%rip),%rdi
call   1030 <fputs@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113e <puts+0x2e>
pop    %rbx
ret
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\0A\00"
@EOF = global i32 0
define i32 @puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i64 @fputs(i8* %0, i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = tail call i64 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5, %1
%10 = load i32, i32* @EOF
br label %11
11: ; preds = %5, %9
%12 = phi i32 [ %10, %9 ], [ 0, %5 ]
ret i32 %12
}
/* Type definitions */
typedef char *pid_t;

/* Variables and functions */
pid_t getpid(void) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(20));
  do {
    return (pid_t)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<getpid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpid>:
mov    $0x14,%eax
int    $0x80
ret

LLVM IR (-O0):
define i8* @getpid() {
%1 = alloca i64
%2 = call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 20)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %3
ret i8* %5
}

LLVM IR (-O2):
define i8* @getpid() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 20)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
void x86_switch_to_usermode() {}


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

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

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

LLVM IR (-O2):
define void @x86_switch_to_usermode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char *);
void check(int test, const char *message) {
  printf("Test `%s': %s\n", message, test ? "PASS" : "FAIL");
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%ecx
lea    0xee7(%rip),%rdx
lea    0xedb(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %edi,%edi
lea    0xefb(%rip),%rax
lea    0xeef(%rip),%rdx
cmove  %rax,%rdx
lea    0xed5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Test `%s': %s\0A\00"
@.str.1 = [5 x i8] c"PASS\00"
@.str.2 = [5 x i8] c"FAIL\00"
define void @check(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Test `%s': %s\0A\00"
@.str.1 = [5 x i8] c"PASS\00"
@.str.2 = [5 x i8] c"FAIL\00"
define void @check(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %4)
ret void
}
/* Variables and functions */
char *sha1(char const *, unsigned int);
char *crypto_hash(int algo, const char *msg, unsigned int *length, char **err) {
  char *digest;
  if (algo != 1) {
    *err = "Unknown hashing algo requested";
    return NULL;
  }
  digest = sha1(msg, *length);
  *length = 20;
  return digest;
}


x86 assembly (clang, -O0):
<crypto_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     114c <crypto_hash+0x3c>
mov    -0x28(%rbp),%rax
lea    0xec4(%rip),%rcx
mov    %rcx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1171 <crypto_hash+0x61>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1030 <sha1@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x14,(%rax)
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_hash>:
push   %rbx
cmp    $0x1,%edi
jne    112d <crypto_hash+0x1d>
mov    %rdx,%rbx
mov    (%rdx),%eax
mov    %rsi,%rdi
mov    %eax,%esi
call   1030 <sha1@plt>
movl   $0x14,(%rbx)
pop    %rbx
ret
lea    0xecc(%rip),%rax
mov    %rax,(%rcx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Unknown hashing algo requested\00"
define i8* @crypto_hash(i32 %0, i8* %1, i32* %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i8**
%10 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i8** %3, i8*** %9
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i8**, i8*** %9
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %14
store i8* null, i8** %5
br label %22
15: ; preds = %4
%16 = load i8*, i8** %7
%17 = load i32*, i32** %8
%18 = load i32, i32* %17
%19 = call i8* @sha1(i8* %16, i32 %18)
store i8* %19, i8** %10
%20 = load i32*, i32** %8
store i32 20, i32* %20
%21 = load i8*, i8** %10
store i8* %21, i8** %5
br label %22
22: ; preds = %15, %13
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
@.str = [31 x i8] c"Unknown hashing algo requested\00"
define i8* @crypto_hash(i32 %0, i8* %1, i32* nocapture %2, i8** nocapture writeonly %3) {
%5 = icmp eq i32 %0, 1
br i1 %5, label %7, label %6
6: ; preds = %4
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %3
br label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = tail call i8* @sha1(i8* %1, i32 %8)
store i32 20, i32* %2
br label %10
10: ; preds = %7, %6
%11 = phi i8* [ null, %6 ], [ %9, %7 ]
ret i8* %11
}
void time_init(void) {}


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

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

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

LLVM IR (-O2):
define void @time_init() {
ret void
}
void gtk_clipboard_wait_for_contents() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_wait_for_contents() {
ret void
}
/* Variables and functions */
int g();
int f(void) { return g(); }


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

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

LLVM IR (-O0):
define i32 @f() {
%1 = call i32 (...) @g()
ret i32 %1
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 (...) @g()
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void minipack_pack_str8(void *ptr, uint8_t length, size_t *sz) {
  *sz = 2;
  *((uint8_t *)ptr) = 0xD9;
  *((uint8_t *)(ptr + 1)) = length;
}


x86 assembly (clang, -O0):
<minipack_pack_str8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xd9,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_pack_str8>:
movq   $0x2,(%rdx)
movl   $0xd9,(%rdi)
mov    %esi,0x1(%rdi)
ret

LLVM IR (-O0):
define void @minipack_pack_str8(i8* %0, i32 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
store i64 2, i64* %7
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32 217, i32* %9
%10 = load i32, i32* %5
%11 = load i8*, i8** %4
%12 = getelementptr i8, i8* %11, i64 1
%13 = bitcast i8* %12 to i32*
store i32 %10, i32* %13
ret void
}

LLVM IR (-O2):
define void @minipack_pack_str8(i8* nocapture writeonly %0, i32 %1, i64* nocapture writeonly %2) {
store i64 2, i64* %2
%4 = bitcast i8* %0 to i32*
store i32 217, i32* %4
%5 = getelementptr i8, i8* %0, i64 1
%6 = bitcast i8* %5 to i32*
store i32 %1, i32* %6
ret void
}
void __attribute__((weak)) pvd_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<pvd_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvd_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.pvd_isr = [8 x i8] c"pvd_isr\00"
define weak void @pvd_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.pvd_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.pvd_isr = [8 x i8] c"pvd_isr\00"
define weak void @pvd_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.pvd_isr, i64 0, i64 0))
ret void
}
int getDigitSum(int n) {
  int sumDigit = 0;
  while (n) {
    sumDigit += n % 10;
    n /= 10;
  }
  return sumDigit;
}


x86 assembly (clang, -O0):
<getDigitSum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <getDigitSum+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <getDigitSum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDigitSum>:
xor    %eax,%eax
test   %edi,%edi
je     113b <getDigitSum+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <getDigitSum+0x10>
ret

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

LLVM IR (-O2):
define i32 @getDigitSum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = add nsw i32 %4, %6
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
void INT_Excep_PERIB_INTB156(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB156() {
ret void
}
int fs_hfsp_probe(int fd, long long offs) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fs_hfsp_probe(i32 %0, i64 %1) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_property_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ XCB_ATOM_WINDOW;
int /*<<< orphan*/ XCB_ATOM_WM_TRANSIENT_FOR;
int /*<<< orphan*/ xcb_get_property(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/,
                                    int);
xcb_get_property_cookie_t xcb_icccm_get_wm_transient_for(xcb_connection_t *c,
                                                         xcb_window_t window) {
  return xcb_get_property(c, 0, window, XCB_ATOM_WM_TRANSIENT_FOR,
                          XCB_ATOM_WINDOW, 0, 1);
}


x86 assembly (clang, -O0):
<xcb_icccm_get_wm_transient_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec2(%rip),%rax
mov    (%rax),%r8d
xor    %r9d,%r9d
mov    %r9d,%esi
movl   $0x1,(%rsp)
call   1030 <xcb_get_property@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_icccm_get_wm_transient_for>:
push   %rax
mov    %esi,%edx
mov    0x2ec6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ed5(%rip),%rax
mov    (%rax),%r8d
movl   $0x1,(%rsp)
xor    %esi,%esi
xor    %r9d,%r9d
call   1030 <xcb_get_property@plt>
pop    %rcx
ret

LLVM IR (-O0):
@XCB_ATOM_WM_TRANSIENT_FOR = global i32 0
@XCB_ATOM_WINDOW = global i32 0
define i32 @xcb_icccm_get_wm_transient_for(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 = load i32, i32* @XCB_ATOM_WM_TRANSIENT_FOR
%8 = load i32, i32* @XCB_ATOM_WINDOW
%9 = call i32 @xcb_get_property(i32* %5, i32 0, i32 %6, i32 %7, i32 %8, i32 0, i32 1)
ret i32 %9
}

LLVM IR (-O2):
@XCB_ATOM_WM_TRANSIENT_FOR = global i32 0
@XCB_ATOM_WINDOW = global i32 0
define i32 @xcb_icccm_get_wm_transient_for(i32* %0, i32 %1) {
%3 = load i32, i32* @XCB_ATOM_WM_TRANSIENT_FOR
%4 = load i32, i32* @XCB_ATOM_WINDOW
%5 = tail call i32 @xcb_get_property(i32* %0, i32 0, i32 %1, i32 %3, i32 %4, i32 0, i32 1)
ret i32 %5
}
__attribute__((always_)) unsigned long long int rdtsc() {
  unsigned long long int x;
  __asm__ volatile("rdtsc" : "=A"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
void w8(void *x, long long y) { *(long long *)(x + 32760) = y; }


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

x86 assembly (clang, -O2):
<w8>:
mov    %rsi,0x7ff8(%rdi)
ret

LLVM IR (-O0):
define void @w8(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32760
%8 = bitcast i8* %7 to i64*
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @w8(i8* nocapture writeonly %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 32760
%4 = bitcast i8* %3 to i64*
store i64 %1, i64* %4
ret void
}
int get(struct node *head, int index) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.node = type opaque
define i32 @get(%struct.node* nocapture readnone %0, i32 %1) {
ret i32 1
}
void version_output(struct cnode *cnode, unsigned int indent) {
  printf("%*s<version>\n", indent, "");
  outputchildren(cnode, indent, 1);
  printf("%*s</version>\n", indent, "");
}


x86 assembly (clang, -O0):
<version_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
lea    0xedc(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1040 <outputchildren@plt>
mov    -0xc(%rbp),%esi
lea    0xeaa(%rip),%rdi
lea    0xeb1(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version_output>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xecf(%rip),%rdi
lea    0xee4(%rip),%r15
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <outputchildren@plt>
lea    0xeb4(%rip),%rdi
mov    %ebx,%esi
mov    %r15,%rdx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.cnode = type opaque
@.str = [14 x i8] c"%*s<version>\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [15 x i8] c"%*s</version>\0A\00"
define void @version_output(%struct.cnode* %0, i32 %1) {
%3 = alloca %struct.cnode*
%4 = alloca i32
store %struct.cnode* %0, %struct.cnode** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = load %struct.cnode*, %struct.cnode** %3
%8 = load i32, i32* %4
%9 = call i32 (%struct.cnode*, i32, i32, ...) bitcast (i32 (...)* @outputchildren to i32 (%struct.cnode*, i32, i32, ...)*)(%struct.cnode* %7, i32 %8, i32 1)
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.cnode = type opaque
@.str = [14 x i8] c"%*s<version>\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [15 x i8] c"%*s</version>\0A\00"
define void @version_output(%struct.cnode* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (%struct.cnode*, i32, i32, ...) bitcast (i32 (...)* @outputchildren to i32 (%struct.cnode*, i32, i32, ...)*)(%struct.cnode* %0, i32 %1, i32 1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((no)) int foo(int *p) {
  int r;
  asm("movl $6, (%1)\n\txorl %0, %0" : "=r"(r) : "r"(p) : "memory");
  return r;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x6,(%rax)
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x6,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 asm "movl $$6, ($1)\0A\09xorl $0, $0", "=r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32* %0) {
%2 = tail call i32 asm "movl $$6, ($1)\0A\09xorl $0, $0", "=r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, char const *, char const *);
int /*<<< orphan*/ stderr;
void message4(const char *a, const char *b, const char *c, const char *d) {
  fprintf(stderr, "%s%s%s%s\n", a, b, c, d);
}


x86 assembly (clang, -O0):
<message4>:
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    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message4>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"%s%s%s%s\0A\00"
define void @message4(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"%s%s%s%s\0A\00"
define void @message4(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i8* %3)
ret void
}
/* Variables and functions */
void *sbrk(size_t);
void *alloc(size_t size) {
  void *ptr;
  ptr = sbrk(size);
  return ptr == (void *)-1 ? NULL : ptr;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sbrk@plt>
mov    %rax,-0x10(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x10(%rbp)
jne    1145 <alloc+0x35>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    114d <alloc+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rax
call   1030 <sbrk@plt>
xor    %ecx,%ecx
cmp    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @alloc(i64 %0) {
%2 = tail call i8* @sbrk(i64 %0)
%3 = icmp eq i8* %2, inttoptr (i64 -1 to i8*)
%4 = select i1 %3, i8* null, i8* %2
ret i8* %4
}
/* Variables and functions */
void *alloca(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void swap_data(void *a, void *b, int size) {
  void *temp = alloca(size);
  memcpy(temp, a, size);
  memcpy(a, b, size);
  memcpy(b, temp, size);
  return;
}


x86 assembly (clang, -O0):
<swap_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <alloca@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_data>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%edi
call   1030 <alloca@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @swap_data(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i8* @alloca(i32 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i32 @memcpy(i8* %14, i8* %15, i32 %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %7
%20 = load i32, i32* %6
%21 = call i32 @memcpy(i8* %18, i8* %19, i32 %20)
ret void
}

LLVM IR (-O2):
define void @swap_data(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @alloca(i32 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %2)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%7 = tail call i32 @memcpy(i8* %1, i8* %4, i32 %2)
ret void
}
/* Type definitions */
struct ILibWebServer_Session {
  int dummy;
};

/* Variables and functions */
int ILibWebServer_GetLocalInterface(struct ILibWebServer_Session *);
int UpnpGetLocalInterfaceToHost(const void *UPnPToken) {
  return (ILibWebServer_GetLocalInterface(
      (struct ILibWebServer_Session *)UPnPToken));
}


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

x86 assembly (clang, -O2):
<UpnpGetLocalInterfaceToHost>:
jmp    1030 <ILibWebServer_GetLocalInterface@plt>

LLVM IR (-O0):
%struct.ILibWebServer_Session = type { i32 }
define i32 @UpnpGetLocalInterfaceToHost(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.ILibWebServer_Session*
%5 = call i32 @ILibWebServer_GetLocalInterface(%struct.ILibWebServer_Session* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.ILibWebServer_Session = type { i32 }
define i32 @UpnpGetLocalInterfaceToHost(i8* %0) {
%2 = bitcast i8* %0 to %struct.ILibWebServer_Session*
%3 = tail call i32 @ILibWebServer_GetLocalInterface(%struct.ILibWebServer_Session* %2)
ret i32 %3
}