xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void *shmem_realloc(void *ptr, size_t size) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_realloc>:
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):
<shmem_realloc>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define i8* @shmem_realloc(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* @shmem_realloc(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
}
/* Variables and functions */
char *system_kernel_version() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @system_kernel_version() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @system_kernel_version() {
ret i8* null
}
void init_uart(void) {
  (*((volatile unsigned short *)0x7F008000)) &= ~0xff;
  (*((volatile unsigned short *)0x7F008000)) |= 0x22;
  (*((volatile unsigned long *)0x7F005000)) = 0x3;
  (*((volatile unsigned long *)0x7F005004)) = 0x5;
  (*((volatile unsigned long *)0x7F005008)) = 0x01;
  (*((volatile unsigned long *)0x7F00500C)) = 0;
  (*((volatile unsigned short *)0x7F005028)) = 35;
  (*((volatile unsigned short *)0x7F00502C)) = 0x1;
}


x86 assembly (clang, -O0):
<init_uart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008000,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0xffffff00,%eax
mov    %ax,%cx
mov    $0x7f008000,%eax
mov    %cx,(%rax)
mov    $0x7f008000,%eax
mov    (%rax),%ax
movzwl %ax,%eax
or     $0x22,%eax
mov    %ax,%cx
mov    $0x7f008000,%eax
mov    %cx,(%rax)
mov    $0x7f005000,%eax
movq   $0x3,(%rax)
mov    $0x7f005004,%eax
movq   $0x5,(%rax)
mov    $0x7f005008,%eax
movq   $0x1,(%rax)
mov    $0x7f00500c,%eax
movq   $0x0,(%rax)
mov    $0x7f005028,%eax
movw   $0x23,(%rax)
mov    $0x7f00502c,%eax
movw   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_uart>:
andw   $0xff00,0x7f008000
orw    $0x22,0x7f008000
7f 22
movq   $0x3,0x7f005000
movq   $0x5,0x7f005004
movq   $0x1,0x7f005008
movq   $0x0,0x7f00500c
movw   $0x23,0x7f005028
movw   $0x1,0x7f00502c
ret

LLVM IR (-O0):
define void @init_uart() {
%1 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%2 = zext i16 %1 to i32
%3 = and i32 %2, -256
%4 = trunc i32 %3 to i16
store volatile i16 %4, i16* inttoptr (i64 2130739200 to i16*)
%5 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%6 = zext i16 %5 to i32
%7 = or i32 %6, 34
%8 = trunc i32 %7 to i16
store volatile i16 %8, i16* inttoptr (i64 2130739200 to i16*)
store volatile i64 3, i64* inttoptr (i64 2130726912 to i64*)
store volatile i64 5, i64* inttoptr (i64 2130726916 to i64*)
store volatile i64 1, i64* inttoptr (i64 2130726920 to i64*)
store volatile i64 0, i64* inttoptr (i64 2130726924 to i64*)
store volatile i16 35, i16* inttoptr (i64 2130726952 to i16*)
store volatile i16 1, i16* inttoptr (i64 2130726956 to i16*)
ret void
}

LLVM IR (-O2):
define void @init_uart() {
%1 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%2 = and i16 %1, -256
store volatile i16 %2, i16* inttoptr (i64 2130739200 to i16*)
%3 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%4 = or i16 %3, 34
store volatile i16 %4, i16* inttoptr (i64 2130739200 to i16*)
store volatile i64 3, i64* inttoptr (i64 2130726912 to i64*)
store volatile i64 5, i64* inttoptr (i64 2130726916 to i64*)
store volatile i64 1, i64* inttoptr (i64 2130726920 to i64*)
store volatile i64 0, i64* inttoptr (i64 2130726924 to i64*)
store volatile i16 35, i16* inttoptr (i64 2130726952 to i16*)
store volatile i16 1, i16* inttoptr (i64 2130726956 to i16*)
ret void
}
/* Variables and functions */
void byte_set(void *dst, const char value, size_t size) {
  if (!dst)
    return;
  char *restrict d = dst;
  while (size--)
    *d++ = value;
}


x86 assembly (clang, -O0):
<byte_set>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1122 <byte_set+0x22>
jmp    115c <byte_set+0x5c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     115c <byte_set+0x5c>
mov    -0x9(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    112a <byte_set+0x2a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_set>:
test   %rdi,%rdi
je     1128 <byte_set+0x18>
test   %rdx,%rdx
je     1128 <byte_set+0x18>
push   %rax
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @byte_set(i8* writeonly %0, i8 signext %1, i64 %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i64 %2, 0
%6 = or i1 %4, %5
br i1 %6, label %8, label %7
7: ; preds = %3
br label %8
8: ; preds = %7, %3
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *find(char *haystack, char needle) {
  char *s;
  s = strchr(haystack, needle);
  if (s != NULL)
    return s;
  else
    return NULL;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114b <find+0x3b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <find+0x43>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i8* @find(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
%7 = load i8*, i8** %4
%8 = load i8, i8* %5
%9 = call i8* @strchr(i8* %7, i8 signext %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %6
store i8* %13, i8** %3
br label %15
14: ; preds = %2
store i8* null, i8** %3
br label %15
15: ; preds = %14, %12
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @find(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
ret i8* %3
}
int assign_arg_idx(int *p, int i) {
  int j;
  __builtin_prefetch(&p[j = i], 0, 0);
  return j == i;
}


x86 assembly (clang, -O0):
<assign_arg_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x10(%rbp)
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
prefetchnta (%rax)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_arg_idx>:
movslq %esi,%rax
prefetchnta (%rdi,%rax,4)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @assign_arg_idx(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
store i32 %7, i32* %5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = bitcast i32* %9 to i8*
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @assign_arg_idx(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = bitcast i32* %4 to i8*
tail call void @llvm.prefetch.p0i8(i8* %5, i32 0, i32 0, i32 1)
ret i32 1
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t byteswap2(uint16_t num) {
  return ((num & 0xFF00) >> 8) | ((num & 0x00FF) << 8);
}


x86 assembly (clang, -O0):
<byteswap2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteswap2>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @byteswap2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @byteswap2(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
struct TYPE_4__ {
  scalar_t__ __owner;
  scalar_t__ __count;
  scalar_t__ __lock;
};
struct TYPE_5__ {
  TYPE_1__ __data;
};
typedef TYPE_2__ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_init(pthread_mutex_t *mutex,
                       const pthread_mutexattr_t *mutexattr) {
__ESBMC_HIDE:
  ((*mutex).__data.__lock) = 0;
  ((*mutex).__data.__count) = 0;
  ((*mutex).__data.__owner) = 0;
  return 0;
}


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

x86 assembly (clang, -O2):
<pthread_mutex_init>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
movq   $0x0,0x10(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i64, i64, i64 }
define i32 @pthread_mutex_init(%struct.TYPE_5__* %0, i32* %1) {
%3 = alloca %struct.TYPE_5__*
%4 = alloca i32*
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %3
store i32* %1, i32** %4
br label %5
5: ; preds = %2
%6 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%7 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 2
store i64 0, i64* %8
%9 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%10 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %9, i32 0, i32 0
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 1
store i64 0, i64* %11
%12 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%13 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %12, i32 0, i32 0
%14 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %13, i32 0, i32 0
store i64 0, i64* %14
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i64, i64, i64 }
define i32 @pthread_mutex_init(%struct.TYPE_5__* nocapture writeonly %0, i32* nocapture readnone %1) {
%3 = bitcast %struct.TYPE_5__* %0 to i8*
ret i32 0
}
long SSIDataPutNonBlocking(unsigned long ulBase, unsigned long ulData) {
  ;

  ;
  if ((*((volatile unsigned long *)(ulBase + 0x0000000C))) & 0x00000002) {
    (*((volatile unsigned long *)(ulBase + 0x00000008))) = ulData;
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<SSIDataPutNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     113b <SSIDataPutNonBlocking+0x3b>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
movq   $0x1,-0x8(%rbp)
jmp    1143 <SSIDataPutNonBlocking+0x43>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDataPutNonBlocking>:
testq  $0x2,0xc(%rdi)
jne    110d <SSIDataPutNonBlocking+0xd>
xor    %eax,%eax
ret
mov    %rsi,0x8(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @SSIDataPutNonBlocking(i64 %0, i64 %1) {
%3 = add i64 %0, 12
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, 2
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = add i64 %0, 8
%10 = inttoptr i64 %9 to i64*
store volatile i64 %1, i64* %10
br label %11
11: ; preds = %2, %8
%12 = phi i64 [ 1, %8 ], [ 0, %2 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ print_mem(char *, void *, int, char *, char, char *);
void println_hex(char *leader, void *mem, int len, char sep) {
  print_mem(leader, mem, len, "%02x", sep, "\n");
}


x86 assembly (clang, -O0):
<println_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xec6(%rip),%rcx
lea    0xec4(%rip),%r9
movsbl -0x15(%rbp),%r8d
call   1030 <print_mem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<println_hex>:
mov    %ecx,%r8d
lea    0xee6(%rip),%rcx
lea    0xee4(%rip),%r9
jmp    1030 <print_mem@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @println_hex(i8* %0, i8* %1, i32 %2, i8 signext %3) {
%5 = tail call i32 @print_mem(i8* %0, i8* %1, i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t cmovznz(uint64_t t, uint64_t z, uint64_t nz) {
  asm("testq %1, %1;"
      "\n"
      "\t"
      "cmovnzq %3, %0;"
      : "=r"(z)
      : "r"(t), "0"(z), "r"(nz));
  return z;
}


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

x86 assembly (clang, -O2):
<cmovznz>:
mov    %rsi,%rax
test   %rdi,%rdi
cmovne %rdx,%rax
ret

LLVM IR (-O0):
define i8* @cmovznz(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* asm "testq $1, $1;\0A\09cmovnzq $3, $0;", "=r,r,0,r,~{dirflag},~{fpsr},~{flags}"(i8* %7, i8* %8, i8* %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @cmovznz(i8* readnone %0, i8* readnone %1, i8* readnone %2) {
%4 = tail call i8* asm "testq $1, $1;\0A\09cmovnzq $3, $0;", "=r,r,0,r,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Variables and functions */
int myStrLen(char *);
int /*<<< orphan*/ printf(char *, int);
main(void) {
  int a;
  char str[8] = "gopal";
  char str2[40] = "venu";
  a = myStrLen(str);
  printf("length = %d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movb   $0x76,-0x40(%rbp)
movb   $0x65,-0x3f(%rbp)
movb   $0x6e,-0x3e(%rbp)
movb   $0x75,-0x3d(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <myStrLen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x6c61706f67,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1040 <myStrLen@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [8 x i8] c"gopal\00\00\00"
@.str = [13 x i8] c"length = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = alloca [40 x i8]
%4 = bitcast [8 x i8]* %2 to i8*
%5 = bitcast [40 x i8]* %3 to i8*
%6 = bitcast i8* %5 to [40 x i8]*
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i32 0, i32 0
store i8 118, i8* %7
%8 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i32 0, i32 1
store i8 101, i8* %8
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i32 0, i32 2
store i8 110, i8* %9
%10 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i32 0, i32 3
store i8 117, i8* %10
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%12 = call i32 @myStrLen(i8* %11)
store i32 %12, i32* %1
%13 = load i32, i32* %1
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"length = %d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 465491226471, i64* %1
%3 = call i32 @myStrLen(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int tpd_driver_add(struct tpd_driver_t *t) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.tpd_driver_t = type opaque
define i32 @tpd_driver_add(%struct.tpd_driver_t* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fun();
int main(int argc, char **argv) {
  fun();
  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    $0x0,%al
call   1030 <fun@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <fun@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 (...) @fun()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fun()
ret i32 0
}
void image_stretch_to_screen() {}


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

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

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

LLVM IR (-O2):
define void @image_stretch_to_screen() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
struct sshbuf {
  int dummy;
};

/* Variables and functions */
int sshbuf_put_string8(struct sshbuf *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int sshbuf_put_cstring8(struct sshbuf *buf, const char *v) {
  return sshbuf_put_string8(buf, (u_char *)v, v == NULL ? 0 : strlen(v));
}


x86 assembly (clang, -O0):
<sshbuf_put_cstring8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <sshbuf_put_cstring8+0x35>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1161 <sshbuf_put_cstring8+0x41>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
call   1040 <sshbuf_put_string8@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sshbuf_put_cstring8>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     113b <sshbuf_put_cstring8+0x1b>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
jmp    113d <sshbuf_put_cstring8+0x1d>
xor    %edx,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sshbuf_put_string8@plt>

LLVM IR (-O0):
%struct.sshbuf = type { i32 }
define i32 @sshbuf_put_cstring8(%struct.sshbuf* %0, i8* %1) {
%3 = alloca %struct.sshbuf*
%4 = alloca i8*
store %struct.sshbuf* %0, %struct.sshbuf** %3
store i8* %1, i8** %4
%5 = load %struct.sshbuf*, %struct.sshbuf** %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
br label %14
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @strlen(i8* %12)
br label %14
14: ; preds = %11, %10
%15 = phi i32 [ 0, %10 ], [ %13, %11 ]
%16 = call i32 @sshbuf_put_string8(%struct.sshbuf* %5, i32* %7, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.sshbuf = type { i32 }
define i32 @sshbuf_put_cstring8(%struct.sshbuf* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
%8 = bitcast i8* %1 to i32*
%9 = tail call i32 @sshbuf_put_string8(%struct.sshbuf* %0, i32* %8, i32 %7)
ret i32 %9
}
__attribute__((always_)) void sb(void) {
  asm volatile("sfence\n\t" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @sb() {
tail call void asm sideeffect "sfence\0A\09", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int ugetxc_(const char **s) { return '\0'; }


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

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

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

LLVM IR (-O2):
define i32 @ugetxc_(i8** nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void cat_test_cleanup(void) {
  remove("result_cat1");
  remove("result_cat2");
}


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

x86 assembly (clang, -O2):
<cat_test_cleanup>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <remove@plt>
lea    0xee8(%rip),%rdi
pop    %rax
jmp    1030 <remove@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"result_cat1\00"
@.str.1 = [12 x i8] c"result_cat2\00"
define void @cat_test_cleanup() {
%1 = call i32 @remove(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @remove(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"result_cat1\00"
@.str.1 = [12 x i8] c"result_cat2\00"
define void @cat_test_cleanup() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @remove(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int RTLD_LOCAL;
int RTLD_NOW;
void *dlopen(char const *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void *loadlib(const char *path) {
  void *addr = dlopen(path, RTLD_NOW | RTLD_LOCAL);
  if (addr == NULL) {
    fprintf(stderr, "failed to load: %s\n", path);
    exit(2);
  }
  return addr;
}


x86 assembly (clang, -O0):
<loadlib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2e78(%rip),%rax
or     (%rax),%esi
call   1030 <dlopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1189 <loadlib+0x59>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe86(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadlib>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    0x2e86(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1030 <dlopen@plt>
test   %rax,%rax
je     1152 <loadlib+0x22>
pop    %rbx
ret
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@RTLD_NOW = global i32 0
@RTLD_LOCAL = global i32 0
@stderr = global i32 0
@.str = [20 x i8] c"failed to load: %s\0A\00"
define i8* @loadlib(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @RTLD_NOW
%6 = load i32, i32* @RTLD_LOCAL
%7 = or i32 %5, %6
%8 = call i8* @dlopen(i8* %4, i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %2
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 2)
unreachable
16: ; preds = %1
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@RTLD_NOW = global i32 0
@RTLD_LOCAL = global i32 0
@stderr = global i32 0
@.str = [20 x i8] c"failed to load: %s\0A\00"
define i8* @loadlib(i8* %0) {
%2 = load i32, i32* @RTLD_NOW
%3 = load i32, i32* @RTLD_LOCAL
%4 = or i32 %3, %2
%5 = tail call i8* @dlopen(i8* %0, i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = tail call i32 @exit(i32 2)
unreachable
11: ; preds = %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage(char **, int);
void __attribute__((__noreturn__)) invalid(char **argv, char *devpath) {
  fprintf(stderr, "Invalid DEVPATH '%s'.\n", devpath);
  usage(argv, 1);
}


x86 assembly (clang, -O0):
<invalid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <usage@plt>

x86 assembly (clang, -O2):
<invalid>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <usage@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Invalid DEVPATH '%s'.\0A\00"
define void @invalid(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8**, i8*** %3
%9 = call i32 @usage(i8** %8, i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Invalid DEVPATH '%s'.\0A\00"
define void @invalid(i8** %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @usage(i8** %0, i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void minuscconlyc(unsigned char a, unsigned char b) {
  unsigned char difference = a - b;
  if (difference > a)
    abort();
}


x86 assembly (clang, -O0):
<minuscconlyc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jle    1148 <minuscconlyc+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minuscconlyc>:
cmp    %dil,%sil
ja     1116 <minuscconlyc+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @minuscconlyc(i8 zeroext %0, i8 zeroext %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
%7 = zext i8 %6 to i32
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = sub nsw i32 %7, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %5
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = icmp sgt i32 %13, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @minuscconlyc(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp ugt i8 %1, %0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void this_is_a_long_file_name(void) { printf("this_is_a_long_file_name()\n"); }


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"this_is_a_long_file_name()\00"
define void @this_is_a_long_file_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exp(double);
int /*<<< orphan*/ expf(float);
int /*<<< orphan*/ expl(long double);
void uninitvar_exp(void) {
  float f;
  (void)expf(f);
  double d;
  (void)exp(d);
  long double ld;
  (void)expl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <exp@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <expl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_exp>:
sub    $0x18,%rsp
call   1030 <expf@plt>
call   1050 <exp@plt>
call   1040 <expl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_exp() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @expf(float %4)
%6 = load double, double* %2
%7 = call i32 @exp(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @expl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_exp() {
%1 = tail call i32 @expf(float undef)
%2 = tail call i32 @exp(double undef)
%3 = tail call i32 @expl(x86_fp80 undef)
ret void
}
/* Variables and functions */
bool vowel(char c) {
  char vowels[6] = {'a', 'e', 'i', 'o', 'u', 'y'};
  for (int i = 0; i < 6; i++) {
    if (vowels[i] == c)
      return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<vowel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xeea(%rip),%ax
mov    %ax,-0x7(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    1163 <vowel+0x63>
movslq -0x10(%rbp),%rax
movsbl -0xb(%rbp,%rax,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1150 <vowel+0x50>
movl   $0x1,-0x4(%rbp)
jmp    116a <vowel+0x6a>
jmp    1155 <vowel+0x55>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <vowel+0x25>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vowel>:
add    $0x9f,%dil
ror    %dil
xor    %eax,%eax
cmp    $0xc,%dil
ja     111d <vowel+0x1d>
movsbq %dil,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.vowel.vowels = [6 x i8] c"aeiouy"
define i32 @vowel(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [6 x i8]
%5 = alloca i32
store i8 %0, i8* %3
%6 = bitcast [6 x i8]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %21, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 6
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %20
19: ; preds = %10
store i32 1, i32* %2
br label %25
20: ; preds = %10
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@switch.table.vowel = [13 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1]
define i32 @vowel(i8 signext %0) {
%2 = add i8 %0, -97
%3 = call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 7)
%4 = icmp ult i8 %3, 13
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i8 %3 to i64
%7 = getelementptr inbounds [13 x i32], [13 x i32]* @switch.table.vowel, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
int _evhtp_is_http_10(const char major, const char minor) {
  if (major >= 1 && minor <= 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_evhtp_is_http_10>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x1,%eax
jl     1136 <_evhtp_is_http_10+0x36>
movsbl -0x6(%rbp),%eax
cmp    $0x0,%eax
jg     1136 <_evhtp_is_http_10+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <_evhtp_is_http_10+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_evhtp_is_http_10>:
test   %dil,%dil
setg   %al
test   %sil,%sil
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @_evhtp_is_http_10(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, 0
%4 = icmp slt i8 %1, 1
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int show_help_string() {
  printf("This is ccronctl.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"This is ccronctl.\00"
define i32 @show_help_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_prompt() { printf(">>> "); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c">>> \00"
define void @print_prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_36int16_mem(short *val) {
  return ((*val) & (0x36 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_36int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x36,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_36int16_mem>:
testb  $0x36,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_36int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 54
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_36int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 54
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int geteuid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("uid is :%d \n euid is %d\n\n", getuid(), geteuid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xea4(%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 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <geteuid@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"uid is :%d \0A euid is %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getuid()
%3 = call i32 (...) @geteuid()
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"uid is :%d \0A euid is %d\0A\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @geteuid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ load_image();
int /*<<< orphan*/ reset_machine_state();
void reset() {
  reset_machine_state();
  load_image();
}


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

x86 assembly (clang, -O2):
<reset>:
push   %rax
xor    %eax,%eax
call   1040 <reset_machine_state@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <load_image@plt>

LLVM IR (-O0):
define void @reset() {
%1 = call i32 (...) @reset_machine_state()
%2 = call i32 (...) @load_image()
ret void
}

LLVM IR (-O2):
define void @reset() {
%1 = tail call i32 (...) @reset_machine_state()
%2 = tail call i32 (...) @load_image()
ret void
}
void test1(void) { char tmp[2] = "0"; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.test1.tmp = [2 x i8] c"0\00"
define void @test1() {
%1 = alloca [2 x i8]
%2 = bitcast [2 x i8]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @test1() {
ret void
}
int aanum(ch)
int ch;
{
  static const int aacvs[] = {999, 0,  20, 4,  3,  6,  13, 7,  8,
                              9,   20, 11, 10, 12, 2,  20, 14, 5,
                              1,   15, 16, 20, 19, 17, 20, 18, 20};
  return (isalpha(ch) ? aacvs[ch & 31] : 20);
}


x86 assembly (clang, -O0):
<aanum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%eax
je     1147 <aanum+0x37>
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0xec4(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <aanum+0x44>
mov    $0x14,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <aanum+0x44>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aanum>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %eax,%eax
je     112b <aanum+0x1b>
and    $0x1f,%ebx
lea    0xeda(%rip),%rax
mov    (%rax,%rbx,4),%eax
pop    %rbx
ret
mov    $0x14,%eax
pop    %rbx
ret

LLVM IR (-O0):
@aanum.aacvs = internal constant [27 x i32] [i32 999, i32 0, i32 20, i32 4, i32 3, i32 6, i32 13, i32 7, i32 8, i32 9, i32 20, i32 11, i32 10, i32 12, i32 2, i32 20, i32 14, i32 5, i32 1, i32 15, i32 16, i32 20, i32 19, i32 17, i32 20, i32 18, i32 20]
define i32 @aanum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isalpha(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, 31
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [27 x i32], [27 x i32]* @aanum.aacvs, i64 0, i64 %9
%11 = load i32, i32* %10
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %6
%14 = phi i32 [ %11, %6 ], [ 20, %12 ]
ret i32 %14
}

LLVM IR (-O2):
@aanum.aacvs = internal unnamed_addr constant [27 x i32] [i32 999, i32 0, i32 20, i32 4, i32 3, i32 6, i32 13, i32 7, i32 8, i32 9, i32 20, i32 11, i32 10, i32 12, i32 2, i32 20, i32 14, i32 5, i32 1, i32 15, i32 16, i32 20, i32 19, i32 17, i32 20, i32 18, i32 20]
define i32 @aanum(i32 %0) {
%2 = tail call i32 @isalpha(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = and i32 %0, 31
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [27 x i32], [27 x i32]* @aanum.aacvs, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 20, %1 ]
ret i32 %10
}
OP(fd, f2) {
  illegal_1();
  op_f2();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_f2@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f2()
ret i32 undef
}
int alignconv(int align) {
  int i;
  if ((i = align) >= 1) {
    align = 1;
    while (i >>= 1)
      ;
    align++;
  }
  return align;
}


x86 assembly (clang, -O0):
<alignconv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x1,%eax
jl     113d <alignconv+0x3d>
movl   $0x1,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1134 <alignconv+0x34>
jmp    111d <alignconv+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alignconv>:
test   %edi,%edi
mov    $0x2,%eax
cmovle %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @alignconv(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 2, i32 %0
ret i32 %3
}
/* Variables and functions */
int S_IRWXG;
int S_IRWXO;
int S_IRWXU;
int mkdir(char const *, int);
int CreateDir(const char *pathname) {
  return mkdir(pathname, S_IRWXU | S_IRWXG | S_IRWXO);
}


x86 assembly (clang, -O0):
<CreateDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
mov    0x2eb7(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateDir>:
mov    0x2ec9(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ec7(%rip),%rax
or     (%rax),%esi
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IRWXO = global i32 0
define i32 @CreateDir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IRWXU
%5 = load i32, i32* @S_IRWXG
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IRWXO
%8 = or i32 %6, %7
%9 = call i32 @mkdir(i8* %3, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IRWXO = global i32 0
define i32 @CreateDir(i8* nocapture %0) {
%2 = load i32, i32* @S_IRWXU
%3 = load i32, i32* @S_IRWXG
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IRWXO
%6 = or i32 %4, %5
%7 = tail call i32 @mkdir(i8* %0, i32 %6)
ret i32 %7
}