xunge/DecIR huggingface dataset:
int Izquierda(int x) { return ((x > 0) ? (x - 1) : (5 - 1)); }


x86 assembly (clang, -O0):
<Izquierda>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111f <Izquierda+0x1f>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <Izquierda+0x2c>
mov    $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <Izquierda+0x2c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Izquierda>:
lea    -0x1(%rdi),%ecx
test   %edi,%edi
mov    $0x4,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Izquierda(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 4, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @Izquierda(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = select i1 %2, i32 %3, i32 4
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *const, void const *const, int);
size_t store_deserialize_uint32(uint32_t *const to, const void *const from) {
  memcpy(to, from, sizeof(*to));
  return sizeof(*to);
}


x86 assembly (clang, -O0):
<store_deserialize_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    $0x4,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_deserialize_uint32>:
push   %rax
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    $0x4,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @store_deserialize_uint32(i32* %0, i8* %1) {
%3 = tail call i32 @memcpy(i32* %0, i8* %1, i32 4)
ret i64 4
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int main(int argc, char **argv) {
  print("Hello, World!\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\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 @print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int value(char r) {
  switch (r) {
  case 'I':
    return 1;
  case 'V':
    return 5;
  case 'X':
    return 10;
  case 'L':
    return 50;
  case 'C':
    return 100;
  case 'D':
    return 500;
  case 'M':
    return 1000;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1188 <value+0x88>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    118f <value+0x8f>
movl   $0x5,-0x4(%rbp)
jmp    118f <value+0x8f>
movl   $0xa,-0x4(%rbp)
jmp    118f <value+0x8f>
movl   $0x32,-0x4(%rbp)
jmp    118f <value+0x8f>
movl   $0x64,-0x4(%rbp)
jmp    118f <value+0x8f>
movl   $0x1f4,-0x4(%rbp)
jmp    118f <value+0x8f>
movl   $0x3e8,-0x4(%rbp)
jmp    118f <value+0x8f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<value>:
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     1129 <value+0x29>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x64,%eax
ret
mov    $0x1f4,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret
mov    $0x3e8,%eax
ret

LLVM IR (-O0):
define i32 @value(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %13 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
i32 68, label %11
i32 77, label %12
]
6: ; preds = %1
store i32 1, i32* %2
br label %14
7: ; preds = %1
store i32 5, i32* %2
br label %14
8: ; preds = %1
store i32 10, i32* %2
br label %14
9: ; preds = %1
store i32 50, i32* %2
br label %14
10: ; preds = %1
store i32 100, i32* %2
br label %14
11: ; preds = %1
store i32 500, i32* %2
br label %14
12: ; preds = %1
store i32 1000, i32* %2
br label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @value(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 73, label %10
i32 86, label %3
i32 88, label %4
i32 76, label %5
i32 67, label %6
i32 68, label %7
i32 77, label %8
]
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3
%11 = phi i32 [ -1, %9 ], [ 1000, %8 ], [ 500, %7 ], [ 100, %6 ], [ 50, %5 ], [ 10, %4 ], [ 5, %3 ], [ 1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
int main(int argc, char *argv[]) {
  for (int i = 0; i < 5; i++)
    printf("%d%c", i, i == 4 ? '\n' : ' ');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    116a <main+0x5a>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    $0x20,%eax
mov    $0xa,%ecx
cmp    $0x4,%edx
cmove  %ecx,%eax
lea    0xeac(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x20,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x20,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x20,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 4
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 10, i32 32
%16 = trunc i32 %15 to i8
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11, i8 signext %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0, i8 signext 32)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1, i8 signext 32)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2, i8 signext 32)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3, i8 signext 32)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4, i8 signext 10)
ret i32 0
}
/* Type definitions */
struct mesh {
  int dummy;
};

/* Variables and functions */
struct mesh *create_cube_mesh(void) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.mesh = type { i32 }
define %struct.mesh* @create_cube_mesh() {
ret %struct.mesh* null
}

LLVM IR (-O2):
%struct.mesh = type { i32 }
define noalias %struct.mesh* @create_cube_mesh() {
ret %struct.mesh* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
scalar_t__ strlen(char *);
int /*<<< orphan*/ write(int, char *, scalar_t__);
void handle_recv_msg(int sockfd, char *buf) {
  printf("client recv msg is:%s\n", buf);
  sleep(5);
  write(sockfd, buf, strlen(buf) + 1);
}


x86 assembly (clang, -O0):
<handle_recv_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1050 <printf@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_recv_msg>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"client recv msg is:%s\0A\00"
define void @handle_recv_msg(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 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @sleep(i32 5)
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i32 @write(i32 %8, i8* %9, i64 %12)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"client recv msg is:%s\0A\00"
define void @handle_recv_msg(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @sleep(i32 5)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = add nsw i64 %5, 1
%7 = tail call i32 @write(i32 %0, i8* %1, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpenLRSHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void OpenLRSUpdated() { UAVObjUpdated(OpenLRSHandle()); }


x86 assembly (clang, -O0):
<OpenLRSUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OpenLRSHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenLRSUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <OpenLRSHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @OpenLRSUpdated() {
%1 = call i32 (...) @OpenLRSHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpenLRSUpdated() {
%1 = tail call i32 (...) @OpenLRSHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
char *ft_strrev(char *str) {
  int len;
  char *rev;
  int i;
  len = 0;
  while (str[len] != '\0') {
    len++;
  }
  i = 0;
  while (i < len) {
    rev[i] = str[len - i - 1];
    i++;
  }
  return (*rev);
}


x86 assembly (clang, -O0):
<ft_strrev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <ft_strrev+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strrev+0xf>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1171 <ft_strrev+0x71>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1139 <ft_strrev+0x39>
mov    -0x18(%rbp),%rax
movsbq (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strrev>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ft_strrev+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @ft_strrev(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %6
6: ; preds = %14, %1
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %6
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
store i32 0, i32* %5
br label %18
18: ; preds = %22, %17
%19 = load i32, i32* %5
%20 = load i32, i32* %3
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %37
22: ; preds = %18
%23 = load i8*, i8** %2
%24 = load i32, i32* %3
%25 = load i32, i32* %5
%26 = sub nsw i32 %24, %25
%27 = sub nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %23, i64 %28
%30 = load i8, i8* %29
%31 = load i8*, i8** %4
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
store i8 %30, i8* %34
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %18
37: ; preds = %18
%38 = load i8*, i8** %4
%39 = load i8, i8* %38
%40 = sext i8 %39 to i64
%41 = inttoptr i64 %40 to i8*
ret i8* %41
}

LLVM IR (-O2):
define noalias i8* @ft_strrev(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = icmp eq i32 %9, 0
tail call void @llvm.assume(i1 %10)
ret i8* null
}
void test_ar_1_USHRT(void *d, unsigned short n) {
  if (n == (0x7fff * 2 + 1) - 1)
    n = (0x7fff * 2 + 1) - 2;
  __builtin_memset(d, 0, n);
}


x86 assembly (clang, -O0):
<test_ar_1_USHRT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
cmp    $0xfffe,%eax
jne    1138 <test_ar_1_USHRT+0x28>
movw   $0xfffd,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movzwl -0xa(%rbp),%eax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ar_1_USHRT>:
cmp    $0xfffe,%si
mov    $0xfffd,%edx
cmovne %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @test_ar_1_USHRT(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = icmp eq i32 %6, 65534
br i1 %7, label %8, label %9
8: ; preds = %2
store i16 -3, i16* %4
br label %9
9: ; preds = %8, %2
%10 = load i8*, i8** %3
%11 = load i16, i16* %4
%12 = zext i16 %11 to i64
ret void
}

LLVM IR (-O2):
define void @test_ar_1_USHRT(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = icmp eq i16 %1, -2
%4 = select i1 %3, i16 -3, i16 %1
%5 = zext i16 %4 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %5, i1 false)
ret void
}
int enclave_close() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @enclave_close() {
ret i32 0
}
/* Variables and functions */
int getcurx(int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
int t_getcurx() { return getcurx(stdscr); }


x86 assembly (clang, -O0):
<t_getcurx>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getcurx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_getcurx>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getcurx@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define i32 @t_getcurx() {
%1 = load i32, i32* @stdscr
%2 = call i32 @getcurx(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdscr = global i32 0
define i32 @t_getcurx() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @getcurx(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA2_Stream6_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @DMA2_Stream6_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @DMA2_Stream6_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ divisor(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int number;
  printf("Enter a positive integer: ");
  scanf("%d", &number);
  printf("Factors of %d are: ", number);
  divisor(number);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <divisor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
call   1040 <divisor@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter a positive integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Factors of %d are: \00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @divisor(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter a positive integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Factors of %d are: \00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @divisor(i32 %7)
ret void
}
int check_filename(char *cc) {
  while (*cc) {
    if (*cc == '/')
      return 0;
    cc++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_filename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <check_filename+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1131 <check_filename+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1149 <check_filename+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <check_filename+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @check_filename(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 [ 0, %7 ], [ 1, %2 ]
ret i32 %9
}
int _disconnect(int id) { return 0x0; }


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

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

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

LLVM IR (-O2):
define i32 @_disconnect(i32 %0) {
ret i32 0
}
int prstrlen(const char *s) {
  int l;
  l = 0;
  while (s[l] >= ' ' && s[l] <= 'z')
    l++;
  if (s[l] == 0) {
    return l;
  }
  return -1;
}


x86 assembly (clang, -O0):
<prstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x15(%rbp)
jl     113e <prstrlen+0x3e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114e <prstrlen+0x4e>
jmp    115c <prstrlen+0x5c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <prstrlen+0xf>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    117c <prstrlen+0x7c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <prstrlen+0x83>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prstrlen>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%eax
lea    -0x20(%rax),%edx
add    $0x1,%ecx
add    $0x1,%rdi
cmp    $0x5b,%dl
jb     1110 <prstrlen+0x10>
neg    %al
sbb    %eax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @prstrlen(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %23, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 32
br i1 %12, label %13, label %21
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 122
br label %21
21: ; preds = %13, %5
%22 = phi i1 [ false, %5 ], [ %20, %13 ]
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %5
26: ; preds = %21
%27 = load i8*, i8** %3
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %26
%35 = load i32, i32* %4
store i32 %35, i32* %2
br label %37
36: ; preds = %26
store i32 -1, i32* %2
br label %37
37: ; preds = %36, %34
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @prstrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %8, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = add i8 %5, -32
%7 = icmp ult i8 %6, 91
%8 = add nuw i64 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
%10 = trunc i64 %3 to i32
%11 = icmp eq i8 %5, 0
%12 = select i1 %11, i32 %10, i32 -1
ret i32 %12
}
int test_imm_42int64_highword_reg(long long val) {
  return ((val >> 32) & (0x42 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_42int64_highword_reg(i64 %0) {
%2 = and i64 %0, 283467841536
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ handler();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void main() {
  int i;
  handler();
  for (i = 1; i < 301; i++) {
    printf("sleep %d ...\n", i);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <handler@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x12d,-0x4(%rbp)
jge    117a <main+0x4a>
mov    -0x4(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <handler@plt>
mov    $0x1,%ebx
lea    0xeb9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
add    $0x1,%ebx
cmp    $0x12d,%ebx
jne    1150 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"sleep %d ...\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @handler()
store i32 1, i32* %1
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 301
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @sleep(i32 1)
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"sleep %d ...\0A\00"
define void @main() {
%1 = tail call i32 (...) @handler()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %6, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @sleep(i32 1)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 301
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
double log10(double);
double ln_get_asteroid_sdiam_km(double H, double A) {
  return 3.13 - 0.2 * H - (0.5 * log10(A));
}


x86 assembly (clang, -O0):
<ln_get_asteroid_sdiam_km>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log10@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xea5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_asteroid_sdiam_km>:
push   %rax
mulsd  0xee7(%rip),%xmm0
addsd  0xee7(%rip),%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
call   1030 <log10@plt>
mulsd  0xed9(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_asteroid_sdiam_km(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 = call double @llvm.fmuladd.f64(double -2.000000e-01, double %5, double 3.130000e+00)
%7 = load double, double* %4
%8 = call double @log10(double %7)
%9 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %8, double %6)
ret double %9
}

LLVM IR (-O2):
define double @ln_get_asteroid_sdiam_km(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e-01, double 3.130000e+00)
%4 = tail call double @log10(double %1)
%5 = tail call double @llvm.fmuladd.f64(double %4, double -5.000000e-01, double %3)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ bang_tilde_setup();
int /*<<< orphan*/ print_setup();
int /*<<< orphan*/ samplerate_tilde_setup();
int /*<<< orphan*/ scope_setup();
void d_misc_setup(void) {
  print_setup();
  scope_setup();
  bang_tilde_setup();
  samplerate_tilde_setup();
}


x86 assembly (clang, -O0):
<d_misc_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <print_setup@plt>
mov    $0x0,%al
call   1030 <scope_setup@plt>
mov    $0x0,%al
call   1060 <bang_tilde_setup@plt>
mov    $0x0,%al
call   1050 <samplerate_tilde_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_misc_setup>:
push   %rax
xor    %eax,%eax
call   1040 <print_setup@plt>
xor    %eax,%eax
call   1030 <scope_setup@plt>
xor    %eax,%eax
call   1060 <bang_tilde_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <samplerate_tilde_setup@plt>

LLVM IR (-O0):
define void @d_misc_setup() {
%1 = call i32 (...) @print_setup()
%2 = call i32 (...) @scope_setup()
%3 = call i32 (...) @bang_tilde_setup()
%4 = call i32 (...) @samplerate_tilde_setup()
ret void
}

LLVM IR (-O2):
define void @d_misc_setup() {
%1 = tail call i32 (...) @print_setup()
%2 = tail call i32 (...) @scope_setup()
%3 = tail call i32 (...) @bang_tilde_setup()
%4 = tail call i32 (...) @samplerate_tilde_setup()
ret void
}
__attribute__((always_)) void __module_get(struct module *module) {}


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

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

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

LLVM IR (-O2):
%struct.module = type opaque
define void @__module_get(%struct.module* nocapture %0) {
ret void
}
void ff_hevc_put_hevc_bi_w_epel_v64_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_v64_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  printf("sizeof(int)         %lu\n", sizeof(int));
  printf("sizeof(long int)    %lu\n", sizeof(long int));
  printf("sizeof(float)       %lu\n", sizeof(float));
  printf("sizeof(double)      %lu\n", sizeof(double));
  printf("sizeof(long double) %lu\n", sizeof(long double));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
mov    $0x10,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"sizeof(int) %lu\0A\00"
@.str.1 = [25 x i8] c"sizeof(long int) %lu\0A\00"
@.str.2 = [25 x i8] c"sizeof(float) %lu\0A\00"
@.str.3 = [25 x i8] c"sizeof(double) %lu\0A\00"
@.str.4 = [25 x i8] c"sizeof(long double) %lu\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 16)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"sizeof(int) %lu\0A\00"
@.str.1 = [25 x i8] c"sizeof(long int) %lu\0A\00"
@.str.2 = [25 x i8] c"sizeof(float) %lu\0A\00"
@.str.3 = [25 x i8] c"sizeof(double) %lu\0A\00"
@.str.4 = [25 x i8] c"sizeof(long double) %lu\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 8)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die();
int getegid();
int geteuid();
int getgid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main() {
  printf("UID=%d EUID=%d GID=%d EGID=%d\n", getuid(), geteuid(), getgid(),
         getegid());
  die();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    %eax,%r8d
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <die@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <getgid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <getegid@plt>
lea    0xe72(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <die@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"UID=%d EUID=%d GID=%d EGID=%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getuid()
%3 = call i32 (...) @geteuid()
%4 = call i32 (...) @getgid()
%5 = call i32 (...) @getegid()
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %4, i32 %5)
%7 = call i32 (...) @die()
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"UID=%d EUID=%d GID=%d EGID=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @geteuid()
%3 = tail call i32 (...) @getgid()
%4 = tail call i32 (...) @getegid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4)
%6 = tail call i32 (...) @die()
ret i32 0
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
unsigned int odroid_xu_gpio_read_25() {
  unsigned int bank_offset = 0x0C20;
  unsigned int bit_index = 7;
  return (exynos_5410_gpio_read(bank_offset) >> bit_index) & 0x1;
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_read_25>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc20,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exynos_5410_gpio_read@plt>
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_read_25>:
push   %rax
mov    $0xc20,%edi
call   1030 <exynos_5410_gpio_read@plt>
shr    $0x7,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @odroid_xu_gpio_read_25() {
%1 = alloca i32
%2 = alloca i32
store i32 3104, i32* %1
store i32 7, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @exynos_5410_gpio_read(i32 %3)
%5 = load i32, i32* %2
%6 = lshr i32 %4, %5
%7 = and i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @odroid_xu_gpio_read_25() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3104)
%2 = lshr i32 %1, 7
%3 = and i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ wrbyte(int /*<<< orphan*/ *, int);
void wrbool(FILE *fd, int val) { wrbyte(fd, val); }


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

x86 assembly (clang, -O2):
<wrbool>:
jmp    1030 <wrbyte@plt>

LLVM IR (-O0):
define void @wrbool(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 = call i32 @wrbyte(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @wrbool(i32* %0, i32 %1) {
%3 = tail call i32 @wrbyte(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call(char *);
ule() { call("ccule"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"ccule\00"
define i32 @ule() {
%1 = tail call i32 @call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ kzmem_free(char *);
int /*<<< orphan*/ putcurrent();
int thread_kmfree(char *p) {
  kzmem_free(p);
  putcurrent();
  return 0;
}


x86 assembly (clang, -O0):
<thread_kmfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <kzmem_free@plt>
mov    $0x0,%al
call   1040 <putcurrent@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_kmfree>:
push   %rax
call   1030 <kzmem_free@plt>
xor    %eax,%eax
call   1040 <putcurrent@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @thread_kmfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @kzmem_free(i8* %3)
%5 = call i32 (...) @putcurrent()
ret i32 0
}

LLVM IR (-O2):
define i32 @thread_kmfree(i8* %0) {
%2 = tail call i32 @kzmem_free(i8* %0)
%3 = tail call i32 (...) @putcurrent()
ret i32 0
}
void rotr(int *a, int *b, int *c) {
  int tmp = *a;
  *a = *c;
  *c = *b;
  *b = tmp;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
store i32 %5, i32* %0
%6 = load i32, i32* %1
store i32 %6, i32* %2
store i32 %4, i32* %1
ret void
}
int test_imm_10int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x10 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_10int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 16
%7 = icmp ne i64 %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_10int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 68719476736
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int vec_ui8_desc_compare(const void *p1, const void *p2) {
  const uint8_t *pp1 = (const uint8_t *)p1;
  const uint8_t *pp2 = (const uint8_t *)p2;
  if (*pp1 > *pp2)
    return -1;
  if (*pp1 < *pp2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<vec_ui8_desc_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jle    113c <vec_ui8_desc_compare+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <vec_ui8_desc_compare+0x63>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jge    115c <vec_ui8_desc_compare+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <vec_ui8_desc_compare+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_ui8_desc_compare>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @vec_ui8_desc_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
%8 = icmp slt i64 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void X509_NAME_add_entry_by_NID(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_add_entry_by_NID() {
ret void
}
int isarg(char *s) {
  if (s[0] == '-')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isarg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1124 <isarg+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <isarg+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isarg>:
xor    %eax,%eax
cmpb   $0x2d,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isarg(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 45
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isarg(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int fabs(double);
double game_adapt_K(double w) { return 32 + 32 * fabs(w); }


x86 assembly (clang, -O0):
<game_adapt_K>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
shl    $0x5,%eax
add    $0x20,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_adapt_K>:
push   %rax
call   1030 <fabs@plt>
shl    $0x5,%eax
add    $0x20,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @game_adapt_K(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @fabs(double %3)
%5 = mul nsw i32 32, %4
%6 = add nsw i32 32, %5
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @game_adapt_K(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = shl nsw i32 %2, 5
%4 = add nsw i32 %3, 32
%5 = sitofp i32 %4 to double
ret double %5
}
void movePlanets(struct planet *thePlanets, double dt) {}


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

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

LLVM IR (-O0):
%struct.planet = type opaque
define void @movePlanets(%struct.planet* %0, double %1) {
%3 = alloca %struct.planet*
%4 = alloca double
store %struct.planet* %0, %struct.planet** %3
store double %1, double* %4
ret void
}

LLVM IR (-O2):
%struct.planet = type opaque
define void @movePlanets(%struct.planet* nocapture %0, double %1) {
ret void
}