xunge/DecIR huggingface dataset:
void kasan_free_early_identity(void) {}


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

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

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

LLVM IR (-O2):
define void @kasan_free_early_identity() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ azo_put_char(char);
void azo_put_str(char *str) {
  int i = 0;
  while (str[i] != '\0') {
    azo_put_char(str[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<azo_put_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <azo_put_str+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <azo_put_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <azo_put_str+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<azo_put_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <azo_put_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <azo_put_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <azo_put_str+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @azo_put_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @azo_put_char(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int is_number(char c) {
  if (c <= '9' && c >= '0')
    return 1;
  else if (c == '-')
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <is_number+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <is_number+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1150 <is_number+0x50>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    1149 <is_number+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <is_number+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number>:
lea    -0x30(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x2d,%dil
sete   %cl
neg    %ecx
cmp    $0xa,%al
mov    $0x1,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @is_number(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 57
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 48
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %18
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 45
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 @is_number(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = icmp eq i8 %0, 45
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Inet_aton(char *, struct in_addr *);
int /*<<< orphan*/ getLine(char *, int, char *);
void setIPin(struct in_addr *addr) {
  char buf[255];
  getLine(buf, 255, "Enter host IPv4 address (dotted notation): ");
  Inet_aton(buf, addr);
  return;
}


x86 assembly (clang, -O0):
<setIPin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0xff,%esi
lea    0xebe(%rip),%rdx
call   1040 <getLine@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <Inet_aton@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setIPin>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
lea    0xecc(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xff,%esi
call   1040 <getLine@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Inet_aton@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [44 x i8] c"Enter host IPv4 address (dotted notation): \00"
define void @setIPin(%struct.in_addr* %0) {
%2 = alloca %struct.in_addr*
%3 = alloca [255 x i8]
store %struct.in_addr* %0, %struct.in_addr** %2
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @getLine(i8* %4, i32 255, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%7 = load %struct.in_addr*, %struct.in_addr** %2
%8 = call i32 @Inet_aton(i8* %6, %struct.in_addr* %7)
ret void
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@.str = [44 x i8] c"Enter host IPv4 address (dotted notation): \00"
define void @setIPin(%struct.in_addr* %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @getLine(i8* %3, i32 255, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @Inet_aton(i8* %3, %struct.in_addr* %0)
ret void
}
int get_length(char *a) {
  char *c = a - 1;
  int i = 0;
  while (*(++c) != '\0')
    i++;
  return i - 1;
}


x86 assembly (clang, -O0):
<get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1145 <get_length+0x45>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <get_length+0x1b>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_length>:
mov    $0xfffffffe,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <get_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_length(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -1
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %6, %3 ]
%5 = phi i32 [ 0, %1 ], [ %9, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = add nuw nsw i32 %5, 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = add nsw i32 %5, -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello, world\f"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world\0C\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello, world\0C\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int strlen(char const *);
void malloc_strcpy(char **dest, char const *src) {
  if (src == NULL) {
    *dest = NULL;
    return;
  }
  *dest = malloc((strlen(src) + 1) * sizeof(char));
  sprintf(*dest, "%s", src);
}


x86 assembly (clang, -O0):
<malloc_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <malloc_strcpy+0x2b>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
jmp    1195 <malloc_strcpy+0x65>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe70(%rip),%rsi
call   1050 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rsi,%rsi
je     1164 <malloc_strcpy+0x34>
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>
movq   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @malloc_strcpy(i8** nocapture writeonly %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %5
4: ; preds = %2
store i8* null, i8** %0
br label %10
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %1)
%7 = add nsw i32 %6, 1
%8 = tail call i8* @malloc(i32 %7)
store i8* %8, i8** %0
%9 = tail call i8* @strcpy(i8* dereferenceable(1) %8, i8* %1)
br label %10
10: ; preds = %5, %4
ret void
}
void gdk_drawable_copy_to_image() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drawable_copy_to_image() {
ret void
}
void foo(int b, int c) {
  void *x = &&lab;
  if (b) {
  lab:
    __builtin_unreachable();
  }
lab2:
  if (c)
    x = &&lab2;
  goto *x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0x13(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1124 <foo+0x24>
jmp    1124 <foo+0x24>
jmp    1129 <foo+0x29>
cmpl   $0x0,-0x8(%rbp)
je     113e <foo+0x3e>
lea    -0x11(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<foo>:
lea    0x21(%rip),%rax
test   %esi,%esi
lea    0x10(%rip),%rcx
cmovne %rcx,%rax
jmp    *%rax
cs nopw 0x0(%rax,%rax,1)
test   %esi,%esi
cmovne %rcx,%rax
jmp    *%rax

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* blockaddress(@foo, %9), i8** %5
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
br label %9
9: ; preds = %8, %17
unreachable
10: ; preds = %2
br label %11
11: ; preds = %17, %10
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
store i8* blockaddress(@foo, %11), i8** %5
br label %15
15: ; preds = %14, %11
%16 = load i8*, i8** %5
br label %17
17: ; preds = %15
%18 = phi i8* [ %16, %15 ]
indirectbr i8* %18, [label %9, label %11]
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
tail call void @llvm.assume(i1 %3)
%4 = icmp eq i32 %1, 0
br label %6
5: ; preds = %6
unreachable
6: ; preds = %6, %2
%7 = phi i8* [ blockaddress(@foo, %5), %2 ], [ %8, %6 ]
%8 = select i1 %4, i8* %7, i8* blockaddress(@foo, %6)
indirectbr i8* %8, [label %5, label %6]
}
/* Type definitions */
typedef scalar_t__ ptr;

/* Variables and functions */
void *SEXP_rawptr_mask(void *ptr, uintptr_t mask) {
  return (void *)((uintptr_t)(ptr)&mask);
}


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

x86 assembly (clang, -O2):
<SEXP_rawptr_mask>:
mov    %rdi,%rax
and    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @SEXP_rawptr_mask(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i64, i64* %4
%8 = and i64 %6, %7
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @SEXP_rawptr_mask(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = and i64 %3, %1
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int level1(int, int);
int main(void) {
  int a = 1;
  a = level1(a, a);
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @level1(i32 1, i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_licence() {
  printf(
      "LFMM Copyright (C) 2012 Eric Frichot\n"
      "This program is free software: you can redistribute it and/or modify\n"
      "it under the terms of the GNU General Public License as published by\n"
      "the Free Software Foundation, either version 3 of the License, or\n"
      "(at your option) any later version.\n"
      "This program is distributed in the hope that it will be useful,\n"
      "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
      "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
      "GNU General Public License for more details.\n"
      "You should have received a copy of the GNU General Public License\n"
      "along with this program.  If not, see "
      "<http://www.gnu.org/licenses/>.\n");
}


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

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

LLVM IR (-O0):
@.str = [648 x i8] c"LFMM Copyright (C) 2012 Eric Frichot\0AThis program is free software: you can redistribute it and/or modify\0Ait under the terms of the GNU General Public License as published by\0Athe Free Software Foundation, either version 3 of the License, or\0A(at your option) any later version.\0AThis program is distributed in the hope that it will be useful,\0Abut WITHOUT ANY WARRANTY; without even the implied warranty of\0AMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\0AGNU General Public License for more details.\0AYou should have received a copy of the GNU General Public License\0Aalong with this program. If not, see <http://www.gnu.org/licenses/>.\0A\00"
define void @print_licence() {
%1 = call i32 @printf(i8* getelementptr inbounds ([648 x i8], [648 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [647 x i8] c"LFMM Copyright (C) 2012 Eric Frichot\0AThis program is free software: you can redistribute it and/or modify\0Ait under the terms of the GNU General Public License as published by\0Athe Free Software Foundation, either version 3 of the License, or\0A(at your option) any later version.\0AThis program is distributed in the hope that it will be useful,\0Abut WITHOUT ANY WARRANTY; without even the implied warranty of\0AMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\0AGNU General Public License for more details.\0AYou should have received a copy of the GNU General Public License\0Aalong with this program. If not, see <http://www.gnu.org/licenses/>.\00"
define void @print_licence() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([647 x i8], [647 x i8]* @str, i64 0, i64 0))
ret void
}
void _M2_StrIO_finish(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_StrIO_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
struct timespec {
  int member_1;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void _usleep(int micro) {
  if (micro < 0)
    return;
  struct timespec req = {0, micro * 1000L};
  nanosleep(&req, (struct timespec *)NULL);
}


x86 assembly (clang, -O0):
<_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112a <_usleep+0x1a>
jmp    114c <_usleep+0x3c>
movl   $0x0,-0x10(%rbp)
movslq -0x4(%rbp),%rax
imul   $0x3e8,%rax,%rax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usleep>:
test   %edi,%edi
js     1134 <_usleep+0x24>
push   %rax
movl   $0x0,(%rsp)
imul   $0x3e8,%edi,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @_usleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %15
7: ; preds = %1
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 0, i32* %8
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = mul nsw i64 %11, 1000
%13 = trunc i64 %12 to i32
store i32 %13, i32* %9
%14 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* null)
br label %15
15: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @_usleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = icmp slt i32 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = bitcast %struct.timespec* %2 to i8*
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 0, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%8 = mul i32 %0, 1000
store i32 %8, i32* %7
%9 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* null)
br label %10
10: ; preds = %1, %4
ret void
}
void g_source_destroy() {}


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

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

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

LLVM IR (-O2):
define void @g_source_destroy() {
ret void
}
/* Variables and functions */
int myAtoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", myAtoi("    -10326662300y")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [18 x i8] c" -10326662300y\00"
define i32 @main() {
%1 = call i32 @myAtoi(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [18 x i8] c" -10326662300y\00"
define i32 @main() {
%1 = tail call i32 @myAtoi(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
void foo(int i) {
  int array[i];
  while (i--)
    foo(array[i] = 0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1171 <foo+0x61>
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
xor    %edi,%edi
call   1030 <foo@plt>
jmp    1142 <foo+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
je     111b <foo+0xb>
xor    %edi,%edi
jmp    1030 <foo@plt>
ret

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

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @foo(i32 0)
br label %4
4: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x = 1;
  int *p = &x;
  p = p + 0;
  assert(*p == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 1, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ printf(char *);
float *vector(long nl, long nh) {
  float *v;
  v = (float *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(float)));
  if (!v)
    printf("allocation error in vector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <vector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <vector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
shl    $0x2,%r14
sub    %r14,%rbx
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"allocation error in vector()\00"
define float* @vector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca float*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to float*
store float* %13, float** %5
%14 = load float*, float** %5
%15 = icmp ne float* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load float*, float** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds float, float* %19, i64 %21
%23 = getelementptr inbounds float, float* %22, i64 1
ret float* %23
}

LLVM IR (-O2):
@.str = [29 x i8] c"allocation error in vector()\00"
define float* @vector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to float*
%12 = sub i64 0, %0
%13 = getelementptr inbounds float, float* %11, i64 %12
%14 = getelementptr inbounds float, float* %13, i64 1
ret float* %14
}
/* Type definitions */
struct timeval {
  int tv_sec;
  long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long long java_lang_System_nanoTime(char *gc_info, int *exception) {
  struct timeval tm;
  gettimeofday(&tm, 0);
  return tm.tv_sec * 1000000 + tm.tv_usec;
}


x86 assembly (clang, -O0):
<java_lang_System_nanoTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x20(%rbp),%eax
cltq
add    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<java_lang_System_nanoTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @java_lang_System_nanoTime(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca %struct.timeval
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32 0)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000000
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%12 = load i64, i64* %11
%13 = add nsw i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @java_lang_System_nanoTime(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%11 = load i64, i64* %10
%12 = add nsw i64 %11, %9
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void version(FILE *fp) {
  fprintf(fp, "romcc "
              "0"
              "."
              "72"
              " released "
              "10 February 2010"
              "\n");
}


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

x86 assembly (clang, -O2):
<version>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x25,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"romcc 0.72 released 10 February 2010\0A\00"
define void @version(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"romcc 0.72 released 10 February 2010\0A\00"
define void @version(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 37, i64 1, i32* %0)
ret void
}
void foo(void) {
  unsigned int i = 0;
#pragma acc kernels
  { i++; }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world, from C\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Hello world, from C\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"Hello world, from C\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ is_leap_year(int);
int days_in_month(int month, int year) {
  static char month_days[] = {
      31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
  };
  if (month == 1)
    return is_leap_year(year) ? 29 : 28;
  return month_days[month];
}


x86 assembly (clang, -O0):
<days_in_month>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114c <days_in_month+0x3c>
mov    -0xc(%rbp),%edi
call   1030 <is_leap_year@plt>
mov    %rax,%rdx
mov    $0x1c,%eax
mov    $0x1d,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115e <days_in_month+0x4e>
movslq -0x8(%rbp),%rcx
lea    0x2ed1(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<days_in_month>:
push   %rax
cmp    $0x1,%edi
jne    112b <days_in_month+0x1b>
mov    %esi,%edi
call   1030 <is_leap_year@plt>
cmp    $0x1,%rax
mov    $0x1d,%eax
sbb    $0x0,%eax
pop    %rcx
ret
movslq %edi,%rax
lea    0xecb(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rcx
ret

LLVM IR (-O0):
@days_in_month.month_days = internal global [12 x i8] c"\1F\1C\1F\1E\1F\1E\1F\1F\1E\1F\1E\1F"
define i32 @days_in_month(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 eq i32 %6, 1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %5
%10 = call i64 @is_leap_year(i32 %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 29, i32 28
store i32 %13, i32* %3
br label %20
14: ; preds = %2
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [12 x i8], [12 x i8]* @days_in_month.month_days, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %14, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@days_in_month.month_days = internal unnamed_addr constant [12 x i8] c"\1F\1C\1F\1E\1F\1E\1F\1F\1E\1F\1E\1F"
define i32 @days_in_month(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i64 @is_leap_year(i32 %1)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 28, i32 29
br label %13
8: ; preds = %2
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds [12 x i8], [12 x i8]* @days_in_month.month_days, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
br label %13
13: ; preds = %8, %4
%14 = phi i32 [ %7, %4 ], [ %12, %8 ]
ret i32 %14
}
void gtk_about_dialog_get_website() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_get_website() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int shm_unlink(char *);
int IPCRemoveSharedMemFile(char *shared_memory_name) {
  if (shm_unlink(shared_memory_name) == -1) {
    printf("Error occured when removing shared memory file\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<IPCRemoveSharedMemFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <shm_unlink@plt>
cmp    $0xffffffff,%eax
jne    1156 <IPCRemoveSharedMemFile+0x36>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    115d <IPCRemoveSharedMemFile+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IPCRemoveSharedMemFile>:
push   %rax
call   1040 <shm_unlink@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1131 <IPCRemoveSharedMemFile+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Error occured when removing shared memory file\0A\00"
define i32 @IPCRemoveSharedMemFile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @shm_unlink(i8* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@str = [47 x i8] c"Error occured when removing shared memory file\00"
define i32 @IPCRemoveSharedMemFile(i8* %0) {
%2 = tail call i32 @shm_unlink(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ kill_bus();
void kill_bus_and_exit(int exitcode) {
  close(0);
  close(1);
  close(2);
  kill_bus();
  exit(exitcode);
}


x86 assembly (clang, -O0):
<kill_bus_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1030 <close@plt>
mov    $0x2,%edi
call   1030 <close@plt>
mov    $0x0,%al
call   1040 <kill_bus@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<kill_bus_and_exit>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1030 <close@plt>
mov    $0x2,%edi
call   1030 <close@plt>
xor    %eax,%eax
call   1040 <kill_bus@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @kill_bus_and_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @close(i32 0)
%4 = call i32 @close(i32 1)
%5 = call i32 @close(i32 2)
%6 = call i32 (...) @kill_bus()
%7 = load i32, i32* %2
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define void @kill_bus_and_exit(i32 %0) {
%2 = tail call i32 @close(i32 0)
%3 = tail call i32 @close(i32 1)
%4 = tail call i32 @close(i32 2)
%5 = tail call i32 (...) @kill_bus()
%6 = tail call i32 @exit(i32 %0)
unreachable
}
int lgtd_lifx_gateway_allocate_tag_id(struct lgtd_lifx_gateway *gw, int tag_id,
                                      const char *tag_label) {
  (void)gw;
  (void)tag_id;
  (void)tag_label;
  return -1;
}


x86 assembly (clang, -O0):
<lgtd_lifx_gateway_allocate_tag_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.lgtd_lifx_gateway = type opaque
define i32 @lgtd_lifx_gateway_allocate_tag_id(%struct.lgtd_lifx_gateway* %0, i32 %1, i8* %2) {
%4 = alloca %struct.lgtd_lifx_gateway*
%5 = alloca i32
%6 = alloca i8*
store %struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_gateway** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.lgtd_lifx_gateway*, %struct.lgtd_lifx_gateway** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.lgtd_lifx_gateway = type opaque
define i32 @lgtd_lifx_gateway_allocate_tag_id(%struct.lgtd_lifx_gateway* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ LcdWriteChar(int /*<<< orphan*/);
void LcdWriteString(char *character) {
  while (*character)
    LcdWriteChar(*character++);
}


x86 assembly (clang, -O0):
<LcdWriteString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <LcdWriteString+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <LcdWriteChar@plt>
jmp    111c <LcdWriteString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LcdWriteString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <LcdWriteString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <LcdWriteChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <LcdWriteString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @LcdWriteString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @LcdWriteChar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sighandler(int sig) {
  printf("\nctrl-c\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\0Actrl-c\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"\0Actrl-c\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int SetSlewRate(void) {
  fprintf(stderr, "NexStar does not support remote setting of slew rate.\n");
  return 0;
}


x86 assembly (clang, -O0):
<SetSlewRate>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetSlewRate>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"NexStar does not support remote setting of slew rate.\0A\00"
define i32 @SetSlewRate() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"NexStar does not support remote setting of slew rate.\0A\00"
define i32 @SetSlewRate() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int execute(char *arglist[]) {
  execvp(arglist[0], arglist);
  perror("execvp failed");
  exit(1);
}


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <execvp@plt>
lea    0xead(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<execute>:
push   %rax
mov    %rdi,%rsi
mov    (%rdi),%rdi
call   1040 <execvp@plt>
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"execvp failed\00"
define i32 @execute(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = call i32 @execvp(i8* %5, i8** %6)
%8 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"execvp failed\00"
define i32 @execute(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @execvp(i8* %2, i8** %0)
%4 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SIGBUS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  kill(getpid(), SIGBUS);
  printf("xyzzy\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1050 <kill@plt>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getpid@plt>
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1050 <kill@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@SIGBUS = global i32 0
@str = [6 x i8] c"xyzzy\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGBUS
%3 = tail call i32 @kill(i32 %1, i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double __nv_cos(double);
double cos(double __a) { return __nv_cos(__a); }


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

x86 assembly (clang, -O2):
<cos>:
jmp    1030 <__nv_cos@plt>

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

LLVM IR (-O2):
define double @cos(double %0) {
%2 = tail call double @__nv_cos(double %0)
ret double %2
}