xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ *dll_opendir(char const *);
DIR *__wrap_opendir(const char *name) { return dll_opendir(name); }


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

x86 assembly (clang, -O2):
<__wrap_opendir>:
jmp    1030 <dll_opendir@plt>

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

LLVM IR (-O2):
define i32* @__wrap_opendir(i8* %0) {
%2 = tail call i32* @dll_opendir(i8* %0)
ret i32* %2
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
bool isSymmetricIteration(struct TreeNode *root) { return false; }


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

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

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @isSymmetricIteration(%struct.TreeNode* %0) {
%2 = alloca %struct.TreeNode*
store %struct.TreeNode* %0, %struct.TreeNode** %2
ret i32 0
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @isSymmetricIteration(%struct.TreeNode* nocapture readnone %0) {
ret i32 0
}
char *unused_str(char __attribute__((unused)) * str) {
  return "__attribute__((unused))";
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"__attribute__((unused))\00"
define i8* @unused_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [24 x i8] c"__attribute__((unused))\00"
define i8* @unused_str(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct Vector_EntryPointer {
  int dummy;
};

/* Variables and functions */
struct Vector_EntryPointer *vec_Create_EntryPointer(int);
struct Vector_EntryPointer *vec_CreateDefault_EntryPointer() {
  return vec_Create_EntryPointer(20);
}


x86 assembly (clang, -O0):
<vec_CreateDefault_EntryPointer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
call   1030 <vec_Create_EntryPointer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_CreateDefault_EntryPointer>:
mov    $0x14,%edi
jmp    1030 <vec_Create_EntryPointer@plt>

LLVM IR (-O0):
%struct.Vector_EntryPointer = type { i32 }
define %struct.Vector_EntryPointer* @vec_CreateDefault_EntryPointer() {
%1 = call %struct.Vector_EntryPointer* @vec_Create_EntryPointer(i32 20)
ret %struct.Vector_EntryPointer* %1
}

LLVM IR (-O2):
%struct.Vector_EntryPointer = type { i32 }
define %struct.Vector_EntryPointer* @vec_CreateDefault_EntryPointer() {
%1 = tail call %struct.Vector_EntryPointer* @vec_Create_EntryPointer(i32 20)
ret %struct.Vector_EntryPointer* %1
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int tcdrain(int);
void serialWaitUntilSent(int fd) {
  while (tcdrain(fd) == -1) {
    fprintf(stderr, "Could not drain data: %s\n", strerror(errno));
  }
}


x86 assembly (clang, -O0):
<serialWaitUntilSent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tcdrain@plt>
cmp    $0xffffffff,%eax
jne    117d <serialWaitUntilSent+0x4d>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
jmp    113b <serialWaitUntilSent+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialWaitUntilSent>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%ebx
call   1030 <tcdrain@plt>
cmp    $0xffffffff,%eax
jne    1185 <serialWaitUntilSent+0x55>
mov    0x2e95(%rip),%r15
mov    0x2e86(%rip),%r12
lea    0xea7(%rip),%r14
nopl   0x0(%rax)
mov    (%r15),%ebp
mov    (%r12),%edi
call   1050 <strerror@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    %ebx,%edi
call   1030 <tcdrain@plt>
cmp    $0xffffffff,%eax
je     1160 <serialWaitUntilSent+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Could not drain data: %s\0A\00"
@errno = global i32 0
define void @serialWaitUntilSent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = call i32 @tcdrain(i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load i32, i32* @stderr
%9 = load i32, i32* @errno
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Could not drain data: %s\0A\00"
@errno = global i32 0
define void @serialWaitUntilSent(i32 %0) {
%2 = tail call i32 @tcdrain(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @tcdrain(i32 %0)
%10 = icmp eq i32 %9, -1
br i1 %10, label %4, label %11
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPI_Out(int);
int /*<<< orphan*/ waitmillisec(int);
void erase() {
  SPI_Out(0xAC);
  SPI_Out(0x04);
  SPI_Out(0x00);
  waitmillisec(16);
}


x86 assembly (clang, -O0):
<erase>:
push   %rbp
mov    %rsp,%rbp
mov    $0xac,%edi
call   1030 <SPI_Out@plt>
mov    $0x4,%edi
call   1030 <SPI_Out@plt>
xor    %edi,%edi
call   1030 <SPI_Out@plt>
mov    $0x10,%edi
call   1040 <waitmillisec@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase>:
push   %rax
mov    $0xac,%edi
call   1030 <SPI_Out@plt>
mov    $0x4,%edi
call   1030 <SPI_Out@plt>
xor    %edi,%edi
call   1030 <SPI_Out@plt>
mov    $0x10,%edi
pop    %rax
jmp    1040 <waitmillisec@plt>

LLVM IR (-O0):
define void @erase() {
%1 = call i32 @SPI_Out(i32 172)
%2 = call i32 @SPI_Out(i32 4)
%3 = call i32 @SPI_Out(i32 0)
%4 = call i32 @waitmillisec(i32 16)
ret void
}

LLVM IR (-O2):
define void @erase() {
%1 = tail call i32 @SPI_Out(i32 172)
%2 = tail call i32 @SPI_Out(i32 4)
%3 = tail call i32 @SPI_Out(i32 0)
%4 = tail call i32 @waitmillisec(i32 16)
ret void
}
int getRomanValue(char number) {
  int value;
  switch (number) {
  case 'I':
    value = 1;
    break;
  case 'V':
    value = 5;
    break;
  case 'X':
    value = 10;
    break;
  case 'L':
    value = 50;
    break;
  case 'C':
    value = 100;
    break;
  }
  return value;
}


x86 assembly (clang, -O0):
<getRomanValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     116b <getRomanValue+0x6b>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    116b <getRomanValue+0x6b>
movl   $0x5,-0x8(%rbp)
jmp    116b <getRomanValue+0x6b>
movl   $0xa,-0x8(%rbp)
jmp    116b <getRomanValue+0x6b>
movl   $0x32,-0x8(%rbp)
jmp    116b <getRomanValue+0x6b>
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getRomanValue(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 67, label %6
i32 86, label %3
i32 88, label %4
i32 76, label %5
]
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3
%8 = phi i32 [ 100, %6 ], [ 50, %5 ], [ 10, %4 ], [ 5, %3 ], [ 1, %1 ]
ret i32 %8
}
/* Variables and functions */
char *strdup(char *);
void utarray_str_cpy(void *dst, const void *src) {
  char **_src = (char **)src, **_dst = (char **)dst;
  *_dst = (*_src == NULL) ? NULL : strdup(*_src);
}


x86 assembly (clang, -O0):
<utarray_str_cpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1149 <utarray_str_cpy+0x39>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1159 <utarray_str_cpy+0x49>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utarray_str_cpy>:
push   %rbx
mov    %rdi,%rbx
mov    (%rsi),%rdi
test   %rdi,%rdi
je     1123 <utarray_str_cpy+0x13>
call   1030 <strdup@plt>
jmp    1125 <utarray_str_cpy+0x15>
xor    %eax,%eax
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @utarray_str_cpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %2
br label %19
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = load i8*, i8** %16
%18 = call i8* @strdup(i8* %17)
br label %19
19: ; preds = %15, %14
%20 = phi i8* [ null, %14 ], [ %18, %15 ]
%21 = load i8**, i8*** %6
store i8* %20, i8** %21
ret void
}

LLVM IR (-O2):
define void @utarray_str_cpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @strdup(i8* %4)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
%10 = bitcast i8* %0 to i8**
store i8* %9, i8** %10
ret void
}
void VP8LEncDspInitSSE41(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8LEncDspInitSSE41() {
ret void
}
void warn(_Bool b) {
  switch (b) {
  case 1:
  case 0:
  default:
    break;
  }
  switch (b) {
  case 0 ... 1:
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<warn>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
test   %al,%al
jne    1120 <warn+0x20>
jmp    111b <warn+0x1b>
jmp    1120 <warn+0x20>
jmp    1125 <warn+0x25>
xor    %eax,%eax
test   %al,%al
jne    1139 <warn+0x39>
jmp    1134 <warn+0x34>
jmp    1139 <warn+0x39>
jmp    113e <warn+0x3e>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @warn(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = zext i1 %5 to i32
switch i32 %6, label %8 [
i32 1, label %7
i32 0, label %7
]
7: ; preds = %1, %1
br label %8
8: ; preds = %1, %7
br label %9
9: ; preds = %8
%10 = load i8, i8* %2
%11 = trunc i8 %10 to i1
%12 = zext i1 %11 to i32
switch i32 %12, label %14 [
i32 0, label %13
i32 1, label %13
]
13: ; preds = %9, %9
br label %14
14: ; preds = %9, %13
br label %15
15: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @warn(i1 zeroext %0) {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ stat(char *, struct stat *);
int isdir(char *path) {
  struct stat st;
  if (stat(path, &st) != 0) {
    perror("stat");
    exit(EXIT_FAILURE);
  }
  return S_ISDIR(st.st_mode);
}


x86 assembly (clang, -O0):
<isdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     117d <isdir+0x3d>
lea    0xe96(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
jne    1158 <isdir+0x18>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret
lea    0xea1(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [5 x i8] c"stat\00"
@EXIT_FAILURE = global i32 0
define i32 @isdir(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 @S_ISDIR(i32 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [5 x i8] c"stat\00"
@EXIT_FAILURE = global i32 0
define i32 @isdir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @S_ISDIR(i32 %12)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("I am going to love this course");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"I am going to love this course\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"I am going to love this course\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int __serialize_uint16(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int __serialize_uint32(uint8_t *out, int out_sz, uint32_t n) {
  out_sz = __serialize_uint16(out, out_sz, (uint16_t)(n & 0xFFFF));
  out_sz = __serialize_uint16(out + 2, out_sz, (uint16_t)((n >> 16) & 0xFFFF));
  return (out_sz);
}


x86 assembly (clang, -O0):
<__serialize_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
and    $0xffff,%edx
call   1030 <__serialize_uint16@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
sar    $0x10,%edx
and    $0xffff,%edx
call   1030 <__serialize_uint16@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__serialize_uint32>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
movzwl %bp,%edx
call   1030 <__serialize_uint16@plt>
add    $0x8,%rbx
shr    $0x10,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__serialize_uint16@plt>

LLVM IR (-O0):
define i32 @__serialize_uint32(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = and i32 %9, 65535
%11 = call i32 @__serialize_uint16(i32* %7, i32 %8, i32 %10)
store i32 %11, i32* %5
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = ashr i32 %15, 16
%17 = and i32 %16, 65535
%18 = call i32 @__serialize_uint16(i32* %13, i32 %14, i32 %17)
store i32 %18, i32* %5
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @__serialize_uint32(i32* %0, i32 %1, i32 %2) {
%4 = and i32 %2, 65535
%5 = tail call i32 @__serialize_uint16(i32* %0, i32 %1, i32 %4)
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = lshr i32 %2, 16
%8 = tail call i32 @__serialize_uint16(i32* %6, i32 %5, i32 %7)
ret i32 %8
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char *getPassword(void) {
  char *password = malloc(sizeof(char) * 1000);
  printf("Password: ");
  scanf("%s", password);
  return password;
}


x86 assembly (clang, -O0):
<getPassword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3e8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPassword>:
push   %rbx
mov    $0x3e8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Password: \00"
@.str.1 = [3 x i8] c"%s\00"
define i8* @getPassword() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1000)
store i8* %2, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %1
ret i8* %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"Password: \00"
@.str.1 = [3 x i8] c"%s\00"
define i8* @getPassword() {
%1 = tail call dereferenceable_or_null(1000) i8* @malloc(i32 1000)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ ecc108p_sleep();
void ecc108e_sleep(void) { (void)ecc108p_sleep(); }


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

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

LLVM IR (-O0):
define void @ecc108e_sleep() {
%1 = call i32 (...) @ecc108p_sleep()
ret void
}

LLVM IR (-O2):
define void @ecc108e_sleep() {
%1 = tail call i32 (...) @ecc108p_sleep()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(size_t);
int resize_buf(char **buf, size_t *old_size, size_t size) {
  if (size > *old_size) {
    free(*buf);
    *old_size = size;
    if (!(*buf = malloc(size)))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<resize_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jbe    1187 <resize_buf+0x67>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rdi
call   1040 <malloc@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    1182 <resize_buf+0x62>
movl   $0x0,-0x4(%rbp)
jmp    118e <resize_buf+0x6e>
jmp    1187 <resize_buf+0x67>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize_buf>:
push   %r15
push   %r14
push   %rbx
cmp    %rdx,(%rsi)
jae    114e <resize_buf+0x2e>
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,(%r15)
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,(%r14)
test   %rax,%rax
je     1155 <resize_buf+0x35>
mov    $0x1,%eax
jmp    1157 <resize_buf+0x37>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @resize_buf(i8** nocapture %0, i64* nocapture %1, i64 %2) {
%4 = load i64, i64* %1
%5 = icmp ult i64 %4, %2
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i8*, i8** %0
%8 = tail call i32 @free(i8* %7)
store i64 %2, i64* %1
%9 = tail call i8* @malloc(i64 %2)
store i8* %9, i8** %0
%10 = icmp eq i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %6, %3
br label %12
12: ; preds = %6, %11
%13 = phi i32 [ 1, %11 ], [ 0, %6 ]
ret i32 %13
}
/* Type definitions */
struct TIC_sPOP {
  int dummy;
};
struct TIC_conf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dolog(int, char *, struct TIC_conf *);
struct TIC_sPOP *tic_ListPOPs(struct TIC_conf *tic) {
  dolog(3, "Not implemented - tic_ListPOPs(%x)\n", tic);
  return NULL;
}


x86 assembly (clang, -O0):
<tic_ListPOPs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x3,%edi
lea    0xed4(%rip),%rsi
call   1030 <dolog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tic_ListPOPs>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    $0x3,%edi
call   1030 <dolog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TIC_sPOP = type { i32 }
%struct.TIC_conf = type { i32 }
@.str = [36 x i8] c"Not implemented - tic_ListPOPs(%x)\0A\00"
define %struct.TIC_sPOP* @tic_ListPOPs(%struct.TIC_conf* %0) {
%2 = alloca %struct.TIC_conf*
store %struct.TIC_conf* %0, %struct.TIC_conf** %2
%3 = load %struct.TIC_conf*, %struct.TIC_conf** %2
%4 = call i32 @dolog(i32 3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), %struct.TIC_conf* %3)
ret %struct.TIC_sPOP* null
}

LLVM IR (-O2):
%struct.TIC_sPOP = type { i32 }
%struct.TIC_conf = type { i32 }
@.str = [36 x i8] c"Not implemented - tic_ListPOPs(%x)\0A\00"
define noalias %struct.TIC_sPOP* @tic_ListPOPs(%struct.TIC_conf* %0) {
%2 = tail call i32 @dolog(i32 3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), %struct.TIC_conf* %0)
ret %struct.TIC_sPOP* null
}
void InitializeKeywords(void *theEnv) {}


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

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

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

LLVM IR (-O2):
define void @InitializeKeywords(i8* nocapture %0) {
ret void
}
__attribute__((visibility("hidden"))) void tux_sound_flash_get_descripor(void) {
}


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

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

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

LLVM IR (-O2):
define hidden void @tux_sound_flash_get_descripor() {
ret void
}
quant(n, m) int n, m;
{
  register i, neg;
  neg = 0;
  if (n < 0) {
    neg++;
    n = -n;
  }
  i = n / m;
  if ((n - m * i) > (m / 2))
    i += 1;
  i *= m;
  if (neg)
    i = -i;
  return (i);
}


x86 assembly (clang, -O0):
<quant>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112c <quant+0x2c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jle    1166 <quant+0x66>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1182 <quant+0x82>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quant>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
cltd
idiv   %esi
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
sar    %ecx
xor    %r8d,%r8d
cmp    %ecx,%edx
setg   %r8b
add    %r8d,%eax
imul   %esi,%eax
mov    %eax,%ecx
neg    %ecx
test   %edi,%edi
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @quant(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = sub nsw i32 0, %0
%5 = select i1 %3, i32 %4, i32 %0
%6 = sdiv i32 %5, %1
%7 = mul nsw i32 %6, %1
%8 = srem i32 %5, %1
%9 = sdiv i32 %1, 2
%10 = icmp sgt i32 %8, %9
%11 = zext i1 %10 to i32
%12 = add nsw i32 %6, %11
%13 = mul nsw i32 %12, %1
%14 = sub nsw i32 0, %13
%15 = select i1 %3, i32 %14, i32 %13
ret i32 %15
}
void foo(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
struct timespec {
  unsigned long long tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ get_mono(struct timespec *);
unsigned long long monotonic_ms(void) {
  struct timespec ts;
  get_mono(&ts);
  return ts.tv_sec * 1000ULL + ts.tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<monotonic_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <get_mono@plt>
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monotonic_ms>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <get_mono@plt>
imul   $0x3e8,0x8(%rsp),%rcx
movslq 0x10(%rsp),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
define i64 @monotonic_ms() {
%1 = alloca %struct.timespec
%2 = call i32 @get_mono(%struct.timespec* %1)
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000000
%9 = sext i32 %8 to i64
%10 = add i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i32 }
define i64 @monotonic_ms() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = call i32 @get_mono(%struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000000
%10 = sext i32 %9 to i64
%11 = add i64 %6, %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ motorSet(int, int /*<<< orphan*/);
void intakeOff() {
  motorSet(5, 0);
  motorSet(6, 0);
}


x86 assembly (clang, -O0):
<intakeOff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <motorSet@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <motorSet@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intakeOff>:
push   %rax
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <motorSet@plt>
mov    $0x6,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <motorSet@plt>

LLVM IR (-O0):
define void @intakeOff() {
%1 = call i32 @motorSet(i32 5, i32 0)
%2 = call i32 @motorSet(i32 6, i32 0)
ret void
}

LLVM IR (-O2):
define void @intakeOff() {
%1 = tail call i32 @motorSet(i32 5, i32 0)
%2 = tail call i32 @motorSet(i32 6, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ i;
typedef int /*<<< orphan*/ f;
typedef int /*<<< orphan*/ d;
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char c;
  double d;
  float f;
  int i;
  printf("char: %lu\n", sizeof(c));
  printf("double: %lu\n", sizeof(d));
  printf("float: %lu\n", sizeof(f));
  printf("int: %lu\n", sizeof(i));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"char: %lu\0A\00"
@.str.1 = [13 x i8] c"double: %lu\0A\00"
@.str.2 = [12 x i8] c"float: %lu\0A\00"
@.str.3 = [10 x i8] c"int: %lu\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca double
%3 = alloca float
%4 = alloca i32
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 8)
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 4)
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"char: %lu\0A\00"
@.str.1 = [13 x i8] c"double: %lu\0A\00"
@.str.2 = [12 x i8] c"float: %lu\0A\00"
@.str.3 = [10 x i8] c"int: %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tViewContextInfo(void) {
  printf("<u>Record Context Info</u><br>");
  printf("No context info available<br>");
}


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

x86 assembly (clang, -O2):
<tViewContextInfo>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"<u>Record Context Info</u><br>\00"
@.str.1 = [30 x i8] c"No context info available<br>\00"
define void @tViewContextInfo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"<u>Record Context Info</u><br>\00"
@.str.1 = [30 x i8] c"No context info available<br>\00"
define void @tViewContextInfo() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int const u_int8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int const *);
unsigned fat12_first_half(u_int8_t *buf) {
  unsigned retval;
  static const int FIRST_HALF_MASK = 0x0F;
  assert(buf);
  retval = buf[0];
  retval += (buf[1] & FIRST_HALF_MASK) << 8;
  return retval;
}


x86 assembly (clang, -O0):
<fat12_first_half>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0xf,%eax
shl    $0x8,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fat12_first_half>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    0x4(%rbx),%eax
and    $0xf,%eax
shl    $0x8,%eax
add    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@fat12_first_half.FIRST_HALF_MASK = internal constant i32 15
define i32 @fat12_first_half(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @assert(i32* %4)
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = and i32 %11, 15
%13 = shl i32 %12, 8
%14 = load i32, i32* %3
%15 = add i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @fat12_first_half(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = and i32 %6, 3840
%8 = add i32 %7, %3
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;
typedef int int16_t;

/* Variables and functions */
__attribute__((always_)) int detexPixel32GetSignedR16(uint32_t pixel) {
  return (int16_t)(pixel & 0x0000FFFF);
}


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

x86 assembly (clang, -O2):
<detexPixel32GetSignedR16>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @detexPixel32GetSignedR16(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
/* Type definitions */
struct be_adapter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ be_mcc_notify(struct be_adapter *);
int be_mcc_wait_compl(struct be_adapter *);
int be_mcc_notify_wait(struct be_adapter *adapter) {
  be_mcc_notify(adapter);
  return be_mcc_wait_compl(adapter);
}


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

x86 assembly (clang, -O2):
<be_mcc_notify_wait>:
push   %rbx
mov    %rdi,%rbx
call   1040 <be_mcc_notify@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <be_mcc_wait_compl@plt>

LLVM IR (-O0):
%struct.be_adapter = type { i32 }
define i32 @be_mcc_notify_wait(%struct.be_adapter* %0) {
%2 = alloca %struct.be_adapter*
store %struct.be_adapter* %0, %struct.be_adapter** %2
%3 = load %struct.be_adapter*, %struct.be_adapter** %2
%4 = call i32 @be_mcc_notify(%struct.be_adapter* %3)
%5 = load %struct.be_adapter*, %struct.be_adapter** %2
%6 = call i32 @be_mcc_wait_compl(%struct.be_adapter* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.be_adapter = type { i32 }
define i32 @be_mcc_notify_wait(%struct.be_adapter* %0) {
%2 = tail call i32 @be_mcc_notify(%struct.be_adapter* %0)
%3 = tail call i32 @be_mcc_wait_compl(%struct.be_adapter* %0)
ret i32 %3
}
int test_imm_72uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x72 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_72uint64_midword_reg>:
test   $0x720000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_72uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 114
%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_72uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 7471104
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ settings_reset(int);
void settings_init() { settings_reset(1); }


x86 assembly (clang, -O0):
<settings_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <settings_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<settings_init>:
mov    $0x1,%edi
jmp    1030 <settings_reset@plt>

LLVM IR (-O0):
define void @settings_init() {
%1 = call i32 @settings_reset(i32 1)
ret void
}

LLVM IR (-O2):
define void @settings_init() {
%1 = tail call i32 @settings_reset(i32 1)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t WatchdogIntStatus(uint32_t ui32Base, bool bMasked) {
  ;
  if (bMasked) {
    return ((*((volatile unsigned long *)(ui32Base + 0x00000014))));
  } else {
    return ((*((volatile unsigned long *)(ui32Base + 0x00000010))));
  }
}


x86 assembly (clang, -O0):
<WatchdogIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1126 <WatchdogIntStatus+0x26>
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <WatchdogIntStatus+0x32>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntStatus>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    -0x8(%rsp),%rcx
mov    0x10(%rcx,%rax,4),%rax
ret

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

LLVM IR (-O2):
define i64 @WatchdogIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = icmp eq i32 %1, 0
%5 = load volatile i64, i64* %3
%6 = select i1 %4, i64 16, i64 20
%7 = add i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Type definitions */
struct s_map {
  int dummy;
};

/* Variables and functions */
scalar_t__ mapRemoveReturnID(struct s_map *, void const *);
int mapRemove(struct s_map *map, const void *key) {
  if (mapRemoveReturnID(map, key) < 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<mapRemove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <mapRemoveReturnID@plt>
cmp    $0x0,%rax
jge    1143 <mapRemove+0x33>
movl   $0x0,-0x4(%rbp)
jmp    114a <mapRemove+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapRemove>:
push   %rax
call   1030 <mapRemoveReturnID@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.s_map = type { i32 }
define i32 @mapRemove(%struct.s_map* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.s_map*
%5 = alloca i8*
store %struct.s_map* %0, %struct.s_map** %4
store i8* %1, i8** %5
%6 = load %struct.s_map*, %struct.s_map** %4
%7 = load i8*, i8** %5
%8 = call i64 @mapRemoveReturnID(%struct.s_map* %6, i8* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %12
11: ; preds = %2
store i32 1, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.s_map = type { i32 }
define i32 @mapRemove(%struct.s_map* %0, i8* %1) {
%3 = tail call i64 @mapRemoveReturnID(%struct.s_map* %0, i8* %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int check_hyphenation(char *, char *, char *);
int main(int argc, char **argv) {
  return check_hyphenation("en-us-g1.ctb,hyph_en_US.dic", "straightforward",
                           "010000001001000");
}


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
lea    0xee8(%rip),%rsi
lea    0xef1(%rip),%rdx
call   1030 <check_hyphenation@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
lea    0xefe(%rip),%rsi
lea    0xf07(%rip),%rdx
jmp    1030 <check_hyphenation@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"en-us-g1.ctb,hyph_en_US.dic\00"
@.str.1 = [16 x i8] c"straightforward\00"
@.str.2 = [16 x i8] c"010000001001000\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 @check_hyphenation(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
@.str = [28 x i8] c"en-us-g1.ctb,hyph_en_US.dic\00"
@.str.1 = [16 x i8] c"straightforward\00"
@.str.2 = [16 x i8] c"010000001001000\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_hyphenation(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void CEX_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @CEX_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned char encode_curr(unsigned char x, unsigned char y) {
  return ((x << 4) | y);
}


x86 assembly (clang, -O0):
<encode_curr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x4,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_curr>:
mov    %edi,%eax
shl    $0x4,%al
or     %sil,%al
ret

LLVM IR (-O0):
define zeroext i8 @encode_curr(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 4
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = or i32 %7, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @encode_curr(i8 zeroext %0, i8 zeroext %1) {
%3 = shl i8 %0, 4
%4 = or i8 %3, %1
ret i8 %4
}
void posix_class2P_ASCII() {}


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

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

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

LLVM IR (-O2):
define void @posix_class2P_ASCII() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void bar(void) { exit(0); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @exit(i32 0)
unreachable
}