xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_message(char *mess[]) {
  int i = 0;
  while (*mess[i++])
    fprintf(stderr, "\n%s", mess[i]);
  return;
}


x86 assembly (clang, -O0):
<print_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
cmpb   $0x0,(%rax)
je     1168 <print_message+0x58>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1123 <print_message+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_message>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%rax
cmpb   $0x0,(%rax)
je     115a <print_message+0x4a>
mov    %rdi,%rbx
add    $0x8,%rbx
mov    0x2eb5(%rip),%r15
lea    0xece(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15),%edi
mov    (%rbx),%rdx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%rax
add    $0x8,%rbx
cmpb   $0x0,(%rax)
jne    1140 <print_message+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"\0A%s\00"
define void @print_message(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i8**, i8*** %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8*, i8** %5, i64 %8
%10 = load i8*, i8** %9
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %4
%14 = load i32, i32* @stderr
%15 = load i8**, i8*** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %19)
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"\0A%s\00"
define void @print_message(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %11, %5 ], [ 1, %1 ]
%7 = load i32, i32* @stderr
%8 = getelementptr inbounds i8*, i8** %0, i64 %6
%9 = load i8*, i8** %8
%10 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw i64 %6, 1
%12 = load i8*, i8** %8
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
int rand();
int /*<<< orphan*/ sleep(int);
int my_rand() {
  printf("[%lu] go into my_rand\n", pthread_self());
  sleep(1);
  return rand() % 30;
}


x86 assembly (clang, -O0):
<my_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff88888889,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0x4,%edx
add    %eax,%edx
mov    %edx,%esi
shl    $0x5,%esi
mov    %edx,%eax
sub    %esi,%eax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"[%lu] go into my_rand\0A\00"
define i32 @my_rand() {
%1 = call i32 (...) @pthread_self()
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @sleep(i32 1)
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 30
ret i32 %5
}

LLVM IR (-O2):
@.str = [23 x i8] c"[%lu] go into my_rand\0A\00"
define i32 @my_rand() {
%1 = tail call i32 (...) @pthread_self()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 30
ret i32 %5
}
/* Type definitions */
struct mm_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG();
void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start,
                        unsigned long end) {
  BUG();
}


x86 assembly (clang, -O0):
<flush_tlb_pgtables>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <BUG@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mm_struct = type { i32 }
define void @flush_tlb_pgtables(%struct.mm_struct* %0, i64 %1, i64 %2) {
%4 = alloca %struct.mm_struct*
%5 = alloca i64
%6 = alloca i64
store %struct.mm_struct* %0, %struct.mm_struct** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
%struct.mm_struct = type { i32 }
define void @flush_tlb_pgtables(%struct.mm_struct* nocapture readnone %0, i64 %1, i64 %2) {
%4 = tail call i32 (...) @BUG()
ret void
}
/* Variables and functions */
double __nv_copysign(double, double);
double copysign(double __a, double __b) { return __nv_copysign(__a, __b); }


x86 assembly (clang, -O0):
<copysign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__nv_copysign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysign>:
jmp    1030 <__nv_copysign@plt>

LLVM IR (-O0):
define double @copysign(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 = call double @__nv_copysign(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @copysign(double %0, double %1) {
%3 = tail call double @__nv_copysign(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void EssentialFunc12(char *Status, char *Input) {
  char Buffer2S[2000];
  strcpy(Buffer2S, Input);
  printf("%s", Status);
}


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

x86 assembly (clang, -O2):
<EssentialFunc12>:
push   %rbx
sub    $0x7d0,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x7d0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @EssentialFunc12(i8* %0, i8* %1) {
%3 = alloca [2000 x i8]
%4 = getelementptr inbounds [2000 x i8], [2000 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %1)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void EC_GROUP_set_asn1_flag(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_set_asn1_flag() {
ret void
}
/* Variables and functions */
int strlen(char const *);
char *strndup(char const *, int);
char *strstr(char const *, char *);
char *copy_prefix_address(const char *prefix_string) {
  const char *slash = strstr(prefix_string, "/");
  int len = 0;
  if (slash != NULL)
    len = slash - prefix_string;
  else
    len = strlen(prefix_string);
  return strndup(prefix_string, len);
}


x86 assembly (clang, -O0):
<copy_prefix_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1175 <copy_prefix_address+0x45>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
jmp    1181 <copy_prefix_address+0x51>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <strndup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_prefix_address>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1147 <copy_prefix_address+0x17>
sub    %ebx,%eax
jmp    114f <copy_prefix_address+0x1f>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1050 <strndup@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @copy_prefix_address(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strstr(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
store i32 0, i32* %4
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
%15 = trunc i64 %14 to i32
store i32 %15, i32* %4
br label %19
16: ; preds = %1
%17 = load i8*, i8** %2
%18 = call i32 @strlen(i8* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %16, %9
%20 = load i8*, i8** %2
%21 = load i32, i32* %4
%22 = call i8* @strndup(i8* %20, i32 %21)
ret i8* %22
}

LLVM IR (-O2):
define noalias i8* @copy_prefix_address(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
br label %11
9: ; preds = %1
%10 = tail call i32 @strlen(i8* %0)
br label %11
11: ; preds = %9, %4
%12 = phi i32 [ %8, %4 ], [ %10, %9 ]
%13 = tail call i8* @strndup(i8* %0, i32 %12)
ret i8* %13
}
void f5(unsigned long size) {}


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

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

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

LLVM IR (-O2):
define void @f5(i64 %0) {
ret void
}
/* Variables and functions */
long round(double);
long int lround(double x) { return round(x); }


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

x86 assembly (clang, -O2):
<lround>:
jmp    1030 <round@plt>

LLVM IR (-O0):
define i64 @lround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @round(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @lround(double %0) {
%2 = tail call i64 @round(double %0)
ret i64 %2
}
int PathName(file)
register char *file;
{
  char *strptr;
  strptr = file;
  while (*strptr != '\0') {
    if (*strptr == '/') {
      return (1);
    }
    strptr++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<PathName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <PathName+0x4d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    113c <PathName+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1154 <PathName+0x54>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <PathName+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PathName>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <PathName+0x11>
cmp    $0x2f,%al
je     1114 <PathName+0x14>
add    $0x1,%rdi
jmp    1100 <PathName>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @PathName(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 47, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ freeMatrixInt(int **, int);
void tearDownExp(int ***A, int ***B, int ***C, int size) {
  freeMatrixInt(*A, size);
  freeMatrixInt(*B, size);
  freeMatrixInt(*C, size);
}


x86 assembly (clang, -O0):
<tearDownExp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <freeMatrixInt@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <freeMatrixInt@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <freeMatrixInt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tearDownExp>:
push   %r15
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rsi,%r15
mov    (%rdi),%rdi
mov    %ecx,%esi
call   1030 <freeMatrixInt@plt>
mov    (%r15),%rdi
mov    %ebx,%esi
call   1030 <freeMatrixInt@plt>
mov    (%r14),%rdi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <freeMatrixInt@plt>

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

LLVM IR (-O2):
define void @tearDownExp(i32*** nocapture %0, i32*** nocapture %1, i32*** nocapture %2, i32 %3) {
%5 = load i32**, i32*** %0
%6 = tail call i32 @freeMatrixInt(i32** %5, i32 %3)
%7 = load i32**, i32*** %1
%8 = tail call i32 @freeMatrixInt(i32** %7, i32 %3)
%9 = load i32**, i32*** %2
%10 = tail call i32 @freeMatrixInt(i32** %9, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logSystemError(char *);
void logMallocError(void) { logSystemError("malloc"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define void @logMallocError() {
%1 = tail call i32 @logSystemError(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
void glTexEnvx(void) { return; }


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

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

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

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

/* Variables and functions */
int twi_read_2byte(int);
uint16_t read_temp1() { return (twi_read_2byte(0x49) >> 4) / 16; }


x86 assembly (clang, -O0):
<read_temp1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x49,%edi
call   1030 <twi_read_2byte@plt>
sar    $0x4,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_temp1>:
push   %rax
mov    $0x49,%edi
call   1030 <twi_read_2byte@plt>
sar    $0x4,%eax
lea    0xf(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
sar    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_temp1() {
%1 = call i32 @twi_read_2byte(i32 73)
%2 = ashr i32 %1, 4
%3 = sdiv i32 %2, 16
ret i32 %3
}

LLVM IR (-O2):
define i32 @read_temp1() {
%1 = tail call i32 @twi_read_2byte(i32 73)
%2 = ashr i32 %1, 4
%3 = sdiv i32 %2, 16
ret i32 %3
}
/* Type definitions */
struct i_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ iwrite(struct i_node *);
void iupdate(struct i_node *inode) { iwrite(inode); }


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

x86 assembly (clang, -O2):
<iupdate>:
jmp    1030 <iwrite@plt>

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

LLVM IR (-O2):
%struct.i_node = type { i32 }
define void @iupdate(%struct.i_node* %0) {
%2 = tail call i32 @iwrite(%struct.i_node* %0)
ret void
}
int test_imm_B8int8_mem(signed char *val) {
  return ((*val) & (0xB8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B8int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -72
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ treatment(int, char **);
int main(int argc, char **argv) {
  treatment(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <treatment@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @treatment(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int main(int argc, char **argv) {
  argv[0] = "wc";
  execvp(argv[0], argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xed6(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <execvp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"wc\00"
define i32 @main(i32 %0, i8** %1) {
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = tail call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
time_t time(time_t *timer) {
  __set_errno(ENOSYS);
  if (timer != NULL)
    *timer = (time_t)-1;
  return (time_t)-1;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
cmpq   $0x0,-0x8(%rbp)
je     1140 <time+0x30>
mov    -0x8(%rbp),%rax
movq   $0xffffffffffffffff,(%rax)
mov    $0xffffffffffffffff,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
test   %rbx,%rbx
je     112e <time+0x1e>
movq   $0xffffffffffffffff,(%rbx)
mov    $0xffffffffffffffff,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i64 @time(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
%5 = load i64*, i64** %2
%6 = icmp ne i64* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i64*, i64** %2
store i64 -1, i64* %8
br label %9
9: ; preds = %7, %1
ret i64 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i64 @time(i64* writeonly %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
%4 = icmp eq i64* %0, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i64 -1, i64* %0
br label %6
6: ; preds = %5, %1
ret i64 -1
}
void function(char t[4]) { t[3] = 0; }


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
movb   $0x0,0x3(%rdi)
ret

LLVM IR (-O0):
define void @function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
store i8 0, i8* %4
ret void
}

LLVM IR (-O2):
define void @function(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
store i8 0, i8* %2
ret void
}
/* Variables and functions */
int writeFd(int, char *);
int writePrompt(int fd) { return writeFd(fd, "> "); }


x86 assembly (clang, -O0):
<writePrompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <writeFd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writePrompt>:
lea    0xee9(%rip),%rsi
jmp    1030 <writeFd@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
define i32 @writePrompt(i32 %0) {
%2 = tail call i32 @writeFd(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Usage: rpilot [switch] filename\n");
  printf("Switch \t Action\n");
  printf("-b \t Suppress banner printing on startup\n");
  printf("-i \t Enter interactive mode when no file names are given\n");
  printf("-? \t Print this help message, then exit\n\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: rpilot [switch] filename\0A\00"
@.str.1 = [17 x i8] c"Switch \09 Action\0A\00"
@.str.2 = [42 x i8] c"-b \09 Suppress banner printing on startup\0A\00"
@.str.3 = [58 x i8] c"-i \09 Enter interactive mode when no file names are given\0A\00"
@.str.4 = [42 x i8] c"-? \09 Print this help message, then exit\0A\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"Usage: rpilot [switch] filename\00"
@str.5 = [16 x i8] c"Switch \09 Action\00"
@str.6 = [41 x i8] c"-b \09 Suppress banner printing on startup\00"
@str.7 = [57 x i8] c"-i \09 Enter interactive mode when no file names are given\00"
@str.8 = [41 x i8] c"-? \09 Print this help message, then exit\0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XKeyReleasedEvent;

/* Variables and functions */
void *get_XKeyReleasedEvent_display(void *_p) {
  return (void *)((XKeyReleasedEvent *)_p)->display;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XKeyReleasedEvent_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XKeyReleasedEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int bar() {
  static int x = 5;
  return x;
}


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

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

LLVM IR (-O0):
@bar.x = internal global i32 5
define i32 @bar() {
%1 = load i32, i32* @bar.x
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 5
}
/* Type definitions */
struct message_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close_serving_thread(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ write_head(int, int, int, int /*<<< orphan*/);
int req_quit(int sockfd, struct message_s *msg) {
  write_head(sockfd, 0xAC, 0x00, 0);
  puts("client request to quit");
  close_serving_thread(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<req_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xac,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1050 <write_head@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%edi
call   1040 <close_serving_thread@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<req_quit>:
push   %rbx
mov    %edi,%ebx
mov    $0xac,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <write_head@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <close_serving_thread@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.message_s = type { i32 }
@.str = [23 x i8] c"client request to quit\00"
define i32 @req_quit(i32 %0, %struct.message_s* %1) {
%3 = alloca i32
%4 = alloca %struct.message_s*
store i32 %0, i32* %3
store %struct.message_s* %1, %struct.message_s** %4
%5 = load i32, i32* %3
%6 = call i32 @write_head(i32 %5, i32 172, i32 0, i32 0)
%7 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = call i32 @close_serving_thread(i32 %8)
ret i32 0
}

LLVM IR (-O2):
%struct.message_s = type { i32 }
@.str = [23 x i8] c"client request to quit\00"
define i32 @req_quit(i32 %0, %struct.message_s* nocapture readnone %1) {
%3 = tail call i32 @write_head(i32 %0, i32 172, i32 0, i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @close_serving_thread(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(int, unsigned char);
void SensorSetMirrorFlip_HV7131RP(unsigned char val) {
  unsigned char x;
  VIM_SIF_I2cReadByte(0x01, &x);
  val = ~val;
  VIM_SIF_I2cWriteByte(0x01,
                       (unsigned char)((x & 0x0cf) | ((val & 0x03) << 4)));
}


x86 assembly (clang, -O0):
<SensorSetMirrorFlip_HV7131RP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0x1(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xcf,%eax
movzbl -0x1(%rbp),%ecx
and    $0x3,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    $0x1,%edi
movzbl %al,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetMirrorFlip_HV7131RP>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xf(%rsp),%rsi
mov    $0x1,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0xf(%rsp),%al
and    $0xcf,%al
shl    $0x4,%bl
and    $0x30,%bl
or     %al,%bl
xor    $0x30,%bl
movzbl %bl,%esi
mov    $0x1,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @SensorSetMirrorFlip_HV7131RP(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call i32 @VIM_SIF_I2cReadByte(i32 1, i8* %3)
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = xor i32 %6, -1
%8 = trunc i32 %7 to i8
store i8 %8, i8* %2
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = and i32 %10, 207
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = and i32 %13, 3
%15 = shl i32 %14, 4
%16 = or i32 %11, %15
%17 = trunc i32 %16 to i8
%18 = call i32 @VIM_SIF_I2cWriteByte(i32 1, i8 zeroext %17)
ret void
}

LLVM IR (-O2):
define void @SensorSetMirrorFlip_HV7131RP(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 1, i8* %2)
%4 = load i8, i8* %2
%5 = and i8 %4, -49
%6 = shl i8 %0, 4
%7 = and i8 %6, 48
%8 = or i8 %5, %7
%9 = xor i8 %8, 48
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 1, i8 zeroext %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ posix_memalign(void **, size_t, size_t);
void *oscap_aligned_malloc(size_t size, size_t alignment) {
  void *ptr = NULL;
  posix_memalign(&ptr, alignment, size);
  return ptr;
}


x86 assembly (clang, -O0):
<oscap_aligned_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1030 <posix_memalign@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oscap_aligned_malloc>:
push   %rax
mov    %rdi,%rdx
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <posix_memalign@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @oscap_aligned_malloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
store i8* null, i8** %5
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = call i32 @posix_memalign(i8** %5, i64 %6, i64 %7)
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @oscap_aligned_malloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @posix_memalign(i8** %3, i64 %1, i64 %0)
%6 = load i8*, i8** %3
ret i8* %6
}
int getDigits(int n) {
  int digits = 0;
  for (int temp = n; temp > 0; ++digits) {
    temp /= 10;
  }
  return digits;
}


x86 assembly (clang, -O0):
<getDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113a <getDigits+0x3a>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <getDigits+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDigits>:
xor    %eax,%eax
test   %edi,%edi
jle    1124 <getDigits+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0xa,%edi
mov    %edx,%edi
jae    1110 <getDigits+0x10>
ret

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

LLVM IR (-O2):
define i32 @getDigits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %4
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ %0, %1 ]
%7 = phi i32 [ %9, %5 ], [ 0, %1 ]
%8 = udiv i32 %6, 10
%9 = add nuw nsw i32 %7, 1
%10 = icmp ult i32 %6, 10
br i1 %10, label %3, label %5
}
/* Variables and functions */
int /*<<< orphan*/ FN_pointer_arith4_Bad(int *);
void call_pointer_arith4_Bad() {
  int x = 100;
  FN_pointer_arith4_Bad(&x);
}


x86 assembly (clang, -O0):
<call_pointer_arith4_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <FN_pointer_arith4_Bad@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_pointer_arith4_Bad>:
push   %rax
movl   $0x64,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <FN_pointer_arith4_Bad@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @call_pointer_arith4_Bad() {
%1 = alloca i32
store i32 100, i32* %1
%2 = call i32 @FN_pointer_arith4_Bad(i32* %1)
ret void
}

LLVM IR (-O2):
define void @call_pointer_arith4_Bad() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 100, i32* %1
%3 = call i32 @FN_pointer_arith4_Bad(i32* %1)
ret void
}
/* Variables and functions */
int add(int, int);
int calculate(int x) {
  int y, i;
  for (i = 0; i < 10; i++) {
    y = add(12, x + y);
  }
  return add(x, y);
}


x86 assembly (clang, -O0):
<calculate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    114d <calculate+0x3d>
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
mov    $0xc,%edi
call   1030 <add@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <calculate+0x12>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate>:
push   %rbx
mov    %edi,%ebx
mov    $0xc,%edi
call   1030 <add@plt>
lea    (%rax,%rbx,1),%esi
mov    $0xc,%edi
call   1030 <add@plt>
lea    (%rax,%rbx,1),%esi
mov    $0xc,%edi
call   1030 <add@plt>
lea    (%rax,%rbx,1),%esi
mov    $0xc,%edi
call   1030 <add@plt>
lea    (%rax,%rbx,1),%esi
mov    $0xc,%edi
call   1030 <add@plt>
lea    (%rax,%rbx,1),%esi
mov    $0xc,%edi
call   1030 <add@plt>
lea    (%rax,%rbx,1),%esi
mov    $0xc,%edi
call   1030 <add@plt>
lea    (%rax,%rbx,1),%esi
mov    $0xc,%edi
call   1030 <add@plt>
lea    (%rax,%rbx,1),%esi
mov    $0xc,%edi
call   1030 <add@plt>
lea    (%rax,%rbx,1),%esi
mov    $0xc,%edi
call   1030 <add@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <add@plt>

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

LLVM IR (-O2):
define i32 @calculate(i32 %0) {
%2 = tail call i32 @add(i32 12, i32 undef)
%3 = add nsw i32 %2, %0
%4 = tail call i32 @add(i32 12, i32 %3)
%5 = add nsw i32 %4, %0
%6 = tail call i32 @add(i32 12, i32 %5)
%7 = add nsw i32 %6, %0
%8 = tail call i32 @add(i32 12, i32 %7)
%9 = add nsw i32 %8, %0
%10 = tail call i32 @add(i32 12, i32 %9)
%11 = add nsw i32 %10, %0
%12 = tail call i32 @add(i32 12, i32 %11)
%13 = add nsw i32 %12, %0
%14 = tail call i32 @add(i32 12, i32 %13)
%15 = add nsw i32 %14, %0
%16 = tail call i32 @add(i32 12, i32 %15)
%17 = add nsw i32 %16, %0
%18 = tail call i32 @add(i32 12, i32 %17)
%19 = add nsw i32 %18, %0
%20 = tail call i32 @add(i32 12, i32 %19)
%21 = tail call i32 @add(i32 %0, i32 %20)
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ aprintf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ atoi(char *);
int main() {
  aprintf("%d\n%d\n", atoi("0"), atoi("1982"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed1(%rip),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x8(%rbp)
lea    0xec4(%rip),%rdi
call   1040 <atoi@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xeaa(%rip),%rdi
call   1030 <aprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = tail call i32 @aprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32 1982)
ret i32 0
}
int Verify_PWM(float value) {
  if (value > 1.0)
    return 100;
  if (value < 0.0)
    return 0;
  return value * 100;
}


x86 assembly (clang, -O0):
<Verify_PWM>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1130 <Verify_PWM+0x30>
movl   $0x64,-0x4(%rbp)
jmp    1166 <Verify_PWM+0x66>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1152 <Verify_PWM+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1166 <Verify_PWM+0x66>
movss  0xeae(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Verify_PWM>:
mov    $0x64,%eax
ucomiss 0xef4(%rip),%xmm0
ja     1124 <Verify_PWM+0x24>
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1124 <Verify_PWM+0x24>
mulss  0xee4(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @Verify_PWM(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 1.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 100, i32* %2
br label %17
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %17
13: ; preds = %8
%14 = load float, float* %3
%15 = fmul float %14, 1.000000e+02
%16 = fptosi float %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %12, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @Verify_PWM(float %0) {
%2 = fcmp ogt float %0, 1.000000e+00
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = fcmp olt float %0, 0.000000e+00
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = fmul float %0, 1.000000e+02
%7 = fptosi float %6 to i32
br label %8
8: ; preds = %3, %1, %5
%9 = phi i32 [ %7, %5 ], [ 100, %1 ], [ 0, %3 ]
ret i32 %9
}
gets(s) char *s;
{
  int c;
  while ((*s++ = c = getchar()) != '\n' && c != '\0')
    ;
  *s = '\0';
  return (c);
}


x86 assembly (clang, -O0):
<gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xd(%rbp)
je     1152 <gets+0x42>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1162 <gets+0x52>
jmp    1167 <gets+0x57>
jmp    111c <gets+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gets>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %eax,%eax
je     1139 <gets+0x29>
movzbl %al,%ecx
cmp    $0xa,%ecx
jne    1120 <gets+0x10>
movb   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gets(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %16, %1
%5 = call i32 (...) @getchar()
store i32 %5, i32* %3
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %2
store i8 %6, i8* %7
%9 = sext i8 %6 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %11, %4
%15 = phi i1 [ false, %4 ], [ %13, %11 ]
br i1 %15, label %16, label %17
16: ; preds = %14
br label %4
17: ; preds = %14
%18 = load i8*, i8** %2
store i8 0, i8* %18
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @gets(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 (...) @getchar()
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %5, i8* %3
%7 = and i32 %4, 255
%8 = icmp ne i32 %7, 10
%9 = icmp ne i32 %4, 0
%10 = and i1 %9, %8
br i1 %10, label %2, label %11
11: ; preds = %2
store i8 0, i8* %6
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int *);
int *malloc(int);
int *mul_three(int *a) {
  int *ret = malloc(sizeof(int));
  assert(ret);
  *ret = *a * 3;
  return ret;
}


x86 assembly (clang, -O0):
<mul_three>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
imul   $0x3,(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_three>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    (%r14),%eax
lea    (%rax,%rax,2),%eax
mov    %eax,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @mul_three(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @assert(i32* %5)
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 3
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
ret i32* %11
}

LLVM IR (-O2):
define i32* @mul_three(i32* nocapture %0) {
%2 = tail call i32* @malloc(i32 4)
%3 = tail call i32 @assert(i32* %2)
%4 = load i32, i32* %0
%5 = mul nsw i32 %4, 3
store i32 %5, i32* %2
ret i32* %2
}
/* Variables and functions */
unsigned char *hmac_blake224(unsigned char *, unsigned char const *, size_t,
                             unsigned char const *, size_t);
unsigned char *mac_hmac_blake224(unsigned char *out, const unsigned char *key,
                                 size_t key_len, const unsigned char *msg,
                                 size_t msg_len) {
  return hmac_blake224(out, key, key_len, msg, msg_len);
}


x86 assembly (clang, -O0):
<mac_hmac_blake224>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <hmac_blake224@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_hmac_blake224>:
jmp    1030 <hmac_blake224@plt>

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

LLVM IR (-O2):
define i8* @mac_hmac_blake224(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_blake224(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}