xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void *safe_malloc(int size) {
  void *p;
  p = (void *)calloc(size, 1);
  if (p == NULL) {
    fprintf(stderr, "can't malloc buffer for size %d!!\n", size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1179 <safe_malloc+0x49>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe96(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1144 <safe_malloc+0x14>
pop    %rbx
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"can't malloc buffer for size %d!!\0A\00"
define i8* @safe_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 1)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i32, i32* %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"can't malloc buffer for size %d!!\0A\00"
define i8* @safe_malloc(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = inttoptr i64 %2 to i8*
ret i8* %9
}
int utf8strlen(char *s) {
  int length = 0;
  while (*s) {
    length += ((*s >> 6) & 3) != 2;
    s++;
  }
  return length;
}


x86 assembly (clang, -O0):
<utf8strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <utf8strlen+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sar    $0x6,%eax
and    $0x3,%eax
cmp    $0x2,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <utf8strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8strlen>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <utf8strlen+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
and    $0xc0,%cl
xor    %edx,%edx
cmp    $0x80,%cl
setne  %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <utf8strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @utf8strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = and i8 %5, -64
%9 = icmp ne i8 %8, -128
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
int psp_video_is_fullscreen(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @psp_video_is_fullscreen() {
ret i32 1
}

LLVM IR (-O2):
define i32 @psp_video_is_fullscreen() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int);
int getpid();
int gimmeThatStuff();
int /*<<< orphan*/ stderr;
void handle_signal(int signum) {
  fprintf(stderr, "signal %i, pid %i, tid %i\n", signum, getpid(),
          gimmeThatStuff());
}


x86 assembly (clang, -O0):
<handle_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <gimmeThatStuff@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    %eax,%r8d
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_signal>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
mov    0x2ea2(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <gimmeThatStuff@plt>
lea    0xea9(%rip),%rsi
mov    %ebp,%edi
mov    %r14d,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"signal %i, pid %i, tid %i\0A\00"
define void @handle_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 (...) @getpid()
%6 = call i32 (...) @gimmeThatStuff()
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"signal %i, pid %i, tid %i\0A\00"
define void @handle_signal(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 (...) @gimmeThatStuff()
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3, i32 %4)
ret void
}
int addBit(unsigned int *bitmap, int hash, int checkOnly) {
  int bit = 1 << (hash % (sizeof(unsigned int) * 8));
  int entry = (hash / (sizeof(unsigned int) * 8)) % 128;
  if (checkOnly)
    return bitmap[entry] & bit;
  bitmap[entry] |= bit;
  return 1;
}


x86 assembly (clang, -O0):
<addBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movslq -0x14(%rbp),%rax
and    $0x1f,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
movslq -0x14(%rbp),%rax
shr    $0x5,%rax
and    $0x7f,%rax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1151 <addBit+0x51>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <addBit+0x69>
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addBit>:
mov    %esi,%ecx
mov    $0x1,%eax
mov    $0x1,%r8d
shl    %cl,%r8d
shr    $0x5,%ecx
and    $0x7f,%ecx
mov    (%rdi,%rcx,4),%esi
test   %edx,%edx
je     1123 <addBit+0x23>
and    %r8d,%esi
mov    %esi,%eax
ret
or     %r8d,%esi
mov    %esi,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define i32 @addBit(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = urem i64 %11, 32
%13 = trunc i64 %12 to i32
%14 = shl i32 1, %13
store i32 %14, i32* %8
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = udiv i64 %16, 32
%18 = urem i64 %17, 128
%19 = trunc i64 %18 to i32
store i32 %19, i32* %9
%20 = load i32, i32* %7
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %30
22: ; preds = %3
%23 = load i32*, i32** %5
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = load i32, i32* %8
%29 = and i32 %27, %28
store i32 %29, i32* %4
br label %38
30: ; preds = %3
%31 = load i32, i32* %8
%32 = load i32*, i32** %5
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
%36 = load i32, i32* %35
%37 = or i32 %36, %31
store i32 %37, i32* %35
store i32 1, i32* %4
br label %38
38: ; preds = %30, %22
%39 = load i32, i32* %4
ret i32 %39
}

LLVM IR (-O2):
define i32 @addBit(i32* nocapture %0, i32 %1, i32 %2) {
%4 = and i32 %1, 31
%5 = shl nuw i32 1, %4
%6 = lshr i32 %1, 5
%7 = and i32 %6, 127
%8 = icmp eq i32 %2, 0
%9 = zext i32 %7 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
br i1 %8, label %14, label %12
12: ; preds = %3
%13 = and i32 %11, %5
br label %16
14: ; preds = %3
%15 = or i32 %11, %5
store i32 %15, i32* %10
br label %16
16: ; preds = %14, %12
%17 = phi i32 [ %13, %12 ], [ 1, %14 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int mem_stack_unit_copy(void *dst, void *src) {
  *((uint64_t *)dst) = *((uint64_t *)src);
  return 0;
}


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

x86 assembly (clang, -O2):
<mem_stack_unit_copy>:
mov    (%rsi),%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mem_stack_unit_copy(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret i32 0
}

LLVM IR (-O2):
define i32 @mem_stack_unit_copy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret i32 0
}
t(int a, int b, int c) {
  int *p;
  if (a)
    p = &a;
  else
    p = &c;
  return *p;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1124 <t+0x24>
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112c <t+0x2c>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
mov    %edx,%eax
test   %edi,%edi
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @t(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %0
ret i32 %5
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int getnameinfo(struct sockaddr *, int /*<<< orphan*/, char *, int,
                int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
char *malloc(int);
char *util_get_fqdn(struct sockaddr *sa, socklen_t salen) {
  char *host = malloc(51);
  int ret = getnameinfo(sa, salen, host, 50, NULL, 0, 0);
  if (ret)
    ;
  return host;
}


x86 assembly (clang, -O0):
<util_get_fqdn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x33,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    $0x32,%ecx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <getnameinfo@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1173 <util_get_fqdn+0x53>
jmp    1173 <util_get_fqdn+0x53>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_get_fqdn>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
mov    $0x33,%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %rax,%rdx
mov    $0x32,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <getnameinfo@plt>
mov    %rbp,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i8* @util_get_fqdn(%struct.sockaddr* %0, i32 %1) {
%3 = alloca %struct.sockaddr*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store %struct.sockaddr* %0, %struct.sockaddr** %3
store i32 %1, i32* %4
%7 = call i8* @malloc(i32 51)
store i8* %7, i8** %5
%8 = load %struct.sockaddr*, %struct.sockaddr** %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = call i32 @getnameinfo(%struct.sockaddr* %8, i32 %9, i8* %10, i32 50, i32* null, i32 0, i32 0)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i8* @util_get_fqdn(%struct.sockaddr* %0, i32 %1) {
%3 = tail call dereferenceable_or_null(51) i8* @malloc(i32 51)
%4 = tail call i32 @getnameinfo(%struct.sockaddr* %0, i32 %1, i8* %3, i32 50, i32* null, i32 0, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ delay();
unsigned char getc(void) {
  while (((*((volatile unsigned long *)0x7F005018)) & (1 << 6)) == 0 &&
         ((*((volatile unsigned long *)0x7F005018)) & 0x3f) == 0)
    delay();
  return (*((volatile unsigned char *)0x7F005024));
}


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    111d <getc+0xd>
mov    $0x7f005018,%eax
mov    (%rax),%rcx
and    $0x40,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    114e <getc+0x3e>
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x3f,%rax
cmp    $0x0,%rax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
test   $0x1,%al
jne    115e <getc+0x4e>
jmp    116a <getc+0x5a>
mov    $0x0,%al
call   1030 <delay@plt>
jmp    111d <getc+0xd>
mov    $0x7f005024,%eax
mov    (%rax),%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
push   %rax
testq  $0x40,0x7f005018
jne    1143 <getc+0x33>
nop
testq  $0x3f,0x7f005018
jne    1143 <getc+0x33>
xor    %eax,%eax
call   1030 <delay@plt>
testq  $0x40,0x7f005018
je     1120 <getc+0x10>
mov    0x7f005024,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @getc() {
br label %1
1: ; preds = %11, %0
%2 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%3 = and i64 %2, 64
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%7 = and i64 %6, 63
%8 = icmp eq i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = call i32 (...) @delay()
br label %1
13: ; preds = %9
%14 = load volatile i8, i8* inttoptr (i64 2130726948 to i8*)
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @getc() {
%1 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%2 = and i64 %1, 64
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %0, %8
%5 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%6 = and i64 %5, 63
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = tail call i32 (...) @delay()
%10 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%11 = and i64 %10, 64
%12 = icmp eq i64 %11, 0
br i1 %12, label %4, label %13
13: ; preds = %4, %8, %0
%14 = load volatile i8, i8* inttoptr (i64 2130726948 to i8*)
ret i8 %14
}
/* Variables and functions */
int isspace(char);
int sep_isspace(char c) { return (isspace(c)); }


x86 assembly (clang, -O0):
<sep_isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sep_isspace>:
jmp    1030 <isspace@plt>

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

LLVM IR (-O2):
define i32 @sep_isspace(i8 signext %0) {
%2 = tail call i32 @isspace(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ copiaStr(char *, char **);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *a = "alou";
  char *b;
  printf("%s\n", a);
  copiaStr(a, &b);
  printf("%s\n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <copiaStr@plt>
mov    -0x10(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeda(%rip),%r14
lea    0xece(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <copiaStr@plt>
mov    (%rsp),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"alou\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @copiaStr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1)
%5 = load i8*, i8** %1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XDestroyWindowEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XDestroyWindowEvent_display(void *_p, void *_v) {
  ((XDestroyWindowEvent *)_p)->display = (Display *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XDestroyWindowEvent_display(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 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XDestroyWindowEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_TanF_init(void) {
  _hmt_register_covercase("HMM_TanF", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_TanF_init>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"HMM_TanF\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_TanF_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"HMM_TanF\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_TanF_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sub_128(unsigned int *, unsigned int *);
int sub_int(unsigned int *y, unsigned int x) {
  unsigned int z[4] = {0, 0, 0, 0};
  z[3] = x;
  return sub_128(z, y);
}


x86 assembly (clang, -O0):
<sub_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <sub_128@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_int>:
sub    $0x18,%rsp
mov    %rdi,%rax
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %esi,0xc(%rsp)
mov    %rsp,%rdi
mov    %rax,%rsi
call   1030 <sub_128@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sub_int(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [4 x i32]
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = bitcast [4 x i32]* %5 to i8*
%7 = load i32, i32* %4
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
store i32 %7, i32* %8
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%10 = load i32*, i32** %3
%11 = call i32 @sub_128(i32* %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @sub_int(i32* %0, i32 %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
store i32 %1, i32* %5
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%7 = call i32 @sub_128(i32* %6, i32* %0)
ret i32 %7
}
void ability_move(struct client *cl, struct shot *shot, int socket) {}


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

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

LLVM IR (-O0):
%struct.client = type opaque
%struct.shot = type opaque
define void @ability_move(%struct.client* %0, %struct.shot* %1, i32 %2) {
%4 = alloca %struct.client*
%5 = alloca %struct.shot*
%6 = alloca i32
store %struct.client* %0, %struct.client** %4
store %struct.shot* %1, %struct.shot** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.client = type opaque
%struct.shot = type opaque
define void @ability_move(%struct.client* nocapture %0, %struct.shot* nocapture %1, i32 %2) {
ret void
}
void pathconN_nm3_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathconN_nm3_decref() {
ret void
}
int getMax(int value1, int value2) {
  if (value1 > value2) {
    return value1;
  } else {
    return value2;
  }
}


x86 assembly (clang, -O0):
<getMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <getMax+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <getMax+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @getMax(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 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @getMax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void DisplayUsage(const char *progname) {
  fprintf(stderr,
          "Usage %s <snort log dir> <command> [-text]"
          "[\"sub command string\"]\n",
          progname);
}


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

x86 assembly (clang, -O2):
<DisplayUsage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"Usage %s <snort log dir> <command> [-text][\22sub command string\22]\0A\00"
define void @DisplayUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"Usage %s <snort log dir> <command> [-text][\22sub command string\22]\0A\00"
define void @DisplayUsage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_by_all_variants(int, int *);
void sys_poll(int variant_count, int *child, struct user_regs_struct *regs) {
  exec_by_all_variants(variant_count, child);
}


x86 assembly (clang, -O0):
<sys_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <exec_by_all_variants@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_poll>:
jmp    1030 <exec_by_all_variants@plt>

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define void @sys_poll(i32 %0, i32* %1, %struct.user_regs_struct* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.user_regs_struct*
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.user_regs_struct* %2, %struct.user_regs_struct** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = call i32 @exec_by_all_variants(i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @sys_poll(i32 %0, i32* %1, %struct.user_regs_struct* nocapture readnone %2) {
%4 = tail call i32 @exec_by_all_variants(i32 %0, i32* %1)
ret void
}
/* Type definitions */
struct _Locale_time {
  int dummy;
};
struct _Locale_name_hint {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_time *_Locale_time_create(const char *name,
                                         struct _Locale_name_hint *hint,
                                         int *__err_code) {
  return (struct _Locale_time *)_Locale_create(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_time_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

LLVM IR (-O0):
%struct._Locale_time = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_time* @_Locale_time_create(i8* %0, %struct._Locale_name_hint* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct._Locale_name_hint*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %6
%9 = call i64 @_Locale_create(i8* %7, i32* %8)
%10 = inttoptr i64 %9 to %struct._Locale_time*
ret %struct._Locale_time* %10
}

LLVM IR (-O2):
%struct._Locale_time = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_time* @_Locale_time_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_time*
ret %struct._Locale_time* %5
}
int is_absolute_path(const char *path) { return path[0] == '/'; }


x86 assembly (clang, -O0):
<is_absolute_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_absolute_path>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_absolute_path(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 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_absolute_path(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int /*<<< orphan*/ squareRoot(double);
int main() {
  double num = 0;
  printf("Enter number for finding square root:");
  scanf("%lf", &num);
  printf("Square root of %lf is %lf\n", num, squareRoot(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <squareRoot@plt>
movsd  -0x18(%rbp),%xmm0
mov    %eax,%esi
lea    0xea3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1050 <squareRoot@plt>
lea    0xeb6(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    %eax,%esi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Enter number for finding square root:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [27 x i8] c"Square root of %lf is %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = load double, double* %2
%7 = call i32 @squareRoot(double %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Enter number for finding square root:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [27 x i8] c"Square root of %lf is %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call i32 @squareRoot(double %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double %5, i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void dmc_unrar_io_stdio_close_func(void *opaque) { fclose((FILE *)opaque); }


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

x86 assembly (clang, -O2):
<dmc_unrar_io_stdio_close_func>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @dmc_unrar_io_stdio_close_func(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ l;

/* Variables and functions */
int fls(unsigned long);
int fls64(unsigned long);
__attribute__((always_)) unsigned fls_long(unsigned long l) {
  if (sizeof(l) == 4)
    return fls(l);
  return fls64(l);
}


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

x86 assembly (clang, -O2):
<fls_long>:
jmp    1030 <fls64@plt>

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

LLVM IR (-O2):
define i32 @fls_long(i64 %0) {
%2 = tail call i32 @fls64(i64 %0)
ret i32 %2
}
int libenv_version() { return 1; }


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

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

LLVM IR (-O0):
define i32 @libenv_version() {
ret i32 1
}

LLVM IR (-O2):
define i32 @libenv_version() {
ret i32 1
}
__attribute__((used)) int _kill(int pid, int sig) {
  (void)pid;
  (void)sig;
  return -1;
}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i32)* @_kill to i8*)], section "llvm.metadata"
define i32 @_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
ret i32 -1
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i32)* @_kill to i8*)], section "llvm.metadata"
define i32 @_kill(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M301_f(char *s) {
  debug("M301_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M301_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M301_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M301_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M301_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M301_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M301_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
const char *get_commands() {
  static const char *commands = "hello start";
  return commands;
}


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

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

LLVM IR (-O0):
@get_commands.commands = internal global i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0)
@.str = [12 x i8] c"hello start\00"
define i8* @get_commands() {
%1 = load i8*, i8** @get_commands.commands
ret i8* %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello start\00"
define i8* @get_commands() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
void adjustVerticalCoordinate(int *y, int *x, int amount) { *y += amount; }


x86 assembly (clang, -O0):
<adjustVerticalCoordinate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjustVerticalCoordinate>:
add    %edx,(%rdi)
ret

LLVM IR (-O0):
define void @adjustVerticalCoordinate(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = add nsw i32 %9, %7
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @adjustVerticalCoordinate(i32* nocapture %0, i32* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* %0
%5 = add nsw i32 %4, %2
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assign(int *, int);
int /*<<< orphan*/ free(int *);
int *safe_allocate();
void function_call_returns_allocated_pointer() {
  int *p = NULL;
  p = safe_allocate();
  assign(p, 42);
  free(p);
}


x86 assembly (clang, -O0):
<function_call_returns_allocated_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <safe_allocate@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2a,%esi
call   1050 <assign@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_call_returns_allocated_pointer>:
push   %rbx
xor    %eax,%eax
call   1040 <safe_allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2a,%esi
call   1050 <assign@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @function_call_returns_allocated_pointer() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = call i32* (...) @safe_allocate()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @assign(i32* %3, i32 42)
%5 = load i32*, i32** %1
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @function_call_returns_allocated_pointer() {
%1 = tail call i32* (...) @safe_allocate()
%2 = tail call i32 @assign(i32* %1, i32 42)
%3 = tail call i32 @free(i32* %1)
ret void
}
int **f(int x) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i32** @f(i32 %0) {
ret i32** null
}
/* Variables and functions */
int average(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int array[] = {1, 2, 3, 4};
  int avg = average(array, 4);
  printf("%d", avg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <average@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <average@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.array = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @average(i32* %3, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_path(int pre[], int source, int destination) {
  if (pre[destination] != source)
    print_path(pre, source, pre[destination]);
  printf("%-4d->", pre[destination]);
}


x86 assembly (clang, -O0):
<print_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
je     115d <print_path+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
call   1040 <print_path@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_path>:
push   %r14
push   %rbx
push   %rax
movslq %edx,%r14
mov    (%rdi,%r14,4),%edx
cmp    %esi,%edx
je     113b <print_path+0x1b>
mov    %rdi,%rbx
call   1040 <print_path@plt>
mov    (%rbx,%r14,4),%esi
lea    0xebe(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%-4d->\00"
define void @print_path(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = load i32, i32* %5
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %3
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = load i32*, i32** %4
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
br label %22
22: ; preds = %14, %3
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %27)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%-4d->\00"
define void @print_path(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, %1
br i1 %7, label %10, label %8
8: ; preds = %3
tail call void @print_path(i32* %0, i32 %1, i32 %6)
%9 = load i32, i32* %5
br label %10
10: ; preds = %8, %3
%11 = phi i32 [ %9, %8 ], [ %1, %3 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}
unsigned _ll_get_real_ind(long i, unsigned len) {
  if (len == 0) {
    return 0;
  }
  if (i < 0) {
    i = i % len;
    if (i < 0) {
      i += len;
    }
  }
  return i;
}


x86 assembly (clang, -O0):
<_ll_get_real_ind>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1121 <_ll_get_real_ind+0x21>
movl   $0x0,-0x4(%rbp)
jmp    115e <_ll_get_real_ind+0x5e>
cmpq   $0x0,-0x10(%rbp)
jge    1157 <_ll_get_real_ind+0x57>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
cqto
idiv   %rcx
mov    %rdx,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1152 <_ll_get_real_ind+0x52>
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1157 <_ll_get_real_ind+0x57>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ll_get_real_ind>:
test   %esi,%esi
je     110d <_ll_get_real_ind+0xd>
mov    %rdi,%rax
test   %rdi,%rdi
js     1110 <_ll_get_real_ind+0x10>
ret
xor    %eax,%eax
ret
mov    %esi,%ecx
neg    %rax
mov    %rax,%rdx
shr    $0x20,%rdx
je     1125 <_ll_get_real_ind+0x25>
xor    %edx,%edx
div    %rcx
jmp    1129 <_ll_get_real_ind+0x29>
xor    %edx,%edx
div    %ecx
sub    %rdx,%rcx
test   %rdx,%rdx
cmove  %rdx,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i32 @_ll_get_real_ind(i64 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %28
9: ; preds = %2
%10 = load i64, i64* %4
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = load i64, i64* %4
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = srem i64 %13, %15
store i64 %16, i64* %4
%17 = load i64, i64* %4
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %12
%20 = load i32, i32* %5
%21 = zext i32 %20 to i64
%22 = load i64, i64* %4
%23 = add nsw i64 %22, %21
store i64 %23, i64* %4
br label %24
24: ; preds = %19, %12
br label %25
25: ; preds = %24, %9
%26 = load i64, i64* %4
%27 = trunc i64 %26 to i32
store i32 %27, i32* %3
br label %28
28: ; preds = %25, %8
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @_ll_get_real_ind(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = icmp slt i64 %0, 0
br i1 %5, label %6, label %13
6: ; preds = %4
%7 = zext i32 %1 to i64
%8 = sub i64 0, %0
%9 = urem i64 %8, %7
%10 = icmp eq i64 %9, 0
%11 = sub nsw i64 %7, %9
%12 = select i1 %10, i64 0, i64 %11
br label %13
13: ; preds = %6, %4
%14 = phi i64 [ %0, %4 ], [ %12, %6 ]
%15 = trunc i64 %14 to i32
br label %16
16: ; preds = %2, %13
%17 = phi i32 [ %15, %13 ], [ 0, %2 ]
ret i32 %17
}