xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ switch_on_bits(unsigned char *, int);
void CTRL_REGSB_BITSET_ST_actvt(unsigned char *data) {
  switch_on_bits(data, (0x20));
}


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

x86 assembly (clang, -O2):
<CTRL_REGSB_BITSET_ST_actvt>:
mov    $0x20,%esi
jmp    1030 <switch_on_bits@plt>

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

LLVM IR (-O2):
define void @CTRL_REGSB_BITSET_ST_actvt(i8* %0) {
%2 = tail call i32 @switch_on_bits(i8* %0, i32 32)
ret void
}
int TestWrite(LinkId)
int LinkId;
{}


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

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

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

LLVM IR (-O2):
define i32 @TestWrite(i32 %0) {
ret i32 undef
}
/* Variables and functions */
char *strncpy(char *restrict dest, const char *restrict src, size_t count) {
  size_t i;
  for (i = 0; i < count; i++) {
    dest[i] = src[i];
    if (!src[i])
      break;
  }
  return dest;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1169 <strncpy+0x69>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
jne    1153 <strncpy+0x53>
jmp    1169 <strncpy+0x69>
jmp    1158 <strncpy+0x58>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <strncpy+0x18>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
test   %rdx,%rdx
je     112b <strncpy+0x2b>
mov    $0x1,%ecx
nopl   (%rax)
movzbl -0x1(%rsi,%rcx,1),%edi
mov    %dil,-0x1(%rax,%rcx,1)
test   %dil,%dil
je     112b <strncpy+0x2b>
lea    0x1(%rcx),%rdi
cmp    %rdx,%rcx
mov    %rdi,%rcx
jb     1110 <strncpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %8, i8* %9
%10 = icmp ne i8 %8, 0
%11 = add nuw i64 %6, 1
%12 = icmp ult i64 %11, %2
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %5, label %14
14: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fptr(int);
void t21(void) { fptr(10); }


x86 assembly (clang, -O0):
<t21>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <fptr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t21>:
mov    $0xa,%edi
jmp    1030 <fptr@plt>

LLVM IR (-O0):
define void @t21() {
%1 = call i32 @fptr(i32 10)
ret void
}

LLVM IR (-O2):
define void @t21() {
%1 = tail call i32 @fptr(i32 10)
ret void
}
void swap(char *a, int len) {
  int h, l;
  char t;
  for (l = 0, h = len - 1; l < h; l++, h--) {
    t = a[l];
    a[l] = a[h];
    a[h] = t;
  }
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1170 <swap+0x70>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x15(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    111b <swap+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
cmp    $0x2,%esi
jl     1131 <swap+0x31>
mov    %esi,%eax
add    $0xfffffffffffffffe,%rax
xor    %ecx,%ecx
nopl   (%rax)
movzbl (%rdi,%rcx,1),%esi
movzbl 0x1(%rdi,%rax,1),%edx
mov    %dl,(%rdi,%rcx,1)
mov    %sil,0x1(%rdi,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <swap+0x10>
ret

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

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = add nsw i64 %5, -1
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %14, %7 ]
%9 = phi i64 [ %6, %4 ], [ %15, %7 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 %9
%13 = load i8, i8* %12
store i8 %13, i8* %10
store i8 %11, i8* %12
%14 = add nuw nsw i64 %8, 1
%15 = add nsw i64 %9, -1
%16 = icmp slt i64 %14, %15
br i1 %16, label %7, label %17
17: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func();
void bar() { func(); }


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

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

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

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @func()
ret void
}
/* Variables and functions */
char *rindex(register char *s, register char c) {
  char *p;
  for (p = 0; *s; s++)
    if (*s == c)
      p = s;
  return (p);
}


x86 assembly (clang, -O0):
<rindex>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1154 <rindex+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <rindex+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1143 <rindex+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <rindex+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rindex>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1123 <rindex+0x23>
nopl   0x0(%rax,%rax,1)
cmp    %sil,%cl
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <rindex+0x10>
ret

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

LLVM IR (-O2):
define i8* @rindex(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ null, %2 ]
%8 = phi i8* [ %11, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = select i1 %9, i8* %8, i8* %7
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i8* [ null, %2 ], [ %10, %5 ]
ret i8* %15
}
/* Variables and functions */
void *dlopen(char const *, int);
void *Exynos_OSAL_dlopen(const char *filename, int flag) {
  return dlopen(filename, flag);
}


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

x86 assembly (clang, -O2):
<Exynos_OSAL_dlopen>:
jmp    1030 <dlopen@plt>

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

LLVM IR (-O2):
define i8* @Exynos_OSAL_dlopen(i8* %0, i32 %1) {
%3 = tail call i8* @dlopen(i8* %0, i32 %1)
ret i8* %3
}
/* Type definitions */
struct a {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo(struct a *);
int main() {
  if (foo((struct a *)0) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <foo@plt>
cmp    $0x0,%rax
je     1149 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <foo@plt>
test   %rax,%rax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.a = type { i32 }
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @foo(%struct.a* null)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
%struct.a = type { i32 }
define i32 @main() {
%1 = tail call i64 @foo(%struct.a* null)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int /*<<< orphan*/ uint64_t;
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ write(int, int /*<<< orphan*/ *, int);
int eventfd_write(int fd, uint64_t val) {
  if (write(fd, &val, sizeof(val)) < (ssize_t)sizeof(val))
    return (-1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<eventfd_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cmp    $0x4,%rax
jge    1145 <eventfd_write+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <eventfd_write+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eventfd_write>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x4,%rax
setl   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @eventfd_write(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i64 @write(i32 %0, i32* %3, i32 4)
%5 = icmp slt i64 %4, 4
%6 = sext i1 %5 to i32
ret i32 %6
}
void log_string(int level, char *s) {}


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

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

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

LLVM IR (-O2):
define void @log_string(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int peer_connect(int, char const *, char const *);
int peer_listen(int, char const *);
int peer_start(int sockfd, const char *host, const char *port) {
  if ((peer_connect(sockfd, host, port)) == 1) {
    return 1;
  }
  if ((peer_listen(sockfd, port)) == 1) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<peer_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <peer_connect@plt>
cmp    $0x1,%eax
jne    1158 <peer_start+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1180 <peer_start+0x60>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <peer_listen@plt>
cmp    $0x1,%eax
jne    1179 <peer_start+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1180 <peer_start+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peer_start>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
call   1030 <peer_connect@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     114d <peer_start+0x2d>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <peer_listen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @peer_start(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = call i32 @peer_connect(i32 %8, i8* %9, i8* %10)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 1, i32* %4
br label %21
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load i8*, i8** %7
%17 = call i32 @peer_listen(i32 %15, i8* %16)
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 1, i32* %4
br label %21
20: ; preds = %14
store i32 0, i32* %4
br label %21
21: ; preds = %20, %19, %13
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @peer_start(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @peer_connect(i32 %0, i8* %1, i8* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @peer_listen(i32 %0, i8* %2)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usermode_3des(int argc, char **argv) { printf("3des \n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"3des \00"
define void @usermode_3des(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long long strtoll(char *, char **, int);
void test2(char *array, char *endptr) {
  array[2] = 'z';
  long long r = strtoll(array, &endptr, 35);
  assert(array + 2 == endptr);
  assert(r == 37);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x7a,0x2(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x23,%edx
call   1030 <strtoll@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x25,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,(%rsp)
lea    0x2(%rdi),%r14
movb   $0x7a,0x2(%rdi)
mov    %rsp,%rsi
mov    $0x23,%edx
call   1030 <strtoll@plt>
mov    %rax,%rbx
xor    %edi,%edi
cmp    (%rsp),%r14
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmp    $0x25,%rbx
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @test2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 2
store i8 122, i8* %7
%8 = load i8*, i8** %3
%9 = call i64 @strtoll(i8* %8, i8** %4, i32 35)
store i64 %9, i64* %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8*, i8** %4
%13 = icmp eq i8* %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i64, i64* %5
%17 = icmp eq i64 %16, 37
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}

LLVM IR (-O2):
define void @test2(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = getelementptr inbounds i8, i8* %0, i64 2
store i8 122, i8* %4
%5 = call i64 @strtoll(i8* %0, i8** %3, i32 35)
%6 = load i8*, i8** %3
%7 = icmp eq i8* %4, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = icmp eq i64 %5, 37
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t HibernateRTCSSGet(void) {
  return ((*((volatile unsigned long *)(0x400FC028))) & 0x00007FFF);
}


x86 assembly (clang, -O0):
<HibernateRTCSSGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc028,%eax
mov    (%rax),%rax
and    $0x7fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCSSGet>:
mov    0x400fc028,%rax
40
and    $0x7fff,%eax
ret

LLVM IR (-O0):
define i64 @HibernateRTCSSGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774056 to i64*)
%2 = and i64 %1, 32767
ret i64 %2
}

LLVM IR (-O2):
define i64 @HibernateRTCSSGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774056 to i64*)
%2 = and i64 %1, 32767
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int a = 1;
  int b = 2, c;
  c = a > b || b + 1 != 1 & 5 == 5;
  printf("c=%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jg     115b <main+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cmp    $0x1,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%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 = [6 x i8] c"c=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp sgt i32 %5, %6
br i1 %7, label %15, label %8
8: ; preds = %0
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = icmp ne i32 %10, 1
%12 = zext i1 %11 to i32
%13 = and i32 %12, 1
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %8, %0
%16 = phi i1 [ true, %0 ], [ %14, %8 ]
%17 = zext i1 %16 to i32
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"c=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
unsigned int alarm(unsigned int seconds __attribute__((unused))) {
  assert(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<alarm>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @alarm(i32 %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(int, int);
double *zero_dvec(int n) {
  double *p = (double *)calloc(n, sizeof(double));
  return p;
}


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

x86 assembly (clang, -O2):
<zero_dvec>:
mov    $0x8,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define double* @zero_dvec(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 8)
%6 = inttoptr i64 %5 to double*
store double* %6, double** %3
%7 = load double*, double** %3
ret double* %7
}

LLVM IR (-O2):
define double* @zero_dvec(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 8)
%3 = inttoptr i64 %2 to double*
ret double* %3
}
void mus_header_set_aifc(int val) {}


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

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

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

LLVM IR (-O2):
define void @mus_header_set_aifc(i32 %0) {
ret void
}
void NV12ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToARGB() {
ret void
}
void _M2_rpc_finish(__attribute__((unused)) int argc,
                    __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_rpc_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void DESIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0xFFFF8030))) |=
      (ui32IntFlags & 0x00070000) >> 16;
  (*((volatile uint32_t *)(ui32Base + 0x00000040))) |=
      ui32IntFlags & 0x0000ffff;
}


x86 assembly (clang, -O0):
<DESIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0x70000,%edx
sar    $0x10,%edx
mov    -0x4(%rbp),%eax
add    $0xffff8030,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0xffff,%edx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESIntEnable>:
movzwl %si,%eax
shr    $0x10,%esi
and    $0x7,%esi
lea    -0x7fd0(%rdi),%ecx
or     %esi,(%rcx)
movslq %edi,%rcx
or     %eax,0x40(%rcx)
ret

LLVM IR (-O0):
define void @DESIntEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 458752
%7 = ashr i32 %6, 16
%8 = load i32, i32* %3
%9 = add i32 %8, -32720
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = or i32 %12, %7
store volatile i32 %13, i32* %11
%14 = load i32, i32* %4
%15 = and i32 %14, 65535
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 64
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load volatile i32, i32* %19
%21 = or i32 %20, %15
store volatile i32 %21, i32* %19
ret void
}

LLVM IR (-O2):
define void @DESIntEnable(i32 %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 7
%5 = add i32 %0, -32720
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, %4
store volatile i32 %9, i32* %7
%10 = and i32 %1, 65535
%11 = add nsw i32 %0, 64
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = or i32 %14, %10
store volatile i32 %15, i32* %13
ret void
}
void peephole(void) {}


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

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

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

LLVM IR (-O2):
define void @peephole() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
void pa_threaded_mainloop_lock(int *m) {
  empty_log("pa_threaded_mainloop_lock: nothing to do\n");
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"pa_threaded_mainloop_lock: nothing to do\0A\00"
define void @pa_threaded_mainloop_lock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @empty_log(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"pa_threaded_mainloop_lock: nothing to do\0A\00"
define void @pa_threaded_mainloop_lock(i32* nocapture readnone %0) {
%2 = tail call i32 @empty_log(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "Usage %s options\n", progname);
  fprintf(stderr, "-n NCOLORS  allocate NCOLORS colors\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xece(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Usage %s options\0A\00"
@.str.1 = [37 x i8] c"-n NCOLORS allocate NCOLORS colors\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Usage %s options\0A\00"
@.str.1 = [37 x i8] c"-n NCOLORS allocate NCOLORS colors\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ adxl345_readAccel(int *, int *, int *);
void adxl345_readAccelxyz(int *xyz) {
  adxl345_readAccel(xyz, xyz + 1, xyz + 2);
}


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

x86 assembly (clang, -O2):
<adxl345_readAccelxyz>:
lea    0x4(%rdi),%rsi
lea    0x8(%rdi),%rdx
jmp    1030 <adxl345_readAccel@plt>

LLVM IR (-O0):
define void @adxl345_readAccelxyz(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 2
%8 = call i32 @adxl345_readAccel(i32* %3, i32* %5, i32* %7)
ret void
}

LLVM IR (-O2):
define void @adxl345_readAccelxyz(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = tail call i32 @adxl345_readAccel(i32* %0, i32* %2, i32* %3)
ret void
}
/* Variables and functions */
int snprintf(char *, int, char *, char *, char *);
int write(int, char *, int);
int pubsub_textline_send(int fd, char *topic, char *text) {
  int r;
  char buf[4096];
  r = snprintf(buf, 4096, "%s>%s\r\n", topic, text);
  return write(fd, buf, r);
}


x86 assembly (clang, -O0):
<pubsub_textline_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1020(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x1000,%esi
lea    0xeaf(%rip),%rdx
call   1040 <snprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x1020(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <write@plt>
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pubsub_textline_send>:
push   %r14
push   %rbx
sub    $0x1008,%rsp
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %edi,%ebx
lea    0xec7(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x1000,%esi
call   1040 <snprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x1008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s>%s\0D\0A\00"
define i32 @pubsub_textline_send(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [4096 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @snprintf(i8* %9, i32 4096, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
store i32 %12, i32* %7
%13 = load i32, i32* %4
%14 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%15 = load i32, i32* %7
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s>%s\0D\0A\00"
define i32 @pubsub_textline_send(i32 %0, i8* %1, i8* %2) {
%4 = alloca [4096 x i8]
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 4096, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%7 = call i32 @write(i32 %0, i8* %5, i32 %6)
ret i32 %7
}
int test_imm_25int8_mem(signed char *val) {
  return ((*val) & (-0x25 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_25int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffdb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_25int8_mem>:
testb  $0xdb,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_25int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -37
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_25int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -37
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void *print_message_function(void *ptr) {
  char *message;
  message = (char *)ptr;
  printf("%s \n", message);
}


x86 assembly (clang, -O0):
<print_message_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
define noalias i8* @print_message_function(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
char *read_line_io();
FILE *open_specified_file() {
  FILE *fp = NULL;
  char *string;
  while (fp == NULL) {
    printf("\nFile to use: ");
    string = read_line_io();
    fp = fopen(string, "r");
  }
  return fp;
}


x86 assembly (clang, -O0):
<open_specified_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117b <open_specified_file+0x4b>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <read_line_io@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
jmp    1140 <open_specified_file+0x10>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_specified_file>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
lea    0xecd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <read_line_io@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1150 <open_specified_file+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\0AFile to use: \00"
@.str.1 = [2 x i8] c"r\00"
define i32* @open_specified_file() {
%1 = alloca i32*
%2 = alloca i8*
store i32* null, i32** %1
br label %3
3: ; preds = %6, %0
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i8* (...) @read_line_io()
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %1
br label %3
11: ; preds = %3
%12 = load i32*, i32** %1
ret i32* %12
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0AFile to use: \00"
@.str.1 = [2 x i8] c"r\00"
define i32* @open_specified_file() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* (...) @read_line_io()
%4 = tail call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %1, label %6
6: ; preds = %1
ret i32* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint8_t *setfield32(uint8_t *field, uint32_t val) {
  memcpy(field, &val, sizeof(uint32_t));
  return field + sizeof(uint32_t);
}


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

x86 assembly (clang, -O2):
<setfield32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32* @setfield32(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 @memcpy(i32* %5, i32* %4, i32 4)
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 4
ret i32* %8
}

LLVM IR (-O2):
define i32* @setfield32(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i32* %0, i32* %3, i32 4)
%5 = getelementptr inbounds i32, i32* %0, i64 4
ret i32* %5
}
void mazefree(char **a, int rows) {
  int i;
  for (i = 0; i < 2 * rows + 1; i++)
    free(a[i]);
  free(a);
}


x86 assembly (clang, -O0):
<mazefree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1159 <mazefree+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <mazefree+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mazefree>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    (%rsi,%rsi,1),%eax
add    $0x1,%eax
test   %eax,%eax
jle    1142 <mazefree+0x32>
mov    %eax,%r15d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <mazefree+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mazefree(i8** nocapture %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = or i32 %3, 1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = zext i32 %4 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %2
%15 = bitcast i8** %0 to i8*
tail call void @free(i8* %15)
ret void
}
int mc64id_(int *icntl) {
  int i__;
  --icntl;
  icntl[1] = 6;
  icntl[2] = 6;
  icntl[3] = -1;
  for (i__ = 4; i__ <= 10; ++i__) {
    icntl[i__] = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<mc64id_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x6,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x6,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0xffffffff,0xc(%rax)
movl   $0x4,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     1163 <mc64id_+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <mc64id_+0x3c>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc64id_>:
movabs $0x600000006,%rax
mov    %rax,(%rdi)
movl   $0xffffffff,0x8(%rdi)
xorps  %xmm0,%xmm0
movups %xmm0,0xc(%rdi)
movups %xmm0,0x18(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mc64id_(i32* nocapture writeonly %0) {
store i32 6, i32* %0
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 6, i32* %2
%3 = getelementptr inbounds i32, i32* %0, i64 2
store i32 -1, i32* %3
%4 = getelementptr i32, i32* %0, i64 3
%5 = bitcast i32* %4 to i8*
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void dsp_end(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @dsp_end() {
%1 = tail call i32 (...) @endwin()
ret void
}
int next_right(char H[], int i, int len) {
  int j;
  for (j = i + 1; H[j] == 'c' && j < len; j++)
    ;
  return j;
}


x86 assembly (clang, -O0):
<next_right>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x63,%ecx
mov    %al,-0x15(%rbp)
jne    113d <next_right+0x3d>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114d <next_right+0x4d>
jmp    1160 <next_right+0x60>
jmp    1152 <next_right+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <next_right+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_right>:
mov    %esi,%eax
movslq %esi,%rsi
movslq %edx,%rcx
add    $0x1,%rsi
nopl   0x0(%rax)
add    $0x1,%eax
cmpb   $0x63,(%rdi,%rsi,1)
jne    1125 <next_right+0x25>
lea    0x1(%rsi),%rdx
cmp    %rcx,%rsi
mov    %rdx,%rsi
jl     1110 <next_right+0x10>
ret

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

LLVM IR (-O2):
define i32 @next_right(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
br label %6
6: ; preds = %6, %3
%7 = phi i64 [ %8, %6 ], [ %4, %3 ]
%8 = add nsw i64 %7, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 99
%12 = icmp slt i64 %8, %5
%13 = select i1 %11, i1 %12, i1 false
br i1 %13, label %6, label %14
14: ; preds = %6
%15 = trunc i64 %8 to i32
ret i32 %15
}
int sdPowerup(int tot) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @sdPowerup(i32 %0) {
ret i32 -1
}