xunge/DecIR huggingface dataset:
/* Type definitions */
struct text_tag_list {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_shuffle(struct genlist *);
void text_tag_list_shuffle(struct text_tag_list *tthis) {
  genlist_shuffle(((struct genlist *)(tthis)));
}


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

x86 assembly (clang, -O2):
<text_tag_list_shuffle>:
jmp    1030 <genlist_shuffle@plt>

LLVM IR (-O0):
%struct.text_tag_list = type { i32 }
%struct.genlist = type { i32 }
define void @text_tag_list_shuffle(%struct.text_tag_list* %0) {
%2 = alloca %struct.text_tag_list*
store %struct.text_tag_list* %0, %struct.text_tag_list** %2
%3 = load %struct.text_tag_list*, %struct.text_tag_list** %2
%4 = bitcast %struct.text_tag_list* %3 to %struct.genlist*
%5 = call i32 @genlist_shuffle(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.text_tag_list = type { i32 }
%struct.genlist = type { i32 }
define void @text_tag_list_shuffle(%struct.text_tag_list* %0) {
%2 = bitcast %struct.text_tag_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_shuffle(%struct.genlist* %2)
ret void
}
/* Variables and functions */
int strcpy(char *dest, char *src) {
  while ((*dest++ = *src++) != '\0')
    ;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <strcpy+0x3f>
jmp    110c <strcpy+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i32 @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void *consume_bytes(void *buffer_ptr, void *target_ptr, int num_bytes) {
  memcpy(target_ptr, buffer_ptr, num_bytes);
  return buffer_ptr + num_bytes;
}


x86 assembly (clang, -O0):
<consume_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consume_bytes>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
call   1030 <memcpy@plt>
movslq %ebx,%rax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @consume_bytes(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr i8, i8* %11, i64 %13
ret i8* %14
}

LLVM IR (-O2):
define i8* @consume_bytes(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %1, i8* %0, i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr i8, i8* %0, i64 %5
ret i8* %6
}
/* Variables and functions */
char **get_memory(int);
int /*<<< orphan*/ print_array(char **, int);
int /*<<< orphan*/ sort_array(char **, int);
void main() {
  char **ptr = NULL;
  int num = 5;
  ptr = get_memory(num);
  print_array(ptr, num);
  sort_array(ptr, num);
  print_array(ptr, num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <get_memory@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <print_array@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <sort_array@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <print_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1040 <get_memory@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <sort_array@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
pop    %rbx
jmp    1030 <print_array@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i8**
%2 = alloca i32
store i8** null, i8*** %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = call i8** @get_memory(i32 %3)
store i8** %4, i8*** %1
%5 = load i8**, i8*** %1
%6 = load i32, i32* %2
%7 = call i32 @print_array(i8** %5, i32 %6)
%8 = load i8**, i8*** %1
%9 = load i32, i32* %2
%10 = call i32 @sort_array(i8** %8, i32 %9)
%11 = load i8**, i8*** %1
%12 = load i32, i32* %2
%13 = call i32 @print_array(i8** %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i8** @get_memory(i32 5)
%2 = tail call i32 @print_array(i8** %1, i32 5)
%3 = tail call i32 @sort_array(i8** %1, i32 5)
%4 = tail call i32 @print_array(i8** %1, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ switch_off_bits(unsigned char *, int);
void CTRL_REGSB_BITSET_ST_dactvt(unsigned char *data) {
  switch_off_bits(data, (0x20));
}


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

x86 assembly (clang, -O2):
<CTRL_REGSB_BITSET_ST_dactvt>:
mov    $0x20,%esi
jmp    1030 <switch_off_bits@plt>

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

LLVM IR (-O2):
define void @CTRL_REGSB_BITSET_ST_dactvt(i8* %0) {
%2 = tail call i32 @switch_off_bits(i8* %0, i32 32)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *strcpy(char *, char *);
char *ltrim(char *s) {
  char *p = s;
  while (isspace(*p))
    p++;
  return strcpy(s, p);
}


x86 assembly (clang, -O0):
<ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     115b <ltrim+0x3b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <ltrim+0x14>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    -0x1(%rdi),%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1040 <isspace@plt>
test   %rax,%rax
jne    1130 <ltrim+0x10>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @ltrim(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 = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call i64 @isspace(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = call i8* @strcpy(i8* %14, i8* %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @ltrim(i8* returned %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
%9 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* %3)
ret i8* %0
}
int is_digit(int c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <is_digit+0x20>
cmpl   $0x39,-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):
<is_digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
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 @is_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ a(int);
void b(int i) {
  if (i > 0) {
    a(i - 1);
  }
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1130 <b+0x20>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
test   %edi,%edi
jle    111c <b+0xc>
add    $0xffffffff,%edi
jmp    1030 <a@plt>
ret

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

LLVM IR (-O2):
define void @b(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @a(i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
void main() {
  int x = 0;
  int y = 50;
  while (x < 100) {
    if (x < 50) {
      x = x + 1;
    } else {
      x = x + 1;
      y = y + 1;
    }
  }
  __VERIFIER_assert(y == 100);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x32,-0x8(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    115f <main+0x4f>
cmpl   $0x32,-0x4(%rbp)
jge    1148 <main+0x38>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <main+0x4a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
cmpl   $0x64,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 1)
ret void
}
/* Variables and functions */
bool nrf91_errata_1(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf91_errata_1() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void write32(volatile void *addr, uint32_t value) {
  *((volatile uint32_t *)(addr)) = value;
}


x86 assembly (clang, -O0):
<write32>:
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):
<write32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @write32(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: timeout [-q] -- duration command [cmd args ...]\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"Usage: timeout [-q] -- duration command [cmd args ...]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"Usage: timeout [-q] -- duration command [cmd args ...]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ error_issue(int, char *, char const *);
void error_warning(const char *message) { error_issue(-1, "warning", message); }


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

x86 assembly (clang, -O2):
<error_warning>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0xffffffff,%edi
jmp    1030 <error_issue@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"warning\00"
define void @error_warning(i8* %0) {
%2 = tail call i32 @error_issue(i32 -1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int zeroize(int input) {
  if (input < 0)
    return 0;
  else
    return input;
}


x86 assembly (clang, -O0):
<zeroize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <zeroize+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1123 <zeroize+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroize>:
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @zeroize(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
ret i32 %3
}
void handle_57(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_57(i32 %0) {
ret void
}
/* Type definitions */
struct VariableShare {
  int dummy;
};

/* Variables and functions */
int DeleteVariable_Database(struct VariableShare *, unsigned int);
int RVS_RemoveVariable(struct VariableShare *vsh, unsigned int var_id) {
  return DeleteVariable_Database(vsh, var_id);
}


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

x86 assembly (clang, -O2):
<RVS_RemoveVariable>:
jmp    1030 <DeleteVariable_Database@plt>

LLVM IR (-O0):
%struct.VariableShare = type { i32 }
define i32 @RVS_RemoveVariable(%struct.VariableShare* %0, i32 %1) {
%3 = alloca %struct.VariableShare*
%4 = alloca i32
store %struct.VariableShare* %0, %struct.VariableShare** %3
store i32 %1, i32* %4
%5 = load %struct.VariableShare*, %struct.VariableShare** %3
%6 = load i32, i32* %4
%7 = call i32 @DeleteVariable_Database(%struct.VariableShare* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.VariableShare = type { i32 }
define i32 @RVS_RemoveVariable(%struct.VariableShare* %0, i32 %1) {
%3 = tail call i32 @DeleteVariable_Database(%struct.VariableShare* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ i2send(int);
void i2start(unsigned char adr) {
  int dat;
  dat = (adr << 1) | 0x100;
  i2send(dat);
}


x86 assembly (clang, -O0):
<i2start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
or     $0x100,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <i2send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2start>:
add    %edi,%edi
or     $0x100,%edi
jmp    1030 <i2send@plt>

LLVM IR (-O0):
define void @i2start(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = shl i32 %5, 1
%7 = or i32 %6, 256
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @i2send(i32 %8)
ret void
}

LLVM IR (-O2):
define void @i2start(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = shl nuw nsw i32 %2, 1
%4 = or i32 %3, 256
%5 = tail call i32 @i2send(i32 %4)
ret void
}
/* Variables and functions */
double days(int, int, int, double);
double days_(int *y0, int *m0, int *d0, double *h0) {
  return days(*y0, *m0, *d0, *h0);
}


x86 assembly (clang, -O0):
<days_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <days@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<days_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
movsd  (%rcx),%xmm0
jmp    1030 <days@plt>

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

LLVM IR (-O2):
define double @days_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, double* nocapture %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load double, double* %3
%9 = tail call double @days(i32 %5, i32 %6, i32 %7, double %8)
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int PTHREAD_CANCEL_ASYNCHRONOUS;
int /*<<< orphan*/ __libc_lseek(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ pthread_setcanceltype(int, int *);
off_t __attribute__((weak)) lseek(int fd, off_t offset, int whence) {
  off_t result;
  int oldtype;
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
  result = __libc_lseek(fd, offset, whence);
  pthread_setcanceltype(oldtype, NULL);
  return result;
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    -0x14(%rbp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <__libc_lseek@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_setcanceltype@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <__libc_lseek@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* %8)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @__libc_lseek(i32 %11, i32 %12, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @pthread_setcanceltype(i32 %15, i32* null)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%7 = call i32 @pthread_setcanceltype(i32 %6, i32* %4)
%8 = call i32 @__libc_lseek(i32 %0, i32 %1, i32 %2)
%9 = load i32, i32* %4
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* null)
ret i32 %8
}
void foo669(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo669(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ quote(char);
void op_squote() { quote('\''); }


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

x86 assembly (clang, -O2):
<op_squote>:
mov    $0x27,%edi
jmp    1030 <quote@plt>

LLVM IR (-O0):
define void @op_squote() {
%1 = call i32 @quote(i8 signext 39)
ret void
}

LLVM IR (-O2):
define void @op_squote() {
%1 = tail call i32 @quote(i8 signext 39)
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *compat_realloc(void *ptr, size_t size) {
  if (size == 0)
    size++;
  return realloc(ptr, size);
}


x86 assembly (clang, -O0):
<compat_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <compat_realloc+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compat_realloc>:
test   %rsi,%rsi
mov    $0x1,%eax
cmove  %rax,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @compat_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %4
%9 = add i64 %8, 1
store i64 %9, i64* %4
br label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i8* @realloc(i8* %11, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @compat_realloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = select i1 %3, i64 1, i64 %1
%5 = tail call i8* @realloc(i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int strcmp(char const *, char const *);
int _strcmp(const void *a, const void *b) {
  const char **str_a = (const char **)a;
  const char **str_b = (const char **)b;
  return strcmp(*str_a, *str_b);
}


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

x86 assembly (clang, -O2):
<_strcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @_strcmp(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 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_server_unref() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_server_unref"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_socket_server_unref\00"
define i32 @pa_socket_server_unref() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int ts72xx_model();
int board_is_ts7400(void) { return ts72xx_model() == 0x04; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ts72xx_model@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %eax,%eax
call   1030 <ts72xx_model@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @board_is_ts7400() {
%1 = call i32 (...) @ts72xx_model()
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @board_is_ts7400() {
%1 = tail call i32 (...) @ts72xx_model()
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ xusleep(struct timespec *);
void xusleep2(long usecs) {
  struct timespec ts = {
      .tv_sec = 0,
      .tv_nsec = usecs * 1000,
  };
  xusleep(&ts);
}


x86 assembly (clang, -O0):
<xusleep2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
imul   $0x3e8,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <xusleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xusleep2>:
sub    $0x18,%rsp
imul   $0x3e8,%rdi,%rax
mov    %rax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <xusleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
define void @xusleep2(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %2
%6 = mul nsw i64 %5, 1000
store i64 %6, i64* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 0, i32* %7
%8 = call i32 @xusleep(%struct.timespec* %3)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i32 }
define void @xusleep2(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%5 = mul nsw i64 %0, 1000
store i64 %5, i64* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 0, i32* %6
%7 = call i32 @xusleep(%struct.timespec* %2)
ret void
}
void clean(char vet[], int n) {
  int i;
  for (i = 0; i < n; i++)
    vet[i] = 0;
}


x86 assembly (clang, -O0):
<clean>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <clean+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clean+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean>:
test   %esi,%esi
jle    1122 <clean+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clean(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
void scale2x_generic_output(void *data, unsigned *out_width,
                            unsigned *out_height, unsigned width,
                            unsigned height) {
  *out_width = width * 2;
  *out_height = height * 2;
}


x86 assembly (clang, -O0):
<scale2x_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale2x_generic_output>:
add    %ecx,%ecx
mov    %ecx,(%rsi)
add    %r8d,%r8d
mov    %r8d,(%rdx)
ret

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

LLVM IR (-O2):
define void @scale2x_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = shl i32 %3, 1
store i32 %6, i32* %1
%7 = shl i32 %4, 1
store i32 %7, i32* %2
ret void
}
/* Variables and functions */
float _castu32_f32(unsigned int);
float test_castu32_f32(unsigned int __A) { return _castu32_f32(__A); }


x86 assembly (clang, -O0):
<test_castu32_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_castu32_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_castu32_f32>:
jmp    1030 <_castu32_f32@plt>

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

LLVM IR (-O2):
define float @test_castu32_f32(i32 %0) {
%2 = tail call float @_castu32_f32(i32 %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ bsp_led_toggle();
int /*<<< orphan*/ vTaskDelay(int);
void task_blink(void *pvParameters) {
  while (1) {
    bsp_led_toggle();
    vTaskDelay(100);
  }
}


x86 assembly (clang, -O0):
<task_blink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bsp_led_toggle@plt>
mov    $0x64,%edi
call   1040 <vTaskDelay@plt>
jmp    112c <task_blink+0xc>

x86 assembly (clang, -O2):
<task_blink>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <bsp_led_toggle@plt>
mov    $0x64,%edi
call   1040 <vTaskDelay@plt>
jmp    1130 <task_blink+0x10>

LLVM IR (-O0):
define void @task_blink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @bsp_led_toggle()
%5 = call i32 @vTaskDelay(i32 100)
br label %3
}

LLVM IR (-O2):
define void @task_blink(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @bsp_led_toggle()
%4 = tail call i32 @vTaskDelay(i32 100)
br label %2
}
int ABS(int Val) { return Val < 0 ? -Val : Val; }


x86 assembly (clang, -O0):
<ABS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <ABS+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <ABS+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ABS(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_group_endgroup();
void fgmvwrite_group_endgroup_() { gmvwrite_group_endgroup(); }


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_group_endgroup_() {
%1 = tail call i32 (...) @gmvwrite_group_endgroup()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t dummy() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dummy() {
ret i32 0
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t len = 0;
  for (const char *s = str; *s; s++)
    len += 1;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <strlen+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <strlen+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i64 [ 0, %1 ], [ %9, %6 ]
ret i64 %5
6: ; preds = %1, %6
%7 = phi i8* [ %10, %6 ], [ %0, %1 ]
%8 = phi i64 [ %9, %6 ], [ 0, %1 ]
%9 = add i64 %8, 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %6
}
/* Variables and functions */
int bridge_mpmd_wrapper(int, char **);
int main(int argc, char **argv) { return bridge_mpmd_wrapper(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <bridge_mpmd_wrapper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <bridge_mpmd_wrapper@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @bridge_mpmd_wrapper(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ wtime(double *);
double elapsed_time(void) {
  double t;
  wtime(&t);
  return (t);
}


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

x86 assembly (clang, -O2):
<elapsed_time>:
push   %rax
mov    %rsp,%rdi
call   1030 <wtime@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @elapsed_time() {
%1 = alloca double
%2 = call i32 @wtime(double* %1)
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @elapsed_time() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @wtime(double* %1)
%4 = load double, double* %1
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ getresuid(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *);
uid_t getuid(void) {
  uid_t uid;
  getresuid(&uid, NULL, NULL);
  return uid;
}


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

x86 assembly (clang, -O2):
<getuid>:
push   %rax
lea    0x4(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <getresuid@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getuid() {
%1 = alloca i32
%2 = call i32 @getresuid(i32* %1, i32* null, i32* null)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @getuid() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @getresuid(i32* %1, i32* null, i32* null)
%4 = load i32, i32* %1
ret i32 %4
}
int fun1028() { return 1028; }


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

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

LLVM IR (-O0):
define i32 @fun1028() {
ret i32 1028
}

LLVM IR (-O2):
define i32 @fun1028() {
ret i32 1028
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void pnstr(uint8_t *s, int c) {
  uint8_t string[132 + 1];
  if (c > 132)
    c = 132;
  strncpy((char *)string, (char *)s, c);
  string[c] = '\0';
  printf("%s", string);
}


x86 assembly (clang, -O0):
<pnstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x84,-0xc(%rbp)
jle    1146 <pnstr+0x26>
movl   $0x84,-0xc(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
movslq -0xc(%rbp),%rax
movb   $0x0,-0xa0(%rbp,%rax,1)
lea    -0xa0(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnstr>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rax
cmp    $0x84,%esi
mov    $0x84,%ebx
cmovl  %esi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movslq %ebx,%rax
movb   $0x0,(%rsp,%rax,1)
lea    0xea7(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @pnstr(i8* %0, i32 %1) {
%3 = alloca [133 x i8]
%4 = getelementptr inbounds [133 x i8], [133 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %1, 132
%6 = select i1 %5, i32 %1, i32 132
%7 = call i32 @strncpy(i8* %4, i8* %0, i32 %6)
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds [133 x i8], [133 x i8]* %3, i64 0, i64 %8
store i8 0, i8* %9
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
void defaultAckFunc(int err, int was) {}


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

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

LLVM IR (-O0):
define void @defaultAckFunc(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 @defaultAckFunc(i32 %0, i32 %1) {
ret void
}
int test_imm_A4uint8_mem(unsigned char *val) {
  return ((*val) & (-0xA4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A4uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 92
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int _isatty_r(void *unused, int fd) { return fd >= 0 && fd <= 2; }


x86 assembly (clang, -O0):
<_isatty_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     1124 <_isatty_r+0x24>
cmpl   $0x2,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isatty_r>:
xor    %eax,%eax
cmp    $0x3,%esi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @_isatty_r(i8* nocapture readnone %0, i32 %1) {
%3 = icmp ult i32 %1, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ prop_register_handlers();
int /*<<< orphan*/ prop_unregister_handlers();
void prop_update_registration() {
  prop_unregister_handlers();
  prop_register_handlers();
}


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

x86 assembly (clang, -O2):
<prop_update_registration>:
push   %rax
xor    %eax,%eax
call   1030 <prop_unregister_handlers@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <prop_register_handlers@plt>

LLVM IR (-O0):
define void @prop_update_registration() {
%1 = call i32 (...) @prop_unregister_handlers()
%2 = call i32 (...) @prop_register_handlers()
ret void
}

LLVM IR (-O2):
define void @prop_update_registration() {
%1 = tail call i32 (...) @prop_unregister_handlers()
%2 = tail call i32 (...) @prop_register_handlers()
ret void
}