xunge/DecIR huggingface dataset:
/* Variables and functions */
void *receive_message(int /*<<< orphan*/);
int /*<<< orphan*/ release_memory_block(void *);
void *request_memory_block();
int /*<<< orphan*/ send_message(int, void *);
void mem_test_blocking1() {
  void *msg = receive_message(0);
  void *msgBack = request_memory_block();
  send_message(27, msgBack);
  release_memory_block(msg);
}


x86 assembly (clang, -O0):
<mem_test_blocking1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <receive_message@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <request_memory_block@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1b,%edi
call   1040 <send_message@plt>
mov    -0x8(%rbp),%rdi
call   1060 <release_memory_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_test_blocking1>:
push   %rbx
xor    %edi,%edi
call   1050 <receive_message@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <request_memory_block@plt>
mov    $0x1b,%edi
mov    %rax,%rsi
call   1040 <send_message@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <release_memory_block@plt>

LLVM IR (-O0):
define void @mem_test_blocking1() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @receive_message(i32 0)
store i8* %3, i8** %1
%4 = call i8* (...) @request_memory_block()
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @send_message(i32 27, i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @release_memory_block(i8* %7)
ret void
}

LLVM IR (-O2):
define void @mem_test_blocking1() {
%1 = tail call i8* @receive_message(i32 0)
%2 = tail call i8* (...) @request_memory_block()
%3 = tail call i32 @send_message(i32 27, i8* %2)
%4 = tail call i32 @release_memory_block(i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isalnum(int c) {
  if (isalpha(c) || isdigit(c))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
jne    114f <isalnum+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     115b <isalnum+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <isalnum+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
char *skip_pigsty_comment(char *buffer) {
  char *b = buffer;
  while (*b != '\n' && *b != 0) {
    b++;
  }
  return b;
}


x86 assembly (clang, -O0):
<skip_pigsty_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x11(%rbp)
je     1135 <skip_pigsty_comment+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1145 <skip_pigsty_comment+0x45>
jmp    1156 <skip_pigsty_comment+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <skip_pigsty_comment+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_pigsty_comment>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <skip_pigsty_comment+0x22>
cmp    $0xa,%cl
je     1122 <skip_pigsty_comment+0x22>
add    $0x1,%rax
jmp    1110 <skip_pigsty_comment+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_pigsty_comment(i8* %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 10, label %7
i8 0, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void ind(size_t indent, FILE *o) {
  size_t i;
  for (i = 0; i < indent; i++)
    putc(' ', o);
}


x86 assembly (clang, -O0):
<ind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1155 <ind+0x45>
mov    -0x10(%rbp),%rsi
mov    $0x20,%edi
call   1030 <putc@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <ind+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ind>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1133 <ind+0x23>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <ind+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ind(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca i64
store i64 %0, i64* %3
store i32* %1, i32** %4
store i64 0, i64* %5
br label %6
6: ; preds = %13, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %3
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %4
%12 = call i32 @putc(i8 signext 32, i32* %11)
br label %13
13: ; preds = %10
%14 = load i64, i64* %5
%15 = add i64 %14, 1
store i64 %15, i64* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ind(i64 %0, i32* nocapture %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @putc(i8 signext 32, i32* %1)
%7 = add nuw i64 %5, 1
%8 = icmp eq i64 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int strcasecmp(char *, char *);
int compare_c_strings_(char **ptr_1, char **ptr_2) {
  char *str1;
  char *str2;
  if (*ptr_1 == NULL)
    str1 = "";
  else
    str1 = *ptr_1;
  if (*ptr_2 == NULL)
    str2 = "";
  else
    str2 = *ptr_2;
  return strcasecmp(str1, str2);
}


x86 assembly (clang, -O0):
<compare_c_strings_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113e <compare_c_strings_+0x2e>
lea    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1149 <compare_c_strings_+0x39>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1167 <compare_c_strings_+0x57>
lea    0xea2(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1172 <compare_c_strings_+0x62>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcasecmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_c_strings_>:
mov    (%rdi),%rdi
test   %rdi,%rdi
lea    0xee3(%rip),%rax
cmove  %rax,%rdi
mov    (%rsi),%rsi
test   %rsi,%rsi
cmove  %rax,%rsi
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @compare_c_strings_(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*** %3
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %5
br label %14
11: ; preds = %2
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
store i8* %13, i8** %5
br label %14
14: ; preds = %11, %10
%15 = load i8**, i8*** %4
%16 = load i8*, i8** %15
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %19
18: ; preds = %14
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %6
br label %22
19: ; preds = %14
%20 = load i8**, i8*** %4
%21 = load i8*, i8** %20
store i8* %21, i8** %6
br label %22
22: ; preds = %19, %18
%23 = load i8*, i8** %5
%24 = load i8*, i8** %6
%25 = call i32 @strcasecmp(i8* %23, i8* %24)
ret i32 %25
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @compare_c_strings_(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %3
%6 = load i8*, i8** %1
%7 = icmp eq i8* %6, null
%8 = select i1 %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6
%9 = tail call i32 @strcasecmp(i8* %5, i8* %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ silly(int *);
int main(int argc, char **argv) {
  int zz = 9;
  silly(&zz);
  printf("hello world - %d\n", zz);
  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   $0x9,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <silly@plt>
mov    -0x14(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x9,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <silly@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"hello world - %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 9, i32* %3
%5 = call i32 @silly(i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_usmatrix_map(ushort **m, long nrl, long nrh, long ncl, long nch) {
  free((char *)(m + nrl));
}


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

x86 assembly (clang, -O2):
<free_usmatrix_map>:
lea    (%rdi,%rsi,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_usmatrix_map(i32** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i32**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i32** %0, i32*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i32**, i32*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds i32*, i32** %11, i64 %12
%14 = bitcast i32** %13 to i8*
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
define void @free_usmatrix_map(i32** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i32*, i32** %0, i64 %1
%7 = bitcast i32** %6 to i8*
%8 = tail call i32 @free(i8* %7)
ret void
}
int chown(s, u, g)
char *s;
{ return (0); }


x86 assembly (clang, -O0):
<chown>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @chown(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @chown(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct VAL_cell {
  int dummy;
};
struct AST_tree {
  int dummy;
};

/* Variables and functions */
struct VAL_cell *new_LIST_VAL_cell(struct VAL_cell *, struct VAL_cell *);
struct VAL_cell *AST_tree_con(struct AST_tree *self, struct VAL_cell *x,
                              struct VAL_cell *y) {
  return new_LIST_VAL_cell(x, y);
}


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

x86 assembly (clang, -O2):
<AST_tree_con>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <new_LIST_VAL_cell@plt>

LLVM IR (-O0):
%struct.AST_tree = type { i32 }
%struct.VAL_cell = type { i32 }
define %struct.VAL_cell* @AST_tree_con(%struct.AST_tree* %0, %struct.VAL_cell* %1, %struct.VAL_cell* %2) {
%4 = alloca %struct.AST_tree*
%5 = alloca %struct.VAL_cell*
%6 = alloca %struct.VAL_cell*
store %struct.AST_tree* %0, %struct.AST_tree** %4
store %struct.VAL_cell* %1, %struct.VAL_cell** %5
store %struct.VAL_cell* %2, %struct.VAL_cell** %6
%7 = load %struct.VAL_cell*, %struct.VAL_cell** %5
%8 = load %struct.VAL_cell*, %struct.VAL_cell** %6
%9 = call %struct.VAL_cell* @new_LIST_VAL_cell(%struct.VAL_cell* %7, %struct.VAL_cell* %8)
ret %struct.VAL_cell* %9
}

LLVM IR (-O2):
%struct.AST_tree = type { i32 }
%struct.VAL_cell = type { i32 }
define %struct.VAL_cell* @AST_tree_con(%struct.AST_tree* nocapture readnone %0, %struct.VAL_cell* %1, %struct.VAL_cell* %2) {
%4 = tail call %struct.VAL_cell* @new_LIST_VAL_cell(%struct.VAL_cell* %1, %struct.VAL_cell* %2)
ret %struct.VAL_cell* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ redfish_mkfs_stub(char *, size_t);
void redfish_mkfs(const char *uconf __attribute__((unused)),
                  uint16_t mid __attribute__((unused)),
                  uint64_t fsid __attribute__((unused)), char *err,
                  size_t err_len) {
  redfish_mkfs_stub(err, err_len);
}


x86 assembly (clang, -O0):
<redfish_mkfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <redfish_mkfs_stub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redfish_mkfs>:
mov    %r8,%rsi
mov    %rcx,%rdi
jmp    1030 <redfish_mkfs_stub@plt>

LLVM IR (-O0):
define void @redfish_mkfs(i8* %0, i32 %1, i32 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %9
%12 = load i64, i64* %10
%13 = call i32 @redfish_mkfs_stub(i8* %11, i64 %12)
ret void
}

LLVM IR (-O2):
define void @redfish_mkfs(i8* nocapture readnone %0, i32 %1, i32 %2, i8* %3, i64 %4) {
%6 = tail call i32 @redfish_mkfs_stub(i8* %3, i64 %4)
ret void
}
void view_hotel_input(void) {}


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

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

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

LLVM IR (-O2):
define void @view_hotel_input() {
ret void
}
int search(char *s, char carac) {
  int i;
  for (i = 0; s[i] != '\0'; i++)
    if (s[i] == carac)
      return i;
  return 0;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <search+0x60>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114d <search+0x4d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <search+0x67>
jmp    1152 <search+0x52>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <search+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1124 <search+0x24>
nopl   0x0(%rax,%rax,1)
cmp    %sil,%cl
je     1124 <search+0x24>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <search+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i8 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i8 %7, %1
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %16, label %5
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %9, %14, %2
%17 = phi i32 [ 0, %2 ], [ %15, %14 ], [ 0, %9 ]
ret i32 %17
}
int ulckpwdf() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ulckpwdf() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ adc_measure_channel(int /*<<< orphan*/);
void adc_measure() { adc_measure_channel(0); }


x86 assembly (clang, -O0):
<adc_measure>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <adc_measure_channel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adc_measure>:
xor    %edi,%edi
jmp    1030 <adc_measure_channel@plt>

LLVM IR (-O0):
define void @adc_measure() {
%1 = call i32 @adc_measure_channel(i32 0)
ret void
}

LLVM IR (-O2):
define void @adc_measure() {
%1 = tail call i32 @adc_measure_channel(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int main(void) {
  foo();
  bar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 (...) @bar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bar()
ret i32 0
}
/* Variables and functions */
bool isUpper(int k) { return k >= 'A' && k <= 'Z'; }


x86 assembly (clang, -O0):
<isUpper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isUpper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUpper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isUpper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isUpper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char **argv) {
  fprintf(stderr,
          "Usage: %s [-ad] [-z max] [-Z min] [-b minlat,minlon,maxlat,maxlon] "
          "file\n",
          argv[0]);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xecc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [73 x i8] c"Usage: %s [-ad] [-z max] [-Z min] [-b minlat,minlon,maxlat,maxlon] file\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [73 x i8] c"Usage: %s [-ad] [-z max] [-Z min] [-b minlat,minlon,maxlat,maxlon] file\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ jet_sleep(int);
int write_block(int, int, int, int, int, int);
int dynamixelAddSynchMove(int servo, int pos, int speed) {
  int pos0 = pos & 255;
  int pos1 = pos >> 8;
  int speed0 = speed & 255;
  int speed1 = speed >> 8;
  int ret = write_block(107, servo, pos0, pos1, speed0, speed1);
  jet_sleep(50);
  return ret;
}


x86 assembly (clang, -O0):
<dynamixelAddSynchMove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    $0x6b,%edi
call   1030 <write_block@plt>
mov    %eax,-0x20(%rbp)
mov    $0x32,%edi
call   1040 <jet_sleep@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynamixelAddSynchMove>:
push   %rbx
mov    %edx,%r9d
mov    %esi,%ecx
mov    %edi,%esi
movzbl %cl,%edx
sar    $0x8,%ecx
movzbl %r9b,%r8d
sar    $0x8,%r9d
mov    $0x6b,%edi
call   1030 <write_block@plt>
mov    %eax,%ebx
mov    $0x32,%edi
call   1040 <jet_sleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dynamixelAddSynchMove(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%12 = load i32, i32* %5
%13 = and i32 %12, 255
store i32 %13, i32* %7
%14 = load i32, i32* %5
%15 = ashr i32 %14, 8
store i32 %15, i32* %8
%16 = load i32, i32* %6
%17 = and i32 %16, 255
store i32 %17, i32* %9
%18 = load i32, i32* %6
%19 = ashr i32 %18, 8
store i32 %19, i32* %10
%20 = load i32, i32* %4
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = load i32, i32* %9
%24 = load i32, i32* %10
%25 = call i32 @write_block(i32 107, i32 %20, i32 %21, i32 %22, i32 %23, i32 %24)
store i32 %25, i32* %11
%26 = call i32 @jet_sleep(i32 50)
%27 = load i32, i32* %11
ret i32 %27
}

LLVM IR (-O2):
define i32 @dynamixelAddSynchMove(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 255
%5 = ashr i32 %1, 8
%6 = and i32 %2, 255
%7 = ashr i32 %2, 8
%8 = tail call i32 @write_block(i32 107, i32 %0, i32 %4, i32 %5, i32 %6, i32 %7)
%9 = tail call i32 @jet_sleep(i32 50)
ret i32 %8
}
/* Variables and functions */
int i2c_smbus_write_word_data(int, int, int);
int ci20I2CWriteReg16(int fd, int reg, int data) {
  return i2c_smbus_write_word_data(fd, reg, data);
}


x86 assembly (clang, -O0):
<ci20I2CWriteReg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <i2c_smbus_write_word_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ci20I2CWriteReg16>:
jmp    1030 <i2c_smbus_write_word_data@plt>

LLVM IR (-O0):
define i32 @ci20I2CWriteReg16(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 = call i32 @i2c_smbus_write_word_data(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ci20I2CWriteReg16(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @i2c_smbus_write_word_data(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
int cmp_func(const void *a, const void *b) { return *(int *)a - *(int *)b; }


x86 assembly (clang, -O0):
<cmp_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_func>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmp_func(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp_func(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_avg2_8(int, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ const *, int, int,
                             int /*<<< orphan*/);
void MC_avg_x_8_mmxext(uint8_t *dest, const uint8_t *ref, int stride,
                       int height) {
  MC_avg2_8(height, dest, ref, stride, 1, 0);
}


x86 assembly (clang, -O0):
<MC_avg_x_8_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <MC_avg2_8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_avg_x_8_mmxext>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
jmp    1030 <MC_avg2_8@plt>

LLVM IR (-O0):
define void @MC_avg_x_8_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @MC_avg2_8(i32 %9, i32* %10, i32* %11, i32 %12, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @MC_avg_x_8_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_avg2_8(i32 %3, i32* %0, i32* %1, i32 %2, i32 1, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
char *next_token(const char *p) {
  while (isspace(*p))
    p++;
  return (char *)p;
}


x86 assembly (clang, -O0):
<next_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <next_token+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <next_token+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_token>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <next_token+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @next_token(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_args(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; ++i)
    printf("%s\n", argv[i]);
}


x86 assembly (clang, -O0):
<print_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <print_args+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_args+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_args>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <print_args+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_args+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_args(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int set_tcpopt(int s, int optname, int val) { return val; }


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

x86 assembly (clang, -O2):
<set_tcpopt>:
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @set_tcpopt(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* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @set_tcpopt(i32 %0, i32 %1, i32 returned %2) {
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
void to_min_int() {
  short a = 0;
  while (a + 1 == ++a)
    ;
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<to_min_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x1,%eax
mov    -0x2(%rbp),%cx
add    $0x1,%cx
mov    %cx,-0x2(%rbp)
movswl %cx,%ecx
cmp    %ecx,%eax
jne    1141 <to_min_int+0x31>
jmp    111e <to_min_int+0xe>
lea    0xeb8(%rip),%rdi
movswl -0x2(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_min_int>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movswl %ax,%ecx
add    $0x1,%ecx
add    $0x1,%eax
movswl %ax,%esi
cmp    %esi,%ecx
je     1120 <to_min_int+0x10>
lea    0xec9(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @to_min_int() {
br label %1
1: ; preds = %1, %0
%2 = phi i16 [ 0, %0 ], [ %5, %1 ]
%3 = sext i16 %2 to i32
%4 = add nsw i32 %3, 1
%5 = add i16 %2, 1
%6 = sext i16 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %1, label %8
8: ; preds = %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 signext %5)
ret void
}
/* Variables and functions */
char const *decode_utf16(unsigned short const *);
const char *decode_to_roman(const unsigned short int *s) {
  return decode_utf16(s);
}


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

x86 assembly (clang, -O2):
<decode_to_roman>:
jmp    1030 <decode_utf16@plt>

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

LLVM IR (-O2):
define i8* @decode_to_roman(i16* %0) {
%2 = tail call i8* @decode_utf16(i16* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ test_stopwatch_millis();
int /*<<< orphan*/ test_stopwatch_nanos();
int /*<<< orphan*/ test_stopwatch_reset();
int /*<<< orphan*/ test_stopwatch_seconds();
int /*<<< orphan*/ test_stopwatch_start();
int /*<<< orphan*/ test_stopwatch_stop();
void test_all() {
  test_stopwatch_start();
  test_stopwatch_stop();
  test_stopwatch_nanos();
  test_stopwatch_millis();
  test_stopwatch_seconds();
  test_stopwatch_reset();
}


x86 assembly (clang, -O0):
<test_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <test_stopwatch_start@plt>
mov    $0x0,%al
call   1070 <test_stopwatch_stop@plt>
mov    $0x0,%al
call   1050 <test_stopwatch_nanos@plt>
mov    $0x0,%al
call   1040 <test_stopwatch_millis@plt>
mov    $0x0,%al
call   1060 <test_stopwatch_seconds@plt>
mov    $0x0,%al
call   1030 <test_stopwatch_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all>:
push   %rax
xor    %eax,%eax
call   1080 <test_stopwatch_start@plt>
xor    %eax,%eax
call   1070 <test_stopwatch_stop@plt>
xor    %eax,%eax
call   1050 <test_stopwatch_nanos@plt>
xor    %eax,%eax
call   1040 <test_stopwatch_millis@plt>
xor    %eax,%eax
call   1060 <test_stopwatch_seconds@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_stopwatch_reset@plt>

LLVM IR (-O0):
define void @test_all() {
%1 = call i32 (...) @test_stopwatch_start()
%2 = call i32 (...) @test_stopwatch_stop()
%3 = call i32 (...) @test_stopwatch_nanos()
%4 = call i32 (...) @test_stopwatch_millis()
%5 = call i32 (...) @test_stopwatch_seconds()
%6 = call i32 (...) @test_stopwatch_reset()
ret void
}

LLVM IR (-O2):
define void @test_all() {
%1 = tail call i32 (...) @test_stopwatch_start()
%2 = tail call i32 (...) @test_stopwatch_stop()
%3 = tail call i32 (...) @test_stopwatch_nanos()
%4 = tail call i32 (...) @test_stopwatch_millis()
%5 = tail call i32 (...) @test_stopwatch_seconds()
%6 = tail call i32 (...) @test_stopwatch_reset()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ hd44780_ll_instruction_write(int);
int8_t hd44780_return_home(void) {
  return (hd44780_ll_instruction_write(0x02));
}


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

x86 assembly (clang, -O2):
<hd44780_return_home>:
mov    $0x2,%edi
jmp    1030 <hd44780_ll_instruction_write@plt>

LLVM IR (-O0):
define i32 @hd44780_return_home() {
%1 = call i32 @hd44780_ll_instruction_write(i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @hd44780_return_home() {
%1 = tail call i32 @hd44780_ll_instruction_write(i32 2)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freeNumList(void *n) { free(n); }


x86 assembly (clang, -O0):
<freeNumList>:
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):
<freeNumList>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freeNumList(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 @freeNumList(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_8Dint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x8D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Dint64_midword_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, 16
%6 = and i64 %5, 141
%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_8Dint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9240576
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct b6_list {
  int dummy;
};
struct b6_dref {
  int dummy;
};

/* Variables and functions */
struct b6_dref *b6_list_del(int /*<<< orphan*/);
int /*<<< orphan*/ b6_list_first(struct b6_list *);
struct b6_dref *b6_list_del_first(struct b6_list *list) {
  return b6_list_del(b6_list_first(list));
}


x86 assembly (clang, -O0):
<b6_list_del_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <b6_list_first@plt>
mov    %eax,%edi
call   1030 <b6_list_del@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b6_list_del_first>:
push   %rax
call   1040 <b6_list_first@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <b6_list_del@plt>

LLVM IR (-O0):
%struct.b6_dref = type { i32 }
%struct.b6_list = type { i32 }
define %struct.b6_dref* @b6_list_del_first(%struct.b6_list* %0) {
%2 = alloca %struct.b6_list*
store %struct.b6_list* %0, %struct.b6_list** %2
%3 = load %struct.b6_list*, %struct.b6_list** %2
%4 = call i32 @b6_list_first(%struct.b6_list* %3)
%5 = call %struct.b6_dref* @b6_list_del(i32 %4)
ret %struct.b6_dref* %5
}

LLVM IR (-O2):
%struct.b6_dref = type { i32 }
%struct.b6_list = type { i32 }
define %struct.b6_dref* @b6_list_del_first(%struct.b6_list* %0) {
%2 = tail call i32 @b6_list_first(%struct.b6_list* %0)
%3 = tail call %struct.b6_dref* @b6_list_del(i32 %2)
ret %struct.b6_dref* %3
}
int a(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @a() {
ret i32 1
}

LLVM IR (-O2):
define i32 @a() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void reg16_write(volatile uint16_t *reg, uint16_t value) { *reg = value; }


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

x86 assembly (clang, -O2):
<reg16_write>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @reg16_write(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
void ScaleRowDown38_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown38_NEON() {
ret void
}
/* Variables and functions */
double atof(char const *);
double CDoubleChars(const char *Src) { return atof(Src); }


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

x86 assembly (clang, -O2):
<CDoubleChars>:
jmp    1030 <atof@plt>

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

LLVM IR (-O2):
define double @CDoubleChars(i8* nocapture %0) {
%2 = tail call double @atof(i8* %0)
ret double %2
}
int compare_pointers(const void *a, const void *b) {
  const int *ia = a;
  const int *ib = b;
  if (ia > ib)
    return 1;
  else if (ia < ib)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_pointers>:
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
cmp    -0x28(%rbp),%rax
jbe    1136 <compare_pointers+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1157 <compare_pointers+0x57>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1150 <compare_pointers+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <compare_pointers+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_pointers>:
cmp    %rsi,%rdi
sbb    %ecx,%ecx
cmp    %rsi,%rdi
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_pointers(i8* readnone %0, i8* readnone %1) {
%3 = icmp ugt i8* %0, %1
%4 = icmp ult i8* %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}