xunge/DecIR huggingface dataset:
__strcspn_c3(__const char *__s, int __reject1, int __reject2, int __reject3) {}


x86 assembly (clang, -O0):
<__strcspn_c3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__strcspn_c3(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  unsigned int i = 1;
  char *c = (char *)&i;
  if (*c)
    printf("Little endian");
  else
    printf("Big endian");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <main+0x3c>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <main+0x48>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Little endian\00"
@.str.1 = [11 x i8] c"Big endian\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 1, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Little endian\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wscanf(int /*<<< orphan*/ *, ...);
void uninivar_wscanf(void) {
  wchar_t *format;
  int i;
  (void)wscanf(format);
  (void)wscanf(format, &i);
}


x86 assembly (clang, -O0):
<uninivar_wscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <wscanf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <wscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninivar_wscanf>:
push   %rax
xor    %eax,%eax
call   1030 <wscanf@plt>
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <wscanf@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @uninivar_wscanf() {
%1 = alloca i32*
%2 = alloca i32
%3 = load i32*, i32** %1
%4 = call i32 (i32*, ...) @wscanf(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 (i32*, ...) @wscanf(i32* %5, i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninivar_wscanf() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i32*, ...) @wscanf(i32* undef)
%4 = call i32 (i32*, ...) @wscanf(i32* undef, i32* %1)
ret void
}
int engFile(char *s) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @engFile(i8* nocapture readnone %0) {
ret i32 -1
}
int test_imm_D0uint8_mem(unsigned char *val) {
  return ((*val) & (0xD0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D0uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 208
%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_D0uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -48
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
scalar_t__ recv_packet(int, int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void *handle_con(void *s_) {
  int s = (int)(intptr_t)s_;
  while (recv_packet(s, 0xffffffff, NULL, 0))
    ;
  close(s);
  return NULL;
}


x86 assembly (clang, -O0):
<handle_con>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0xffffffff,%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <recv_packet@plt>
cmp    $0x0,%rax
je     1155 <handle_con+0x35>
jmp    1133 <handle_con+0x13>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_con>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%edi
mov    $0xffffffff,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <recv_packet@plt>
test   %rax,%rax
jne    1130 <handle_con+0x10>
mov    %ebx,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @handle_con(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
br label %7
7: ; preds = %11, %1
%8 = load i32, i32* %3
%9 = call i64 @recv_packet(i32 %8, i32 -1, i32* null, i32 0)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @handle_con(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
br label %4
4: ; preds = %4, %1
%5 = tail call i64 @recv_packet(i32 %3, i32 -1, i32* null, i32 0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %4
7: ; preds = %4
%8 = tail call i32 @close(i32 %3)
ret i8* null
}
/* Variables and functions */
int testfunc_new(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @testfunc_new() {
ret i32 3
}

LLVM IR (-O2):
define i32 @testfunc_new() {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_port(int /*<<< orphan*/, int, int);
uint8_t io_get_interrupt_on_port(uint8_t port) {
  return get_port(port, 0x04, 0x05);
}


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

x86 assembly (clang, -O2):
<io_get_interrupt_on_port>:
mov    $0x4,%esi
mov    $0x5,%edx
jmp    1030 <get_port@plt>

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

LLVM IR (-O2):
define i32 @io_get_interrupt_on_port(i32 %0) {
%2 = tail call i32 @get_port(i32 %0, i32 4, i32 5)
ret i32 %2
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double drnd() { return ((double)rand()) / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<drnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drnd>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @drnd() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @drnd() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
int xmlUCSIsCJKUnifiedIdeographsExtensionA(int code) {
  return (((code >= 0x3400) && (code <= 0x4DBF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsCJKUnifiedIdeographsExtensionA>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x3400,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsCJKUnifiedIdeographsExtensionA+0x26>
cmpl   $0x4dbf,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsCJKUnifiedIdeographsExtensionA>:
add    $0xffffcc00,%edi
xor    %eax,%eax
cmp    $0x19c0,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsCJKUnifiedIdeographsExtensionA(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 13312
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 19903
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsCJKUnifiedIdeographsExtensionA(i32 %0) {
%2 = add i32 %0, -13312
%3 = icmp ult i32 %2, 6592
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct A {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcmp(struct A *, struct A *, int);
int /*<<< orphan*/ memcpy(struct A *, struct A *, int);
int /*<<< orphan*/ memmove(struct A *, struct A *, int);
int /*<<< orphan*/ memset(struct A *, int /*<<< orphan*/, int);
void bad(struct A *a, struct A *b) {
  memcmp(a, b, sizeof a);
  memset(a, 0, sizeof a);
  memcpy(a, b, sizeof a);
  memmove(a, b, sizeof a);
}


x86 assembly (clang, -O0):
<bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcmp@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1060 <memmove@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x8,%edx
call   1040 <memcmp@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <memmove@plt>

LLVM IR (-O0):
%struct.A = type { i32 }
define void @bad(%struct.A* %0, %struct.A* %1) {
%3 = alloca %struct.A*
%4 = alloca %struct.A*
store %struct.A* %0, %struct.A** %3
store %struct.A* %1, %struct.A** %4
%5 = load %struct.A*, %struct.A** %3
%6 = load %struct.A*, %struct.A** %4
%7 = call i32 @memcmp(%struct.A* %5, %struct.A* %6, i32 8)
%8 = load %struct.A*, %struct.A** %3
%9 = call i32 @memset(%struct.A* %8, i32 0, i32 8)
%10 = load %struct.A*, %struct.A** %3
%11 = load %struct.A*, %struct.A** %4
%12 = call i32 @memcpy(%struct.A* %10, %struct.A* %11, i32 8)
%13 = load %struct.A*, %struct.A** %3
%14 = load %struct.A*, %struct.A** %4
%15 = call i32 @memmove(%struct.A* %13, %struct.A* %14, i32 8)
ret void
}

LLVM IR (-O2):
%struct.A = type { i32 }
define void @bad(%struct.A* %0, %struct.A* %1) {
%3 = tail call i32 @memcmp(%struct.A* %0, %struct.A* %1, i32 8)
%4 = tail call i32 @memset(%struct.A* %0, i32 0, i32 8)
%5 = tail call i32 @memcpy(%struct.A* %0, %struct.A* %1, i32 8)
%6 = tail call i32 @memmove(%struct.A* %0, %struct.A* %1, i32 8)
ret void
}
char *my_strcat(char *dest, const char *src) {
  char *dest_orig = dest;
  while (*dest)
    dest++;
  while (*src)
    *dest++ = *src++;
  *dest = 0;
  return dest_orig;
}


x86 assembly (clang, -O0):
<my_strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <my_strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <my_strcat+0x14>
jmp    1137 <my_strcat+0x37>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <my_strcat+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1137 <my_strcat+0x37>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
mov    %rcx,%rdi
add    $0x1,%rcx
cmpb   $0x0,(%rdi)
jne    1110 <my_strcat+0x10>
mov    (%rsi),%dl
test   %dl,%dl
je     1146 <my_strcat+0x46>
mov    $0xffffffffffffffff,%rdi
nopl   0x0(%rax)
mov    %dl,(%rcx,%rdi,1)
movzbl 0x2(%rsi,%rdi,1),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1130 <my_strcat+0x30>
add    %rdi,%rcx
mov    %rcx,%rdi
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @my_strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %16, %11 ], [ %4, %8 ]
%14 = phi i8* [ %15, %11 ], [ %1, %8 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %13
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %16, %11 ]
store i8 0, i8* %20
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char const *);
int isLUKS(const char *type) { return (type && !strcmp("LUKS1", type)); }


x86 assembly (clang, -O0):
<isLUKS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1147 <isLUKS+0x37>
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLUKS>:
test   %rdi,%rdi
je     1133 <isLUKS+0x23>
push   %rax
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"LUKS1\00"
define i32 @isLUKS(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [6 x i8] c"LUKS1\00"
define i32 @isLUKS(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
int sequencia(int n) {
  if (n == 1 || n == 2 || n == 0)
    return n;
  return 2 * sequencia(n - 1) + 3 * sequencia(n - 2);
}


x86 assembly (clang, -O0):
<sequencia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1139 <sequencia+0x29>
cmpl   $0x2,-0x8(%rbp)
je     1139 <sequencia+0x29>
cmpl   $0x0,-0x8(%rbp)
jne    1144 <sequencia+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <sequencia+0x5d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sequencia@plt>
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <sequencia@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0x3,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequencia>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x2,%edi
jbe    1137 <sequencia+0x27>
lea    -0x1(%rbx),%edi
call   1030 <sequencia@plt>
mov    %eax,%r14d
add    $0xfffffffe,%ebx
mov    %ebx,%edi
call   1030 <sequencia@plt>
lea    (%rax,%rax,2),%eax
lea    (%rax,%r14,2),%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @sequencia(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 2
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9, %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %24
14: ; preds = %9
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
%17 = call i32 @sequencia(i32 %16)
%18 = mul nsw i32 2, %17
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 2
%21 = call i32 @sequencia(i32 %20)
%22 = mul nsw i32 3, %21
%23 = add nsw i32 %18, %22
store i32 %23, i32* %2
br label %24
24: ; preds = %14, %12
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @sequencia(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %12, %5 ], [ %0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @sequencia(i32 %6)
%8 = shl nsw i32 %7, 1
%9 = add nsw i32 %0, -2
%10 = tail call i32 @sequencia(i32 %9)
%11 = mul nsw i32 %10, 3
%12 = add nsw i32 %11, %8
br label %3
}
int test_imm_5Bint16_mem(short *val) {
  return ((*val) & (0x5B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Bint16_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, 91
%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_5Bint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 91
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main() {
  int b = 2, c = 3, d = 4;
  int a = b + c;
  b = a - d;
  int e = b + c;
  int f = a - d;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x1c(%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 i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
store i32 4, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = sub nsw i32 %17, %18
store i32 %19, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int target;
  target = 51235;
  printf("%d\n", target);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xc823,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
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
store i32 51235, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 51235)
ret i32 0
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
long long delta_timeval(struct timeval *start, struct timeval *finish) {
  long long delta_secs = finish->tv_sec - start->tv_sec;
  long long delta_usecs = finish->tv_usec - start->tv_usec;
  return delta_secs * (long long)1000000L + delta_usecs;
}


x86 assembly (clang, -O0):
<delta_timeval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%rax
mov    %rax,-0x20(%rbp)
imul   $0xf4240,-0x18(%rbp),%rax
add    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta_timeval>:
mov    (%rsi),%rax
mov    0x8(%rsi),%rcx
sub    (%rdi),%rax
sub    0x8(%rdi),%rcx
imul   $0xf4240,%rax,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @delta_timeval(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
%5 = alloca i64
%6 = alloca i64
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = load %struct.timeval*, %struct.timeval** %3
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sub nsw i64 %9, %12
store i64 %13, i64* %5
%14 = load %struct.timeval*, %struct.timeval** %4
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
store i64 %20, i64* %6
%21 = load i64, i64* %5
%22 = mul nsw i64 %21, 1000000
%23 = load i64, i64* %6
%24 = add nsw i64 %22, %23
ret i64 %24
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @delta_timeval(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%11 = load i64, i64* %10
%12 = sub i64 %9, %11
%13 = mul nsw i64 %7, 1000000
%14 = add nsw i64 %12, %13
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void assert_malloc(void *ptr) {
  if (ptr == ((void *)0))
    perror("ERROR: assert_malloc");
}


x86 assembly (clang, -O0):
<assert_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <assert_malloc+0x23>
lea    0xed2(%rip),%rdi
call   1030 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_malloc>:
test   %rdi,%rdi
je     1116 <assert_malloc+0x6>
ret
lea    0xee3(%rip),%rdi
jmp    1030 <perror@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"ERROR: assert_malloc\00"
define void @assert_malloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"ERROR: assert_malloc\00"
define void @assert_malloc(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
char *_raw_malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
char *_raw_strdup(char *str) {
  if (!str)
    return NULL;
  int len = strlen(str);
  char *ret = _raw_malloc(len + 1);
  memcpy(ret, str, len);
  ret[len] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<_raw_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <_raw_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1193 <_raw_strdup+0x63>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <_raw_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_raw_strdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1168 <_raw_strdup+0x38>
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%r15d
lea    0x1(%r15),%edi
call   1040 <_raw_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1050 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
jmp    116a <_raw_strdup+0x3a>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @_raw_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i8* @_raw_malloc(i32 %5)
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i32 %4)
%8 = sext i32 %4 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %1, %3
%11 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
char *strrchr(char const *, char);
const char *canonical_progname(const char *str) {
  const char *p;
  p = strrchr(str, '/');
  if (p)
    p++;
  else
    p = str;
  if (strncmp(p, "lt-", 3) == 0)
    p += 3;
  return p;
}


x86 assembly (clang, -O0):
<canonical_progname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115a <canonical_progname+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1162 <canonical_progname+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    118d <canonical_progname+0x6d>
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canonical_progname>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rbx
test   %rax,%rax
cmove  %r14,%rbx
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,2),%rax
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"lt-\00"
define i8* @canonical_progname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = tail call i64 @strncmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i64 3, i64 0
%9 = getelementptr i8, i8* %5, i64 %8
ret i8* %9
}
double _Complex mul_double_rc(double a, double _Complex b) { return a * b; }


x86 assembly (clang, -O0):
<mul_double_rc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_double_rc>:
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm2
movapd %xmm1,%xmm0
movapd %xmm2,%xmm1
ret

LLVM IR (-O0):
define { double, double } @mul_double_rc(double %0, double %1, double %2) {
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = alloca double
%7 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
store double %1, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %2, double* %8
store double %0, double* %6
%9 = load double, double* %6
%10 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%13 = load double, double* %12
%14 = fmul double %9, %11
%15 = fmul double %9, %13
%16 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%17 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %14, double* %16
store double %15, double* %17
%18 = load { double, double }, { double, double }* %4
ret { double, double } %18
}

LLVM IR (-O2):
define { double, double } @mul_double_rc(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = fmul double %0, %2
%6 = insertvalue { double, double } poison, double %4, 0
%7 = insertvalue { double, double } %6, double %5, 1
ret { double, double } %7
}
/* Variables and functions */
int get_and_increment();
int f(int i) { return i * get_and_increment(); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_and_increment@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_and_increment@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @get_and_increment()
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 (...) @get_and_increment()
%3 = mul nsw i32 %2, %0
ret i32 %3
}
int XTextPropertyToStringList() {}


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

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

LLVM IR (-O0):
define i32 @XTextPropertyToStringList() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XTextPropertyToStringList() {
ret i32 undef
}
double Fltofl(double fl) { return fl; }


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

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

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

LLVM IR (-O2):
define double @Fltofl(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "set [address]/[netmask] - set IP address and netmask\n"
                  "get  - display IP address\n"
                  "help - display this message\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [108 x i8] c"set [address]/[netmask] - set IP address and netmask\0Aget - display IP address\0Ahelp - display this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [108 x i8] c"set [address]/[netmask] - set IP address and netmask\0Aget - display IP address\0Ahelp - display this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0))
ret void
}
void g_param_spec_enum() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_enum() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
void ion_cmd_show(char *cmd) { printw("\n\rshow command\n\r\n\r"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"\0A\0Dshow command\0A\0D\0A\0D\00"
define void @ion_cmd_show(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printw(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0A\0Dshow command\0A\0D\0A\0D\00"
define void @ion_cmd_show(i8* nocapture readnone %0) {
%2 = tail call i32 @printw(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void debug(void *p) { printf("%p\n", p); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define void @debug(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main() {
  int i;
  for (i = 0; i < 10; i++) {
    __VERIFIER_assert(i == 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114f <main+0x3f>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 1)
%2 = tail call i32 @__VERIFIER_assert(i32 0)
%3 = tail call i32 @__VERIFIER_assert(i32 0)
%4 = tail call i32 @__VERIFIER_assert(i32 0)
%5 = tail call i32 @__VERIFIER_assert(i32 0)
%6 = tail call i32 @__VERIFIER_assert(i32 0)
%7 = tail call i32 @__VERIFIER_assert(i32 0)
%8 = tail call i32 @__VERIFIER_assert(i32 0)
%9 = tail call i32 @__VERIFIER_assert(i32 0)
%10 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}
/* Variables and functions */
int hits(char *, char *, int);
scalar_t__ pseudo(char *, char *, int);
int test_all_hits_no_pseudo() {
  char actual[] = {'R', 'G', 'B', 'Y'};
  char guess[] = {'R', 'G', 'B', 'Y'};
  return 4 == hits(actual, guess, 4) && 0 == pseudo(actual, guess, 4);
}


x86 assembly (clang, -O0):
<test_all_hits_no_pseudo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <hits@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x4,%ecx
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jne    1180 <test_all_hits_no_pseudo+0x60>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <pseudo@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all_hits_no_pseudo>:
push   %rax
movl   $0x59424752,0x4(%rsp)
59
movl   $0x59424752,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1040 <hits@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
jne    1168 <test_all_hits_no_pseudo+0x48>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <pseudo@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@__const.test_all_hits_no_pseudo.actual = [4 x i8] c"RGBY"
@__const.test_all_hits_no_pseudo.guess = [4 x i8] c"RGBY"
define i32 @test_all_hits_no_pseudo() {
%1 = alloca [4 x i8]
%2 = alloca [4 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = call i32 @hits(i8* %5, i8* %6, i32 4)
%8 = icmp eq i32 4, %7
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%12 = call i64 @pseudo(i8* %10, i8* %11, i32 4)
%13 = icmp eq i64 0, %12
br label %14
14: ; preds = %9, %0
%15 = phi i1 [ false, %0 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_all_hits_no_pseudo() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1497515858, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 1497515858, i32* %2
%5 = call i32 @hits(i8* %3, i8* %4, i32 4)
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = call i64 @pseudo(i8* %3, i8* %4, i32 4)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %0
%12 = phi i32 [ 0, %0 ], [ %10, %7 ]
ret i32 %12
}
int test_imm_56int64_highword_reg(long long val) {
  return ((val >> 32) & (0x56 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_56int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x56,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_56int64_highword_reg>:
movabs $0x5600000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_56int64_highword_reg(i64 %0) {
%2 = and i64 %0, 369367187456
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void test___atomic_or_fetch_2(int *mem) { __atomic_or_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_or_fetch_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
or     %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test___atomic_or_fetch_2+0x4b>
jmp    1122 <test___atomic_or_fetch_2+0x22>
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_or_fetch_2>:
lock orl $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_or_fetch_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw or i32* %5, i32 %6 acq_rel
%8 = or i32 %7, %6
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_or_fetch_2(i32* nocapture %0) {
%2 = atomicrmw or i32* %0, i32 1 acq_rel
ret void
}
void RTVfsFileOpen(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsFileOpen() {
ret void
}
float acircle(float r) { return (3.141592 * r * r); }


x86 assembly (clang, -O0):
<acircle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<acircle>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @acircle(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 0x400921FAFC8B007A, %4
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fmul double %5, %7
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @acircle(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x400921FAFC8B007A
%4 = fmul double %3, %2
%5 = fptrunc double %4 to float
ret float %5
}