xunge/DecIR huggingface dataset:
/* Variables and functions */
void *sbrk(unsigned int);
extern void *malloc(unsigned int len_) { return sbrk(len_); }


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

x86 assembly (clang, -O2):
<malloc>:
jmp    1030 <sbrk@plt>

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

LLVM IR (-O2):
define i8* @malloc(i32 %0) {
%2 = tail call i8* @sbrk(i32 %0)
ret i8* %2
}
/* Variables and functions */
int partition(int *, int, int);
void quicksort(int s[], int l, int h) {
  int p;
  if ((h - l) > 0) {
    p = partition(s, l, h);
    quicksort(s, l, p - 1);
    quicksort(s, p + 1, h);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x0,%eax
jle    1177 <quicksort+0x57>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edx
jle    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  printf("Type int has a size of %u bytes\n", sizeof(int));
  printf("Type char has a size of %u bytes\n", sizeof(char));
  printf("Type long has a size of %u bytes.\n", sizeof(long));
  printf("Type double has a size of %u bytes.\n", sizeof(double));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"Type int has a size of %u bytes\0A\00"
@.str.1 = [34 x i8] c"Type char has a size of %u bytes\0A\00"
@.str.2 = [35 x i8] c"Type long has a size of %u bytes.\0A\00"
@.str.3 = [37 x i8] c"Type double has a size of %u bytes.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 1)
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 8)
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Type int has a size of %u bytes\0A\00"
@.str.1 = [34 x i8] c"Type char has a size of %u bytes\0A\00"
@.str.2 = [35 x i8] c"Type long has a size of %u bytes.\0A\00"
@.str.3 = [37 x i8] c"Type double has a size of %u bytes.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 8)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, int, int);
int integers_not_equal_display_error(int left, int right) {
  const int not_equal = left != right;
  if (!not_equal) {
    print_error("%d == %d\n", left, right);
  }
  return not_equal;
}


x86 assembly (clang, -O0):
<integers_not_equal_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114b <integers_not_equal_display_error+0x3b>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
call   1030 <print_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integers_not_equal_display_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cmp    %esi,%edi
jne    112b <integers_not_equal_display_error+0x1b>
lea    0xede(%rip),%rdi
mov    %ebp,%esi
mov    %ebp,%edx
call   1030 <print_error@plt>
xor    %eax,%eax
cmp    %ebx,%ebp
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d == %d\0A\00"
define i32 @integers_not_equal_display_error(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @print_error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %0)
br label %6
6: ; preds = %4, %2
%7 = zext i1 %3 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_nswap32p(int /*<<< orphan*/ *, int /*<<< orphan*/);
void le32_to_cpup(uint32_t *outp, uint32_t in) { cpu_nswap32p(outp, in); }


x86 assembly (clang, -O0):
<le32_to_cpup>:
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 <cpu_nswap32p@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le32_to_cpup>:
jmp    1030 <cpu_nswap32p@plt>

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

LLVM IR (-O2):
define void @le32_to_cpup(i32* %0, i32 %1) {
%3 = tail call i32 @cpu_nswap32p(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
char *btp_skip_non_whitespace(const char *s) {
  while (*s && !isspace(*s))
    ++s;
  return (char *)s;
}


x86 assembly (clang, -O0):
<btp_skip_non_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <btp_skip_non_whitespace+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <btp_skip_non_whitespace+0x48>
jmp    1169 <btp_skip_non_whitespace+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <btp_skip_non_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btp_skip_non_whitespace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <btp_skip_non_whitespace+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <btp_skip_non_whitespace+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <btp_skip_non_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @btp_skip_non_whitespace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Type definitions */
struct gbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
size_t gbuf_lsize(struct gbuf const *);
size_t gbuf_rsize(struct gbuf const *);
size_t gbuf_size(struct gbuf const *buf) {
  assert(buf != NULL);
  return gbuf_lsize(buf) + gbuf_rsize(buf);
}


x86 assembly (clang, -O0):
<gbuf_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <gbuf_lsize@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gbuf_rsize@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gbuf_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <gbuf_lsize@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <gbuf_rsize@plt>
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.gbuf = type { i32 }
define i64 @gbuf_size(%struct.gbuf* %0) {
%2 = alloca %struct.gbuf*
store %struct.gbuf* %0, %struct.gbuf** %2
%3 = load %struct.gbuf*, %struct.gbuf** %2
%4 = icmp ne %struct.gbuf* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.gbuf*, %struct.gbuf** %2
%8 = call i64 @gbuf_lsize(%struct.gbuf* %7)
%9 = load %struct.gbuf*, %struct.gbuf** %2
%10 = call i64 @gbuf_rsize(%struct.gbuf* %9)
%11 = add i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.gbuf = type { i32 }
define i64 @gbuf_size(%struct.gbuf* %0) {
%2 = icmp ne %struct.gbuf* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @gbuf_lsize(%struct.gbuf* %0)
%6 = tail call i64 @gbuf_rsize(%struct.gbuf* %0)
%7 = add i64 %6, %5
ret i64 %7
}
void put32bits(unsigned char *p, unsigned int v) {
  p[0] = v >> 24;
  p[1] = (unsigned char)(v >> 16);
  p[2] = (unsigned char)(v >> 8);
  p[3] = (unsigned char)v;
}


x86 assembly (clang, -O0):
<put32bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @put32bits(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 = lshr i32 %5, 24
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 16
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i32, i32* %4
%16 = lshr i32 %15, 8
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
%20 = load i32, i32* %4
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @put32bits(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
void UIRQ(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<UIRQ>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UIRQ+0x9>
jmp    1109 <UIRQ+0x9>

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

LLVM IR (-O0):
define void @UIRQ() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UIRQ() {
br label %1
1: ; preds = %0, %1
br label %1
}
int LeapYear(year)
int year;
{
  if ((year % 100 == 0) && (year % 400 != 0))
    return (0);
  else if (year % 4 == 0)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<LeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113b <LeapYear+0x3b>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     113b <LeapYear+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1162 <LeapYear+0x62>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115b <LeapYear+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <LeapYear+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeapYear>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x2,%ecx
cmp    $0x28f5c29,%ecx
setae  %cl
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
setb   %al
or     %cl,%al
test   $0x3,%dil
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @LeapYear(i32 %0) {
%2 = srem i32 %0, 100
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 400
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
%7 = and i32 %0, 3
%8 = icmp eq i32 %7, 0
%9 = and i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char beep = '\007';
  char ch_beep = 7;
  printf("%c \n", beep);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%c \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 7)
ret i32 0
}
const char *getSpec(void) { return "typ_spec { name=typ_IfsType; }"; }


x86 assembly (clang, -O0):
<getSpec>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"typ_spec { name=typ_IfsType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [31 x i8] c"typ_spec { name=typ_IfsType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void func7() {
  print(
      "to avoid laser react\n immediately, give time \nexit,from laser range");
}


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

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

LLVM IR (-O0):
@.str = [68 x i8] c"to avoid laser react\0A immediately, give time \0Aexit,from laser range\00"
define void @func7() {
%1 = call i32 @print(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [68 x i8] c"to avoid laser react\0A immediately, give time \0Aexit,from laser range\00"
define void @func7() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tgl_message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tgls_free_message(void *, struct tgl_message *);
void tgls_free_message_gw(struct tgl_message *M, void *TLS) {
  tgls_free_message(TLS, M);
}


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

x86 assembly (clang, -O2):
<tgls_free_message_gw>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <tgls_free_message@plt>

LLVM IR (-O0):
%struct.tgl_message = type { i32 }
define void @tgls_free_message_gw(%struct.tgl_message* %0, i8* %1) {
%3 = alloca %struct.tgl_message*
%4 = alloca i8*
store %struct.tgl_message* %0, %struct.tgl_message** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load %struct.tgl_message*, %struct.tgl_message** %3
%7 = call i32 @tgls_free_message(i8* %5, %struct.tgl_message* %6)
ret void
}

LLVM IR (-O2):
%struct.tgl_message = type { i32 }
define void @tgls_free_message_gw(%struct.tgl_message* %0, i8* %1) {
%3 = tail call i32 @tgls_free_message(i8* %1, %struct.tgl_message* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, int);
char *yyBEGIN(char *);
int /*<<< orphan*/ yyEND(char const *);
void s_space(int n) {
  do {
    const char *yytag = yyBEGIN("LI");
    print("space %d", n);
    yyEND(yytag);
  } while (0);
}


x86 assembly (clang, -O0):
<s_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1050 <yyBEGIN@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1040 <print@plt>
mov    -0x10(%rbp),%rdi
call   1030 <yyEND@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_space>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xec4(%rip),%rdi
call   1050 <yyBEGIN@plt>
mov    %rax,%rbx
lea    0xeb8(%rip),%rdi
mov    %ebp,%esi
call   1040 <print@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <yyEND@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"LI\00"
@.str.1 = [9 x i8] c"space %d\00"
define void @s_space(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
br label %4
4: ; preds = %1
%5 = call i8* @yyBEGIN(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @yyEND(i8* %8)
br label %10
10: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"LI\00"
@.str.1 = [9 x i8] c"space %d\00"
define void @s_space(i32 %0) {
%2 = tail call i8* @yyBEGIN(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%4 = tail call i32 @yyEND(i8* %2)
ret void
}
/* Variables and functions */
long strtol(char const *, char **, int);
int parsemaxwrks(const char *s) {
  long l;
  char *e;
  l = strtol(s, &e, 10);
  if (e[0]) {
    return -1;
  }
  return (int)l;
}


x86 assembly (clang, -O0):
<parsemaxwrks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <parsemaxwrks+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <parsemaxwrks+0x42>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsemaxwrks>:
push   %rax
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    (%rsp),%rcx
xor    %edx,%edx
cmp    (%rcx),%dl
sbb    %ecx,%ecx
or     %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @parsemaxwrks(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = trunc i64 %4 to i32
%9 = select i1 %7, i32 %8, i32 -1
ret i32 %9
}
/* Variables and functions */
unsigned short inw(unsigned short *);
int /*<<< orphan*/ outw(unsigned short, unsigned short *);
unsigned short lcd_hpi_read_word(unsigned short chip_addr) {
  unsigned short value;
  outw(chip_addr, (unsigned short *)((0x0002 << 1) + 0xfff24000));
  value = inw((unsigned short *)((0x0000 << 1) + 0xfff24000));
  return (value);
}


x86 assembly (clang, -O0):
<lcd_hpi_read_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xfff24004,%esi
movzwl -0x2(%rbp),%edi
call   1040 <outw@plt>
mov    $0xfff24000,%edi
call   1030 <inw@plt>
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_hpi_read_word>:
push   %rax
mov    $0xfff24000,%eax
lea    0x4(%rax),%rsi
call   1040 <outw@plt>
mov    $0xfff24000,%edi
pop    %rax
jmp    1030 <inw@plt>

LLVM IR (-O0):
define zeroext i16 @lcd_hpi_read_word(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 @outw(i16 zeroext %4, i16* inttoptr (i64 4294066180 to i16*))
%6 = call zeroext i16 @inw(i16* inttoptr (i64 4294066176 to i16*))
store i16 %6, i16* %3
%7 = load i16, i16* %3
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @lcd_hpi_read_word(i16 zeroext %0) {
%2 = tail call i32 @outw(i16 zeroext %0, i16* inttoptr (i64 4294066180 to i16*))
%3 = tail call zeroext i16 @inw(i16* inttoptr (i64 4294066176 to i16*))
ret i16 %3
}
void update_transports(void) {}


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

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

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

LLVM IR (-O2):
define void @update_transports() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int get_des_char(FILE *fp) { return (getc(fp)); }


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

x86 assembly (clang, -O2):
<get_des_char>:
jmp    1030 <getc@plt>

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

LLVM IR (-O2):
define i32 @get_des_char(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Lcd_Cmd(int);
Lcd_Clear() {
  Lcd_Cmd(0);
  Lcd_Cmd(1);
}


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

x86 assembly (clang, -O2):
<Lcd_Clear>:
push   %rax
xor    %edi,%edi
call   1030 <Lcd_Cmd@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <Lcd_Cmd@plt>

LLVM IR (-O0):
define i32 @Lcd_Clear() {
%1 = alloca i32
%2 = call i32 @Lcd_Cmd(i32 0)
%3 = call i32 @Lcd_Cmd(i32 1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @Lcd_Clear() {
%1 = tail call i32 @Lcd_Cmd(i32 0)
%2 = tail call i32 @Lcd_Cmd(i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Writen(int, void const *, size_t);
void Pack(const void *p, size_t len, int fd) {
  Writen(fd, &len, sizeof(int));
  Writen(fd, p, len);
}


x86 assembly (clang, -O0):
<Pack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <Writen@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <Writen@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Pack(i8* %0, i64 %1, i32 %2) {
%4 = alloca i64
store i64 %1, i64* %4
%5 = bitcast i64* %4 to i8*
%6 = call i32 @Writen(i32 %2, i8* %5, i64 4)
%7 = load i64, i64* %4
%8 = call i32 @Writen(i32 %2, i8* %0, i64 %7)
ret void
}
int appf_platform_get_cluster_index(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @appf_platform_get_cluster_index() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_NOON30PC11(unsigned char uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_NOON30PC11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_NOON30PC11>:
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_NOON30PC11(i8 zeroext %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 i16, i16* %4
%7 = trunc i16 %6 to i8
%8 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %5, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_NOON30PC11(i8 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %0, i8 zeroext %3)
ret void
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_auth(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0000 | 0x00B0);
}


x86 assembly (clang, -O0):
<ieee80211_is_auth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xb0,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_auth>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0xb0,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_auth(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 176)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_auth(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 176)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(int /*<<< orphan*/, char *, char *, char *, int);
void gmx_wait(int left, int right) {
  fatal_error(0, "Routine %s called in %s, %d", "gmx_wait",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/"
              "tests/test_07/network.c",
              277);
}


x86 assembly (clang, -O0):
<gmx_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
lea    0xed9(%rip),%rsi
lea    0xeee(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x115,%r8d
call   1030 <fatal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmx_wait>:
lea    0xee9(%rip),%rsi
lea    0xefe(%rip),%rdx
lea    0xf00(%rip),%rcx
xor    %edi,%edi
mov    $0x115,%r8d
jmp    1030 <fatal_error@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Routine %s called in %s, %d\00"
@.str.1 = [9 x i8] c"gmx_wait\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/tests/test_07/network.c\00"
define void @gmx_wait(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 277)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Routine %s called in %s, %d\00"
@.str.1 = [9 x i8] c"gmx_wait\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/tests/test_07/network.c\00"
define void @gmx_wait(i32 %0, i32 %1) {
%3 = tail call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 277)
ret void
}
/* Variables and functions */
int qDownloadMime(char *, char *);
int qDownload(char *filename) {
  return qDownloadMime(filename, "application/octet-stream");
}


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

x86 assembly (clang, -O2):
<qDownload>:
lea    0xee9(%rip),%rsi
jmp    1030 <qDownloadMime@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"application/octet-stream\00"
define i32 @qDownload(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @qDownloadMime(i8* %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [25 x i8] c"application/octet-stream\00"
define i32 @qDownload(i8* %0) {
%2 = tail call i32 @qDownloadMime(i8* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
bool nrf52_errata_46(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_46() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_SIZE16_swap(char *, int);
int /*<<< orphan*/ U_swap2(char *, int);
void U_WMRCORE_N16_swap(char *record, int N16, int torev) {
  U_WMRCORE_SIZE16_swap(record, torev);
  U_swap2(record + 6, N16);
}


x86 assembly (clang, -O0):
<U_WMRCORE_N16_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <U_WMRCORE_SIZE16_swap@plt>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
mov    -0xc(%rbp),%esi
call   1030 <U_swap2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRCORE_N16_swap>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,%esi
call   1040 <U_WMRCORE_SIZE16_swap@plt>
add    $0x6,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <U_swap2@plt>

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

LLVM IR (-O2):
define void @U_WMRCORE_N16_swap(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @U_WMRCORE_SIZE16_swap(i8* %0, i32 %2)
%5 = getelementptr inbounds i8, i8* %0, i64 6
%6 = tail call i32 @U_swap2(i8* %5, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ rewinddir(int /*<<< orphan*/ *);
void octave_rewinddir_wrapper(void *dir) { rewinddir((DIR *)dir); }


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

x86 assembly (clang, -O2):
<octave_rewinddir_wrapper>:
jmp    1030 <rewinddir@plt>

LLVM IR (-O0):
define void @octave_rewinddir_wrapper(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @rewinddir(i32* %4)
ret void
}

LLVM IR (-O2):
define void @octave_rewinddir_wrapper(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @rewinddir(i32* %2)
ret void
}
void gw_delref(struct gw_info **gwp) {}


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

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

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

LLVM IR (-O2):
%struct.gw_info = type opaque
define void @gw_delref(%struct.gw_info** nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void print_decimal32(uint64_t value) {
  if (fprintf(stdout, "%u\n", (uint32_t)value) < 0) {
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<print_decimal32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x0,%rax
jge    115f <print_decimal32+0x3f>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_decimal32>:
push   %rax
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
test   %rax,%rax
js     1140 <print_decimal32+0x20>
pop    %rax
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%u\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_decimal32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @stdout
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = call i64 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%u\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_decimal32(i64 %0) {
%2 = load i32, i32* @stdout
%3 = trunc i64 %0 to i32
%4 = tail call i64 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void hex_out(int i) {
  static char digits[] = "0123456789ABCDEF";
  printf("%c%c", digits[(i & 0xf0) >> 4], digits[(i & 0x0f)]);
}


x86 assembly (clang, -O0):
<hex_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0x2f00(%rip),%rax
mov    (%rax,%rcx,1),%dl
mov    -0x4(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xebd(%rip),%rdi
lea    0x2ee6(%rip),%rax
movsbl %dl,%esi
movsbl (%rax,%rcx,1),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_out>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    0xee1(%rip),%rcx
movsbl (%rax,%rcx,1),%esi
and    $0xf,%edi
movsbl (%rdi,%rcx,1),%edx
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@hex_out.digits = internal global [17 x i8] c"0123456789ABCDEF\00"
@.str = [5 x i8] c"%c%c\00"
define void @hex_out(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 240
%5 = ashr i32 %4, 4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* @hex_out.digits, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = load i32, i32* %2
%10 = and i32 %9, 15
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [17 x i8], [17 x i8]* @hex_out.digits, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %8, i8 signext %13)
ret void
}

LLVM IR (-O2):
@hex_out.digits = internal unnamed_addr constant [17 x i8] c"0123456789ABCDEF\00"
@.str = [5 x i8] c"%c%c\00"
define void @hex_out(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @hex_out.digits, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = and i32 %0, 15
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [17 x i8], [17 x i8]* @hex_out.digits, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %10)
ret void
}
void g_scanner_lookup_symbol() {}


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

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

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

LLVM IR (-O2):
define void @g_scanner_lookup_symbol() {
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
size_t max(int /*<<< orphan*/, int);
size_t parent(size_t i) { return max(0, ((ssize_t)i + 1) / 2 - 1); }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
sub    $0x1,%esi
xor    %edi,%edi
call   1030 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
add    $0x1,%eax
shr    $0x1f,%eax
lea    (%rdi,%rax,1),%esi
add    $0x1,%esi
sar    %esi
add    $0xffffffff,%esi
xor    %edi,%edi
jmp    1030 <max@plt>

LLVM IR (-O0):
define i64 @parent(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = add nsw i32 %4, 1
%6 = sdiv i32 %5, 2
%7 = sub nsw i32 %6, 1
%8 = call i64 @max(i32 0, i32 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @parent(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add nsw i32 %2, 1
%4 = sdiv i32 %3, 2
%5 = add nsw i32 %4, -1
%6 = tail call i64 @max(i32 0, i32 %5)
ret i64 %6
}
/* Variables and functions */
size_t word_round(size_t size) {
  return (size + sizeof(void *) - 1) & ~(sizeof(void *) - 1);
}


x86 assembly (clang, -O0):
<word_round>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
sub    $0x1,%rax
and    $0xfffffffffffffff8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<word_round>:
lea    0x7(%rdi),%rax
and    $0xfffffffffffffff8,%rax
ret

LLVM IR (-O0):
define i64 @word_round(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = sub i64 %4, 1
%6 = and i64 %5, -8
ret i64 %6
}

LLVM IR (-O2):
define i64 @word_round(i64 %0) {
%2 = add i64 %0, 7
%3 = and i64 %2, -8
ret i64 %3
}
incref(t) { return (((t & ~07) << 2) | (t & 07) | 010); }


x86 assembly (clang, -O0):
<incref>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffff8,%eax
shl    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
or     %ecx,%eax
or     $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<incref>:
mov    %edi,%eax
and    $0xfffffff8,%eax
and    $0x7,%edi
lea    (%rdi,%rax,4),%eax
add    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @incref(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -8
%5 = shl i32 %4, 2
%6 = load i32, i32* %2
%7 = and i32 %6, 7
%8 = or i32 %5, %7
%9 = or i32 %8, 8
ret i32 %9
}

LLVM IR (-O2):
define i32 @incref(i32 %0) {
%2 = shl i32 %0, 2
%3 = and i32 %2, -32
%4 = and i32 %0, 7
%5 = or i32 %4, %3
%6 = or i32 %5, 8
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ goodbye();
int /*<<< orphan*/ hello();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("main.\n");
  hello();
  goodbye();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <hello@plt>
xor    %eax,%eax
call   1050 <goodbye@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"main.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @hello()
%3 = tail call i32 (...) @goodbye()
ret i32 0
}
int test_imm_97uint16_reg(unsigned short val) {
  return ((val) & (-0x97 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_97uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff69,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_97uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -151
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}