xunge/DecIR huggingface dataset:
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ clean(char *);
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
char *query(char *query, int connection) {
  char *buffer = calloc(1024, sizeof(char));
  write(connection, query, strlen(query));
  read(connection, buffer, 1024 * sizeof(char));
  clean(buffer);
  return buffer;
}


x86 assembly (clang, -O0):
<query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x400,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x400,%edx
call   1050 <read@plt>
mov    -0x18(%rbp),%rdi
call   1070 <clean@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    $0x400,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    $0x400,%edx
call   1050 <read@plt>
mov    %rbp,%rdi
call   1070 <clean@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @query(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i8* @calloc(i32 1024, i32 1)
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write(i32 %7, i8* %8, i32 %10)
%12 = load i32, i32* %4
%13 = load i8*, i8** %5
%14 = call i32 @read(i32 %12, i8* %13, i32 1024)
%15 = load i8*, i8** %5
%16 = call i32 @clean(i8* %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @query(i8* %0, i32 %1) {
%3 = tail call dereferenceable_or_null(1024) i8* @calloc(i32 1024, i32 1)
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @write(i32 %1, i8* %0, i32 %4)
%6 = tail call i32 @read(i32 %1, i8* %3, i32 1024)
%7 = tail call i32 @clean(i8* %3)
ret i8* %3
}
int any_match(void *param, void *priv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @any_match(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char *lower(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char s[] = "Harry Potter";
  printf("%s\n", s);
  printf("%s\n", lower(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x11(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x11(%rbp),%rdi
call   1040 <lower@plt>
mov    %rax,%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x726574746f5020,%rax
mov    %rax,0xd(%rsp)
movabs $0x6f50207972726148,%rax
20 50 6f
mov    %rax,0x8(%rsp)
lea    0xec1(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <lower@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.s = [13 x i8] c"Harry Potter\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @lower(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ factorial(int);
long long factorialSum(int maxItem) {
  long long sum = 0;
  int i = 1;
  for (; i <= maxItem; ++i) {
    sum += factorial(i);
  }
  return sum;
}


x86 assembly (clang, -O0):
<factorialSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1154 <factorialSum+0x44>
mov    -0x14(%rbp),%edi
call   1030 <factorial@plt>
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <factorialSum+0x1a>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorialSum>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    114f <factorialSum+0x3f>
mov    %edi,%r14d
neg    %r14d
mov    $0x1,%ebx
xor    %r15d,%r15d
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <factorial@plt>
add    %rax,%r15
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1130 <factorialSum+0x20>
jmp    1152 <factorialSum+0x42>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @factorialSum(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 1, %1 ]
%5 = phi i64 [ %7, %3 ], [ 0, %1 ]
%6 = tail call i64 @factorial(i32 %4)
%7 = add nsw i64 %6, %5
%8 = add nuw i32 %4, 1
%9 = icmp eq i32 %4, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ mlforce(char *);
clrmes(int f, int n) {
  mlforce("");
  return (1);
}


x86 assembly (clang, -O0):
<clrmes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <mlforce@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrmes>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <mlforce@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @clrmes(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @mlforce(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @clrmes(i32 %0, i32 %1) {
%3 = tail call i32 @mlforce(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void cmd_arg_default_verfun(void *data) {
  char *name = (char *)data;
  printf("%s build on %s %s\n", name, "Mar 17 2022", "12:25:06");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<cmd_arg_default_verfun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec1(%rip),%rdi
lea    0xecd(%rip),%rdx
lea    0xed2(%rip),%rcx
call   1030 <printf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cmd_arg_default_verfun>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
lea    0xee1(%rip),%rdx
lea    0xee6(%rip),%rcx
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s build on %s %s\0A\00"
@.str.1 = [12 x i8] c"Mar 17 2022\00"
@.str.2 = [9 x i8] c"12:25:06\00"
@EXIT_SUCCESS = global i32 0
define void @cmd_arg_default_verfun(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s build on %s %s\0A\00"
@.str.1 = [12 x i8] c"Mar 17 2022\00"
@.str.2 = [9 x i8] c"12:25:06\00"
@EXIT_SUCCESS = global i32 0
define void @cmd_arg_default_verfun(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int mcharprint(char **, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int stringprint(char **s, char *string) {
  return mcharprint(s, string, strlen(string));
}


x86 assembly (clang, -O0):
<stringprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <mcharprint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringprint>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <mcharprint@plt>

LLVM IR (-O0):
define i32 @stringprint(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @mcharprint(i8** %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @stringprint(i8** %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @mcharprint(i8** %0, i8* %1, i32 %3)
ret i32 %4
}
void strnonl(char *p) {
  for (; *p; p++)
    if (*p == '\n' || *p == '\r')
      *p = ' ';
}


x86 assembly (clang, -O0):
<strnonl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <strnonl+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1135 <strnonl+0x35>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    113c <strnonl+0x3c>
mov    -0x8(%rbp),%rax
movb   $0x20,(%rax)
jmp    1141 <strnonl+0x41>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <strnonl+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnonl>:
jmp    1117 <strnonl+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x20,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <strnonl+0x10>
cmp    $0xd,%al
je     1110 <strnonl+0x10>
test   %al,%al
jne    1113 <strnonl+0x13>
ret

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

LLVM IR (-O2):
define void @strnonl(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
i8 13, label %5
]
5: ; preds = %2, %2
store i8 32, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ nrf_802154_received_raw(int /*<<< orphan*/ *,
                                           int /*<<< orphan*/,
                                           int /*<<< orphan*/);
void nrf_802154_notify_received(uint8_t *p_data, int8_t power, int8_t lqi) {
  nrf_802154_received_raw(p_data, power, lqi);
}


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

x86 assembly (clang, -O2):
<nrf_802154_notify_received>:
jmp    1030 <nrf_802154_received_raw@plt>

LLVM IR (-O0):
define void @nrf_802154_notify_received(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* %5
%9 = load i32, i32* %6
%10 = call i32 @nrf_802154_received_raw(i32* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @nrf_802154_notify_received(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @nrf_802154_received_raw(i32* %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
struct i915_gem_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ context_close(struct i915_gem_context *);
void mock_context_close(struct i915_gem_context *ctx) { context_close(ctx); }


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

x86 assembly (clang, -O2):
<mock_context_close>:
jmp    1030 <context_close@plt>

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

LLVM IR (-O2):
%struct.i915_gem_context = type { i32 }
define void @mock_context_close(%struct.i915_gem_context* %0) {
%2 = tail call i32 @context_close(%struct.i915_gem_context* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_puts(char *);
void console_clrscr() {
  char buf[32] = "\033c";
  console_puts(buf);
}


x86 assembly (clang, -O0):
<console_clrscr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <console_puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_clrscr>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <console_puts@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.console_clrscr.buf = [32 x i8] c"\1Bc\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @console_clrscr() {
%1 = alloca [32 x i8]
%2 = bitcast [32 x i8]* %1 to i8*
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%4 = call i32 @console_puts(i8* %3)
ret void
}

LLVM IR (-O2):
@__const.console_clrscr.buf = [32 x i8] c"\1Bc\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @console_clrscr() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @console_puts(i8* %2)
ret void
}
/* Type definitions */
struct probe {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_object(int, short *);
void free_probe(struct probe *prb) { free_object(7, (short *)prb); }


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

x86 assembly (clang, -O2):
<free_probe>:
mov    %rdi,%rsi
mov    $0x7,%edi
jmp    1030 <free_object@plt>

LLVM IR (-O0):
%struct.probe = type { i32 }
define void @free_probe(%struct.probe* %0) {
%2 = alloca %struct.probe*
store %struct.probe* %0, %struct.probe** %2
%3 = load %struct.probe*, %struct.probe** %2
%4 = bitcast %struct.probe* %3 to i16*
%5 = call i32 @free_object(i32 7, i16* %4)
ret void
}

LLVM IR (-O2):
%struct.probe = type { i32 }
define void @free_probe(%struct.probe* %0) {
%2 = bitcast %struct.probe* %0 to i16*
%3 = tail call i32 @free_object(i32 7, i16* %2)
ret void
}
signed char getSC() { return 0x80; }


x86 assembly (clang, -O0):
<getSC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSC>:
mov    $0x80,%al
ret

LLVM IR (-O0):
define signext i8 @getSC() {
ret i8 -128
}

LLVM IR (-O2):
define signext i8 @getSC() {
ret i8 -128
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzPassiveEagerFalseVariable_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_REQDOWN(int);
void BrzPassiveEagerFalseVariable_ackup(struct comp *comp, int port) {
  struct BrzPassiveEagerFalseVariable_ *c =
      (struct BrzPassiveEagerFalseVariable_ *)comp;
  SEND_REQDOWN(2);
}


x86 assembly (clang, -O0):
<BrzPassiveEagerFalseVariable_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x2,%edi
call   1030 <SEND_REQDOWN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzPassiveEagerFalseVariable_ackup>:
mov    $0x2,%edi
jmp    1030 <SEND_REQDOWN@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzPassiveEagerFalseVariable_ = type { i32 }
define void @BrzPassiveEagerFalseVariable_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzPassiveEagerFalseVariable_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzPassiveEagerFalseVariable_*
store %struct.BrzPassiveEagerFalseVariable_* %7, %struct.BrzPassiveEagerFalseVariable_** %5
%8 = call i32 @SEND_REQDOWN(i32 2)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzPassiveEagerFalseVariable_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_REQDOWN(i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void close_if_open(FILE *f) {
  if (f) {
    fclose(f);
  }
}


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

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

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

LLVM IR (-O2):
define void @close_if_open(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fclose(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ paw_dealloc_1d_array(double *);
void paw_dealloc_LogGrid(double *grid) { paw_dealloc_1d_array(grid); }


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

x86 assembly (clang, -O2):
<paw_dealloc_LogGrid>:
jmp    1030 <paw_dealloc_1d_array@plt>

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

LLVM IR (-O2):
define void @paw_dealloc_LogGrid(double* %0) {
%2 = tail call i32 @paw_dealloc_1d_array(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CK4_Map_SetupFunctions();
int /*<<< orphan*/ CK4_Misc_SetupFunctions();
int /*<<< orphan*/ CK4_Obj1_SetupFunctions();
int /*<<< orphan*/ CK4_Obj2_SetupFunctions();
int /*<<< orphan*/ CK4_Obj3_SetupFunctions();
void CK4_SetupFunctions() {
  CK4_Obj1_SetupFunctions();
  CK4_Obj2_SetupFunctions();
  CK4_Obj3_SetupFunctions();
  CK4_Map_SetupFunctions();
  CK4_Misc_SetupFunctions();
}


x86 assembly (clang, -O0):
<CK4_SetupFunctions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CK4_Obj1_SetupFunctions@plt>
mov    $0x0,%al
call   1050 <CK4_Obj2_SetupFunctions@plt>
mov    $0x0,%al
call   1070 <CK4_Obj3_SetupFunctions@plt>
mov    $0x0,%al
call   1040 <CK4_Map_SetupFunctions@plt>
mov    $0x0,%al
call   1060 <CK4_Misc_SetupFunctions@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CK4_SetupFunctions>:
push   %rax
xor    %eax,%eax
call   1030 <CK4_Obj1_SetupFunctions@plt>
xor    %eax,%eax
call   1050 <CK4_Obj2_SetupFunctions@plt>
xor    %eax,%eax
call   1070 <CK4_Obj3_SetupFunctions@plt>
xor    %eax,%eax
call   1040 <CK4_Map_SetupFunctions@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <CK4_Misc_SetupFunctions@plt>

LLVM IR (-O0):
define void @CK4_SetupFunctions() {
%1 = call i32 (...) @CK4_Obj1_SetupFunctions()
%2 = call i32 (...) @CK4_Obj2_SetupFunctions()
%3 = call i32 (...) @CK4_Obj3_SetupFunctions()
%4 = call i32 (...) @CK4_Map_SetupFunctions()
%5 = call i32 (...) @CK4_Misc_SetupFunctions()
ret void
}

LLVM IR (-O2):
define void @CK4_SetupFunctions() {
%1 = tail call i32 (...) @CK4_Obj1_SetupFunctions()
%2 = tail call i32 (...) @CK4_Obj2_SetupFunctions()
%3 = tail call i32 (...) @CK4_Obj3_SetupFunctions()
%4 = tail call i32 (...) @CK4_Map_SetupFunctions()
%5 = tail call i32 (...) @CK4_Misc_SetupFunctions()
ret void
}
void __attribute__((destructor)) finalize1() {
  printf(__func__);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<finalize1>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__func__.finalize1 = [10 x i8] c"finalize1\00"
@.str = [2 x i8] c"\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @finalize1, i8* null }]
define void @finalize1() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.finalize1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.finalize1 = [10 x i8] c"finalize1\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @finalize1, i8* null }]
define void @finalize1() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.finalize1, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
int starts_with(char *string, char *with) {
  if (!with)
    die("strlen(empty-string)\n");
  return strncmp(string, with, strlen(with)) ? 0 : 1;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1157 <starts_with+0x27>
lea    0xeae(%rip),%rdi
call   1050 <die@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
jne    114b <starts_with+0x1b>
lea    0xeba(%rip),%rdi
call   1050 <die@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"strlen(empty-string)\0A\00"
define i32 @starts_with(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @die(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void foz(char *c) { printf("foz %c\n", *c); }


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

x86 assembly (clang, -O2):
<foz>:
movsbl (%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"foz %c\0A\00"
define void @foz(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret void
}
/* Variables and functions */
bool IsLeft(void) { return true; }


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

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

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

LLVM IR (-O2):
define i32 @IsLeft() {
ret i32 1
}
int spaceCount(const char *stringz) {
  int numberOfSpaces = 0;
  int index = 0;
  while (stringz[index] != '\0') {
    if (stringz[index] == ' ') {
      numberOfSpaces = numberOfSpaces + 1;
    }
    index = index + 1;
  }
  return numberOfSpaces;
}


x86 assembly (clang, -O0):
<spaceCount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <spaceCount+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1149 <spaceCount+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <spaceCount+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaceCount>:
xor    %eax,%eax
jmp    1117 <spaceCount+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x20,%cl
je     1110 <spaceCount+0x10>
test   %cl,%cl
jne    1113 <spaceCount+0x13>
ret

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

LLVM IR (-O2):
define i32 @spaceCount(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 32, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x39_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x39_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x39_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x39_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x39_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
size_t hash_string(char *_str) {
  unsigned char *str = (unsigned char *)_str;
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x1505,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1152 <hash_string+0x52>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <hash_string+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hash_string+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
mov    $0x1505,%eax
ret

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

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

/* Variables and functions */
int ceph_frag_bits(int /*<<< orphan*/);
int /*<<< orphan*/ ceph_frag_make(int, int);
int ceph_frag_value(int /*<<< orphan*/);
__u32 ceph_frag_sibling(__u32 f) {
  return ceph_frag_make(ceph_frag_bits(f),
                        ceph_frag_value(f) ^ (0x1000000 >> ceph_frag_bits(f)));
}


x86 assembly (clang, -O0):
<ceph_frag_sibling>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ceph_frag_bits@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <ceph_frag_value@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ceph_frag_bits@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edi
mov    %eax,%ecx
mov    $0x1000000,%eax
sar    %cl,%eax
xor    %eax,%esi
call   1040 <ceph_frag_make@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_frag_sibling>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <ceph_frag_bits@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1050 <ceph_frag_value@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <ceph_frag_bits@plt>
mov    $0x1000000,%esi
mov    %eax,%ecx
shr    %cl,%esi
xor    %ebp,%esi
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ceph_frag_make@plt>

LLVM IR (-O0):
define i32 @ceph_frag_sibling(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ceph_frag_bits(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @ceph_frag_value(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @ceph_frag_bits(i32 %7)
%9 = ashr i32 16777216, %8
%10 = xor i32 %6, %9
%11 = call i32 @ceph_frag_make(i32 %4, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @ceph_frag_sibling(i32 %0) {
%2 = tail call i32 @ceph_frag_bits(i32 %0)
%3 = tail call i32 @ceph_frag_value(i32 %0)
%4 = tail call i32 @ceph_frag_bits(i32 %0)
%5 = lshr i32 16777216, %4
%6 = xor i32 %5, %3
%7 = tail call i32 @ceph_frag_make(i32 %2, i32 %6)
ret i32 %7
}
/* Variables and functions */
int fetchIndexableByteLength(int);
int primitiveObject_ByteSize(int receiver, int *arguments) {
  return ((fetchIndexableByteLength(receiver) << 1) | 1);
}


x86 assembly (clang, -O0):
<primitiveObject_ByteSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fetchIndexableByteLength@plt>
shl    $0x1,%eax
or     $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitiveObject_ByteSize>:
push   %rax
call   1030 <fetchIndexableByteLength@plt>
add    %eax,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @primitiveObject_ByteSize(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 = call i32 @fetchIndexableByteLength(i32 %5)
%7 = shl i32 %6, 1
%8 = or i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @primitiveObject_ByteSize(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @fetchIndexableByteLength(i32 %0)
%4 = shl i32 %3, 1
%5 = or i32 %4, 1
ret i32 %5
}
void RTTcpClientClose(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpClientClose() {
ret void
}
int exact_square(int num) {
  int i = 0;
  if (num == 1)
    return 1;
  for (; i <= num / 2; i++) {
    if (i * i == num)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1124 <exact_square+0x24>
movl   $0x1,-0x4(%rbp)
jmp    117d <exact_square+0x7d>
jmp    1129 <exact_square+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1176 <exact_square+0x76>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1163 <exact_square+0x63>
movl   $0x1,-0x4(%rbp)
jmp    117d <exact_square+0x7d>
jmp    1168 <exact_square+0x68>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <exact_square+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
cmp    $0x1,%edi
jne    110c <exact_square+0xc>
mov    $0x1,%eax
jmp    1113 <exact_square+0x13>
xor    %eax,%eax
cmp    $0xffffffff,%edi
jge    1114 <exact_square+0x14>
ret
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
add    $0x1,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
je     1105 <exact_square+0x5>
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1130 <exact_square+0x30>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, -1
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = sdiv i32 %0, 2
br label %10
7: ; preds = %10
%8 = add nuw nsw i32 %11, 1
%9 = icmp eq i32 %11, %6
br i1 %9, label %14, label %10
10: ; preds = %5, %7
%11 = phi i32 [ %8, %7 ], [ 0, %5 ]
%12 = mul nsw i32 %11, %11
%13 = icmp eq i32 %12, %0
br i1 %13, label %14, label %7
14: ; preds = %10, %7, %3, %1
%15 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 1, %10 ], [ 0, %7 ]
ret i32 %15
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_int32_t(int32_t const k1, int32_t const k2) {
  return k1 == k2;
}


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

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_int32_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_int32_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo707(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo707(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_char_string(char *string) {
  free(string);
  return;
}


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

x86 assembly (clang, -O2):
<free_char_string>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_char_string(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void record_transfer_skb(struct sk_buff *skb, int newType) {}


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

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
define void @record_transfer_skb(%struct.sk_buff* %0, i32 %1) {
%3 = alloca %struct.sk_buff*
%4 = alloca i32
store %struct.sk_buff* %0, %struct.sk_buff** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
define void @record_transfer_skb(%struct.sk_buff* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int a, k, n, d;
  a = 1;
  d = 1;
  n = 1;
  while (k != 5) {
    a = a + 1 / n;
    n = n * (d + 1);
  }
  printf("å = %d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x5,-0xc(%rbp)
je     116b <main+0x5b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x1,%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"\C3\A5 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}