xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int _UARTBaseValid(int);
void UARTFlowControlSet(uint32_t ui32Base, uint32_t ui32Mode) {
  ASSERT(_UARTBaseValid(ui32Base));
  ASSERT((ui32Mode & ~(0x00008000 | 0x00004000)) == 0);
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) =
      (((*((volatile uint32_t *)(ui32Base + 0x00000030))) &
        ~(0x00008000 | 0x00004000)) |
       ui32Mode);
}


x86 assembly (clang, -O0):
<UARTFlowControlSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%eax
and    $0xffff3fff,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%ecx
and    $0xffff3fff,%ecx
or     -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFlowControlSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
xor    %edi,%edi
test   $0xffff3fff,%ebx
sete   %dil
call   1040 <ASSERT@plt>
movslq %ebp,%rax
mov    $0xffff3fff,%ecx
and    0x30(%rax),%ecx
or     %ebx,%ecx
mov    %ecx,0x30(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @UARTFlowControlSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @_UARTBaseValid(i32 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, -49153
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 48
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = and i32 %17, -49153
%19 = load i32, i32* %4
%20 = or i32 %18, %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 48
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
store volatile i32 %20, i32* %24
ret void
}

LLVM IR (-O2):
define void @UARTFlowControlSet(i32 %0, i32 %1) {
%3 = tail call i32 @_UARTBaseValid(i32 %0)
%4 = tail call i32 @ASSERT(i32 %3)
%5 = and i32 %1, -49153
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = add nsw i32 %0, 48
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = and i32 %12, -49153
%14 = or i32 %13, %1
store volatile i32 %14, i32* %11
ret void
}
/* Type definitions */
typedef char int8_t;

/* Variables and functions */
size_t int8PackSize(char *);
size_t int8Unpack(const char *buffer, size_t size, int8_t *data) {
  size_t req = int8PackSize(data);
  if (size >= req) {
    *data = buffer[0];
  }
  return req;
}


x86 assembly (clang, -O0):
<int8Unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <int8PackSize@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     114b <int8Unpack+0x3b>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int8Unpack>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rdx,%rdi
call   1030 <int8PackSize@plt>
cmp    %r15,%rax
ja     1130 <int8Unpack+0x20>
mov    (%r14),%cl
mov    %cl,(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @int8Unpack(i8* nocapture %0, i64 %1, i8* %2) {
%4 = tail call i64 @int8PackSize(i8* %2)
%5 = icmp ugt i64 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = load i8, i8* %0
store i8 %7, i8* %2
br label %8
8: ; preds = %6, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf_skip(char *, char const *);
int /*<<< orphan*/ stress_check_capability(int);
int stress_physpage_supported(const char *name) {
  if (!stress_check_capability((-1))) {
    pr_inf_skip("%s stressor will be skipped, "
                "need to be running with CAP_SYS_ADMIN "
                "rights for this stressor\n",
                name);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<stress_physpage_supported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <stress_check_capability@plt>
cmp    $0x0,%eax
jne    115b <stress_physpage_supported+0x3b>
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <pr_inf_skip@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <stress_physpage_supported+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_physpage_supported>:
push   %rbx
mov    %rdi,%rbx
mov    $0xffffffff,%edi
call   1030 <stress_check_capability@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1138 <stress_physpage_supported+0x18>
pop    %rbx
ret
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <pr_inf_skip@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [93 x i8] c"%s stressor will be skipped, need to be running with CAP_SYS_ADMIN rights for this stressor\0A\00"
define i32 @stress_physpage_supported(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @stress_check_capability(i32 -1)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @pr_inf_skip(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [93 x i8] c"%s stressor will be skipped, need to be running with CAP_SYS_ADMIN rights for this stressor\0A\00"
define i32 @stress_physpage_supported(i8* %0) {
%2 = tail call i32 @stress_check_capability(i32 -1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pr_inf_skip(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int WTERMSIG(int);
int octave_wtermsig_wrapper(int status) { return WTERMSIG(status); }


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

x86 assembly (clang, -O2):
<octave_wtermsig_wrapper>:
jmp    1030 <WTERMSIG@plt>

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

LLVM IR (-O2):
define i32 @octave_wtermsig_wrapper(i32 %0) {
%2 = tail call i32 @WTERMSIG(i32 %0)
ret i32 %2
}
/* Variables and functions */
int hidden_function();
__attribute__((visibility("default"))) int not_hidden(void) {
  return hidden_function();
}


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

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

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

LLVM IR (-O2):
define i32 @not_hidden() {
%1 = tail call i32 (...) @hidden_function()
ret i32 %1
}
void Sigint(sig) int sig;
{
  Reset_Term();
  exit(1);
}


x86 assembly (clang, -O0):
<Sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Reset_Term@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Sigint>:
push   %rax
xor    %eax,%eax
call   1030 <Reset_Term@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Reset_Term()
unreachable
}

LLVM IR (-O2):
define void @Sigint(i32 %0) {
%2 = tail call i32 (...) @Reset_Term()
tail call void @exit(i32 1)
unreachable
}
int num_cifras(int n) {
  int cont = 1;
  while (n / 10 != 0) {
    cont++;
    n = n / 10;
  }
  return cont;
}


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

x86 assembly (clang, -O2):
<num_cifras>:
lea    0x9(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x13,%ecx
jb     1145 <num_cifras+0x45>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    $0x1,%eax
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1120 <num_cifras+0x20>
ret

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

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


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

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

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

LLVM IR (-O2):
define void @g_trash_stack_peek() {
ret void
}
int test_imm_E0int32_reg(int val) { return ((val) & (0xE0 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_E0int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xe0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E0int32_reg>:
test   $0xe0,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E0int32_reg(i32 %0) {
%2 = and i32 %0, 224
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void X509_NAME_get_text_by_NID(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_get_text_by_NID() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash(char lastname[]) {
  uint32_t hashVal = 5381;
  int c;
  do {
    c = *lastname++;
    hashVal = ((hashVal << 5) + hashVal) + c;
  } while (*lastname != '\0');
  return hashVal % 42737;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0xa6f1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
add    $0x1,%rdi
mov    $0x1505,%eax
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
cltq
imul   $0x31123439,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2d,%rcx
add    %edx,%ecx
imul   $0xa6f1,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
br label %3
3: ; preds = %3, %1
%4 = phi i8 [ %2, %1 ], [ %11, %3 ]
%5 = phi i32 [ 5381, %1 ], [ %10, %3 ]
%6 = phi i8* [ %0, %1 ], [ %7, %3 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %4 to i32
%9 = mul i32 %5, 33
%10 = add nsw i32 %9, %8
%11 = load i8, i8* %7
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %3
13: ; preds = %3
%14 = srem i32 %10, 42737
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *get_date(char *buf, int len) {
  struct tm *p_tm_time;
  time_t ptime;
  ptime = time(NULL);
  p_tm_time = localtime(&ptime);
  strftime(buf, len, "%F %T", p_tm_time);
  return buf;
}


x86 assembly (clang, -O0):
<get_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
lea    0xe96(%rip),%rdx
call   1050 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_date>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [6 x i8] c"%F %T\00"
define i8* @get_date(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.tm*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %6
%8 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %8, %struct.tm** %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = load %struct.tm*, %struct.tm** %5
%12 = call i32 @strftime(i8* %9, i32 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %struct.tm* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [6 x i8] c"%F %T\00"
define i8* @get_date(i8* returned %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret i8* %0
}
/* Variables and functions */
void *mpgdecoder_new(void *, int, int, int, int);
void *default_mpgdecoder_new(void *ctx, int sample_rate, int stereo, int rvol,
                             int lvol) {
  return mpgdecoder_new(ctx, sample_rate, stereo, rvol, lvol);
}


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

x86 assembly (clang, -O2):
<default_mpgdecoder_new>:
jmp    1030 <mpgdecoder_new@plt>

LLVM IR (-O0):
define i8* @default_mpgdecoder_new(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i8* @mpgdecoder_new(i8* %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @default_mpgdecoder_new(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i8* @mpgdecoder_new(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ bzero_test_2(int);
int /*<<< orphan*/ memcpy_test_2(int);
int /*<<< orphan*/ mempcpy_test_2(int);
int /*<<< orphan*/ memset_test_2(int);
void test_stringops_2(int len) {
  bzero_test_2(len);
  memcpy_test_2(len);
  mempcpy_test_2(len);
  memset_test_2(len);
}


x86 assembly (clang, -O0):
<test_stringops_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bzero_test_2@plt>
mov    -0x4(%rbp),%edi
call   1050 <memcpy_test_2@plt>
mov    -0x4(%rbp),%edi
call   1060 <mempcpy_test_2@plt>
mov    -0x4(%rbp),%edi
call   1030 <memset_test_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_stringops_2>:
push   %rbx
mov    %edi,%ebx
call   1040 <bzero_test_2@plt>
mov    %ebx,%edi
call   1050 <memcpy_test_2@plt>
mov    %ebx,%edi
call   1060 <mempcpy_test_2@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <memset_test_2@plt>

LLVM IR (-O0):
define void @test_stringops_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bzero_test_2(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @memcpy_test_2(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @mempcpy_test_2(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @memset_test_2(i32 %9)
ret void
}

LLVM IR (-O2):
define void @test_stringops_2(i32 %0) {
%2 = tail call i32 @bzero_test_2(i32 %0)
%3 = tail call i32 @memcpy_test_2(i32 %0)
%4 = tail call i32 @mempcpy_test_2(i32 %0)
%5 = tail call i32 @memset_test_2(i32 %0)
ret void
}
/* Type definitions */
struct sock {
  int dummy;
};
struct sk_buff {
  int dummy;
};

/* Variables and functions */
struct sk_buff *tcp_alloc_pskb(struct sock *, int, int /*<<< orphan*/, int);
struct sk_buff *tcp_alloc_skb(struct sock *sk, int size, int gfp) {
  return tcp_alloc_pskb(sk, size, 0, gfp);
}


x86 assembly (clang, -O0):
<tcp_alloc_skb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
xor    %edx,%edx
call   1030 <tcp_alloc_pskb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_alloc_skb>:
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <tcp_alloc_pskb@plt>

LLVM IR (-O0):
%struct.sk_buff = type { i32 }
%struct.sock = type { i32 }
define %struct.sk_buff* @tcp_alloc_skb(%struct.sock* %0, i32 %1, i32 %2) {
%4 = alloca %struct.sock*
%5 = alloca i32
%6 = alloca i32
store %struct.sock* %0, %struct.sock** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.sock*, %struct.sock** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call %struct.sk_buff* @tcp_alloc_pskb(%struct.sock* %7, i32 %8, i32 0, i32 %9)
ret %struct.sk_buff* %10
}

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
%struct.sock = type { i32 }
define %struct.sk_buff* @tcp_alloc_skb(%struct.sock* %0, i32 %1, i32 %2) {
%4 = tail call %struct.sk_buff* @tcp_alloc_pskb(%struct.sock* %0, i32 %1, i32 0, i32 %2)
ret %struct.sk_buff* %4
}
int main() {
  int a = 1;
  int b = a++;
  int c = --b;
  ++a;
  --a;
  return a-- + b-- - ++c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0xffffffff,%edx
mov    %edx,-0xc(%rbp)
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
sub    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
double min3(double a, double b, double c) {
  double min;
  min = a;
  if (b < min)
    min = b;
  if (c < min)
    min = c;
  return min;
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <min3+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1159 <min3+0x59>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @min3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
store double %8, double* %7
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fcmp olt double %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load double, double* %5
store double %13, double* %7
br label %14
14: ; preds = %12, %3
%15 = load double, double* %6
%16 = load double, double* %7
%17 = fcmp olt double %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load double, double* %6
store double %19, double* %7
br label %20
20: ; preds = %18, %14
%21 = load double, double* %7
ret double %21
}

LLVM IR (-O2):
define double @min3(double %0, double %1, double %2) {
%4 = fcmp olt double %1, %0
%5 = select i1 %4, double %1, double %0
%6 = fcmp ogt double %5, %2
%7 = select i1 %6, double %2, double %5
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void afficherReponsePendu(int vie, char motMystere[]) {
  if (vie == 0)
    printf("\nDommage vous avez perdu, le mot etait : %s\n", motMystere);
  else
    printf("\nBravo vous avez trouve le mot mystere ! Le mot etait bien : %s\n",
           motMystere);
}


x86 assembly (clang, -O0):
<afficherReponsePendu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113e <afficherReponsePendu+0x2e>
mov    -0x10(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <afficherReponsePendu+0x3e>
mov    -0x10(%rbp),%rsi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficherReponsePendu>:
test   %edi,%edi
lea    0xee7(%rip),%rax
lea    0xf0d(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"\0ADommage vous avez perdu, le mot etait : %s\0A\00"
@.str.1 = [65 x i8] c"\0ABravo vous avez trouve le mot mystere ! Le mot etait bien : %s\0A\00"
define void @afficherReponsePendu(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %13
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"\0ADommage vous avez perdu, le mot etait : %s\0A\00"
@.str.1 = [65 x i8] c"\0ABravo vous avez trouve le mot mystere ! Le mot etait bien : %s\0A\00"
define void @afficherReponsePendu(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i8* %1)
ret void
}
void os_prepare_sample(int a) {}


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

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

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

LLVM IR (-O2):
define void @os_prepare_sample(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void show_help(const char *program) {
  fprintf(stdout, "Usage: %s [ arguments ] -- [ command ]\n", program);
  fprintf(stdout, "Arguments:\n");
  fprintf(stdout, "  -h, --help: show help message\n");
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef0(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [40 x i8] c"Usage: %s [ arguments ] -- [ command ]\0A\00"
@.str.1 = [12 x i8] c"Arguments:\0A\00"
@.str.2 = [33 x i8] c" -h, --help: show help message\0A\00"
define void @show_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [40 x i8] c"Usage: %s [ arguments ] -- [ command ]\0A\00"
@.str.1 = [12 x i8] c"Arguments:\0A\00"
@.str.2 = [33 x i8] c" -h, --help: show help message\0A\00"
define void @show_help(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ __util_oom(char const *, char const *, int,
                              int /*<<< orphan*/);
int vasprintf(char **, char const *, int /*<<< orphan*/);
int __util_vasprintf(const char *func, const char *file, int line, char **strp,
                     const char *fmt, va_list ap) {
  int rc;
  rc = vasprintf(strp, fmt, ap);
  if (rc == -1)
    __util_oom(func, file, line, 0);
  return rc;
}


x86 assembly (clang, -O0):
<__util_vasprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1030 <vasprintf@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0xffffffff,-0x30(%rbp)
jne    116e <__util_vasprintf+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1040 <__util_oom@plt>
mov    -0x30(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__util_vasprintf>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rcx,%rdi
mov    %r8,%rsi
mov    %r9d,%edx
call   1030 <vasprintf@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1155 <__util_vasprintf+0x35>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
xor    %ecx,%ecx
call   1040 <__util_oom@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @__util_vasprintf(i8* %0, i8* %1, i32 %2, i8** %3, i8* %4, i32 %5) {
%7 = tail call i32 @vasprintf(i8** %3, i8* %4, i32 %5)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @__util_oom(i8* %0, i8* %1, i32 %2, i32 0)
br label %11
11: ; preds = %9, %6
ret i32 %7
}
void func2(void) {
  ({
    __label__ l1;
  l1:
    goto l1;
  });
  ({
    __label__ l1;
  l1:
    goto l1;
  });
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <func2+0x9>
jmp    1109 <func2+0x9>

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

LLVM IR (-O0):
define void @func2() {
br label %1
1: ; preds = %1, %0
br label %1
2: ; No predecessors!
br label %3
3: ; preds = %3, %2
br label %3
}

LLVM IR (-O2):
define void @func2() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
double RAND_MAX;
double rand();
double Alea() {
  double ret = rand();
  ret /= RAND_MAX;
  return ret;
}


x86 assembly (clang, -O0):
<Alea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
movsd  (%rax),%xmm1
movsd  -0x8(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @Alea() {
%1 = alloca double
%2 = call double (...) @rand()
store double %2, double* %1
%3 = load double, double* @RAND_MAX
%4 = load double, double* %1
%5 = fdiv double %4, %3
store double %5, double* %1
%6 = load double, double* %1
ret double %6
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @Alea() {
%1 = tail call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fdiv double %1, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void doxextrfree(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define void @doxextrfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void Moe_Msg_Init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @Moe_Msg_Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntMasterIRQEnable();
void IntEnable(unsigned char status) {
  if ((status & 0x80) == 0) {
    IntMasterIRQEnable();
  }
}


x86 assembly (clang, -O0):
<IntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1137 <IntEnable+0x27>
mov    $0x0,%al
call   1030 <IntMasterIRQEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntEnable>:
test   %dil,%dil
js     111c <IntEnable+0xc>
xor    %eax,%eax
jmp    1030 <IntMasterIRQEnable@plt>
ret

LLVM IR (-O0):
define void @IntEnable(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 128
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @IntMasterIRQEnable()
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @IntEnable(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @IntMasterIRQEnable()
br label %5
5: ; preds = %3, %1
ret void
}
float max_float(float x, float y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<max_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <max_float+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <max_float+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_float>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @max_float(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
int test_foobarbaz(int foobarbaz) { return foobarbaz; }


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

x86 assembly (clang, -O2):
<test_foobarbaz>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_foobarbaz(i32 returned %0) {
ret i32 %0
}
int symphonia_uninit() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @symphonia_uninit() {
ret i32 0
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("current pid is %d\n", getpid());
  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 <getpid@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"current pid is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void pps2() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct gendisk *);
void del_gendisk(struct gendisk *gp) {
  free(gp);
  return;
}


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

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

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

LLVM IR (-O2):
%struct.gendisk = type { i32 }
define void @del_gendisk(%struct.gendisk* nocapture %0) {
%2 = tail call i32 @free(%struct.gendisk* %0)
ret void
}
void module_imv_update(void) {}


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

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

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

LLVM IR (-O2):
define void @module_imv_update() {
ret void
}
unsigned int randInt(void) {
  static unsigned int x = 0x333a13cd;
  static unsigned int y = 0xecb2adea;
  x = (x >> 1) ^ ((1 + ~(x & 1)) & 0xd0000001);
  y = y * 1103515245 + 12345;
  return x ^ y;
}


x86 assembly (clang, -O0):
<randInt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
shr    $0x1,%eax
mov    0x2f0d(%rip),%ecx
and    $0x1,%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
and    $0xd0000001,%ecx
xor    %ecx,%eax
mov    %eax,0x2ef6(%rip)
imul   $0x41c64e6d,0x2ef0(%rip),%eax
4e c6 41
add    $0x3039,%eax
mov    %eax,0x2ee5(%rip)
mov    0x2edb(%rip),%eax
xor    0x2ed9(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<randInt>:
mov    0x2f1a(%rip),%ecx
mov    %ecx,%eax
shr    %eax
and    $0x1,%ecx
neg    %ecx
and    $0xd0000001,%ecx
xor    %eax,%ecx
imul   $0x41c64e6d,0x2f03(%rip),%eax
4e c6 41
mov    %ecx,0x2ef9(%rip)
add    $0x3039,%eax
mov    %eax,0x2ef2(%rip)
xor    %ecx,%eax
ret

LLVM IR (-O0):
@randInt.x = internal global i32 859444173
@randInt.y = internal global i32 -323834390
define i32 @randInt() {
%1 = load i32, i32* @randInt.x
%2 = lshr i32 %1, 1
%3 = load i32, i32* @randInt.x
%4 = and i32 %3, 1
%5 = xor i32 %4, -1
%6 = add i32 1, %5
%7 = and i32 %6, -805306367
%8 = xor i32 %2, %7
store i32 %8, i32* @randInt.x
%9 = load i32, i32* @randInt.y
%10 = mul i32 %9, 1103515245
%11 = add i32 %10, 12345
store i32 %11, i32* @randInt.y
%12 = load i32, i32* @randInt.x
%13 = load i32, i32* @randInt.y
%14 = xor i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
@randInt.x = internal unnamed_addr global i32 859444173
@randInt.y = internal unnamed_addr global i32 -323834390
define i32 @randInt() {
%1 = load i32, i32* @randInt.x
%2 = lshr i32 %1, 1
%3 = and i32 %1, 1
%4 = sub nsw i32 0, %3
%5 = and i32 %4, -805306367
%6 = xor i32 %5, %2
store i32 %6, i32* @randInt.x
%7 = load i32, i32* @randInt.y
%8 = mul i32 %7, 1103515245
%9 = add i32 %8, 12345
store i32 %9, i32* @randInt.y
%10 = xor i32 %9, %6
ret i32 %10
}
int sort_utils_int_icmp(const void *const a, const void *const b) {
  const int *const x = (const int *const)a;
  const int *const y = (const int *const)b;
  return (*x < *y) - (*x > *y);
}


x86 assembly (clang, -O0):
<sort_utils_int_icmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x20(%rbp),%rdx
cmp    (%rdx),%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_utils_int_icmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%ecx
setl   %al
setg   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @sort_utils_int_icmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp slt i32 %12, %14
%16 = zext i1 %15 to i32
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = icmp sgt i32 %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @sort_utils_int_icmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i32 %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int distance = 100;
  printf("You live %d miles away.\n", distance);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"You live %d miles away.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
int test_imm_F5int32_reg(int val) { return ((val) & (0xF5 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_F5int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xf5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F5int32_reg>:
test   $0xf5,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F5int32_reg(i32 %0) {
%2 = and i32 %0, 245
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo748(int p) {}


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

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

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

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