xunge/DecIR huggingface dataset:
char kernel__Char___45d(char self, long p0) {
  char var;
  char var1;
  var1 = self - p0;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<kernel__Char___45d>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbq -0x1(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Char___45d>:
mov    %edi,%eax
sub    %sil,%al
ret

LLVM IR (-O0):
define signext i8 @kernel__Char___45d(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
store i64 %1, i64* %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i64
%9 = load i64, i64* %4
%10 = sub nsw i64 %8, %9
%11 = trunc i64 %10 to i8
store i8 %11, i8* %6
%12 = load i8, i8* %6
store i8 %12, i8* %5
br label %13
13: ; preds = %2
%14 = load i8, i8* %5
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @kernel__Char___45d(i8 signext %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = sub i8 %0, %3
ret i8 %4
}
int is_hidden_essid(char *essid) {
  return (('\0' == essid[0]) || ((' ' == essid[0]) && ('\0' == essid[1])));
}


x86 assembly (clang, -O0):
<is_hidden_essid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%al
xor    %ecx,%ecx
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
je     114f <is_hidden_essid+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x20,%ecx
cmp    %edx,%ecx
mov    %al,-0xa(%rbp)
jne    1149 <is_hidden_essid+0x49>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hidden_essid>:
mov    (%rdi),%al
test   %al,%al
je     1114 <is_hidden_essid+0x14>
cmp    $0x20,%al
jne    111a <is_hidden_essid+0x1a>
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_hidden_essid(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %8 [
i8 0, label %9
i8 32, label %3
]
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = zext i1 %6 to i32
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %3
%10 = phi i32 [ 1, %1 ], [ %7, %3 ], [ 0, %8 ]
ret i32 %10
}
long big_msg_send(long *destination, struct Msg *msgpt) {
  long res = 3;
  __asm__ volatile("int $0x80"
                   : "=a"(res)
                   : "0"(res), "b"(*destination), "c"((long)msgpt));
  if (res == 1)
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<big_msg_send>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movq   $0x3,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rbx
mov    -0x20(%rbp),%rcx
int    $0x80
mov    %rax,-0x28(%rbp)
cmpq   $0x1,-0x28(%rbp)
jne    1142 <big_msg_send+0x42>
movq   $0x1,-0x10(%rbp)
jmp    114a <big_msg_send+0x4a>
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_msg_send>:
push   %rbx
mov    %rsi,%rcx
mov    (%rdi),%rbx
mov    $0x3,%eax
int    $0x80
xor    %ecx,%ecx
cmp    $0x1,%rax
sete   %cl
lea    (%rcx,%rcx,1),%rax
add    $0xffffffffffffffff,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Msg = type opaque
define i64 @big_msg_send(i64* %0, %struct.Msg* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca %struct.Msg*
%6 = alloca i64
store i64* %0, i64** %4
store %struct.Msg* %1, %struct.Msg** %5
store i64 3, i64* %6
%7 = load i64, i64* %6
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
%10 = load %struct.Msg*, %struct.Msg** %5
%11 = ptrtoint %struct.Msg* %10 to i64
%12 = call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %7, i64 %9, i64 %11)
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = icmp eq i64 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %2
store i64 1, i64* %3
br label %17
16: ; preds = %2
store i64 -1, i64* %3
br label %17
17: ; preds = %16, %15
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
%struct.Msg = type opaque
define i64 @big_msg_send(i64* nocapture %0, %struct.Msg* %1) {
%3 = load i64, i64* %0
%4 = ptrtoint %struct.Msg* %1 to i64
%5 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 3, i64 %3, i64 %4)
%6 = icmp eq i64 %5, 1
%7 = select i1 %6, i64 1, i64 -1
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int socketpair(int family, int type, int protocol, int fd[2]) {
  fd[0] = 0;
  fd[1] = 0;
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<socketpair>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    0x2ebb(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea2(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketpair>:
movq   $0x0,(%rcx)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
mov    0x2ec1(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 0, i32* %10
%11 = load i32*, i32** %8
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 0, i32* %12
%13 = load i32, i32* @ENOSYS
store i32 %13, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
store i32 0, i32* %3
%5 = getelementptr inbounds i32, i32* %3, i64 1
store i32 0, i32* %5
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}
long long longlong_ignoring_unsignedchar(long long x, unsigned char y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @longlong_ignoring_unsignedchar(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlong_ignoring_unsignedchar(i64 returned %0, i8 zeroext %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ pr(void *);
int main(int argc, char *argv[]) {
  pr((void *)100);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @pr(i8* inttoptr (i64 100 to i8*))
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @pr(i8* inttoptr (i64 100 to i8*))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *mmap(void *, size_t, int, int, int, int /*<<< orphan*/);
void *do_mmap(void *addr, size_t size, int prot, int flags, int fd,
              off_t offset) {
  void *ret = mmap(addr, size, prot, flags, fd, offset);
  assert(ret != NULL);
  return ret;
}


x86 assembly (clang, -O0):
<do_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1030 <mmap@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_mmap>:
push   %rbx
call   1030 <mmap@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @do_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i8*, i8** %7
%15 = load i64, i64* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = call i8* @mmap(i8* %14, i64 %15, i32 %16, i32 %17, i32 %18, i32 %19)
store i8* %20, i8** %13
%21 = load i8*, i8** %13
%22 = icmp ne i8* %21, null
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i8*, i8** %13
ret i8* %25
}

LLVM IR (-O2):
define i8* @do_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret i8* %7
}
void str_del(char *str, int i) {
  while (str[i] != '\0') {
    str[i] = str[i + 1];
    i++;
  }
}


x86 assembly (clang, -O0):
<str_del>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1149 <str_del+0x49>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <str_del+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_del>:
movslq %esi,%rax
cmpb   $0x0,(%rdi,%rax,1)
je     111e <str_del+0x1e>
add    %rdi,%rax
add    $0x1,%rax
movzbl (%rax),%ecx
mov    %cl,-0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <str_del+0x10>
ret

LLVM IR (-O0):
define void @str_del(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 = %13, %2
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %26
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %3
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 %19, i8* %23
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %5
26: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @str_del(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ %3, %2 ]
%9 = phi i8* [ %11, %7 ], [ %4, %2 ]
%10 = add i64 %8, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %9
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %2
ret void
}
char *space(n)
int n;
{
  register char *cp;
  if ((cp = getcell(n)) == 0) {
    garbage();
    if ((cp = getcell(n)) == 0)
      err("out of string space");
  }
  return (cp);
}


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <getcell@plt>
cltq
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1189 <space+0x59>
mov    $0x0,%al
call   1050 <garbage@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <getcell@plt>
cltq
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1184 <space+0x54>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <err@plt>
jmp    1189 <space+0x59>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <getcell@plt>
test   %eax,%eax
jne    1152 <space+0x22>
xor    %eax,%eax
call   1050 <garbage@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <getcell@plt>
test   %eax,%eax
je     115a <space+0x2a>
movslq %eax,%rbx
mov    %rbx,%rax
pop    %rbx
ret
lea    0xe9f(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <err@plt>
jmp    1155 <space+0x25>

LLVM IR (-O0):
@.str = [20 x i8] c"out of string space\00"
define i8* @space(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @getcell to i32 (i32, ...)*)(i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %19
9: ; preds = %1
%10 = call i32 (...) @garbage()
%11 = load i32, i32* %2
%12 = call i32 (i32, ...) bitcast (i32 (...)* @getcell to i32 (i32, ...)*)(i32 %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %3
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %9
br label %19
19: ; preds = %18, %1
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [20 x i8] c"out of string space\00"
define i8* @space(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @getcell to i32 (i32, ...)*)(i32 %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i32 %2, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = tail call i32 (...) @garbage()
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @getcell to i32 (i32, ...)*)(i32 %0)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %6, %12, %1
%15 = phi i8* [ null, %12 ], [ %10, %6 ], [ %4, %1 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(int);
int /*<<< orphan*/ isalpha(int);
int /*<<< orphan*/ isblank(int);
int /*<<< orphan*/ iscntrl(int);
int /*<<< orphan*/ isdigit(int);
int /*<<< orphan*/ isgraph(int);
int /*<<< orphan*/ islower(int);
int /*<<< orphan*/ isprint(int);
int /*<<< orphan*/ ispunct(int);
int /*<<< orphan*/ isspace(int);
int /*<<< orphan*/ isupper(int);
int /*<<< orphan*/ isxdigit(int);
int /*<<< orphan*/ tolower(int);
int /*<<< orphan*/ toupper(int);
void test(int x) {
  (void)isalnum(x);
  (void)isalpha(x);
  (void)isblank(x);
  (void)iscntrl(x);
  (void)isdigit(x);
  (void)isgraph(x);
  (void)islower(x);
  (void)isprint(x);
  (void)ispunct(x);
  (void)isspace(x);
  (void)isupper(x);
  (void)isxdigit(x);
  (void)tolower(x);
  (void)toupper(x);
}


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

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

LLVM IR (-O0):
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isalnum(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @isalpha(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @isblank(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @iscntrl(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @isdigit(i32 %11)
%13 = load i32, i32* %2
%14 = call i32 @isgraph(i32 %13)
%15 = load i32, i32* %2
%16 = call i32 @islower(i32 %15)
%17 = load i32, i32* %2
%18 = call i32 @isprint(i32 %17)
%19 = load i32, i32* %2
%20 = call i32 @ispunct(i32 %19)
%21 = load i32, i32* %2
%22 = call i32 @isspace(i32 %21)
%23 = load i32, i32* %2
%24 = call i32 @isupper(i32 %23)
%25 = load i32, i32* %2
%26 = call i32 @isxdigit(i32 %25)
%27 = load i32, i32* %2
%28 = call i32 @tolower(i32 %27)
%29 = load i32, i32* %2
%30 = call i32 @toupper(i32 %29)
ret void
}

LLVM IR (-O2):
define void @test(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ br();
int /*<<< orphan*/ ic();
int /*<<< orphan*/ printf(char *);
int main(void) {
  br();
  printf(", ");
  ic();
  printf("\n");
  ic();
  printf("\n");
  br();
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <br@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <ic@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <ic@plt>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <br@plt>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <br@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <ic@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <ic@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <br@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c", \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = call i32 (...) @br()
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @ic()
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @ic()
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @br()
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c", \00"
define i32 @main() {
%1 = tail call i32 (...) @br()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @ic()
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (...) @ic()
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 (...) @br()
%8 = tail call i32 @putchar(i32 10)
ret i32 0
}
int main() {
  char c = 'A';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 65, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int string_array_len(char *const *array) {
  int i = 0;
  if (array == NULL) {
    return 0;
  }
  while (array[i] != NULL) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<string_array_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <string_array_len+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1152 <string_array_len+0x52>
jmp    112b <string_array_len+0x2b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     114c <string_array_len+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <string_array_len+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_array_len>:
test   %rdi,%rdi
je     111e <string_array_len+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <string_array_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_array_len(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
int __attribute__((target("arch=sandybridge"))) redecl4(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @redecl4() {
ret i32 2
}

LLVM IR (-O2):
define i32 @redecl4() {
ret i32 2
}
void hlt(void) { asm volatile("hlt"); }


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

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

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

LLVM IR (-O2):
define void @hlt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int debug_step_02() {
  int x = 1;
  x++;
  x++;
  x++;
  x++;
  x++;
  x++;
  x++;
  x++;
  x++;
  x++;
  return x;
}


x86 assembly (clang, -O0):
<debug_step_02>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @debug_step_02() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
store i32 %21, i32* %1
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @debug_step_02() {
ret i32 11
}
/* Variables and functions */
unsigned int _bextr_u32(unsigned int, unsigned int, unsigned int);
unsigned int test_bextr_u32(unsigned int __X, unsigned int __Y,
                            unsigned int __Z) {
  return _bextr_u32(__X, __Y, __Z);
}


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

x86 assembly (clang, -O2):
<test_bextr_u32>:
jmp    1030 <_bextr_u32@plt>

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

LLVM IR (-O2):
define i32 @test_bextr_u32(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_bextr_u32(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printstr(char *, ...);
int /*<<< orphan*/ send_signal(int, int);
int /*<<< orphan*/ sleep(int);
void sniper(int pid) {
  printstr("You are looking through your scope, the victim with number %d is "
           "right in the middle.\n",
           pid);
  sleep(4);
  printstr("You breath smoothly and shoot...\n");
  sleep(4);
  send_signal(pid, 15);
}


x86 assembly (clang, -O0):
<sniper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printstr@plt>
mov    $0x4,%edi
call   1050 <sleep@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printstr@plt>
mov    $0x4,%edi
call   1050 <sleep@plt>
mov    -0x4(%rbp),%edi
mov    $0xf,%esi
call   1040 <send_signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sniper>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printstr@plt>
mov    $0x4,%edi
call   1050 <sleep@plt>
lea    0xf03(%rip),%rdi
xor    %eax,%eax
call   1030 <printstr@plt>
mov    $0x4,%edi
call   1050 <sleep@plt>
mov    %ebx,%edi
mov    $0xf,%esi
pop    %rbx
jmp    1040 <send_signal@plt>

LLVM IR (-O0):
@.str = [87 x i8] c"You are looking through your scope, the victim with number %d is right in the middle.\0A\00"
@.str.1 = [34 x i8] c"You breath smoothly and shoot...\0A\00"
define void @sniper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printstr(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 4)
%6 = call i32 (i8*, ...) @printstr(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @sleep(i32 4)
%8 = load i32, i32* %2
%9 = call i32 @send_signal(i32 %8, i32 15)
ret void
}

LLVM IR (-O2):
@.str = [87 x i8] c"You are looking through your scope, the victim with number %d is right in the middle.\0A\00"
@.str.1 = [34 x i8] c"You breath smoothly and shoot...\0A\00"
define void @sniper(i32 %0) {
%2 = tail call i32 (i8*, ...) @printstr(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 4)
%4 = tail call i32 (i8*, ...) @printstr(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 4)
%6 = tail call i32 @send_signal(i32 %0, i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_get();
int /*<<< orphan*/ test_init();
int /*<<< orphan*/ test_put();
int main(void) {
  test_init();
  test_put();
  test_get();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_init@plt>
xor    %eax,%eax
call   1050 <test_put@plt>
xor    %eax,%eax
call   1030 <test_get@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_init()
%3 = call i32 (...) @test_put()
%4 = call i32 (...) @test_get()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_init()
%2 = tail call i32 (...) @test_put()
%3 = tail call i32 (...) @test_get()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errStop(int *);
void err_stop_(int *const STATUS) {
  int status;
  status = *STATUS;
  errStop(&status);
}


x86 assembly (clang, -O0):
<err_stop_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <errStop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_stop_>:
push   %rax
mov    (%rdi),%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <errStop@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @err_stop_(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %0
store i32 %4, i32* %2
%5 = call i32 @errStop(i32* %2)
ret void
}
void account_txt_set_default_configvalue(void) {}


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

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

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

LLVM IR (-O2):
define void @account_txt_set_default_configvalue() {
ret void
}
void InitializeNonportableFeatures(void *theEnv) {}


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

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

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

LLVM IR (-O2):
define void @InitializeNonportableFeatures(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void run_test_d(char *out, char *in) {
  int i = 0;
  for (i = 0; i < 102400; i++) {
    memcpy(out, in, (1024 * 4));
  }
}


x86 assembly (clang, -O0):
<run_test_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x19000,-0x14(%rbp)
jge    115b <run_test_d+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1000,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <run_test_d+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_test_d>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x19000,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1000,%edx
call   1030 <memcpy@plt>
add    $0xffffffff,%ebp
jne    1120 <run_test_d+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @run_test_d(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 102400
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @memcpy(i8* %10, i8* %11, i32 4096)
br label %13
13: ; preds = %9
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @run_test_d(i8* %0, i8* %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 4096)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 102400
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned long);
unsigned long rol(unsigned long);
int main() {
  unsigned long val;
  int ii;
  val = 0x80000000;
  for (ii = 0; ii < 64; ++ii) {
    val = rol(val);
    printf("%3d : 0x%08x\n", ii, val);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80000000,%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    1177 <main+0x57>
mov    -0x10(%rbp),%rdi
call   1040 <rol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <main+0x1f>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x80000000,%r15d
xor    %ebx,%ebx
lea    0xecc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
call   1040 <rol@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x40,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%3d : 0x%08x\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i64 [ 2147483648, %0 ], [ %4, %1 ]
%4 = tail call i64 @rol(i64 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2, i64 %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 64
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
void put_fs_byte(char val, char *addr) {
  __asm__("movb %0,%%fs:%1" ::"r"(val), "m"(*addr));
}


x86 assembly (clang, -O0):
<put_fs_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rcx
mov    %al,%fs:(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_fs_byte>:
mov    %dil,%fs:(%rsi)
ret

LLVM IR (-O0):
define void @put_fs_byte(i8 signext %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
ret void
}

LLVM IR (-O2):
define void @put_fs_byte(i8 signext %0, i8* %1) {
tail call void asm sideeffect "movb $0,%fs:$1", "r,*m,~{dirflag},~{fpsr},~{flags}"(i8 %0, i8* elementtype(i8) %1)
ret void
}
/* Variables and functions */
int func1();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x;
  x = func1();
  printf("%d\n", x);
  x = func1();
  printf("%d\n", x);
  x = func1();
  printf("%d\n", x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <func1@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <func1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <func1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @func1()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @func1()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @func1()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int main() { return sizeof(double); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
unsigned long long xgetbv(int ctr) {
  unsigned a, d;
  __asm("xgetbv" : "=a"(a), "=d"(d) : "c"(ctr) :);
  return (unsigned long long)d << 32 | a;
}


x86 assembly (clang, -O0):
<xgetbv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xgetbv
mov    %eax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x20,%rax
mov    -0x8(%rbp),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xgetbv>:
mov    %edi,%ecx
xgetbv
shl    $0x20,%rdx
mov    %eax,%eax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @xgetbv(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm "xgetbv", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = shl i64 %10, 32
%12 = load i32, i32* %3
%13 = zext i32 %12 to i64
%14 = or i64 %11, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @xgetbv(i32 %0) {
%2 = tail call { i32, i32 } asm "xgetbv", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 0
%4 = extractvalue { i32, i32 } %2, 1
%5 = zext i32 %4 to i64
%6 = shl nuw i64 %5, 32
%7 = zext i32 %3 to i64
%8 = or i64 %6, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int);
int main(int argc, const char *argv[]) {
  printf("Sum: %d", sum(4, 5));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x5,%esi
call   1040 <sum@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"Sum: %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sum(i32 4, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int foo(int a, int b) {
  int i;
  volatile int *labelref = &&label1;
  if (a > b) {
    while (i < b) {
      a += *labelref;
      i += 1;
    }
    goto *labelref;
  } else
    b = b + 3;
  a = a * b;
label1:
  return a + b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0x5b(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1159 <foo+0x59>
jmp    1126 <foo+0x26>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114c <foo+0x4c>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <foo+0x26>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1174 <foo+0x74>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret
mov    -0x20(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<foo>:
lea    0x3(%rsi),%ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
cmovg  %esi,%ecx
imul   %edi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32* bitcast (i8* blockaddress(@foo, %32) to i32*), i32** %6
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %25
10: ; preds = %2
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load i32*, i32** %6
%17 = load volatile i32, i32* %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %11
22: ; preds = %11
%23 = load i32*, i32** %6
%24 = bitcast i32* %23 to i8*
br label %36
25: ; preds = %2
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 3
store i32 %27, i32* %4
br label %28
28: ; preds = %25
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = mul nsw i32 %29, %30
store i32 %31, i32* %3
br label %32
32: ; preds = %28, %36
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = add nsw i32 %33, %34
ret i32 %35
36: ; preds = %22
%37 = phi i8* [ %24, %22 ]
indirectbr i8* %37, [label %32]
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = add nsw i32 %1, 3
%5 = select i1 %3, i32 1, i32 %4
%6 = mul nsw i32 %5, %0
%7 = select i1 %3, i32 %1, i32 %4
%8 = add nsw i32 %6, %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ TGLC_rand_bytes(void *, int);
int /*<<< orphan*/ assert(int);
void tglt_secure_random(void *s, int l) {
  if (TGLC_rand_bytes(s, l) <= 0) {
    assert(0 && "End of random. If you want, you can start with -w");
  } else {
  }
}


x86 assembly (clang, -O0):
<tglt_secure_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <TGLC_rand_bytes@plt>
cmp    $0x0,%rax
jg     1151 <tglt_secure_random+0x31>
xor    %edi,%edi
call   1030 <assert@plt>
jmp    1156 <tglt_secure_random+0x36>
jmp    1156 <tglt_secure_random+0x36>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tglt_secure_random>:
push   %rax
call   1040 <TGLC_rand_bytes@plt>
test   %rax,%rax
jle    112d <tglt_secure_random+0xd>
pop    %rax
ret
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @tglt_secure_random(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @TGLC_rand_bytes(i8* %5, i32 %6)
%8 = icmp sle i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @assert(i32 0)
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @tglt_secure_random(i8* %0, i32 %1) {
%3 = tail call i64 @TGLC_rand_bytes(i8* %0, i32 %1)
%4 = icmp slt i64 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @assert(i32 0)
br label %7
7: ; preds = %2, %5
ret void
}
void f(int x) {
  int *(p[25]);
  int m[25 * 7];
  int i;
  for (i = 0; i < 25; i++)
    p[i] = m + x * i;
  p[1][0] = 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x320,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x394(%rbp)
cmpl   $0x19,-0x394(%rbp)
jge    1162 <f+0x62>
lea    -0x390(%rbp),%rcx
mov    -0x4(%rbp),%eax
imul   -0x394(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
movslq -0x394(%rbp),%rax
mov    %rcx,-0xd0(%rbp,%rax,8)
ff
mov    -0x394(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x394(%rbp)
jmp    1118 <f+0x18>
mov    -0xc8(%rbp),%rax
movl   $0x0,(%rax)
add    $0x320,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
%3 = alloca [25 x i32*]
%4 = alloca [175 x i32]
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %5
br label %6
6: ; preds = %19, %1
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 25
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = getelementptr inbounds [175 x i32], [175 x i32]* %4, i64 0, i64 0
%11 = load i32, i32* %2
%12 = load i32, i32* %5
%13 = mul nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %10, i64 %14
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [25 x i32*], [25 x i32*]* %3, i64 0, i64 %17
store i32* %15, i32** %18
br label %19
19: ; preds = %9
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
%23 = getelementptr inbounds [25 x i32*], [25 x i32*]* %3, i64 0, i64 1
%24 = load i32*, i32** %23
%25 = getelementptr inbounds i32, i32* %24, i64 0
store i32 0, i32* %25
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}