xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system(
      "cd /mnt/user/code/CreateDistanceSensor/bin && /mnt/user/jvm/java Main");
}


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

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

LLVM IR (-O0):
@.str = [70 x i8] c"cd /mnt/user/code/CreateDistanceSensor/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [70 x i8] c"cd /mnt/user/code/CreateDistanceSensor/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_ATTRIBUTE;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_ATTRIBUTE_it;
X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a, const unsigned char **in,
                                   long len) {
  return (X509_ATTRIBUTE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                         &X509_ATTRIBUTE_it);
}


x86 assembly (clang, -O0):
<d2i_X509_ATTRIBUTE>:
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
mov    0x2ea1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_X509_ATTRIBUTE>:
mov    0x2ec1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@X509_ATTRIBUTE_it = global i32 0
define i32* @d2i_X509_ATTRIBUTE(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @X509_ATTRIBUTE_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@X509_ATTRIBUTE_it = global i32 0
define i32* @d2i_X509_ATTRIBUTE(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @X509_ATTRIBUTE_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_empty(struct list *);
int /*<<< orphan*/ list_pop(struct list *);
void list_purge(struct list *l) {
  while (!list_empty(l))
    list_pop(l);
}


x86 assembly (clang, -O0):
<list_purge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <list_empty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114a <list_purge+0x2a>
jmp    1158 <list_purge+0x38>
mov    -0x8(%rbp),%rdi
call   1030 <list_pop@plt>
jmp    112c <list_purge+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_purge>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1040 <list_empty@plt>
test   %eax,%eax
jne    1146 <list_purge+0x26>
mov    %rbx,%rdi
call   1030 <list_pop@plt>
mov    %rbx,%rdi
jmp    1130 <list_purge+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_purge(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
br label %3
3: ; preds = %8, %1
%4 = load %struct.list*, %struct.list** %2
%5 = call i32 @list_empty(%struct.list* %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load %struct.list*, %struct.list** %2
%10 = call i32 @list_pop(%struct.list* %9)
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_purge(%struct.list* %0) {
%2 = tail call i32 @list_empty(%struct.list* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @list_pop(%struct.list* %0)
%6 = tail call i32 @list_empty(%struct.list* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %1
ret void
}
void report_num_tests_silent(int num_tests) {}


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

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

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

LLVM IR (-O2):
define void @report_num_tests_silent(i32 %0) {
ret void
}
/* Variables and functions */
int sg_ll_send_diag(int, int /*<<< orphan*/, int, int /*<<< orphan*/,
                    int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                    void *, int, int, int);
int do_senddiag(int sg_fd, int pf_bit, void *outgoing_pg, int outgoing_len,
                int noisy, int verbose) {
  return sg_ll_send_diag(sg_fd, 0, pf_bit, 0, 0, 0, 0, outgoing_pg,
                         outgoing_len, noisy, verbose);
}


x86 assembly (clang, -O0):
<do_senddiag>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x48,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rbx
mov    -0x1c(%rbp),%r11d
mov    -0x20(%rbp),%r10d
mov    -0x24(%rbp),%eax
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1030 <sg_ll_send_diag@plt>
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_senddiag>:
push   %rbx
mov    %r9d,%eax
mov    %r8d,%r10d
mov    %ecx,%r11d
mov    %rdx,%rbx
mov    %esi,%edx
sub    $0x8,%rsp
xor    %esi,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
push   %r10
push   %r11
push   %rbx
push   $0x0
call   1030 <sg_ll_send_diag@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @do_senddiag(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @sg_ll_send_diag(i32 %13, i32 0, i32 %14, i32 0, i32 0, i32 0, i32 0, i8* %15, i32 %16, i32 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @do_senddiag(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @sg_ll_send_diag(i32 %0, i32 0, i32 %1, i32 0, i32 0, i32 0, i32 0, i8* %2, i32 %3, i32 %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ pushint(long);
long strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
void procint(char *cmd) {
  long val = strtol(cmd, NULL, 0);
  pushint(val);
}


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

x86 assembly (clang, -O2):
<procint>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <pushint@plt>

LLVM IR (-O0):
define void @procint(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strtol(i8* %4, i32* null, i32 0)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @pushint(i64 %6)
ret void
}

LLVM IR (-O2):
define void @procint(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 0)
%3 = tail call i32 @pushint(i64 %2)
ret void
}
/* Variables and functions */
int get_mdterm();
void md_draw_string_red(int x, int y, char *str) {
  switch (get_mdterm()) {}
}


x86 assembly (clang, -O0):
<md_draw_string_red>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
call   1030 <get_mdterm@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @md_draw_string_red(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 (...) @get_mdterm()
switch i32 %7, label %8 [
]
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @md_draw_string_red(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @get_mdterm()
ret void
}
/* Variables and functions */
char *lltoa(long, char *, int);
char *ltoa(long value, char *str, int base) { return lltoa(value, str, base); }


x86 assembly (clang, -O0):
<ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <lltoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltoa>:
jmp    1030 <lltoa@plt>

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

LLVM IR (-O2):
define i8* @ltoa(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @lltoa(i64 %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
char *MALLOC(int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ split_dir_and_file(char const *, char *, char *);
int strlen(char const *);
char *get_dirname(const char *in) {
  char *dir = MALLOC(sizeof(char) * (strlen(in) + 2));
  char *file = MALLOC(sizeof(char) * (strlen(in) + 2));
  split_dir_and_file(in, dir, file);
  free(file);
  return dir;
}


x86 assembly (clang, -O0):
<get_dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x2,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <MALLOC@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x2,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <MALLOC@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1060 <split_dir_and_file@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dirname>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
lea    0x2(%rax),%edi
call   1050 <MALLOC@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    0x2(%rax),%edi
call   1050 <MALLOC@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1060 <split_dir_and_file@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @get_dirname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 2
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i8* @MALLOC(i32 %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = add nsw i32 %13, 2
%15 = sext i32 %14 to i64
%16 = mul i64 1, %15
%17 = trunc i64 %16 to i32
%18 = call i8* @MALLOC(i32 %17)
store i8* %18, i8** %4
%19 = load i8*, i8** %2
%20 = load i8*, i8** %3
%21 = load i8*, i8** %4
%22 = call i32 @split_dir_and_file(i8* %19, i8* %20, i8* %21)
%23 = load i8*, i8** %4
%24 = call i32 @free(i8* %23)
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @get_dirname(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 2
%4 = tail call i8* @MALLOC(i32 %3)
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, 2
%7 = tail call i8* @MALLOC(i32 %6)
%8 = tail call i32 @split_dir_and_file(i8* %0, i8* %4, i8* %7)
%9 = tail call i32 @free(i8* %7)
ret i8* %4
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *skynet_strdup(const char *str) {
  size_t sz = strlen(str);
  char *ret = malloc(sz + 1);
  memcpy(ret, str, sz + 1);
  return ret;
}


x86 assembly (clang, -O0):
<skynet_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skynet_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @skynet_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = add i64 %12, 1
%14 = call i32 @memcpy(i8* %10, i8* %11, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @skynet_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
ret i8* %4
}
/* Variables and functions */
char *ulltoa(unsigned long long, char *, int);
char *ultoa(unsigned long value, char *result, int base) {
  return ulltoa((unsigned long long)value, result, base);
}


x86 assembly (clang, -O0):
<ultoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ulltoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ultoa>:
jmp    1030 <ulltoa@plt>

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

LLVM IR (-O2):
define i8* @ultoa(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @ulltoa(i64 %0, i8* %1, i32 %2)
ret i8* %4
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void AVRCP_ResponseSink_AVTransport_Stop(struct UPnPService *Service,
                                         int ErrorCode, void *User) {
  printf("AVRCP_ Invoke Response: AVTransport/Stop[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<AVRCP_ResponseSink_AVTransport_Stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [59 x i8] c"AVRCP_ Invoke Response: AVTransport/Stop[ErrorCode:%d]()\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_Stop(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [59 x i8] c"AVRCP_ Invoke Response: AVTransport/Stop[ErrorCode:%d]()\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_Stop(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int ft_strcmp(char const *, char const *);
int ft_strequ(const char *s1, const char *s2) {
  int equal;
  equal = ft_strcmp(s1, s2);
  if (equal == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_strequ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ft_strcmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1146 <ft_strequ+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114d <ft_strequ+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_strequ(i8* %0, i8* %1) {
%3 = tail call i32 @ft_strcmp(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int PAPI_num_hwctrs();
void papif_num_hwctrs_(int *num) { *num = PAPI_num_hwctrs(); }


x86 assembly (clang, -O0):
<papif_num_hwctrs_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PAPI_num_hwctrs@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_num_hwctrs_>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_num_hwctrs@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_num_hwctrs_(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_num_hwctrs()
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
unsigned char atomic_exchange_and_add(unsigned char volatile *, char);
unsigned char atomic_add_char_nv(volatile unsigned char *target,
                                 signed char delta) {
  return atomic_exchange_and_add(target, delta) + 1;
}


x86 assembly (clang, -O0):
<atomic_add_char_nv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <atomic_exchange_and_add@plt>
movzbl %al,%eax
add    $0x1,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @atomic_add_char_nv(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call zeroext i8 @atomic_exchange_and_add(i8* %5, i8 signext %6)
%8 = zext i8 %7 to i32
%9 = add nsw i32 %8, 1
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @atomic_add_char_nv(i8* %0, i8 signext %1) {
%3 = tail call zeroext i8 @atomic_exchange_and_add(i8* %0, i8 signext %1)
%4 = add i8 %3, 1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char);
void displayString(char s[]) {
  for (int i = 0; s[i] != '\0'; i++) {
    printf("address is %p, char is %c\n", &s[i], s[i]);
  }
}


x86 assembly (clang, -O0):
<displayString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1169 <displayString+0x59>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xeae(%rip),%rdi
movsbl (%rax,%rcx,1),%edx
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <displayString+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayString>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114a <displayString+0x3a>
mov    %rdi,%rbx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <displayString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"address is %p, char is %c\0A\00"
define void @displayString(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8 [ %12, %5 ], [ %2, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %8, i8 signext %7)
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %4, label %5
}
/* Variables and functions */
int util_strlen(char *str) {
  int c = 0;
  while (*str++ != 0)
    c++;
  return c;
}


x86 assembly (clang, -O0):
<util_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <util_strlen+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <util_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_strlen>:
cmpb   $0x0,(%rdi)
je     111c <util_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <util_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @util_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int do_shell(cnt)
long cnt;
{ shell('!', cnt); }


x86 assembly (clang, -O0):
<do_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x21,%edi
mov    $0x0,%al
call   1030 <shell@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_shell>:
mov    %rdi,%rsi
mov    $0x21,%edi
xor    %eax,%eax
jmp    1030 <shell@plt>

LLVM IR (-O0):
define i32 @do_shell(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = call i32 (i32, i64, ...) bitcast (i32 (...)* @shell to i32 (i32, i64, ...)*)(i32 33, i64 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @do_shell(i64 %0) {
%2 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @shell to i32 (i32, i64, ...)*)(i32 33, i64 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ io_print(char *, char const *);
void print_opt(const char *opt) { io_print("%s;", opt); }


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

x86 assembly (clang, -O2):
<print_opt>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <io_print@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s;\00"
define void @print_opt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @io_print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s;\00"
define void @print_opt(i8* %0) {
%2 = tail call i32 @io_print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func5(int, int);
int main() {
  func5(3, 5);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func5(i32 3, i32 5)
ret i32 0
}
unsigned short int f13(unsigned short int x, int y) {
  return (x << y) | (x >> (8 * sizeof(unsigned short) - y));
}


x86 assembly (clang, -O0):
<f13>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
movslq -0x8(%rbp),%rsi
mov    $0x10,%ecx
sub    %rsi,%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f13>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%ax
ret

LLVM IR (-O0):
define zeroext i16 @f13(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = sub i64 16, %12
%14 = trunc i64 %13 to i32
%15 = ashr i32 %10, %14
%16 = or i32 %8, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f13(i16 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = tail call i16 @llvm.fshl.i16(i16 %0, i16 %0, i16 %3)
ret i16 %4
}
/* Variables and functions */
int foo4(int);
int bar4(int x) { return foo4(x + 6); }


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

x86 assembly (clang, -O2):
<bar4>:
add    $0x6,%edi
jmp    1030 <foo4@plt>

LLVM IR (-O0):
define i32 @bar4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 6
%5 = call i32 @foo4(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @bar4(i32 %0) {
%2 = add nsw i32 %0, 6
%3 = tail call i32 @foo4(i32 %2)
ret i32 %3
}
/* Type definitions */
struct free_region {
  int dummy;
};

/* Variables and functions */
uintptr_t get_region_start(struct free_region *reg) { return (uintptr_t)reg; }


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

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

LLVM IR (-O0):
%struct.free_region = type { i32 }
define i64 @get_region_start(%struct.free_region* %0) {
%2 = alloca %struct.free_region*
store %struct.free_region* %0, %struct.free_region** %2
%3 = load %struct.free_region*, %struct.free_region** %2
%4 = ptrtoint %struct.free_region* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
%struct.free_region = type { i32 }
define i64 @get_region_start(%struct.free_region* %0) {
%2 = ptrtoint %struct.free_region* %0 to i64
ret i64 %2
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
scalar_t__ fstat(int, struct stat *);
int get_file_size(int fd) {
  struct stat s;
  if (fstat(fd, &s) == 0) {
    return s.st_size;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <fstat@plt>
cmp    $0x0,%rax
jne    113c <get_file_size+0x2c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <get_file_size+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1126 <get_file_size+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_file_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @fstat(i32 %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
/* Variables and functions */
int rand5();
int rand7() {
  for (;;) {
    int res = 5 * rand5() + rand5();
    if (res < 21)
      return res % 7;
  }
}


x86 assembly (clang, -O0):
<rand7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand5@plt>
imul   $0x5,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand5@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x15,-0x4(%rbp)
jge    1153 <rand7+0x43>
mov    -0x4(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1118 <rand7+0x8>

x86 assembly (clang, -O2):
<rand7>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand5@plt>
lea    (%rax,%rax,4),%ebx
xor    %eax,%eax
call   1030 <rand5@plt>
add    %ebx,%eax
cmp    $0x14,%eax
jg     1120 <rand7+0x10>
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %eax,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand7() {
%1 = alloca i32
br label %2
2: ; preds = %12, %0
%3 = call i32 (...) @rand5()
%4 = mul nsw i32 5, %3
%5 = call i32 (...) @rand5()
%6 = add nsw i32 %4, %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 21
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %1
%11 = srem i32 %10, 7
ret i32 %11
12: ; preds = %2
br label %2
}

LLVM IR (-O2):
define i32 @rand7() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @rand5()
%3 = mul nsw i32 %2, 5
%4 = tail call i32 (...) @rand5()
%5 = add nsw i32 %3, %4
%6 = icmp slt i32 %5, 21
br i1 %6, label %7, label %1
7: ; preds = %1
%8 = srem i32 %5, 7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f1(void) { puts("f1() is working."); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"f1() is working.\00"
define void @f1() {
%1 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"f1() is working.\00"
define void @f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo313() {}


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

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

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

LLVM IR (-O2):
define void @foo313() {
ret void
}
void SL_Exit(void) {}


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

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

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

LLVM IR (-O2):
define void @SL_Exit() {
ret void
}
void console_sysfs_notify(void) {}


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

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

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

LLVM IR (-O2):
define void @console_sysfs_notify() {
ret void
}
void MergeRGBRow_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @MergeRGBRow_Any_SSSE3() {
ret void
}
void gtk_window_reshow_with_initial_size() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_reshow_with_initial_size() {
ret void
}
/* Variables and functions */
scalar_t__ config_readString(char const *, char const *, char const *, char *,
                             int);
scalar_t__ isValidIP(char *);
int config_readIP(const char *configfile, const char *label, const char *key,
                  char *value, int num) {
  if (config_readString(configfile, label, key, value, num) != 0) {
    return -1;
  }
  if (isValidIP(value)) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<config_readIP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
call   1030 <config_readString@plt>
cmp    $0x0,%rax
je     116b <config_readIP+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1191 <config_readIP+0x71>
mov    -0x28(%rbp),%rdi
call   1040 <isValidIP@plt>
cmp    $0x0,%rax
je     118a <config_readIP+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1191 <config_readIP+0x71>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_readIP>:
push   %rbx
mov    %rcx,%rbx
call   1030 <config_readString@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1138 <config_readIP+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <isValidIP@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @config_readIP(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i64 @config_readString(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @isValidIP(i8* %3)
%10 = icmp eq i64 %9, 0
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ -1, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
int LOAD_HOST_REG(int host_reg) {
  if (host_reg & 8)
    addbyte(0x44);
  addbyte(0x89);
  addbyte(0xc0 | 3 | ((host_reg & 7) << 3));
  return 3 | (host_reg & 0x10);
}


x86 assembly (clang, -O0):
<LOAD_HOST_REG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1134 <LOAD_HOST_REG+0x24>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0x3,%edi
or     $0xc3,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%eax
and    $0x10,%eax
or     $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOAD_HOST_REG>:
push   %rbx
mov    %edi,%ebx
test   $0x8,%bl
je     1122 <LOAD_HOST_REG+0x12>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
lea    0x0(,%rbx,8),%eax
or     $0xc3,%eax
movzbl %al,%edi
call   1030 <addbyte@plt>
and    $0x10,%ebx
or     $0x3,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @LOAD_HOST_REG(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @addbyte(i32 68)
br label %8
8: ; preds = %6, %1
%9 = call i32 @addbyte(i32 137)
%10 = load i32, i32* %2
%11 = and i32 %10, 7
%12 = shl i32 %11, 3
%13 = or i32 195, %12
%14 = call i32 @addbyte(i32 %13)
%15 = load i32, i32* %2
%16 = and i32 %15, 16
%17 = or i32 3, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @LOAD_HOST_REG(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @addbyte(i32 68)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @addbyte(i32 137)
%8 = shl i32 %0, 3
%9 = and i32 %8, 56
%10 = or i32 %9, 195
%11 = tail call i32 @addbyte(i32 %10)
%12 = and i32 %0, 16
%13 = or i32 %12, 3
ret i32 %13
}
void __attribute__((no, noclone)) bar(int j, int n, int *a) {
  int i;
  for (i = j + 1; i < n; i += 3)
    a[i] = i;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113f <bar+0x3f>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <bar+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
add    $0x1,%edi
cmp    %esi,%edi
jge    111c <bar+0x1c>
movslq %edi,%rax
movslq %esi,%rcx
nopl   (%rax)
mov    %eax,(%rdx,%rax,4)
add    $0x3,%rax
cmp    %rcx,%rax
jl     1110 <bar+0x10>
ret

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

LLVM IR (-O2):
define void @bar(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = add i32 %0, 1
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = sext i32 %1 to i64
br label %9
9: ; preds = %6, %9
%10 = phi i64 [ %7, %6 ], [ %13, %9 ]
%11 = getelementptr inbounds i32, i32* %2, i64 %10
%12 = trunc i64 %10 to i32
store i32 %12, i32* %11
%13 = add nsw i64 %10, 3
%14 = icmp slt i64 %13, %8
br i1 %14, label %9, label %15
15: ; preds = %9, %3
ret void
}
/* Variables and functions */
unsigned int strlen(char *);
char *strcat(char *destination, const char *appendix) {
  unsigned int i = strlen(destination);
  while ((destination[i] = *appendix++) != '\0')
    i++;
  return destination;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%edx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1161 <strcat+0x51>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112c <strcat+0x1c>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    (%rbx),%cl
mov    %eax,%edx
mov    %cl,(%r14,%rdx,1)
test   %cl,%cl
je     1154 <strcat+0x44>
add    $0x1,%eax
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%ecx
mov    %eax,%edx
mov    %cl,(%r14,%rdx,1)
add    $0x1,%eax
add    $0x1,%rbx
test   %cl,%cl
jne    1140 <strcat+0x30>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = load i8, i8* %1
%5 = zext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %4, i8* %6
%7 = icmp eq i8 %4, 0
br i1 %7, label %17, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %12, %8 ], [ %3, %2 ]
%10 = phi i8* [ %11, %8 ], [ %1, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = add i32 %9, 1
%13 = load i8, i8* %11
%14 = zext i32 %12 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 %13, i8* %15
%16 = icmp eq i8 %13, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %2
ret i8* %0
}
/* Variables and functions */
int lmuOy2(int, unsigned long volatile *, unsigned int);
__attribute__((no)) unsigned __attribute__((stdcall, regparm(3)))
NHDsK3(volatile unsigned long *RdZoN, unsigned kKiv65) {
  return lmuOy2(01, RdZoN, kKiv65);
}


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

x86 assembly (clang, -O2):
<NHDsK3>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <lmuOy2@plt>

LLVM IR (-O0):
define i32 @NHDsK3(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i32, i32* %4
%7 = call i32 @lmuOy2(i32 1, i64* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @NHDsK3(i64* %0, i32 %1) {
%3 = tail call i32 @lmuOy2(i32 1, i64* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ two_two_five();
int /*<<< orphan*/ two_two_three();
int /*<<< orphan*/ two_two_two();
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  test1();
  two_two_two();
  two_two_three();
  two_two_five();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test1@plt>
mov    $0x0,%al
call   1050 <two_two_two@plt>
mov    $0x0,%al
call   1060 <two_two_three@plt>
mov    $0x0,%al
call   1070 <two_two_five@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1050 <two_two_two@plt>
xor    %eax,%eax
call   1060 <two_two_three@plt>
xor    %eax,%eax
call   1070 <two_two_five@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test1()
%8 = call i32 (...) @two_two_two()
%9 = call i32 (...) @two_two_three()
%10 = call i32 (...) @two_two_five()
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test1()
%5 = tail call i32 (...) @two_two_two()
%6 = tail call i32 (...) @two_two_three()
%7 = tail call i32 (...) @two_two_five()
ret i32 0
}