xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void undefined() {
  fprintf(stderr, "undefined function is called\n");
  abort();
}


x86 assembly (clang, -O0):
<undefined>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<undefined>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"undefined function is called\0A\00"
define void @undefined() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"undefined function is called\0A\00"
define void @undefined() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void PRCMSRAMRetentionEnable(unsigned long ulSramColSel,
                             unsigned long ulModeFlags) {
  if (ulModeFlags & 0x00000001) {
    (*((volatile unsigned long *)(0x4402D000 + 0x00000018))) =
        (ulSramColSel & 0xF);
  }
  if (ulModeFlags & 0x00000002) {
    (*((volatile unsigned long *)(0x4402D000 + 0x0000001C))) =
        (ulSramColSel & 0xF);
  }
}


x86 assembly (clang, -O0):
<PRCMSRAMRetentionEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     112e <PRCMSRAMRetentionEnable+0x2e>
mov    -0x8(%rbp),%rcx
and    $0xf,%rcx
mov    $0x4402d018,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     1150 <PRCMSRAMRetentionEnable+0x50>
mov    -0x8(%rbp),%rcx
and    $0xf,%rcx
mov    $0x4402d01c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMSRAMRetentionEnable>:
test   $0x1,%sil
jne    110d <PRCMSRAMRetentionEnable+0xd>
test   $0x2,%sil
jne    1120 <PRCMSRAMRetentionEnable+0x20>
ret
mov    %edi,%eax
and    $0xf,%eax
mov    %rax,0x4402d018
44
test   $0x2,%sil
je     110c <PRCMSRAMRetentionEnable+0xc>
and    $0xf,%edi
mov    %rdi,0x4402d01c
44
ret

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

LLVM IR (-O2):
define void @PRCMSRAMRetentionEnable(i64 %0, i64 %1) {
%3 = and i64 %1, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = and i64 %0, 15
store volatile i64 %6, i64* inttoptr (i64 1141035032 to i64*)
br label %7
7: ; preds = %5, %2
%8 = and i64 %1, 2
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = and i64 %0, 15
store volatile i64 %11, i64* inttoptr (i64 1141035036 to i64*)
br label %12
12: ; preds = %10, %7
ret void
}
/* Variables and functions */
int function();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("result was %d\n", function());
  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   1040 <function@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"result was %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 (...) @function()
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"result was %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @function()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
char *f2(char *);
char *f1(char *v) { return f2(v); }


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

x86 assembly (clang, -O2):
<f1>:
jmp    1030 <f2@plt>

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

LLVM IR (-O2):
define i8* @f1(i8* %0) {
%2 = tail call i8* @f2(i8* %0)
ret i8* %2
}
/* Variables and functions */
size_t malloc_usable_size(void *);
int /*<<< orphan*/ memset(void *, int, size_t);
void deinit(void *ptr) {
  if (ptr) {
    size_t asz = malloc_usable_size(ptr);
    memset(ptr, 0xEE, asz);
  }
}


x86 assembly (clang, -O0):
<deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <deinit+0x36>
mov    -0x8(%rbp),%rdi
call   1040 <malloc_usable_size@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xee,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deinit>:
test   %rdi,%rdi
je     113f <deinit+0x1f>
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc_usable_size@plt>
mov    %rbx,%rdi
mov    $0xee,%esi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <memset@plt>
ret

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

LLVM IR (-O2):
define void @deinit(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @malloc_usable_size(i8* %0)
%5 = tail call i32 @memset(i8* %0, i32 238, i64 %4)
br label %6
6: ; preds = %3, %1
ret void
}
void coalesce_block() {}


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

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

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

LLVM IR (-O2):
define void @coalesce_block() {
ret void
}
/* Variables and functions */
void malloc_stats(void) {}


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

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

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

LLVM IR (-O2):
define void @malloc_stats() {
ret void
}
void I2C1_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define void @I2C1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @I2C1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char *);
scalar_t__ strcmp(char *, char *);
int parse_bool(char *s) {
  return (strcmp(s, "1") == 0) || (strcasecmp(s, "true") == 0);
}


x86 assembly (clang, -O0):
<parse_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1168 <parse_bool+0x48>
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%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):
<parse_bool>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1151 <parse_bool+0x31>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [5 x i8] c"true\00"
define i32 @parse_bool(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int owHasOverDrive(int portnum) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @owHasOverDrive(i32 %0) {
ret i32 1
}
void head_lower(char *str) {
  if (str) {
    char *head = str;
    if (*head >= 'a' && *head <= 'z') {
      *head |= 0x20;
    }
  }
}


x86 assembly (clang, -O0):
<head_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <head_lower+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1147 <head_lower+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1147 <head_lower+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
or     $0x20,%ecx
mov    %cl,(%rax)
jmp    114c <head_lower+0x4c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<head_lower>:
test   %rdi,%rdi
je     1113 <head_lower+0x13>
mov    (%rdi),%al
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1113 <head_lower+0x13>
or     $0x20,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @head_lower(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %24
6: ; preds = %1
%7 = load i8*, i8** %2
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 97
br i1 %11, label %12, label %23
12: ; preds = %6
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp sle i32 %15, 122
br i1 %16, label %17, label %23
17: ; preds = %12
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = or i32 %20, 32
%22 = trunc i32 %21 to i8
store i8 %22, i8* %18
br label %23
23: ; preds = %17, %12, %6
br label %24
24: ; preds = %23, %1
ret void
}

LLVM IR (-O2):
define void @head_lower(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = add i8 %4, -97
%6 = icmp ult i8 %5, 26
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = or i8 %4, 32
store i8 %8, i8* %0
br label %9
9: ; preds = %3, %7, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void block_sig(int sig) {
  sigset_t mask, omask;
  sigemptyset(&mask);
  sigaddset(&mask, sig);
  sigprocmask(SIG_BLOCK, &mask, &omask);
}


x86 assembly (clang, -O0):
<block_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_sig>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
mov    %r14,%rsi
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define void @block_sig(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @sigemptyset(i32* %3)
%6 = load i32, i32* %2
%7 = call i32 @sigaddset(i32* %3, i32 %6)
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define void @block_sig(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @sigemptyset(i32* %2)
%7 = call i32 @sigaddset(i32* %2, i32 %0)
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %2, i32* %3)
ret void
}
void __DELETE_java_nio_charset_Charset_1(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_nio_charset_Charset_1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_nio_charset_Charset_1(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int get_operand_right(int *program, int statement) {
  return program[statement * 4 + 3];
}


x86 assembly (clang, -O0):
<get_operand_right>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_operand_right>:
lea    0x3(,%rsi,4),%eax
cltq
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @get_operand_right(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 4
%8 = add nsw i32 %7, 3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %5, i64 %9
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_operand_right(i32* nocapture %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = or i32 %3, 3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void test_failure(char *name) { printf("failure: %s\n", name); }


x86 assembly (clang, -O0):
<test_failure>:
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):
<test_failure>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"failure: %s\0A\00"
define void @test_failure(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_semaphore_post() {
  printf("NOT IMPLEMENTED:"
         "pa_semaphore_post"
         "\n");
}


x86 assembly (clang, -O0):
<pa_semaphore_post>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_semaphore_post\0A\00"
define i32 @pa_semaphore_post() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_semaphore_post\00"
define i32 @pa_semaphore_post() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void RTTimeLocalExplode(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeLocalExplode() {
ret void
}
int floating(int a, float b, double c, long double d, int e) {
  int i;
  i = (int)((float)a / b + ((float)c / (float)d));
  return i;
}


x86 assembly (clang, -O0):
<floating>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
fstpt  -0x20(%rbp)
mov    %esi,-0x24(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
cvtsd2ss %xmm1,%xmm1
fldt   -0x20(%rbp)
fstps  -0x2c(%rbp)
movss  -0x2c(%rbp),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floating>:
cvtsi2ss %edi,%xmm2
fldt   0x8(%rsp)
cvtsd2ss %xmm1,%xmm1
unpcklps %xmm1,%xmm2
fstps  -0x4(%rsp)
movss  -0x4(%rsp),%xmm1
unpcklps %xmm1,%xmm0
divps  %xmm0,%xmm2
movaps %xmm2,%xmm0
shufps $0x55,%xmm2,%xmm0
addss  %xmm2,%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @floating(i32 %0, float %1, double %2, x86_fp80 %3, i32 %4) {
%6 = alloca i32
%7 = alloca float
%8 = alloca double
%9 = alloca x86_fp80
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store float %1, float* %7
store double %2, double* %8
store x86_fp80 %3, x86_fp80* %9
store i32 %4, i32* %10
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to float
%14 = load float, float* %7
%15 = fdiv float %13, %14
%16 = load double, double* %8
%17 = fptrunc double %16 to float
%18 = load x86_fp80, x86_fp80* %9
%19 = fptrunc x86_fp80 %18 to float
%20 = fdiv float %17, %19
%21 = fadd float %15, %20
%22 = fptosi float %21 to i32
store i32 %22, i32* %11
%23 = load i32, i32* %11
ret i32 %23
}

LLVM IR (-O2):
define i32 @floating(i32 %0, float %1, double %2, x86_fp80 %3, i32 %4) {
%6 = sitofp i32 %0 to float
%7 = fptrunc double %2 to float
%8 = fptrunc x86_fp80 %3 to float
%9 = insertelement <2 x float> poison, float %6, i64 0
%10 = insertelement <2 x float> %9, float %7, i64 1
%11 = insertelement <2 x float> poison, float %1, i64 0
%12 = insertelement <2 x float> %11, float %8, i64 1
%13 = fdiv <2 x float> %10, %12
%14 = shufflevector <2 x float> %13, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%15 = fadd <2 x float> %13, %14
%16 = extractelement <2 x float> %15, i64 0
%17 = fptosi float %16 to i32
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free_mem();
void error_out(void) {
  free_mem();
  exit(1);
}


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

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

LLVM IR (-O0):
define void @error_out() {
%1 = call i32 (...) @free_mem()
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error_out() {
%1 = tail call i32 (...) @free_mem()
%2 = tail call i32 @exit(i32 1)
unreachable
}
mytempo(tempo) long tempo;
{
  prtime();
  printf("Tempo %ld\n", tempo);
}


x86 assembly (clang, -O0):
<mytempo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mytempo>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <prtime@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Tempo %ld\0A\00"
define i32 @mytempo(i64 %0) {
%2 = tail call i32 (...) @prtime()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 undef
}
const char *socket_vendor(void) { return "william@25thandClement.com"; }


x86 assembly (clang, -O0):
<socket_vendor>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_vendor>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"william@25thandClement.com\00"
define i8* @socket_vendor() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [27 x i8] c"william@25thandClement.com\00"
define i8* @socket_vendor() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ getch();
double hypot(double, double);
int /*<<< orphan*/ printf(char *, double);
main() {
  double x, y, result;
  x = 3.0;
  y = 4.0;
  result = hypot(x, y);
  printf("\n The hypotenuse is:%lf", result);
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <hypot@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
movsd  0xec7(%rip),%xmm1
call   1040 <hypot@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0A The hypotenuse is:%lf\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store double 3.000000e+00, double* %1
store double 4.000000e+00, double* %2
%4 = load double, double* %1
%5 = load double, double* %2
%6 = call double @hypot(double %4, double %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %7)
%9 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0A The hypotenuse is:%lf\00"
define i32 @main() {
%1 = tail call double @hypot(double 3.000000e+00, double 4.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call i32 (...) @getch()
ret i32 0
}
/* Variables and functions */
int dopprompt(char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int promptlen(const char *cp) { return (dopprompt(cp, 0, 0)); }


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

x86 assembly (clang, -O2):
<promptlen>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <dopprompt@plt>

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

LLVM IR (-O2):
define i32 @promptlen(i8* %0) {
%2 = tail call i32 @dopprompt(i8* %0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ my_system(char *);
void print_process_name_proc(void) { my_system("cat /proc/self/comm"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"cat /proc/self/comm\00"
define void @print_process_name_proc() {
%1 = call i32 @my_system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"cat /proc/self/comm\00"
define void @print_process_name_proc() {
%1 = tail call i32 @my_system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
void RTSemRWReleaseRead(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemRWReleaseRead() {
ret void
}
void fd31(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  p01A:
    goto p01A;
    goto a;
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
a:;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd31>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd31+0x7>

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

LLVM IR (-O0):
define void @fd31(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; preds = %8
br label %8
9: ; No predecessors!
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
br label %12
12: ; preds = %12, %9
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
br label %17
17: ; preds = %17, %14
br label %17
18: ; preds = %18
br label %18
19: ; No predecessors!
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
br label %22
22: ; preds = %22, %19
br label %22
23: ; preds = %23
br label %23
24: ; No predecessors!
%25 = load i32, i32* %2
%26 = zext i32 %25 to i64
br label %27
27: ; preds = %27, %24
br label %27
28: ; No predecessors!
%29 = load i32, i32* %2
%30 = zext i32 %29 to i64
br label %31
31: ; preds = %31, %28
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; preds = %37
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd31(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int test_foobar(int foobar) { return foobar; }


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

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

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

LLVM IR (-O2):
define i32 @test_foobar(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("[BEGIN] unix-conformance.dtest\n");
  printf("[PASS] unix-conformance.dtest\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xeee(%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
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"[BEGIN] unix-conformance.dtest\0A\00"
@.str.1 = [31 x i8] c"[PASS] unix-conformance.dtest\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"[BEGIN] unix-conformance.dtest\00"
@str.2 = [30 x i8] c"[PASS] unix-conformance.dtest\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long GetPosY70();
long getposy() { return GetPosY70(); }


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

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

LLVM IR (-O0):
define i64 @getposy() {
%1 = call i64 (...) @GetPosY70()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getposy() {
%1 = tail call i64 (...) @GetPosY70()
ret i64 %1
}
int (*f1(int i))(int i, int k) {}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i32 (i32, i32)* @f1(i32 %0) {
ret i32 (i32, i32)* undef
}
/* Type definitions */
struct iwreq {
  char *ifr_name;
};

/* Variables and functions */
int ioctl(int, int, struct iwreq *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int iw_get_ext(int skfd, char *ifname, int request, struct iwreq *pwrq) {
  strncpy(pwrq->ifr_name, ifname, 16);
  pwrq->ifr_name[16] = '\0';
  return (ioctl(skfd, request, pwrq));
}


x86 assembly (clang, -O0):
<iw_get_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movb   $0x0,0x10(%rax)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_get_ext>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %edi,%ebp
mov    (%rcx),%rdi
mov    $0x10,%edx
call   1030 <strncpy@plt>
mov    (%rbx),%rax
movb   $0x0,0x10(%rax)
mov    %ebp,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
%struct.iwreq = type { i8* }
define i32 @iw_get_ext(i32 %0, i8* %1, i32 %2, %struct.iwreq* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.iwreq*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.iwreq* %3, %struct.iwreq** %8
%9 = load %struct.iwreq*, %struct.iwreq** %8
%10 = getelementptr inbounds %struct.iwreq, %struct.iwreq* %9, i32 0, i32 0
%11 = load i8*, i8** %10
%12 = load i8*, i8** %6
%13 = call i32 @strncpy(i8* %11, i8* %12, i32 16)
%14 = load %struct.iwreq*, %struct.iwreq** %8
%15 = getelementptr inbounds %struct.iwreq, %struct.iwreq* %14, i32 0, i32 0
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i64 16
store i8 0, i8* %17
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = load %struct.iwreq*, %struct.iwreq** %8
%21 = call i32 @ioctl(i32 %18, i32 %19, %struct.iwreq* %20)
ret i32 %21
}

LLVM IR (-O2):
%struct.iwreq = type { i8* }
define i32 @iw_get_ext(i32 %0, i8* %1, i32 %2, %struct.iwreq* %3) {
%5 = getelementptr inbounds %struct.iwreq, %struct.iwreq* %3, i64 0, i32 0
%6 = load i8*, i8** %5
%7 = tail call i32 @strncpy(i8* %6, i8* %1, i32 16)
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 16
store i8 0, i8* %9
%10 = tail call i32 @ioctl(i32 %0, i32 %2, %struct.iwreq* %3)
ret i32 %10
}
void pinmux_free_setting(const struct pinctrl_setting *setting) {}


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

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

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

LLVM IR (-O2):
%struct.pinctrl_setting = type opaque
define void @pinmux_free_setting(%struct.pinctrl_setting* nocapture %0) {
ret void
}
int double_eq(double a, double b) {
  return ((a <= b && a + 0.0001 > b) || (a >= b && a - 0.0001 < b));
}


x86 assembly (clang, -O0):
<double_eq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     113f <double_eq+0x3f>
movsd  0xed6(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x11(%rbp)
ja     117a <double_eq+0x7a>
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x12(%rbp)
jb     1174 <double_eq+0x74>
movsd  -0x8(%rbp),%xmm1
movsd  0xe9f(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_eq>:
ucomisd %xmm0,%xmm1
jb     111e <double_eq+0x1e>
movsd  0xef2(%rip),%xmm2
addsd  %xmm0,%xmm2
mov    $0x1,%eax
ucomisd %xmm1,%xmm2
jbe    111e <double_eq+0x1e>
ret
ucomisd %xmm1,%xmm0
setae  %al
addsd  0xedb(%rip),%xmm0
ucomisd %xmm0,%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @double_eq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ole double %5, %6
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load double, double* %3
%10 = fadd double %9, 1.000000e-04
%11 = load double, double* %4
%12 = fcmp ogt double %10, %11
br i1 %12, label %24, label %13
13: ; preds = %8, %2
%14 = load double, double* %3
%15 = load double, double* %4
%16 = fcmp oge double %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load double, double* %3
%19 = fsub double %18, 1.000000e-04
%20 = load double, double* %4
%21 = fcmp olt double %19, %20
br label %22
22: ; preds = %17, %13
%23 = phi i1 [ false, %13 ], [ %21, %17 ]
br label %24
24: ; preds = %22, %8
%25 = phi i1 [ true, %8 ], [ %23, %22 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @double_eq(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = fadd double %0, 1.000000e-04
%5 = fcmp ogt double %4, %1
%6 = and i1 %3, %5
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = fcmp oge double %0, %1
%9 = fadd double %0, -1.000000e-04
%10 = fcmp olt double %9, %1
%11 = and i1 %8, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %2, %7
%14 = phi i32 [ %12, %7 ], [ 1, %2 ]
ret i32 %14
}
int num_primo(int n) {
  int x;
  for (x = n - 1; n % x != 0; x--)
    ;
  if (x <= 1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<num_primo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1133 <num_primo+0x33>
jmp    1125 <num_primo+0x25>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1110 <num_primo+0x10>
cmpl   $0x1,-0xc(%rbp)
jg     1149 <num_primo+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <num_primo+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_primo>:
lea    0x1(%rdi),%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x2(%rcx),%esi
mov    %edi,%eax
cltd
idiv   %esi
add    $0xffffffff,%ecx
test   %edx,%edx
jne    1110 <num_primo+0x10>
xor    %eax,%eax
cmp    $0x3,%ecx
setl   %al
ret

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

LLVM IR (-O2):
define i32 @num_primo(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %4, %2 ]
%4 = add nsw i32 %3, -1
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = icmp slt i32 %3, 3
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ c;

/* Variables and functions */
char *allocate(int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *copystr(const char *s) {
  char *c = allocate(0, (strlen(s) + 1) * sizeof(c[0]));
  strcpy(c, s);
  return c;
}


x86 assembly (clang, -O0):
<copystr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%esi
xor    %edi,%edi
call   1050 <allocate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copystr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%esi
xor    %edi,%edi
call   1050 <allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copystr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i8* @allocate(i32 0, i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @copystr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @allocate(i32 0, i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int,
                          unsigned int);
void structSample1() {
  struct T_FOO {
    char c1;
    short s;
    char c2;
    int i;
  } a;
  printf("c1 -> %d, s -> %d, c2 -> %d, i -> %d\n",
         (unsigned int)(void *)&a.c1 - (unsigned int)(void *)&a,
         (unsigned int)(void *)&a.s - (unsigned int)(void *)&a,
         (unsigned int)(void *)&a.c2 - (unsigned int)(void *)&a,
         (unsigned int)(void *)&a.i - (unsigned int)(void *)&a);
}


x86 assembly (clang, -O0):
<structSample1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rax
mov    %eax,%esi
lea    -0x10(%rbp),%rax
sub    %eax,%esi
lea    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %eax,%edx
lea    -0x10(%rbp),%rax
sub    %eax,%edx
lea    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %eax,%ecx
lea    -0x10(%rbp),%rax
sub    %eax,%ecx
lea    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %eax,%r8d
lea    -0x10(%rbp),%rax
sub    %eax,%r8d
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<structSample1>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
mov    $0x8,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.T_FOO = type { i8, i16, i8, i32 }
@.str = [38 x i8] c"c1 -> %d, s -> %d, c2 -> %d, i -> %d\0A\00"
define void @structSample1() {
%1 = alloca %struct.T_FOO
%2 = getelementptr inbounds %struct.T_FOO, %struct.T_FOO* %1, i32 0, i32 0
%3 = ptrtoint i8* %2 to i32
%4 = bitcast %struct.T_FOO* %1 to i8*
%5 = ptrtoint i8* %4 to i32
%6 = sub i32 %3, %5
%7 = getelementptr inbounds %struct.T_FOO, %struct.T_FOO* %1, i32 0, i32 1
%8 = bitcast i16* %7 to i8*
%9 = ptrtoint i8* %8 to i32
%10 = bitcast %struct.T_FOO* %1 to i8*
%11 = ptrtoint i8* %10 to i32
%12 = sub i32 %9, %11
%13 = getelementptr inbounds %struct.T_FOO, %struct.T_FOO* %1, i32 0, i32 2
%14 = ptrtoint i8* %13 to i32
%15 = bitcast %struct.T_FOO* %1 to i8*
%16 = ptrtoint i8* %15 to i32
%17 = sub i32 %14, %16
%18 = getelementptr inbounds %struct.T_FOO, %struct.T_FOO* %1, i32 0, i32 3
%19 = bitcast i32* %18 to i8*
%20 = ptrtoint i8* %19 to i32
%21 = bitcast %struct.T_FOO* %1 to i8*
%22 = ptrtoint i8* %21 to i32
%23 = sub i32 %20, %22
%24 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %12, i32 %17, i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"c1 -> %d, s -> %d, c2 -> %d, i -> %d\0A\00"
define void @structSample1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 0, i32 2, i32 4, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch(0, 2))) void hp1(void) { printf("hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void SobelToPlaneRow_C() {}


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

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

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

LLVM IR (-O2):
define void @SobelToPlaneRow_C() {
ret void
}
void RTStrmPutCh(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrmPutCh() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checkSeed();
int random();
int coinflip(void) {
  checkSeed();
  return (random() % 2);
}


x86 assembly (clang, -O0):
<coinflip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <checkSeed@plt>
mov    $0x0,%al
call   1030 <random@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<coinflip>:
push   %rax
xor    %eax,%eax
call   1040 <checkSeed@plt>
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @coinflip() {
%1 = call i32 (...) @checkSeed()
%2 = call i32 (...) @random()
%3 = srem i32 %2, 2
ret i32 %3
}

LLVM IR (-O2):
define i32 @coinflip() {
%1 = tail call i32 (...) @checkSeed()
%2 = tail call i32 (...) @random()
%3 = srem i32 %2, 2
ret i32 %3
}
void __attribute__((visibility("hidden"))) lib2_hidden(void) {}


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

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

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

LLVM IR (-O2):
define hidden void @lib2_hidden() {
ret void
}
/* Variables and functions */
float roundf(float);
void vec2_round(float *dst) {
  dst[0] = roundf(dst[0]);
  dst[1] = roundf(dst[1]);
}


x86 assembly (clang, -O0):
<vec2_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <roundf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1030 <roundf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_round>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  %xmm1,0xc(%rsp)
call   1030 <roundf@plt>
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <roundf@plt>
movss  %xmm0,0x4(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @vec2_round(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = call float @llvm.round.f32(float %5)
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = call float @llvm.round.f32(float %11)
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
ret void
}

LLVM IR (-O2):
define void @vec2_round(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @llvm.round.f32(float %2)
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = tail call float @llvm.round.f32(float %5)
store float %6, float* %4
ret void
}