xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char *);
int check_if_trace(char *cmd) {
  char *first = strtok(cmd, " ");
  return strcmp(first, "trace") == 0;
}


x86 assembly (clang, -O0):
<check_if_trace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if_trace>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strtok@plt>
lea    0xece(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [6 x i8] c"trace\00"
define i32 @check_if_trace(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [6 x i8] c"trace\00"
define i32 @check_if_trace(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ put_nibbles(char *, unsigned int, int);
void put_xnum(char **p, unsigned short num) {
  put_nibbles(*p, (unsigned int)num, 4);
  *p += 4;
}


x86 assembly (clang, -O0):
<put_xnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
movzwl -0xa(%rbp),%esi
mov    $0x4,%edx
call   1030 <put_nibbles@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_xnum>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x4,%edx
call   1030 <put_nibbles@plt>
addq   $0x4,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @put_xnum(i8** %0, i16 zeroext %1) {
%3 = alloca i8**
%4 = alloca i16
store i8** %0, i8*** %3
store i16 %1, i16* %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = call i32 @put_nibbles(i8* %6, i32 %8, i32 4)
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 4
store i8* %12, i8** %10
ret void
}

LLVM IR (-O2):
define void @put_xnum(i8** nocapture %0, i16 zeroext %1) {
%3 = load i8*, i8** %0
%4 = zext i16 %1 to i32
%5 = tail call i32 @put_nibbles(i8* %3, i32 %4, i32 4)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 4
store i8* %7, i8** %0
ret void
}
int LexIsEOF(char c) { return (c == '\0' ? 1 : 0); }


x86 assembly (clang, -O0):
<LexIsEOF>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LexIsEOF>:
xor    %eax,%eax
test   %dil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @LexIsEOF(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @LexIsEOF(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void miniz_def_free_func(void *opaque, void *address) {
  (void)opaque, (void)address;
  (void)address, ((void)0);
}


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

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

LLVM IR (-O0):
define void @miniz_def_free_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 = load i8*, i8** %4
%7 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @miniz_def_free_func(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core_cleanup();
int /*<<< orphan*/ core_init();
int /*<<< orphan*/ core_main();
int main(void) {
  core_init();
  core_main();
  core_cleanup();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @core_init()
%2 = tail call i32 (...) @core_main()
%3 = tail call i32 (...) @core_cleanup()
ret i32 0
}
void switcher(long a, long b, long c, long *dest) {
  long val;
  switch (a) {
  case 5:
    c = b ^ 15;
  case 0:
    val = c + 112;
    break;
  case 2:
  case 7:
    val = (b + c) << 2;
    break;
  case 4:
    val = a;
    break;
  default:
    val = b;
  }
  *dest = val;
}


x86 assembly (clang, -O0):
<switcher>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
sub    $0x7,%rax
ja     1179 <switcher+0x79>
mov    -0x30(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
xor    $0xf,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x70,%rax
mov    %rax,-0x28(%rbp)
jmp    1181 <switcher+0x81>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    1181 <switcher+0x81>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1181 <switcher+0x81>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<switcher>:
cmp    $0x7,%rdi
ja     1121 <switcher+0x21>
lea    0xef3(%rip),%r8
movslq (%r8,%rdi,4),%rax
add    %r8,%rax
jmp    *%rax
add    %rsi,%rdx
shl    $0x2,%rdx
mov    %rdx,(%rcx)
ret
mov    %rsi,%rdi
mov    %rdi,(%rcx)
ret
xor    $0xf,%rsi
mov    %rsi,%rdx
add    $0x70,%rdx
mov    %rdx,(%rcx)
ret

LLVM IR (-O0):
define void @switcher(i64 %0, i64 %1, i64 %2, i64* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64*
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64* %3, i64** %8
%10 = load i64, i64* %5
switch i64 %10, label %24 [
i64 5, label %11
i64 0, label %14
i64 2, label %17
i64 7, label %17
i64 4, label %22
]
11: ; preds = %4
%12 = load i64, i64* %6
%13 = xor i64 %12, 15
store i64 %13, i64* %7
br label %14
14: ; preds = %4, %11
%15 = load i64, i64* %7
%16 = add nsw i64 %15, 112
store i64 %16, i64* %9
br label %26
17: ; preds = %4, %4
%18 = load i64, i64* %6
%19 = load i64, i64* %7
%20 = add nsw i64 %18, %19
%21 = shl i64 %20, 2
store i64 %21, i64* %9
br label %26
22: ; preds = %4
%23 = load i64, i64* %5
store i64 %23, i64* %9
br label %26
24: ; preds = %4
%25 = load i64, i64* %6
store i64 %25, i64* %9
br label %26
26: ; preds = %24, %22, %17, %14
%27 = load i64, i64* %9
%28 = load i64*, i64** %8
store i64 %27, i64* %28
ret void
}

LLVM IR (-O2):
define void @switcher(i64 %0, i64 %1, i64 %2, i64* nocapture writeonly %3) {
switch i64 %0, label %13 [
i64 5, label %5
i64 0, label %7
i64 2, label %10
i64 7, label %10
i64 4, label %14
]
5: ; preds = %4
%6 = xor i64 %1, 15
br label %7
7: ; preds = %4, %5
%8 = phi i64 [ %2, %4 ], [ %6, %5 ]
%9 = add nsw i64 %8, 112
br label %14
10: ; preds = %4, %4
%11 = add nsw i64 %2, %1
%12 = shl i64 %11, 2
br label %14
13: ; preds = %4
br label %14
14: ; preds = %4, %13, %10, %7
%15 = phi i64 [ %1, %13 ], [ %12, %10 ], [ %9, %7 ], [ %0, %4 ]
store i64 %15, i64* %3
ret void
}
/* Variables and functions */
int other();
int stubfn() { return other(); }


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

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

LLVM IR (-O0):
define i32 @stubfn() {
%1 = call i32 (...) @other()
ret i32 %1
}

LLVM IR (-O2):
define i32 @stubfn() {
%1 = tail call i32 (...) @other()
ret i32 %1
}
void Mzero() {}


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

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

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

LLVM IR (-O2):
define void @Mzero() {
ret void
}
/* Type definitions */
struct expression {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ extract_plural_expression(char const *,
                                             struct expression const **,
                                             unsigned long *);
unsigned long int get_plural_count(const char *header) {
  const struct expression *plural;
  unsigned long int nplurals;
  extract_plural_expression(header, &plural, &nplurals);
  return nplurals;
}


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

x86 assembly (clang, -O2):
<get_plural_count>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <extract_plural_expression@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.expression = type { i32 }
define i64 @get_plural_count(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.expression*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @extract_plural_expression(i8* %5, %struct.expression** %3, i64* %4)
%7 = load i64, i64* %4
ret i64 %7
}

LLVM IR (-O2):
%struct.expression = type { i32 }
define i64 @get_plural_count(i8* %0) {
%2 = alloca %struct.expression*
%3 = alloca i64
%4 = bitcast %struct.expression** %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i32 @extract_plural_expression(i8* %0, %struct.expression** %2, i64* %3)
%7 = load i64, i64* %3
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ local_mcu_Pin0_clear__E();
void pollen_parts_Led0_off__E() {
  { local_mcu_Pin0_clear__E(); }
}


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

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

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

LLVM IR (-O2):
define void @pollen_parts_Led0_off__E() {
%1 = tail call i32 (...) @local_mcu_Pin0_clear__E()
ret void
}
int mlist_length(void **p) {
  int n;
  for (n = 0; p; p = *p, n++)
    ;
  return n;
}


x86 assembly (clang, -O0):
<mlist_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <mlist_length+0x38>
jmp    111f <mlist_length+0x1f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mlist_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlist_length>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <mlist_length+0x1b>
nopw   0x0(%rax,%rax,1)
mov    (%rdi),%rdi
add    $0x1,%eax
test   %rdi,%rdi
jne    1110 <mlist_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @mlist_length(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i8** [ %7, %3 ], [ %0, %1 ]
%6 = bitcast i8** %5 to i8***
%7 = load i8**, i8*** %6
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i8** %7, null
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
void *xmalloc(bytes)
int bytes;
{
  void *temp = malloc(bytes);
  if (!temp)
    memory_error_and_abort("xmalloc");
  return (temp);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <xmalloc+0x31>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <memory_error_and_abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
movslq %edi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xmalloc+0x1f>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <memory_error_and_abort@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"xmalloc\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @memory_error_and_abort to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"xmalloc\00"
define i8* @xmalloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @memory_error_and_abort to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_read_basic(void *m, char type, void *p) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_read_basic>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec5(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_read_basic>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_read_basic(i8* %0, i8 signext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_read_basic(i8* nocapture readnone %0, i8 signext %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
int f2(char *x, char p) {
  char *q = x;
  while (*q < p && *q != '\0') {
    q++;
  }
  return q - x;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
jge    113e <f2+0x3e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114e <f2+0x4e>
jmp    115f <f2+0x5f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <f2+0x16>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
add    $0x1,%eax
cmp    %sil,%cl
jge    1123 <f2+0x23>
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <f2+0x10>
ret

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

LLVM IR (-O2):
define i32 @f2(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp sge i8 %5, %1
%7 = icmp eq i8 %5, 0
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = ptrtoint i8* %4 to i64
%12 = ptrtoint i8* %0 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ sd_get_seats();
void call_sd_get_seats(void) { sd_get_seats(); }


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

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

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

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

/* Variables and functions */
const uint8_t *skip_varint(const uint8_t *buffer, const uint8_t *buffer_end) {
  while (1) {
    if (buffer >= buffer_end)
      return NULL;
    if ((*buffer++) >> 7 == 0)
      break;
  }
  return buffer;
}


x86 assembly (clang, -O0):
<skip_varint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1127 <skip_varint+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1156 <skip_varint+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
sar    $0x7,%eax
cmp    $0x0,%eax
jne    1149 <skip_varint+0x49>
jmp    114e <skip_varint+0x4e>
jmp    110c <skip_varint+0xc>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_varint>:
cmp    %rsi,%rdi
jae    1112 <skip_varint+0x12>
lea    0x4(%rdi),%rax
cmpl   $0x7f,(%rdi)
mov    %rax,%rdi
ja     1100 <skip_varint>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32* @skip_varint(i32* %0, i32* readnone %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i32* [ %0, %2 ], [ %7, %6 ]
%5 = icmp ult i32* %4, %1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds i32, i32* %4, i64 1
%8 = load i32, i32* %4
%9 = icmp ult i32 %8, 128
br i1 %9, label %10, label %3
10: ; preds = %6, %3
%11 = phi i32* [ null, %3 ], [ %7, %6 ]
ret i32* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int x = 0;
  printf("%d", x);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int __tzcnt_u16(int /*<<< orphan*/);
int /*<<< orphan*/ link_error();
int main() {
  if (__tzcnt_u16(0) != 16)
    link_error();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <__tzcnt_u16@plt>
cmp    $0x10,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1040 <link_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <__tzcnt_u16@plt>
cmp    $0x10,%eax
je     1134 <main+0x14>
xor    %eax,%eax
call   1040 <link_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @__tzcnt_u16(i32 0)
%3 = icmp ne i32 %2, 16
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @link_error()
br label %6
6: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__tzcnt_u16(i32 0)
%2 = icmp eq i32 %1, 16
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @link_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Type definitions */
struct udev_queue_export {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void udev_queue_export_cleanup(struct udev_queue_export *udev_queue_export) {
  if (udev_queue_export == NULL)
    return;
  unlink("/run/udev/queue.tmp");
  unlink("/run/udev/queue.bin");
}


x86 assembly (clang, -O0):
<udev_queue_export_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <udev_queue_export_cleanup+0x1c>
jmp    1144 <udev_queue_export_cleanup+0x34>
lea    0xecd(%rip),%rdi
call   1030 <unlink@plt>
lea    0xed5(%rip),%rdi
call   1030 <unlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udev_queue_export_cleanup>:
test   %rdi,%rdi
je     112f <udev_queue_export_cleanup+0x1f>
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <unlink@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <unlink@plt>
ret

LLVM IR (-O0):
%struct.udev_queue_export = type { i32 }
@.str = [20 x i8] c"/run/udev/queue.tmp\00"
@.str.1 = [20 x i8] c"/run/udev/queue.bin\00"
define void @udev_queue_export_cleanup(%struct.udev_queue_export* %0) {
%2 = alloca %struct.udev_queue_export*
store %struct.udev_queue_export* %0, %struct.udev_queue_export** %2
%3 = load %struct.udev_queue_export*, %struct.udev_queue_export** %2
%4 = icmp eq %struct.udev_queue_export* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = call i32 @unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.udev_queue_export = type { i32 }
@.str = [20 x i8] c"/run/udev/queue.tmp\00"
@.str.1 = [20 x i8] c"/run/udev/queue.bin\00"
define void @udev_queue_export_cleanup(%struct.udev_queue_export* readnone %0) {
%2 = icmp eq %struct.udev_queue_export* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %1, %3
ret void
}
const char *rcsid(const char *p) {
  return rcsid(
      p = "@(#)$File: compress.c,v 1.57 2008/07/16 18:00:57 christos Exp $");
}


x86 assembly (clang, -O0):
<rcsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <rcsid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcsid>:
jmp    1100 <rcsid>

LLVM IR (-O0):
@.str = [64 x i8] c"@(#)$File: compress.c,v 1.57 2008/07/16 18:00:57 christos Exp $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int main() {
  while (1 > 0) {
    continue;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
double rull(unsigned long long a, double secs) { return (double)a / secs; }


x86 assembly (clang, -O0):
<rull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movaps 0xeec(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xeeb(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rull>:
movq   %rdi,%xmm2
punpckldq 0xef3(%rip),%xmm2
subpd  0xefb(%rip),%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @rull(i64 %0, double %1) {
%3 = alloca i64
%4 = alloca double
store i64 %0, i64* %3
store double %1, double* %4
%5 = load i64, i64* %3
%6 = uitofp i64 %5 to double
%7 = load double, double* %4
%8 = fdiv double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @rull(i64 %0, double %1) {
%3 = uitofp i64 %0 to double
%4 = fdiv double %3, %1
ret double %4
}
void G_LevelGarbageCollect(void) {}


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

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

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

LLVM IR (-O2):
define void @G_LevelGarbageCollect() {
ret void
}
/* Variables and functions */
double sin(double);
double iw_sinc(double x) {
  if (x <= 0.000000005)
    return 1.0;
  return sin(3.14159265358979323846 * x) / (3.14159265358979323846 * x);
}


x86 assembly (clang, -O0):
<iw_sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1142 <iw_sinc+0x32>
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116a <iw_sinc+0x5a>
movsd  0xebe(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  0xeac(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_sinc>:
push   %rax
movsd  0xeef(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1138 <iw_sinc+0x28>
mulsd  0xee9(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xec0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @iw_sinc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 5.000000e-09
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %14
7: ; preds = %1
%8 = load double, double* %3
%9 = fmul double 0x400921FB54442D18, %8
%10 = call double @sin(double %9)
%11 = load double, double* %3
%12 = fmul double 0x400921FB54442D18, %11
%13 = fdiv double %10, %12
store double %13, double* %2
br label %14
14: ; preds = %7, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @iw_sinc(double %0) {
%2 = fcmp ugt double %0, 5.000000e-09
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fmul double %0, 0x400921FB54442D18
%5 = tail call double @sin(double %4)
%6 = fdiv double %5, %4
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 1.000000e+00, %1 ]
ret double %8
}
int fn8(int a, int b) {
  int tem1 = b ^ a;
  int tem2 = b & a;
  return tem1 + tem2;
}


x86 assembly (clang, -O0):
<fn8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn8>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = xor i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = and i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn8(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
void slipdev_char_put() {}


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

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

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

LLVM IR (-O2):
define void @slipdev_char_put() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max(float, float);
float min(int /*<<< orphan*/, float);
float fclamp(float val, float fmin, float fmax) {
  return min(max(val, fmin), fmax);
}


x86 assembly (clang, -O0):
<fclamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <max@plt>
mov    %eax,%edi
movss  -0xc(%rbp),%xmm0
call   1030 <min@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclamp>:
push   %rax
movss  %xmm2,0x4(%rsp)
call   1040 <max@plt>
mov    %eax,%edi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <min@plt>

LLVM IR (-O0):
define float @fclamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = call i32 @max(float %7, float %8)
%10 = load float, float* %6
%11 = call float @min(i32 %9, float %10)
ret float %11
}

LLVM IR (-O2):
define float @fclamp(float %0, float %1, float %2) {
%4 = tail call i32 @max(float %0, float %1)
%5 = tail call float @min(i32 %4, float %2)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ dhcp6_sendmessage(void *, void (*)(void *));
void dhcp6_senddiscover(void *arg) {
  dhcp6_sendmessage(arg, dhcp6_senddiscover);
}


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

x86 assembly (clang, -O2):
<dhcp6_senddiscover>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <dhcp6_sendmessage@plt>

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

LLVM IR (-O2):
define void @dhcp6_senddiscover(i8* %0) {
%2 = tail call i32 @dhcp6_sendmessage(i8* %0, void (i8*)* @dhcp6_senddiscover)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x = 10;
  int y = 99;
  printf("x = %d, y = %d\n", x, y);
  do {
    x = x + y;
    y = x - y;
    x = x - y;
  } while (0);
  printf("x = %d, y = %d\n", x, y);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"x = %d, y = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10, i32 99)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 99, i32 10)
ret i32 0
}
void nand_deselect(void) {
  (*((volatile unsigned long *)0x70200004)) |= (1 << 1);
}


x86 assembly (clang, -O0):
<nand_deselect>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70200004,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0x70200004,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_deselect>:
orq    $0x2,0x70200004
70 02
ret

LLVM IR (-O0):
define void @nand_deselect() {
%1 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1881145348 to i64*)
ret void
}

LLVM IR (-O2):
define void @nand_deselect() {
%1 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1881145348 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void test() {
  typedef signed long int ssize_t;
  printf("%f", (ssize_t)42);
}


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

x86 assembly (clang, -O2):
<test>:
lea    0xee9(%rip),%rdi
mov    $0x2a,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 42)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @test() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 42)
ret void
}
int __attribute__((always_))
trace_printf(const char *format __attribute__((unused)), ...) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @trace_printf(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void msleep(int ms) { udelay(ms * 1000); }


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

x86 assembly (clang, -O2):
<msleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <udelay@plt>

LLVM IR (-O0):
define void @msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @udelay(i32 %4)
ret void
}

LLVM IR (-O2):
define void @msleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @udelay(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printPtr(int *ptr) { printf("%d\n", *ptr); }


x86 assembly (clang, -O0):
<printPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPtr>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printPtr(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
double sin(double);
double func1(double *X0, double *X, void (*vofx)(double *, double *)) {
  double V[(4)];
  vofx(X, V);
  return (sin(V[2]));
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   *%rax
movsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
sub    $0x28,%rsp
mov    %rsi,%rdi
mov    %rsp,%rsi
call   *%rdx
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @func1(double* %0, double* %1, void (double*, double*)* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca void (double*, double*)*
%7 = alloca [4 x double]
store double* %0, double** %4
store double* %1, double** %5
store void (double*, double*)* %2, void (double*, double*)** %6
%8 = load void (double*, double*)*, void (double*, double*)** %6
%9 = load double*, double** %5
%10 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%11 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 2
%12 = load double, double* %11
%13 = call double @sin(double %12)
ret double %13
}

LLVM IR (-O2):
define double @func1(double* nocapture readnone %0, double* %1, void (double*, double*)* nocapture %2) {
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %4 to i8*
%6 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%7 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%8 = load double, double* %7
%9 = call double @sin(double %8)
ret double %9
}
/* Type definitions */
typedef int u_int;
typedef int u_char;

/* Variables and functions */
int test_channelmap(u_int nr, u_char *map) {
  if (nr <= 127)
    return map[nr >> 3] & (1 << (nr & 7));
  else
    return 0;
}


x86 assembly (clang, -O0):
<test_channelmap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jg     113e <test_channelmap+0x3e>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <test_channelmap+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_channelmap>:
xor    %eax,%eax
cmp    $0x7f,%edi
jg     111f <test_channelmap+0x1f>
mov    %edi,%edx
and    $0x7,%dil
mov    $0x1,%eax
mov    %edi,%ecx
shl    %cl,%eax
sar    $0x3,%edx
movslq %edx,%rcx
and    (%rsi,%rcx,4),%eax
ret

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

LLVM IR (-O2):
define i32 @test_channelmap(i32 %0, i32* nocapture %1) {
%3 = icmp slt i32 %0, 128
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = ashr i32 %0, 3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = and i32 %0, 7
%10 = shl nuw nsw i32 1, %9
%11 = and i32 %8, %10
br label %12
12: ; preds = %2, %4
%13 = phi i32 [ %11, %4 ], [ 0, %2 ]
ret i32 %13
}
void databaseNonAccess() {}


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

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

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

LLVM IR (-O2):
define void @databaseNonAccess() {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ lstat(char const *, struct stat *);
int rec_delete_file(char const *, struct stat *);
int delete_file(const char *path) {
  struct stat b;
  if (lstat(path, &b)) {
    return -1;
  }
  return rec_delete_file(path, &b);
}


x86 assembly (clang, -O0):
<delete_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0x0,%rax
je     114f <delete_file+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <delete_file+0x3f>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <rec_delete_file@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_file>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <lstat@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    114c <delete_file+0x2c>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <rec_delete_file@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @delete_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @rec_delete_file(i8* %0, %struct.stat* %2)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void FanIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  ;
  ;
  IntRegister(130, pfnHandler);
  IntEnable(130);
}


x86 assembly (clang, -O0):
<FanIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x82,%edi
call   1040 <IntRegister@plt>
mov    $0x82,%edi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanIntRegister>:
push   %rax
mov    $0x82,%edi
call   1040 <IntRegister@plt>
mov    $0x82,%edi
pop    %rax
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @FanIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%5 = load void ()*, void ()** %4
%6 = bitcast void ()* %5 to void (...)*
%7 = call i32 @IntRegister(i32 130, void (...)* %6)
%8 = call i32 @IntEnable(i32 130)
ret void
}

LLVM IR (-O2):
define void @FanIntRegister(i64 %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @IntRegister(i32 130, void (...)* %3)
%5 = tail call i32 @IntEnable(i32 130)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("Usage: %s ROM\n", argv[0]);
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1156 <main+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
je     1129 <main+0x19>
push   %rax
mov    (%rsi),%rsi
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Usage: %s ROM\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %2, %4
ret i32 0
}