xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int __service_eq(void *p1, void *p2) {
  return (strcmp((const char *)p1, (const char *)p2) == 0);
}


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

x86 assembly (clang, -O2):
<__service_eq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @__service_eq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_while_sub(char *, int);
char *malloc(int);
void do_while_Bad() {
  char *a = malloc(10);
  do_while_sub(a, 11);
}


x86 assembly (clang, -O0):
<do_while_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1040 <do_while_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_while_Bad>:
push   %rax
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,%rdi
mov    $0xb,%esi
pop    %rax
jmp    1040 <do_while_sub@plt>

LLVM IR (-O0):
define void @do_while_Bad() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 10)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @do_while_sub(i8* %3, i32 11)
ret void
}

LLVM IR (-O2):
define void @do_while_Bad() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @do_while_sub(i8* %1, i32 11)
ret void
}
unsigned int djb2_hash(void *str) {
  char *s = (char *)str;
  unsigned int hash = 0;
  int c;
  while (c = *s++) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<djb2_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     1149 <djb2_hash+0x49>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <djb2_hash+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <djb2_hash+0x28>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <djb2_hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @djb2_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
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* %8
%11 = sext i8 %10 to i32
store i32 %11, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %7
%14 = load i32, i32* %4
%15 = shl i32 %14, 5
%16 = load i32, i32* %4
%17 = add i32 %15, %16
%18 = load i32, i32* %5
%19 = add i32 %17, %18
store i32 %19, i32* %4
br label %7
20: ; preds = %7
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @djb2_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
void pthread_init_mutex(pthread_mutex_t *mutex) {
  pthread_mutex_init(mutex, NULL);
}


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

x86 assembly (clang, -O2):
<pthread_init_mutex>:
xor    %esi,%esi
jmp    1030 <pthread_mutex_init@plt>

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

LLVM IR (-O2):
define void @pthread_init_mutex(i32* %0) {
%2 = tail call i32 @pthread_mutex_init(i32* %0, i32* null)
ret void
}
/* Type definitions */
struct grecs_node {
  int dummy;
};

/* Variables and functions */
scalar_t__ read_statement(struct grecs_node *);
void read_statement_list(struct grecs_node *parent) {
  while (read_statement(parent))
    ;
}


x86 assembly (clang, -O0):
<read_statement_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_statement@plt>
cmp    $0x0,%rax
je     1134 <read_statement_list+0x24>
jmp    111c <read_statement_list+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_statement_list>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <read_statement@plt>
test   %rax,%rax
jne    1120 <read_statement_list+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.grecs_node = type { i32 }
define void @read_statement_list(%struct.grecs_node* %0) {
%2 = alloca %struct.grecs_node*
store %struct.grecs_node* %0, %struct.grecs_node** %2
br label %3
3: ; preds = %7, %1
%4 = load %struct.grecs_node*, %struct.grecs_node** %2
%5 = call i64 @read_statement(%struct.grecs_node* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.grecs_node = type { i32 }
define void @read_statement_list(%struct.grecs_node* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @read_statement(%struct.grecs_node* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Type definitions */
struct _nibseq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _nibseq_init(struct _nibseq *);
void nibseq_init(struct _nibseq *ns) {
  if (ns) {
    _nibseq_init(ns);
  }
}


x86 assembly (clang, -O0):
<nibseq_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <nibseq_init+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <_nibseq_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibseq_init>:
test   %rdi,%rdi
je     111a <nibseq_init+0xa>
jmp    1030 <_nibseq_init@plt>
ret

LLVM IR (-O0):
%struct._nibseq = type { i32 }
define void @nibseq_init(%struct._nibseq* %0) {
%2 = alloca %struct._nibseq*
store %struct._nibseq* %0, %struct._nibseq** %2
%3 = load %struct._nibseq*, %struct._nibseq** %2
%4 = icmp ne %struct._nibseq* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct._nibseq*, %struct._nibseq** %2
%7 = call i32 @_nibseq_init(%struct._nibseq* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct._nibseq = type { i32 }
define void @nibseq_init(%struct._nibseq* %0) {
%2 = icmp eq %struct._nibseq* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @_nibseq_init(%struct._nibseq* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EIO;
int /*<<< orphan*/ errno;
__attribute__((weak)) int unlink(char *path) {
  (void)path;
  errno = EIO;
  return (-1);
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EIO = global i32 0
@errno = global i32 0
define weak i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @EIO
store i32 %4, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EIO = global i32 0
@errno = global i32 0
define weak i32 @unlink(i8* %0) {
%2 = load i32, i32* @EIO
store i32 %2, i32* @errno
ret i32 -1
}
void ff_hevc_put_hevc_qpel_h32_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h32_8_avx2() {
ret void
}
/* Type definitions */
struct wl_surface {
  int dummy;
};
struct wl_subsurface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int,
                                    struct wl_surface *);
void wl_subsurface_place_below(struct wl_subsurface *wl_subsurface,
                               struct wl_surface *sibling) {
  wl_proxy_marshal((struct wl_proxy *)wl_subsurface, 3, sibling);
}


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

x86 assembly (clang, -O2):
<wl_subsurface_place_below>:
mov    %rsi,%rdx
mov    $0x3,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_subsurface = type { i32 }
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subsurface_place_below(%struct.wl_subsurface* %0, %struct.wl_surface* %1) {
%3 = alloca %struct.wl_subsurface*
%4 = alloca %struct.wl_surface*
store %struct.wl_subsurface* %0, %struct.wl_subsurface** %3
store %struct.wl_surface* %1, %struct.wl_surface** %4
%5 = load %struct.wl_subsurface*, %struct.wl_subsurface** %3
%6 = bitcast %struct.wl_subsurface* %5 to %struct.wl_proxy*
%7 = load %struct.wl_surface*, %struct.wl_surface** %4
%8 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %6, i32 3, %struct.wl_surface* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_subsurface = type { i32 }
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subsurface_place_below(%struct.wl_subsurface* %0, %struct.wl_surface* %1) {
%3 = bitcast %struct.wl_subsurface* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %3, i32 3, %struct.wl_surface* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
void ft_put_ch_arr(char **str) {
  int i;
  int j;
  i = 0;
  while (str[i]) {
    ft_putstr(str[i]);
    ft_putchar('\n');
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_put_ch_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     116f <ft_put_ch_arr+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <ft_put_ch_arr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_put_ch_arr>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     114b <ft_put_ch_arr+0x2b>
add    $0x8,%rbx
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <ft_put_ch_arr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_put_ch_arr(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %5
5: ; preds = %12, %1
%6 = load i8**, i8*** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %6, i64 %8
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %22
12: ; preds = %5
%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 @ft_putstr(i8* %17)
%19 = call i32 @ft_putchar(i8 signext 10)
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %5
22: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ft_put_ch_arr(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8* [ %11, %4 ], [ %2, %1 ]
%7 = tail call i32 @ft_putstr(i8* %6)
%8 = tail call i32 @ft_putchar(i8 signext 10)
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
int fun911() { return 911; }


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

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

LLVM IR (-O0):
define i32 @fun911() {
ret i32 911
}

LLVM IR (-O2):
define i32 @fun911() {
ret i32 911
}
unsigned property_list_count(const int *pList) {
  unsigned property_count = 0;
  if (pList) {
    while (*pList != -1) {
      property_count++;
      pList++;
    }
  }
  return property_count;
}


x86 assembly (clang, -O0):
<property_list_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <property_list_count+0x4b>
jmp    111f <property_list_count+0x1f>
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1146 <property_list_count+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    111f <property_list_count+0x1f>
jmp    114b <property_list_count+0x4b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<property_list_count>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <property_list_count+0x1b>
cmpl   $0xffffffff,(%rdi)
je     111b <property_list_count+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpl   $0xffffffff,0x4(%rdi,%rax,4)
lea    0x1(%rax),%rax
jne    1110 <property_list_count+0x10>
ret

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

LLVM IR (-O2):
define i32 @property_list_count(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, -1
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = phi i32* [ %10, %6 ], [ %0, %3 ]
%9 = add i32 %7, 1
%10 = getelementptr inbounds i32, i32* %8, i64 1
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %14
}
int cairo_code_draw_cheapDial_get_height() { return 119; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_cheapDial_get_height() {
ret i32 119
}

LLVM IR (-O2):
define i32 @cairo_code_draw_cheapDial_get_height() {
ret i32 119
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_reply_method_errorf(void *call, const char *name, const char *format,
                           ...) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_reply_method_errorf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_reply_method_errorf(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, ...) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gcode2kulibin(char *);
int main(void) {
  gcode2kulibin("input.g");
  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 <gcode2kulibin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"input.g\00"
define i32 @main() {
%1 = tail call i32 @gcode2kulibin(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t pack_bytes(uint8_t *bytes) {
  return (bytes[0] << 24) + (bytes[1] << 16) + (bytes[2] << 8) + bytes[3];
}


x86 assembly (clang, -O0):
<pack_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
add    0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_bytes>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
add    %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
add    %ecx,%eax
add    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @pack_bytes(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = add nsw i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = add nsw i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = add nsw i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @pack_bytes(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = add nsw i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = add nsw i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = add nsw i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (n % 2 == 1 || (n >= 6 && n <= 20)) {
    printf("Weird\n");
  } else {
    printf("Not Weird\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
je     1167 <main+0x47>
cmpl   $0x6,-0x8(%rbp)
jl     1178 <main+0x58>
cmpl   $0x14,-0x8(%rbp)
jg     1178 <main+0x58>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1184 <main+0x64>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
mov    %eax,%edx
sub    %ecx,%edx
add    $0xfffffffa,%eax
cmp    $0xf,%eax
lea    0xeb6(%rip),%rax
lea    0xeab(%rip),%rdi
cmovb  %rax,%rdi
cmp    $0x1,%edx
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [10 x i8] c"Not Weird\00"
@str.3 = [6 x i8] c"Weird\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 1
%7 = add i32 %4, -6
%8 = icmp ult i32 %7, 15
%9 = or i1 %6, %8
%10 = select i1 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0)
%11 = call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int);
void ft_putnbr(int nb) {
  if (nb < 0) {
    ft_putchar('-');
    nb = -nb;
  }
  if (nb >= 10) {
    ft_putnbr(nb / 10);
    ft_putnbr(nb % 10);
  } else {
    ft_putchar(nb + '0');
  }
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1147 <ft_putnbr+0x27>
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     117a <ft_putnbr+0x5a>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <ft_putnbr@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <ft_putnbr@plt>
jmp    1185 <ft_putnbr+0x65>
mov    -0x4(%rbp),%edi
add    $0x30,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    $0xcccccccd,%r14d
test   %ebp,%ebp
jns    113c <ft_putnbr+0x1c>
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
neg    %ebp
cmp    $0xa,%ebp
jb     115f <ft_putnbr+0x3f>
mov    %ebp,%ebx
imul   %r14,%rbx
shr    $0x23,%rbx
mov    %ebx,%edi
call   1040 <ft_putnbr@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%ebp
test   %ebp,%ebp
jns    113c <ft_putnbr+0x1c>
jmp    1130 <ft_putnbr+0x10>
add    $0x30,%ebp
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putnbr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @ft_putchar(i32 45)
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %9
9: ; preds = %5, %1
%10 = load i32, i32* %2
%11 = icmp sge i32 %10, 10
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 10
%15 = load i32, i32* %2
%16 = srem i32 %15, 10
br label %21
17: ; preds = %9
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 48
%20 = call i32 @ft_putchar(i32 %19)
br label %21
21: ; preds = %17, %12
ret void
}

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i32 [ %0, %1 ], [ %13, %11 ]
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @ft_putchar(i32 45)
%7 = sub nsw i32 0, %3
br label %8
8: ; preds = %5, %2
%9 = phi i32 [ %7, %5 ], [ %3, %2 ]
%10 = icmp ugt i32 %9, 9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = udiv i32 %9, 10
tail call void @ft_putnbr(i32 %12)
%13 = urem i32 %9, 10
br label %2
14: ; preds = %8
%15 = add nuw nsw i32 %9, 48
%16 = tail call i32 @ft_putchar(i32 %15)
ret void
}
/* Variables and functions */
scalar_t__ strToLong(char *, int);
int strToInt(char *txt, int defaultValue) {
  return (int)strToLong(txt, defaultValue);
}


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

x86 assembly (clang, -O2):
<strToInt>:
jmp    1030 <strToLong@plt>

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

LLVM IR (-O2):
define i32 @strToInt(i8* %0, i32 %1) {
%3 = tail call i64 @strToLong(i8* %0, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int vde_chain_nm9_init(int *n_in, int *n_out, int *n_int, int *n_real) {
  if (n_in)
    *n_in = 4;
  if (n_out)
    *n_out = 3;
  if (n_int)
    *n_int = 0;
  if (n_real)
    *n_real = 0;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm9_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <vde_chain_nm9_init+0x29>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <vde_chain_nm9_init+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <vde_chain_nm9_init+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <vde_chain_nm9_init+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm9_init>:
test   %rdi,%rdi
je     110b <vde_chain_nm9_init+0xb>
movl   $0x4,(%rdi)
test   %rsi,%rsi
je     1116 <vde_chain_nm9_init+0x16>
movl   $0x3,(%rsi)
test   %rdx,%rdx
je     1121 <vde_chain_nm9_init+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <vde_chain_nm9_init+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @vde_chain_nm9_init(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 4, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 3, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 0, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @vde_chain_nm9_init(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 4, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 3, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
double add_d(double x, double y) {
  __asm__ __volatile__("addsd %1, %0" : "+x"(x) : "x"(y));
  return x;
}


x86 assembly (clang, -O0):
<add_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_d>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @add_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double asm sideeffect "addsd $1, $0", "=x,x,0,~{dirflag},~{fpsr},~{flags}"(double %6, double %5)
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @add_d(double %0, double %1) {
%3 = tail call double asm sideeffect "addsd $1, $0", "=x,x,0,~{dirflag},~{fpsr},~{flags}"(double %1, double %0)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int fetch_current_time(char *time_str) {
  time_t current_time = time(NULL);
  struct tm *current_tm = localtime(&current_time);
  return strftime(time_str, 32, "\uf017 %H:%M", current_tm);
}


x86 assembly (clang, -O0):
<fetch_current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x20,%esi
lea    0xe97(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch_current_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [10 x i8] c"\EF\80\97 %H:%M\00"
define i32 @fetch_current_time(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [10 x i8] c"\EF\80\97 %H:%M\00"
define i32 @fetch_current_time(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i32 %6
}
/* Variables and functions */
void *alloc_fun(int);
void *ce_alloc_msg_space(int size) { return alloc_fun(size); }


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

x86 assembly (clang, -O2):
<ce_alloc_msg_space>:
jmp    1030 <alloc_fun@plt>

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

LLVM IR (-O2):
define i8* @ce_alloc_msg_space(i32 %0) {
%2 = tail call i8* @alloc_fun(i32 %0)
ret i8* %2
}
void gtk_icon_source_get_size() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_source_get_size() {
ret void
}
int isNum(char c) { return ((c >= '0') && (c <= '9')); }


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isNum+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNum>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isNum(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
double myRand(long int x) {
  x = (x << 13) ^ x;
  return 1.0 - ((x * (x * x * 15731 + 789221) + 1376312589) & 0x7fffffff) /
                   1073741824.0;
}


x86 assembly (clang, -O0):
<myRand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0xd,%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
imul   -0x8(%rbp),%rcx
imul   $0x3d73,%rcx,%rcx
add    $0xc0ae5,%rcx
imul   %rcx,%rax
add    $0x5208dd0d,%rax
and    $0x7fffffff,%rax
cvtsi2sd %rax,%xmm1
movsd  0xeb8(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xea4(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<myRand>:
mov    %edi,%eax
shl    $0xd,%eax
xor    %edi,%eax
mov    %eax,%ecx
imul   %eax,%ecx
imul   $0x3d73,%ecx,%ecx
add    $0xc0ae5,%ecx
imul   %eax,%ecx
add    $0x5208dd0d,%ecx
and    $0x7fffffff,%ecx
cvtsi2sd %ecx,%xmm0
mulsd  0xecd(%rip),%xmm0
addsd  0xecd(%rip),%xmm0
ret

LLVM IR (-O0):
define double @myRand(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 13
%5 = load i64, i64* %2
%6 = xor i64 %4, %5
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = load i64, i64* %2
%9 = load i64, i64* %2
%10 = mul nsw i64 %8, %9
%11 = mul nsw i64 %10, 15731
%12 = add nsw i64 %11, 789221
%13 = mul nsw i64 %7, %12
%14 = add nsw i64 %13, 1376312589
%15 = and i64 %14, 2147483647
%16 = sitofp i64 %15 to double
%17 = fdiv double %16, 0x41D0000000000000
%18 = fsub double 1.000000e+00, %17
ret double %18
}

LLVM IR (-O2):
define double @myRand(i64 %0) {
%2 = shl i64 %0, 13
%3 = xor i64 %2, %0
%4 = mul i64 %3, 15731
%5 = mul i64 %4, %3
%6 = add nuw nsw i64 %5, 789221
%7 = mul nsw i64 %6, %3
%8 = add nsw i64 %7, 1376312589
%9 = and i64 %8, 2147483647
%10 = sitofp i64 %9 to double
%11 = fmul double %10, 0x3E10000000000000
%12 = fsub double 1.000000e+00, %11
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: tscan -r \"Remote host\" -p \"Port\" [-e] [end Port] "
                  "[-o shows only open ports]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [84 x i8] c"Usage: tscan -r \22Remote host\22 -p \22Port\22 [-e] [end Port] [-o shows only open ports]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [84 x i8] c"Usage: tscan -r \22Remote host\22 -p \22Port\22 [-e] [end Port] [-o shows only open ports]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void strcpy(char *t, char *s) {
  while (*s) {
    *t++ = *s++;
  }
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <strcpy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ putint(int /*<<< orphan*/);
int f() {
  putint(0);
  putchar(10);
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
xor    %edi,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f() {
%1 = call i32 @putint(i32 0)
%2 = call i32 @putchar(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 @putint(i32 0)
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
void foo5c() {}


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

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

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

LLVM IR (-O2):
define void @foo5c() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ud_port_config();
void ud_init() { ud_port_config(); }


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

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

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

LLVM IR (-O2):
define void @ud_init() {
%1 = tail call i32 (...) @ud_port_config()
ret void
}
/* Variables and functions */
double sqrt(int);
double Dist(int r1, int g1, int b1, int r2, int g2, int b2) {
  int deltar = r1 - r2;
  int deltag = g1 - g2;
  int deltab = b1 - b2;
  return sqrt((deltar * deltar) + (deltag * deltag) + (deltab * deltab));
}


x86 assembly (clang, -O0):
<Dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
imul   -0x1c(%rbp),%edi
mov    -0x20(%rbp),%eax
imul   -0x20(%rbp),%eax
add    %eax,%edi
mov    -0x24(%rbp),%eax
imul   -0x24(%rbp),%eax
add    %eax,%edi
call   1030 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dist>:
sub    %ecx,%edi
sub    %r8d,%esi
sub    %r9d,%edx
imul   %edi,%edi
imul   %esi,%esi
add    %esi,%edi
imul   %edx,%edx
add    %edx,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @Dist(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%16 = load i32, i32* %7
%17 = load i32, i32* %10
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %13
%19 = load i32, i32* %8
%20 = load i32, i32* %11
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %14
%22 = load i32, i32* %9
%23 = load i32, i32* %12
%24 = sub nsw i32 %22, %23
store i32 %24, i32* %15
%25 = load i32, i32* %13
%26 = load i32, i32* %13
%27 = mul nsw i32 %25, %26
%28 = load i32, i32* %14
%29 = load i32, i32* %14
%30 = mul nsw i32 %28, %29
%31 = add nsw i32 %27, %30
%32 = load i32, i32* %15
%33 = load i32, i32* %15
%34 = mul nsw i32 %32, %33
%35 = add nsw i32 %31, %34
%36 = call double @sqrt(i32 %35)
ret double %36
}

LLVM IR (-O2):
define double @Dist(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = sub nsw i32 %0, %3
%8 = sub nsw i32 %1, %4
%9 = sub nsw i32 %2, %5
%10 = mul nsw i32 %7, %7
%11 = mul nsw i32 %8, %8
%12 = add nuw nsw i32 %11, %10
%13 = mul nsw i32 %9, %9
%14 = add nuw nsw i32 %12, %13
%15 = tail call double @sqrt(i32 %14)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int LOG_NDELAY;
int LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int);
void logsignal(int s) {
  openlog("firejail", LOG_NDELAY | LOG_PID, LOG_USER);
  syslog(LOG_INFO, "Signal %d caught", s);
  closelog();
}


x86 assembly (clang, -O0):
<logsignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
mov    0x2e8d(%rip),%rax
or     (%rax),%esi
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
lea    0xea3(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe94(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logsignal>:
push   %rbx
mov    %edi,%ebx
mov    0x2e86(%rip),%rax
mov    0x2e97(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    0xeab(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
mov    %ebx,%edx
call   1040 <syslog@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <closelog@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"firejail\00"
@LOG_NDELAY = global i32 0
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [17 x i8] c"Signal %d caught\00"
define void @logsignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_NDELAY
%4 = load i32, i32* @LOG_PID
%5 = or i32 %3, %4
%6 = load i32, i32* @LOG_USER
%7 = call i32 @openlog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* @LOG_INFO
%9 = load i32, i32* %2
%10 = call i32 @syslog(i32 %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"firejail\00"
@LOG_NDELAY = global i32 0
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [17 x i8] c"Signal %d caught\00"
define void @logsignal(i32 %0) {
%2 = load i32, i32* @LOG_NDELAY
%3 = load i32, i32* @LOG_PID
%4 = or i32 %3, %2
%5 = load i32, i32* @LOG_USER
%6 = tail call i32 @openlog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* @LOG_INFO
%8 = tail call i32 @syslog(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%9 = tail call i32 (...) @closelog()
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_read_middle(int);
void read_two_pages_middle(void) {
  ssize_t n;
  init_test();
  n = log_read_middle(8192);
  basic_test(n == 8192);
  cleanup_test();
}


x86 assembly (clang, -O0):
<read_two_pages_middle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x2000,%edi
call   1040 <log_read_middle@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x2000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1050 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_two_pages_middle>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x2000,%edi
call   1040 <log_read_middle@plt>
xor    %edi,%edi
cmp    $0x2000,%eax
sete   %dil
call   1030 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cleanup_test@plt>

LLVM IR (-O0):
define void @read_two_pages_middle() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_read_middle(i32 8192)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 8192
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @read_two_pages_middle() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_read_middle(i32 8192)
%3 = icmp eq i32 %2, 8192
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}