xunge/DecIR huggingface dataset:
/* Type definitions */
struct in6_addr {
  int dummy;
};

/* Variables and functions */
void teredo_dummy_icmpv6_cb(void *o, const void *p, size_t l,
                            const struct in6_addr *d) {
  (void)o;
  (void)p;
  (void)l;
  (void)d;
}


x86 assembly (clang, -O0):
<teredo_dummy_icmpv6_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define void @teredo_dummy_icmpv6_cb(i8* nocapture %0, i8* nocapture %1, i64 %2, %struct.in6_addr* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void err(int val, const char *msg) {
  printf("ERROR: %s\n", msg);
  exit(val);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @err(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 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @err(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ DecodeEaD_xxxxdddxssmmmrrr();
int /*<<< orphan*/ DoBinOpAnd(int /*<<< orphan*/);
void DoCodeAndEaD(void) { DoBinOpAnd(DecodeEaD_xxxxdddxssmmmrrr()); }


x86 assembly (clang, -O0):
<DoCodeAndEaD>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <DecodeEaD_xxxxdddxssmmmrrr@plt>
mov    %eax,%edi
call   1030 <DoBinOpAnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeAndEaD>:
push   %rax
xor    %eax,%eax
call   1040 <DecodeEaD_xxxxdddxssmmmrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <DoBinOpAnd@plt>

LLVM IR (-O0):
define void @DoCodeAndEaD() {
%1 = call i32 (...) @DecodeEaD_xxxxdddxssmmmrrr()
%2 = call i32 @DoBinOpAnd(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeAndEaD() {
%1 = tail call i32 (...) @DecodeEaD_xxxxdddxssmmmrrr()
%2 = tail call i32 @DoBinOpAnd(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void *shrealloc(void *ptr, size_t size) {
  printf("\nOpenSHMEM Analyzer\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define i8* @shrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define noalias i8* @shrealloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
/* Type definitions */
typedef int __u8;

/* Variables and functions */
int hea_u8_bit(int);
__u8 hea_set_u8_bit(__u8 v, int b) { return v | hea_u8_bit(b); }


x86 assembly (clang, -O0):
<hea_set_u8_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <hea_u8_bit@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_set_u8_bit>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <hea_u8_bit@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hea_set_u8_bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @hea_u8_bit(i32 %6)
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @hea_set_u8_bit(i32 %0, i32 %1) {
%3 = tail call i32 @hea_u8_bit(i32 %1)
%4 = or i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigdelset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/ *);
int sigsuspend(int /*<<< orphan*/ *);
int sigpause(int sig) {
  sigset_t mask;
  sigprocmask(0, 0, &mask);
  sigdelset(&mask, sig);
  return sigsuspend(&mask);
}


x86 assembly (clang, -O0):
<sigpause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %esi,%esi
lea    -0x8(%rbp),%rdx
mov    %esi,%edi
call   1030 <sigprocmask@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigdelset@plt>
lea    -0x8(%rbp),%rdi
call   1040 <sigsuspend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigpause>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <sigprocmask@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigdelset@plt>
mov    %r14,%rdi
call   1040 <sigsuspend@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @sigpause(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @sigprocmask(i32 0, i32 0, i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @sigdelset(i32* %3, i32 %5)
%7 = call i32 @sigsuspend(i32* %3)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sigpause(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigprocmask(i32 0, i32 0, i32* %2)
%5 = call i32 @sigdelset(i32* %2, i32 %0)
%6 = call i32 @sigsuspend(i32* %2)
ret i32 %6
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_has_retry(__le16 fc) { return (fc & __cpu_to_le16(0x0800)) != 0; }


x86 assembly (clang, -O0):
<ieee80211_has_retry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x800,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_has_retry>:
push   %rbx
mov    %edi,%ebx
mov    $0x800,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ieee80211_has_retry(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 2048)
%5 = and i32 %3, %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ieee80211_has_retry(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 2048)
%3 = and i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void CropComment(char *line) {
  char *p = line;
  while (*p)
    if (*p == '#') {
      *p = 0;
      break;
    }
}


x86 assembly (clang, -O0):
<CropComment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <CropComment+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1139 <CropComment+0x39>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    113e <CropComment+0x3e>
jmp    1110 <CropComment+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CropComment>:
mov    (%rdi),%al
test   %al,%al
je     110d <CropComment+0xd>
cmp    $0x23,%al
jne    1110 <CropComment+0x10>
movb   $0x0,(%rdi)
ret
xchg   %ax,%ax
jmp    1110 <CropComment+0x10>

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

LLVM IR (-O2):
define void @CropComment(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %3 [
i8 0, label %5
i8 35, label %4
]
3: ; preds = %1, %3
br label %3
4: ; preds = %1
store i8 0, i8* %0
br label %5
5: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void helper(void) { printf("a helper\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"a helper\00"
define void @helper() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
int netmask_to_num(u_int32_t mask) {
  int retval = 0;
  while ((mask & 0x80000000) && retval < 32) {
    retval++;
    mask <<= 1;
  }
  return retval;
}


x86 assembly (clang, -O0):
<netmask_to_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x80000000,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112f <netmask_to_num+0x2f>
cmpl   $0x20,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113f <netmask_to_num+0x3f>
jmp    1156 <netmask_to_num+0x56>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <netmask_to_num+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<netmask_to_num>:
xor    %eax,%eax
test   %edi,%edi
jns    111e <netmask_to_num+0x1e>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
lea    0x1(%rcx),%eax
add    %edi,%edi
jns    111e <netmask_to_num+0x1e>
cmp    $0x1f,%ecx
mov    %eax,%ecx
jb     1110 <netmask_to_num+0x10>
ret

LLVM IR (-O0):
define i32 @netmask_to_num(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %2
%6 = and i32 %5, -2147483648
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 32
br label %11
11: ; preds = %8, %4
%12 = phi i1 [ false, %4 ], [ %10, %8 ]
br i1 %12, label %13, label %18
13: ; preds = %11
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %2
%17 = shl i32 %16, 1
store i32 %17, i32* %2
br label %4
18: ; preds = %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @netmask_to_num(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = shl i32 %5, 1
%8 = icmp slt i32 %7, 0
%9 = icmp ult i32 %4, 31
%10 = select i1 %8, i1 %9, i1 false
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %12
}
unsigned int hash_Knuth(unsigned int i) { return (i * 2654435761 >> 16); }


x86 assembly (clang, -O0):
<hash_Knuth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movabs $0x9e3779b1,%rcx
imul   %rcx,%rax
sar    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_Knuth>:
mov    %edi,%ecx
mov    $0x9e3779b1,%eax
imul   %rcx,%rax
shr    $0x10,%rax
ret

LLVM IR (-O0):
define i32 @hash_Knuth(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = mul nsw i64 %4, 2654435761
%6 = ashr i64 %5, 16
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @hash_Knuth(i32 %0) {
%2 = zext i32 %0 to i64
%3 = mul nuw nsw i64 %2, 2654435761
%4 = lshr i64 %3, 16
%5 = trunc i64 %4 to i32
ret i32 %5
}
unsigned long unsignedlong_ignoring_unsignedlong(unsigned long x,
                                                 unsigned long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @unsignedlong_ignoring_unsignedlong(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlong_ignoring_unsignedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
char pathSeparator() { return ';'; }


x86 assembly (clang, -O0):
<pathSeparator>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathSeparator>:
mov    $0x3b,%al
ret

LLVM IR (-O0):
define signext i8 @pathSeparator() {
ret i8 59
}

LLVM IR (-O2):
define signext i8 @pathSeparator() {
ret i8 59
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void strcpy_lt(char *dest, char *src, int limit) {
  int len = strlen(src);
  if (len > limit) {
    strncpy(dest, src, limit);
    dest[limit] = 0;
  } else
    strcpy(dest, src);
}


x86 assembly (clang, -O0):
<strcpy_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    117c <strcpy_lt+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1189 <strcpy_lt+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_lt>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <strlen@plt>
cmp    %ebp,%eax
jle    1162 <strcpy_lt+0x32>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,(%r14,%rax,1)
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strcpy@plt>

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

LLVM IR (-O2):
define void @strcpy_lt(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp sgt i32 %4, %2
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
br label %12
10: ; preds = %3
%11 = tail call i32 @strcpy(i8* %0, i8* %1)
br label %12
12: ; preds = %10, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nullpo_info_core(char const *, int, char const *, void *,
                                    void *);
void nullpo_info(const char *file, int line, const char *func) {
  nullpo_info_core(file, line, func, (void *)0, (void *)0);
}


x86 assembly (clang, -O0):
<nullpo_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1030 <nullpo_info_core@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullpo_info>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <nullpo_info_core@plt>

LLVM IR (-O0):
define void @nullpo_info(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @nullpo_info_core(i8* %7, i32 %8, i8* %9, i8* null, i8* null)
ret void
}

LLVM IR (-O2):
define void @nullpo_info(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @nullpo_info_core(i8* %0, i32 %1, i8* %2, i8* null, i8* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_char(int /*<<< orphan*/);
void add_string(char *s, int len) {
  while (len--) {
    add_char(*s++);
  }
}


x86 assembly (clang, -O0):
<add_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     114f <add_string+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <add_char@plt>
jmp    111f <add_string+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_string>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <add_string+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <add_char@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <add_string+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @add_string(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = tail call i32 @add_char(i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ strout_lower(int /*<<< orphan*/ const *);
void strout_upper(const uint8_t *p) { strout_lower(p); }


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

x86 assembly (clang, -O2):
<strout_upper>:
jmp    1030 <strout_lower@plt>

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

LLVM IR (-O2):
define void @strout_upper(i32* %0) {
%2 = tail call i32 @strout_lower(i32* %0)
ret void
}
/* Variables and functions */
float M_PI_2;
float cos(float);
float sine_in(float step, float max_steps, float max_val) {
  return -max_val * cos((float)step / max_steps * M_PI_2) + max_val;
}


x86 assembly (clang, -O0):
<sine_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
mov    0x2e99(%rip),%rax
mulss  (%rax),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_in>:
push   %rax
movss  %xmm2,0x4(%rsp)
divss  %xmm1,%xmm0
mov    0x2ec6(%rip),%rax
mulss  (%rax),%xmm0
call   1030 <cos@plt>
movss  0x4(%rsp),%xmm1
mulss  %xmm1,%xmm0
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI_2 = global float 0.000000e+00
define float @sine_in(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = fneg float %7
%9 = load float, float* %4
%10 = load float, float* %5
%11 = fdiv float %9, %10
%12 = load float, float* @M_PI_2
%13 = fmul float %11, %12
%14 = call float @cos(float %13)
%15 = load float, float* %6
%16 = call float @llvm.fmuladd.f32(float %8, float %14, float %15)
ret float %16
}

LLVM IR (-O2):
@M_PI_2 = global float 0.000000e+00
define float @sine_in(float %0, float %1, float %2) {
%4 = fneg float %2
%5 = fdiv float %0, %1
%6 = load float, float* @M_PI_2
%7 = fmul float %5, %6
%8 = tail call float @cos(float %7)
%9 = tail call float @llvm.fmuladd.f32(float %4, float %8, float %2)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
main() {
  float a, b;
  a = 1.3f, b = 3.2f;
  printf("%.1f\n", a + b);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0x3FF4CCCCC0000000, float* %2
store float 0x40099999A0000000, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = fadd float %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 4.500000e+00)
ret i32 0
}
void cmov(a, b) register short *a, *b;
{
  int i;
  i = 8;
  do
    *b++ = *a++;
  while (--i);
}


x86 assembly (clang, -O0):
<cmov>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x2,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cx,(%rax)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    1113 <cmov+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmov>:
movzwl (%rdi),%eax
mov    %ax,(%rsi)
movzwl 0x2(%rdi),%eax
mov    %ax,0x2(%rsi)
movzwl 0x4(%rdi),%eax
mov    %ax,0x4(%rsi)
movzwl 0x6(%rdi),%eax
mov    %ax,0x6(%rsi)
movzwl 0x8(%rdi),%eax
mov    %ax,0x8(%rsi)
movzwl 0xa(%rdi),%eax
mov    %ax,0xa(%rsi)
movzwl 0xc(%rdi),%eax
mov    %ax,0xc(%rsi)
movzwl 0xe(%rdi),%eax
mov    %ax,0xe(%rsi)
ret

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

LLVM IR (-O2):
define void @cmov(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %0
%5 = getelementptr inbounds i16, i16* %1, i64 1
store i16 %4, i16* %1
%6 = getelementptr inbounds i16, i16* %0, i64 2
%7 = load i16, i16* %3
%8 = getelementptr inbounds i16, i16* %1, i64 2
store i16 %7, i16* %5
%9 = getelementptr inbounds i16, i16* %0, i64 3
%10 = load i16, i16* %6
%11 = getelementptr inbounds i16, i16* %1, i64 3
store i16 %10, i16* %8
%12 = getelementptr inbounds i16, i16* %0, i64 4
%13 = load i16, i16* %9
%14 = getelementptr inbounds i16, i16* %1, i64 4
store i16 %13, i16* %11
%15 = getelementptr inbounds i16, i16* %0, i64 5
%16 = load i16, i16* %12
%17 = getelementptr inbounds i16, i16* %1, i64 5
store i16 %16, i16* %14
%18 = getelementptr inbounds i16, i16* %0, i64 6
%19 = load i16, i16* %15
%20 = getelementptr inbounds i16, i16* %1, i64 6
store i16 %19, i16* %17
%21 = getelementptr inbounds i16, i16* %0, i64 7
%22 = load i16, i16* %18
%23 = getelementptr inbounds i16, i16* %1, i64 7
store i16 %22, i16* %20
%24 = load i16, i16* %21
store i16 %24, i16* %23
ret void
}
int config_MODULE_PANDORA(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_MODULE_PANDORA() {
ret i32 0
}
void foo_2_1_1_1_2_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_2_2_1_1_2() {
ret void
}
int fun579() { return 579; }


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

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

LLVM IR (-O0):
define i32 @fun579() {
ret i32 579
}

LLVM IR (-O2):
define i32 @fun579() {
ret i32 579
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int delta;
};
typedef TYPE_1__ XmbTextItem;

/* Variables and functions */
void set_XmbTextItem_delta(void *_p, int _v) {
  ((XmbTextItem *)_p)->delta = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XmbTextItem_delta>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XmbTextItem_delta(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XmbTextItem_delta(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void split_chs(unsigned char *chs, unsigned long *c, unsigned long *h,
               unsigned long *s) {
  *h = chs[0];
  *s = (chs[1] & 0x3F) - 1;
  *c = ((unsigned long)(chs[1] >> 6)) * 256 + chs[2];
}


x86 assembly (clang, -O0):
<split_chs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0x3f,%eax
sub    $0x1,%eax
movslq %eax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
sar    $0x6,%eax
movslq %eax,%rcx
shl    $0x8,%rcx
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
add    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_chs>:
movzbl (%rdi),%eax
mov    %rax,(%rdx)
movzbl 0x1(%rdi),%eax
and    $0x3f,%eax
add    $0xffffffffffffffff,%rax
mov    %rax,(%rcx)
movzbl 0x1(%rdi),%eax
and    $0xc0,%eax
movzbl 0x2(%rdi),%ecx
lea    (%rcx,%rax,4),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @split_chs(i8* %0, i64* %1, i64* %2, i64* %3) {
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64*
store i8* %0, i8** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = load i64*, i64** %7
store i64 %12, i64* %13
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = and i32 %17, 63
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = load i64*, i64** %8
store i64 %20, i64* %21
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = ashr i32 %25, 6
%27 = sext i32 %26 to i64
%28 = mul i64 %27, 256
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 2
%31 = load i8, i8* %30
%32 = zext i8 %31 to i64
%33 = add i64 %28, %32
%34 = load i64*, i64** %6
store i64 %33, i64* %34
ret void
}

LLVM IR (-O2):
define void @split_chs(i8* nocapture %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2, i64* nocapture writeonly %3) {
%5 = load i8, i8* %0
%6 = zext i8 %5 to i64
store i64 %6, i64* %2
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = and i8 %8, 63
%10 = zext i8 %9 to i64
%11 = add nsw i64 %10, -1
store i64 %11, i64* %3
%12 = load i8, i8* %7
%13 = lshr i8 %12, 6
%14 = zext i8 %13 to i64
%15 = shl nuw nsw i64 %14, 8
%16 = getelementptr inbounds i8, i8* %0, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i64
%19 = or i64 %15, %18
store i64 %19, i64* %1
ret void
}
int leftmost_one(unsigned x) {
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  return x ^ x >> 1;
}


x86 assembly (clang, -O0):
<leftmost_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftmost_one>:
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x10,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    %eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @leftmost_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 2
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 8
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 16
%21 = load i32, i32* %2
%22 = or i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = load i32, i32* %2
%25 = lshr i32 %24, 1
%26 = xor i32 %23, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @leftmost_one(i32 %0) {
%2 = lshr i32 %0, 1
%3 = or i32 %2, %0
%4 = lshr i32 %3, 2
%5 = or i32 %4, %3
%6 = lshr i32 %5, 4
%7 = or i32 %6, %5
%8 = lshr i32 %7, 8
%9 = or i32 %8, %7
%10 = lshr i32 %9, 16
%11 = or i32 %10, %9
%12 = lshr i32 %11, 1
%13 = xor i32 %12, %11
ret i32 %13
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ outofmemory();
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
extern void _DupString(char **x, const char *y) {
  (*x) = malloc(strlen(y) + 1);
  if (x == NULL)
    outofmemory();
  strcpy((*x), y);
}


x86 assembly (clang, -O0):
<_DupString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x8(%rbp)
jne    1181 <_DupString+0x41>
mov    $0x0,%al
call   1050 <outofmemory@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DupString>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @_DupString(i8** nocapture %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
store i8* %5, i8** %0
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret void
}
/* Variables and functions */
double exp2(double);
double test2(double x) { return exp2(x); }


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

x86 assembly (clang, -O2):
<test2>:
jmp    1030 <exp2@plt>

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

LLVM IR (-O2):
define double @test2(double %0) {
%2 = tail call double @exp2(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void f5(unsigned long long int s) {
  if ((unsigned char)s == 0)
    return;
  if (s == 0)
    link_error();
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl %al,%eax
cmp    $0x0,%eax
jne    1131 <f5+0x21>
jmp    1143 <f5+0x33>
cmpq   $0x0,-0x8(%rbp)
jne    1143 <f5+0x33>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f5(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %13
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @link_error()
br label %13
13: ; preds = %7, %11, %8
ret void
}

LLVM IR (-O2):
define void @f5(i64 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int lsetxattr(char *, char *, char *, int, int /*<<< orphan*/);
int main(void) {
  char value[] = "valuestring";
  return lsetxattr("/some/path/to/somewhere", "name", value, sizeof(value), 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdx
lea    0xece(%rip),%rdi
lea    0xedf(%rip),%rsi
mov    $0xc,%ecx
xor    %r8d,%r8d
call   1030 <lsetxattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x72747365756c6176,%rax
73 74 72
mov    %rax,0x8(%rsp)
movl   $0x676e69,0x10(%rsp)
lea    0xeda(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    $0xc,%ecx
xor    %r8d,%r8d
call   1030 <lsetxattr@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.value = [12 x i8] c"valuestring\00"
@.str = [24 x i8] c"/some/path/to/somewhere\00"
@.str.1 = [5 x i8] c"name\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
store i32 0, i32* %1
%3 = bitcast [12 x i8]* %2 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @lsetxattr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 12, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@__const.main.value = [12 x i8] c"valuestring\00"
@.str = [24 x i8] c"/some/path/to/somewhere\00"
@.str.1 = [5 x i8] c"name\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @lsetxattr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 12, i32 0)
ret i32 %3
}
struct item *foo(struct item *(*f)(void)) {
  return f();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    *%rdi

LLVM IR (-O0):
%struct.item = type opaque
define %struct.item* @foo(%struct.item* ()* %0) {
%2 = alloca %struct.item* ()*
store %struct.item* ()* %0, %struct.item* ()** %2
%3 = load %struct.item* ()*, %struct.item* ()** %2
%4 = call %struct.item* %3()
ret %struct.item* %4
}

LLVM IR (-O2):
%struct.item = type opaque
define %struct.item* @foo(%struct.item* ()* nocapture %0) {
%2 = tail call %struct.item* %0()
ret %struct.item* %2
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int ic;
  char cc;
  printf("ic: ");
  ic = getchar();
  cc = (char)ic;
  printf("ic = %d\n", ic);
  printf("cc = %c\n", cc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x9(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
lea    0xec6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl %bl,%esi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ic: \00"
@.str.1 = [9 x i8] c"ic = %d\0A\00"
@.str.2 = [9 x i8] c"cc = %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"ic: \00"
@.str.1 = [9 x i8] c"ic = %d\0A\00"
@.str.2 = [9 x i8] c"cc = %c\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = shl i32 %2, 24
%5 = ashr exact i32 %4, 24
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  char *arr = malloc(10);
  (void)write(1, arr, 10);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @write(i32 1, i8* %4, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @write(i32 1, i8* %1, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ time(int);
__attribute__((visibility("hidden"))) void func_0xF2_0x01() {
  time(2);
  ;
}


x86 assembly (clang, -O0):
<func_0xF2_0x01>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_0xF2_0x01>:
mov    $0x2,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define hidden void @func_0xF2_0x01() {
%1 = call i32 @time(i32 2)
ret void
}

LLVM IR (-O2):
define hidden void @func_0xF2_0x01() {
%1 = tail call i32 @time(i32 2)
ret void
}
/* Variables and functions */
char *memory_Malloc(int);
char *string_EmptyString(void) {
  char *s;
  s = memory_Malloc(1);
  s[0] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<string_EmptyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <memory_Malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_EmptyString>:
push   %rax
mov    $0x1,%edi
call   1030 <memory_Malloc@plt>
movb   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @string_EmptyString() {
%1 = alloca i8*
%2 = call i8* @memory_Malloc(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 0, i8* %4
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @string_EmptyString() {
%1 = tail call i8* @memory_Malloc(i32 1)
store i8 0, i8* %1
ret i8* %1
}
char *strcpy(char *s1, const char *s2) {
  char *s = s1;
  for (s = s1; (*s++ = *s2++) != '\0';)
    ;
  return (s1);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     114f <strcpy+0x4f>
jmp    111c <strcpy+0x1c>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void t4(int a) {
  int b = 0;
  if (a)
    b < 1;
  else
    b < 2;
  while (1)
    b < 3;
  do
    b < 4;
  while (1);
  for (;;)
    b < 5;
  for (b < 1;;) {
  }
  for (; b < 1;) {
  }
  for (;; b < 1) {
  }
}


x86 assembly (clang, -O0):
<t4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111d <t4+0x1d>
jmp    111d <t4+0x1d>
jmp    1122 <t4+0x22>
jmp    1122 <t4+0x22>

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

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

LLVM IR (-O2):
define void @t4(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int default_current_brightness(struct backlight *b) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.backlight = type opaque
define i32 @default_current_brightness(%struct.backlight* nocapture readnone %0) {
ret i32 0
}