xunge/DecIR huggingface dataset:
void mbrk(address) char *address;
{
  if (brk(address) < 0)
    error(1, "Cannot reset memory", ((char *)0));
}


x86 assembly (clang, -O0):
<mbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <brk@plt>
cmp    $0x0,%eax
jge    1157 <mbrk+0x37>
mov    $0x1,%edi
lea    0xeb4(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbrk>:
push   %rax
xor    %eax,%eax
call   1030 <brk@plt>
test   %eax,%eax
js     112e <mbrk+0xe>
pop    %rax
ret
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
xor    %edx,%edx
xor    %eax,%eax
pop    %rcx
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Cannot reset memory\00"
define void @mbrk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @brk to i32 (i8*, ...)*)(i8* %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* null)
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Cannot reset memory\00"
define void @mbrk(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @brk to i32 (i8*, ...)*)(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* null)
br label %6
6: ; preds = %4, %1
ret void
}
int cmp_domains(const char *name, const char *pattern) {
  const char *start;
  if (strlen(name) < strlen(pattern)) {
    return 0;
  }
  start = name + strlen(name) - strlen(pattern);
  return !strcasecmp(start, pattern);
}


x86 assembly (clang, -O0):
<cmp_domains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jae    1162 <cmp_domains+0x42>
movl   $0x0,-0x4(%rbp)
jmp    11ba <cmp_domains+0x9a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdx
mov    -0x30(%rbp),%rax
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_domains>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%r15
jb     115f <cmp_domains+0x3f>
add    %r15,%rbx
sub    %rcx,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcasecmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @cmp_domains(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = load i8*, i8** %5
%10 = call i64 @strlen(i8* %9)
%11 = icmp ult i64 %8, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %28
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = load i8*, i8** %4
%16 = call i64 @strlen(i8* %15)
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8*, i8** %5
%19 = call i64 @strlen(i8* %18)
%20 = sub i64 0, %19
%21 = getelementptr inbounds i8, i8* %17, i64 %20
store i8* %21, i8** %6
%22 = load i8*, i8** %6
%23 = load i8*, i8** %5
%24 = call i32 @strcasecmp(i8* %22, i8* %23)
%25 = icmp ne i32 %24, 0
%26 = xor i1 %25, true
%27 = zext i1 %26 to i32
store i32 %27, i32* %3
br label %28
28: ; preds = %13, %12
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @cmp_domains(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 %3
%8 = sub i64 0, %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = tail call i32 @strcasecmp(i8* %9, i8* %1)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %2, %6
%14 = phi i32 [ %12, %6 ], [ 0, %2 ]
ret i32 %14
}
void ostatue(void) {}


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

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

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

LLVM IR (-O2):
define void @ostatue() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _arakoon_log_debug(char *, int, int, int /*<<< orphan*/);
int close(int);
int /*<<< orphan*/ errno;
int _arakoon_networking_close_wrapper(int fd) {
  int rc = close(fd);
  _arakoon_log_debug("arakoon-networking: close(%d) = %d, errno = %d", fd, rc,
                     errno);
  return rc;
}


x86 assembly (clang, -O0):
<_arakoon_networking_close_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    0x2e9d(%rip),%rax
mov    (%rax),%ecx
lea    0xeb4(%rip),%rdi
call   1030 <_arakoon_log_debug@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_arakoon_networking_close_wrapper>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <close@plt>
mov    %eax,%ebp
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <_arakoon_log_debug@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [47 x i8] c"arakoon-networking: close(%d) = %d, errno = %d\00"
@errno = global i32 0
define i32 @_arakoon_networking_close_wrapper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* @errno
%9 = call i32 @_arakoon_log_debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [47 x i8] c"arakoon-networking: close(%d) = %d, errno = %d\00"
@errno = global i32 0
define i32 @_arakoon_networking_close_wrapper(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = load i32, i32* @errno
%4 = tail call i32 @_arakoon_log_debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2, i32 %3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void bar(void) { fprintf(stderr, "bar\n"); }


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

x86 assembly (clang, -O2):
<bar>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"bar\0A\00"
define void @bar() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"bar\0A\00"
define void @bar() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int glutGetWindow();
int /*<<< orphan*/ printf(char *, int, int, int);
void box(int button, int state) {
  printf("box %d %d (%d)\n", button, state, glutGetWindow());
}


x86 assembly (clang, -O0):
<box>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <glutGetWindow@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<box>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <glutGetWindow@plt>
lea    0xecb(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"box %d %d (%d)\0A\00"
define void @box(i32 %0, i32 %1) {
%3 = tail call i32 (...) @glutGetWindow()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XIMStatusDrawCallbackStruct;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XIMStatusDrawCallbackStruct(void) {
  XIMStatusDrawCallbackStruct *_p = (XIMStatusDrawCallbackStruct *)malloc(
      sizeof(XIMStatusDrawCallbackStruct));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XIMStatusDrawCallbackStruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XIMStatusDrawCallbackStruct+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XIMStatusDrawCallbackStruct>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XIMStatusDrawCallbackStruct+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XIMStatusDrawCallbackStruct() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XIMStatusDrawCallbackStruct() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
int isPallin(int a) {
  int number = a;
  int b;
  while (a != 0) {
    int remd = a % 10;
    b = b * 10 + remd;
    a /= 10;
  }
  if (number == b)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<isPallin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1142 <isPallin+0x42>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
imul   $0xa,-0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    110d <isPallin+0xd>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    115a <isPallin+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1161 <isPallin+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPallin>:
test   %edi,%edi
je     1141 <isPallin+0x41>
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
lea    (%rdx,%rdx,4),%r8d
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %ecx,%edx
sub    %esi,%edx
lea    (%rdx,%r8,2),%edx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <isPallin+0x10>
xor    %eax,%eax
cmp    %edi,%edx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @isPallin(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ undef, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = mul nsw i32 %4, 10
%8 = add nsw i32 %7, %6
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ undef, %1 ], [ %8, %3 ]
%14 = icmp ne i32 %13, %0
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Type definitions */
struct sip_msg {
  int dummy;
};

/* Variables and functions */
int do_RR(struct sip_msg *, int /*<<< orphan*/);
int record_route_strict(struct sip_msg *_m, char *_s1, char *_s2) {
  return do_RR(_m, 0);
}


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

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

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

LLVM IR (-O2):
%struct.sip_msg = type { i32 }
define i32 @record_route_strict(%struct.sip_msg* %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @do_RR(%struct.sip_msg* %0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_8008(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_8008() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Type definitions */
struct vector_entry {
  int dummy;
};
struct vector {
  int dummy;
};

/* Variables and functions */
struct vector_entry *__vector_at(struct vector *, int /*<<< orphan*/);
struct vector_entry *vector_front(struct vector *vector) {
  return __vector_at(vector, 0);
}


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

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

LLVM IR (-O0):
%struct.vector_entry = type { i32 }
%struct.vector = type { i32 }
define %struct.vector_entry* @vector_front(%struct.vector* %0) {
%2 = alloca %struct.vector*
store %struct.vector* %0, %struct.vector** %2
%3 = load %struct.vector*, %struct.vector** %2
%4 = call %struct.vector_entry* @__vector_at(%struct.vector* %3, i32 0)
ret %struct.vector_entry* %4
}

LLVM IR (-O2):
%struct.vector_entry = type { i32 }
%struct.vector = type { i32 }
define %struct.vector_entry* @vector_front(%struct.vector* %0) {
%2 = tail call %struct.vector_entry* @__vector_at(%struct.vector* %0, i32 0)
ret %struct.vector_entry* %2
}
int SDL_abs(int x) { return ((x) < 0 ? -(x) : (x)); }


x86 assembly (clang, -O0):
<SDL_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <SDL_abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <SDL_abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @SDL_abs(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 %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @SDL_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
unsigned long whois_hash(void *d, unsigned dl) { return (unsigned long)d; }


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

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

LLVM IR (-O0):
define i64 @whois_hash(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 = ptrtoint i8* %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @whois_hash(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void generateFooter(FILE *stream) {
  fprintf(stream, "#endif // CONFIG_CODEDOM\n");
  fprintf(stream, "\n");
  fprintf(stream, "}; // namespace System.CodeDom\n");
}


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

x86 assembly (clang, -O2):
<generateFooter>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
lea    0xec9(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"#endif // CONFIG_CODEDOM\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [32 x i8] c"}; // namespace System.CodeDom\0A\00"
define void @generateFooter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"#endif // CONFIG_CODEDOM\0A\00"
@.str.2 = [32 x i8] c"}; // namespace System.CodeDom\0A\00"
define void @generateFooter(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 25, i64 1, i32* %0)
%3 = tail call i32 @fputc(i32 10, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i64 31, i64 1, i32* %0)
ret void
}
int cmp_int(const void *t1, const void *t2) {
  int a = *((int *)t1);
  int b = *((int *)t2);
  return a < b ? -1 : (a > b ? 1 : 0);
}


x86 assembly (clang, -O0):
<cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1137 <cmp_int+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <cmp_int+0x4c>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = icmp sgt i32 %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ -1, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
double drand48();
double gen_uniform_double(void) {
  double tmp;
  {
    { tmp = drand48(); }
    return (tmp);
  }
}


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

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

LLVM IR (-O0):
define double @gen_uniform_double() {
%1 = alloca double
%2 = call double (...) @drand48()
store double %2, double* %1
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @gen_uniform_double() {
%1 = tail call double (...) @drand48()
ret double %1
}
int exact_square(int number) {
  int multiplier;
  int multiplication;
  if (number == 0) {
    return 1;
  }
  if (number < 0) {
    return -1;
  } else {
    for (multiplier = 1; multiplication < number; multiplier++) {
      multiplication = multiplier * multiplier;
      if (multiplication == number) {
        return 1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <exact_square+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1187 <exact_square+0x87>
cmpl   $0x0,-0x8(%rbp)
jge    1133 <exact_square+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1187 <exact_square+0x87>
movl   $0x1,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117b <exact_square+0x7b>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1168 <exact_square+0x68>
movl   $0x1,-0x4(%rbp)
jmp    1187 <exact_square+0x87>
jmp    116d <exact_square+0x6d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <exact_square+0x3a>
jmp    1180 <exact_square+0x80>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
mov    %edi,%ecx
sar    $0x1f,%ecx
test   %edi,%edi
mov    $0x1,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = ashr i32 %0, 31
%4 = select i1 %2, i32 1, i32 %3
ret i32 %4
}
void zzcheck_memory_leaks(void) {}


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

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

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

LLVM IR (-O2):
define void @zzcheck_memory_leaks() {
ret void
}
int fb_ConsoleGetkey(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fb_ConsoleGetkey() {
ret i32 0
}
void FanIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  DEBUG_ASSERT(ulBase == 0x40084000);
  DEBUG_ASSERT(pfnHandler);
  IntRegister(130, pfnHandler);
  IntEnable(130);
}


x86 assembly (clang, -O0):
<FanIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40084000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1050 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rsi
mov    $0x82,%edi
mov    $0x0,%al
call   1040 <IntRegister@plt>
mov    $0x82,%edi
mov    $0x0,%al
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanIntRegister>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x40084000,%rdi
sete   %al
mov    %eax,%edi
xor    %eax,%eax
call   1050 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <DEBUG_ASSERT@plt>
mov    $0x82,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <IntRegister@plt>
mov    $0x82,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @FanIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074282496
%7 = zext i1 %6 to i32
%8 = call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i32, ...)*)(i32 %7)
%9 = load void ()*, void ()** %4
%10 = call i32 (void ()*, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (void ()*, ...)*)(void ()* %9)
%11 = load void ()*, void ()** %4
%12 = call i32 (i32, void ()*, ...) bitcast (i32 (...)* @IntRegister to i32 (i32, void ()*, ...)*)(i32 130, void ()* %11)
%13 = call i32 (i32, ...) bitcast (i32 (...)* @IntEnable to i32 (i32, ...)*)(i32 130)
ret void
}

LLVM IR (-O2):
define void @FanIntRegister(i64 %0, void ()* %1) {
%3 = icmp eq i64 %0, 1074282496
%4 = zext i1 %3 to i32
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i32, ...)*)(i32 %4)
%6 = tail call i32 (void ()*, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (void ()*, ...)*)(void ()* %1)
%7 = tail call i32 (i32, void ()*, ...) bitcast (i32 (...)* @IntRegister to i32 (i32, void ()*, ...)*)(i32 130, void ()* %1)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @IntEnable to i32 (i32, ...)*)(i32 130)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ UINT32_MAX;
scalar_t__ pcg32_random();
uint32_t __attribute__((no)) ranged_random_mod(uint32_t range) {
  uint32_t random32bit, candidate;
  do {
    random32bit = pcg32_random();
    candidate = random32bit % range;
  } while (random32bit - candidate > UINT32_MAX - range + 1);
  return candidate;
}


x86 assembly (clang, -O0):
<ranged_random_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <pcg32_random@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x8(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    0x2eb4(%rip),%rcx
mov    (%rcx),%rcx
sub    -0x8(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jg     111c <ranged_random_mod+0xc>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranged_random_mod>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%r14d
sub    %rdi,%r14
mov    0x2ed0(%rip),%r15
jmp    1146 <ranged_random_mod+0x36>
nopw   0x0(%rax,%rax,1)
mov    %rcx,%rax
cqto
idiv   %rbx
sub    %rdx,%rcx
mov    (%r15),%rax
add    %r14,%rax
cmp    %rax,%rcx
jle    1161 <ranged_random_mod+0x51>
xor    %eax,%eax
call   1030 <pcg32_random@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
jne    1130 <ranged_random_mod+0x20>
mov    %ecx,%eax
xor    %edx,%edx
div    %ebx
jmp    1138 <ranged_random_mod+0x28>
mov    %rdx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@UINT32_MAX = global i64 0
define i64 @ranged_random_mod(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
br label %5
5: ; preds = %10, %1
%6 = call i64 (...) @pcg32_random()
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %2
%9 = srem i64 %7, %8
store i64 %9, i64* %4
br label %10
10: ; preds = %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = sub nsw i64 %11, %12
%14 = load i64, i64* @UINT32_MAX
%15 = load i64, i64* %2
%16 = sub nsw i64 %14, %15
%17 = add nsw i64 %16, 1
%18 = icmp sgt i64 %13, %17
br i1 %18, label %5, label %19
19: ; preds = %10
%20 = load i64, i64* %4
ret i64 %20
}

LLVM IR (-O2):
@UINT32_MAX = global i64 0
define i64 @ranged_random_mod(i64 %0) {
%2 = sub i64 1, %0
br label %3
3: ; preds = %3, %1
%4 = tail call i64 (...) @pcg32_random()
%5 = srem i64 %4, %0
%6 = sub nsw i64 %4, %5
%7 = load i64, i64* @UINT32_MAX
%8 = add i64 %2, %7
%9 = icmp sgt i64 %6, %8
br i1 %9, label %3, label %10
10: ; preds = %3
ret i64 %5
}
int hash(int i, int n, int *table) {
  int pos;
  pos = i % n;
  while (*(table + pos) != -1) {
    if (pos == n) {
      pos = 0;
    } else {
      pos++;
    }
  }
  return pos;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1150 <hash+0x50>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1142 <hash+0x42>
movl   $0x0,-0x14(%rbp)
jmp    114b <hash+0x4b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <hash+0x18>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %rdx,%rcx
mov    %edi,%eax
cltd
idiv   %esi
movslq %edx,%rax
cmpl   $0xffffffff,(%rcx,%rax,4)
je     1134 <hash+0x34>
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rdx),%eax
cmp    %esi,%edx
cmove  %edi,%eax
movslq %eax,%rdx
cmpl   $0xffffffff,(%rcx,%rdx,4)
mov    %eax,%edx
jne    1120 <hash+0x20>
ret
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash(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 = load i32, i32* %5
%10 = srem i32 %8, %9
store i32 %10, i32* %7
br label %11
11: ; preds = %26, %3
%12 = load i32*, i32** %6
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, -1
br i1 %17, label %18, label %27
18: ; preds = %11
%19 = load i32, i32* %7
%20 = load i32, i32* %5
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 0, i32* %7
br label %26
23: ; preds = %18
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %26
26: ; preds = %23, %22
br label %11
27: ; preds = %11
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @hash(i32 %0, i32 %1, i32* nocapture %2) {
%4 = srem i32 %0, %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %2, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, -1
br i1 %8, label %18, label %9
9: ; preds = %3, %9
%10 = phi i32 [ %13, %9 ], [ %4, %3 ]
%11 = icmp eq i32 %10, %1
%12 = add nsw i32 %10, 1
%13 = select i1 %11, i32 0, i32 %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %2, i64 %14
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %9
18: ; preds = %9, %3
%19 = phi i32 [ %4, %3 ], [ %13, %9 ]
ret i32 %19
}
/* Variables and functions */
unsigned long _find_next_bit(unsigned long const *, unsigned long,
                             unsigned long, unsigned long);
unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
                            unsigned long offset) {
  return _find_next_bit(addr, size, offset, 0UL);
}


x86 assembly (clang, -O0):
<find_next_bit>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <_find_next_bit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_next_bit>:
xor    %ecx,%ecx
jmp    1030 <_find_next_bit@plt>

LLVM IR (-O0):
define i64 @find_next_bit(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i64 @_find_next_bit(i64* %7, i64 %8, i64 %9, i64 0)
ret i64 %10
}

LLVM IR (-O2):
define i64 @find_next_bit(i64* %0, i64 %1, i64 %2) {
%4 = tail call i64 @_find_next_bit(i64* %0, i64 %1, i64 %2, i64 0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_from_string() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_from_string"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_format_info_from_string\00"
define i32 @pa_format_info_from_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fileToScreen();
int function1a();
int function1b(int, int);
int function3(int, int, int);
int /*<<< orphan*/ readbits();
int /*<<< orphan*/ uniquewords();
int /*<<< orphan*/ writebits();
int main() {
  int f = function3(1, 2, 3);
  f = function1b(5, 6);
  f = function1a();
  writebits();
  readbits();
  fileToScreen();
  uniquewords();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <function3@plt>
mov    %eax,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x6,%esi
call   1080 <function1b@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <function1a@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1070 <writebits@plt>
mov    $0x0,%al
call   1030 <readbits@plt>
mov    $0x0,%al
call   1050 <fileToScreen@plt>
mov    $0x0,%al
call   1090 <uniquewords@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <function3@plt>
mov    $0x5,%edi
mov    $0x6,%esi
call   1080 <function1b@plt>
xor    %eax,%eax
call   1060 <function1a@plt>
xor    %eax,%eax
call   1070 <writebits@plt>
xor    %eax,%eax
call   1030 <readbits@plt>
xor    %eax,%eax
call   1050 <fileToScreen@plt>
xor    %eax,%eax
call   1090 <uniquewords@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 @function3(i32 1, i32 2, i32 3)
store i32 %2, i32* %1
%3 = call i32 @function1b(i32 5, i32 6)
store i32 %3, i32* %1
%4 = call i32 (...) @function1a()
store i32 %4, i32* %1
%5 = call i32 (...) @writebits()
%6 = call i32 (...) @readbits()
%7 = call i32 (...) @fileToScreen()
%8 = call i32 (...) @uniquewords()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @function3(i32 1, i32 2, i32 3)
%2 = tail call i32 @function1b(i32 5, i32 6)
%3 = tail call i32 (...) @function1a()
%4 = tail call i32 (...) @writebits()
%5 = tail call i32 (...) @readbits()
%6 = tail call i32 (...) @fileToScreen()
%7 = tail call i32 (...) @uniquewords()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void re_report(const char *error) {
  fprintf(stderr, "REGEXP ERROR: %s\n", error);
}


x86 assembly (clang, -O0):
<re_report>:
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):
<re_report>:
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 = [18 x i8] c"REGEXP ERROR: %s\0A\00"
define void @re_report(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 ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"REGEXP ERROR: %s\0A\00"
define void @re_report(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct resist_setup_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ resist_free(struct resist_setup_t *);
void resist_setup_free(struct resist_setup_t *stp) { resist_free(stp); }


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

x86 assembly (clang, -O2):
<resist_setup_free>:
jmp    1030 <resist_free@plt>

LLVM IR (-O0):
%struct.resist_setup_t = type { i32 }
define void @resist_setup_free(%struct.resist_setup_t* %0) {
%2 = alloca %struct.resist_setup_t*
store %struct.resist_setup_t* %0, %struct.resist_setup_t** %2
%3 = load %struct.resist_setup_t*, %struct.resist_setup_t** %2
%4 = call i32 @resist_free(%struct.resist_setup_t* %3)
ret void
}

LLVM IR (-O2):
%struct.resist_setup_t = type { i32 }
define void @resist_setup_free(%struct.resist_setup_t* %0) {
%2 = tail call i32 @resist_free(%struct.resist_setup_t* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_out8(int, int);
void interrupt_handler27(int *esp) { io_out8((0x0020), 0x67); }


x86 assembly (clang, -O0):
<interrupt_handler27>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x20,%edi
mov    $0x67,%esi
call   1030 <io_out8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_handler27>:
mov    $0x20,%edi
mov    $0x67,%esi
jmp    1030 <io_out8@plt>

LLVM IR (-O0):
define void @interrupt_handler27(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @io_out8(i32 32, i32 103)
ret void
}

LLVM IR (-O2):
define void @interrupt_handler27(i32* nocapture readnone %0) {
%2 = tail call i32 @io_out8(i32 32, i32 103)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int solveMeFirst(int, int);
int main() {
  int num1, num2;
  scanf("%d %d", &num1, &num2);
  int sum;
  sum = solveMeFirst(num1, num2);
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <solveMeFirst@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <solveMeFirst@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @solveMeFirst(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
main(argc, argv) int argc;
char *argv[];
{
  int local_j = argc;
  char *s;
  printf("Hello from execd-prog...\n");
  if (argc != 2) {
    printf("expected one string argument\n");
    exit(-1);
  }
  s = argv[1];
  printf("argument received: %s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2,-0x4(%rbp)
je     1165 <main+0x45>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x2,%ebp
jne    1164 <main+0x34>
mov    0x8(%rbx),%rsi
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Hello from execd-prog...\0A\00"
@.str.1 = [30 x i8] c"expected one string argument\0A\00"
@.str.2 = [23 x i8] c"argument received: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i32, i32* %3
store i32 %7, i32* %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
store i8* %16, i8** %6
%17 = load i8*, i8** %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [23 x i8] c"argument received: %s\0A\00"
@str = [25 x i8] c"Hello from execd-prog...\00"
@str.3 = [29 x i8] c"expected one string argument\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = icmp eq i32 %0, 2
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.3, i64 0, i64 0))
tail call void @exit(i32 -1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %9)
ret i32 0
}
/* Variables and functions */
int recv(int, void *, int, int /*<<< orphan*/);
int idrnet_recv_buf(int sockfd, void *buf, int len) {
  return recv(sockfd, buf, len, 0);
}


x86 assembly (clang, -O0):
<idrnet_recv_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idrnet_recv_buf>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @idrnet_recv_buf(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @recv(i32 %7, i8* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @idrnet_recv_buf(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}