xunge/DecIR huggingface dataset:
int uri_mark(int c) {
  return ((c == '-') || (c == '_') || (c == '.') || (c == '!') || (c == '~') ||
          (c == '*') || (c == '\'') || (c == '(') || (c == ')'));
}


x86 assembly (clang, -O0):
<uri_mark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x2d,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1189 <uri_mark+0x89>
mov    $0x1,%al
cmpl   $0x5f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1189 <uri_mark+0x89>
mov    $0x1,%al
cmpl   $0x2e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1189 <uri_mark+0x89>
mov    $0x1,%al
cmpl   $0x21,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1189 <uri_mark+0x89>
mov    $0x1,%al
cmpl   $0x7e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1189 <uri_mark+0x89>
mov    $0x1,%al
cmpl   $0x2a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1189 <uri_mark+0x89>
mov    $0x1,%al
cmpl   $0x27,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1189 <uri_mark+0x89>
mov    $0x1,%al
cmpl   $0x28,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1189 <uri_mark+0x89>
cmpl   $0x29,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uri_mark>:
mov    $0x1,%eax
lea    -0x21(%rdi),%ecx
cmp    $0x3e,%ecx
ja     111e <uri_mark+0x1e>
movabs $0x40000000000032c1,%rdx
bt     %rcx,%rdx
jae    111e <uri_mark+0x1e>
ret
cmp    $0x7e,%edi
je     111d <uri_mark+0x1d>
xor    %eax,%eax
cmp    $0x29,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @uri_mark(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 45
br i1 %4, label %29, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 95
br i1 %7, label %29, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 46
br i1 %10, label %29, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 33
br i1 %13, label %29, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 126
br i1 %16, label %29, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 42
br i1 %19, label %29, label %20
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 39
br i1 %22, label %29, label %23
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 40
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 41
br label %29
29: ; preds = %26, %23, %20, %17, %14, %11, %8, %5, %1
%30 = phi i1 [ true, %23 ], [ true, %20 ], [ true, %17 ], [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %28, %26 ]
%31 = zext i1 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @uri_mark(i32 %0) {
switch i32 %0, label %2 [
i32 126, label %5
i32 95, label %5
i32 46, label %5
i32 45, label %5
i32 42, label %5
i32 40, label %5
i32 39, label %5
i32 33, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 41
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
struct stat {
  scalar_t__ st_mtime;
};

/* Variables and functions */
int stat(char const *, struct stat *);
scalar_t__ time(int /*<<< orphan*/ *);
int expired(const char *fname) {
  struct stat st;
  int rc = stat(fname, &st);
  if (rc != 0) {
    return 1;
  }
  if (st.st_mtime + 60 < time(NULL)) {
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<expired>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1152 <expired+0x32>
movl   $0x1,-0x4(%rbp)
jmp    118a <expired+0x6a>
mov    -0x18(%rbp),%rax
add    $0x3c,%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jge    1183 <expired+0x63>
movl   $0x2,-0x4(%rbp)
jmp    118a <expired+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expired>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    1157 <expired+0x37>
mov    0x8(%rsp),%rbx
add    $0x3c,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
setl   %al
add    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @expired(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %19
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load i64, i64* %12
%14 = add nsw i64 %13, 60
%15 = call i64 @time(i32* null)
%16 = icmp slt i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %11
store i32 2, i32* %2
br label %19
18: ; preds = %11
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @expired(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add nsw i64 %8, 60
%10 = tail call i64 @time(i32* null)
%11 = icmp slt i64 %9, %10
%12 = select i1 %11, i32 2, i32 0
br label %13
13: ; preds = %6, %1
%14 = phi i32 [ 1, %1 ], [ %12, %6 ]
ret i32 %14
}
/* Variables and functions */
char *MYstrcpy(char *desination, char *source) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @MYstrcpy(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
int le(int x, int y) {
  if (x > 0 && y > 0) {
    return le(x - 1, y - 1);
  } else {
    return (x == 0);
  }
}


x86 assembly (clang, -O0):
<le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114b <le+0x3b>
cmpl   $0x0,-0xc(%rbp)
jle    114b <le+0x3b>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <le@plt>
mov    %eax,-0x4(%rbp)
jmp    115a <le+0x4a>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le>:
test   %edi,%edi
jle    1115 <le+0x15>
test   %esi,%esi
jle    1115 <le+0x15>
add    $0xffffffff,%edi
add    $0xffffffff,%esi
xor    %eax,%eax
sub    %esi,%edi
cmovb  %eax,%edi
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @le(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 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = call i32 @le(i32 %13, i32 %15)
store i32 %16, i32* %3
br label %21
17: ; preds = %8, %2
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
store i32 %20, i32* %3
br label %21
21: ; preds = %17, %11
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @le(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = add nsw i32 %1, -1
%9 = call i32 @llvm.umin.i32(i32 %8, i32 %7)
%10 = sub nsw i32 %7, %9
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ %0, %2 ], [ %10, %6 ]
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}
int syscall0(int syscall) {
  int ret;
  __asm__("movl %1,%%eax\n\t"
          "int $0x80\n\t"
          "movl %%eax,%0\n\t"
          : "=r"(ret)
          : "m"(syscall)
          : "eax");
  return ret;
}


x86 assembly (clang, -O0):
<syscall0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
int    $0x80
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall0>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
int    $0x80
mov    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @syscall0(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 asm "movl $1,%eax\0A\09int $$0x80\0A\09movl %eax,$0\0A\09", "=r,*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %2)
store i32 %4, i32* %3
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @syscall0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 asm "movl $1,%eax\0A\09int $$0x80\0A\09movl %eax,$0\0A\09", "=r,*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x10() {
  Assert_real((isgraph(16) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              85, ("isgraph should be 0 for 0x10"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x10>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x55,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x10>:
push   %rax
mov    $0x10,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x55,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x10\00"
define void @t_isgraph_0x10() {
%1 = call i64 @isgraph(i32 16)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x10\00"
define void @t_isgraph_0x10() {
%1 = tail call i64 @isgraph(i32 16)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ioctl_sector_data_type(int sector, int ismsf) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @ioctl_sector_data_type(i32 %0, i32 %1) {
ret i32 2
}
f() {
  __label__ mylabel;
mylabel:
  goto mylabel;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f+0x9>
jmp    1109 <f+0x9>

x86 assembly (clang, -O2):
<f>:
jmp    1100 <f>

LLVM IR (-O0):
define i32 @f() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define i32 @f() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
long double exp2(double);
__attribute__((weak)) long double exp2l(long double x) {
  return exp2((double)x);
}


x86 assembly (clang, -O0):
<exp2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <exp2@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp2l>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <exp2@plt>

LLVM IR (-O0):
define weak x86_fp80 @exp2l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @exp2(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @exp2l(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @exp2(double %2)
ret x86_fp80 %3
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
int /*<<< orphan*/ perror(char const *);
void die(const char *s, int sock, struct addrinfo *res) {
  perror(s);
  if (sock)
    close(sock);
  if (res)
    freeaddrinfo(res);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
cmpl   $0x0,-0xc(%rbp)
je     116e <die+0x2e>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
cmpq   $0x0,-0x18(%rbp)
je     1182 <die+0x42>
mov    -0x18(%rbp),%rdi
call   1060 <freeaddrinfo@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <perror@plt>
test   %ebp,%ebp
jne    1160 <die+0x20>
test   %rbx,%rbx
jne    116c <die+0x2c>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    %ebp,%edi
call   1030 <close@plt>
test   %rbx,%rbx
je     1156 <die+0x16>
mov    %rbx,%rdi
call   1060 <freeaddrinfo@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define void @die(i8* %0, i32 %1, %struct.addrinfo* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.addrinfo*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.addrinfo* %2, %struct.addrinfo** %6
%7 = load i8*, i8** %4
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32, i32* %5
%13 = call i32 @close(i32 %12)
br label %14
14: ; preds = %11, %3
%15 = load %struct.addrinfo*, %struct.addrinfo** %6
%16 = icmp ne %struct.addrinfo* %15, null
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load %struct.addrinfo*, %struct.addrinfo** %6
%19 = call i32 @freeaddrinfo(%struct.addrinfo* %18)
br label %20
20: ; preds = %17, %14
%21 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define void @die(i8* nocapture %0, i32 %1, %struct.addrinfo* %2) {
%4 = tail call i32 @perror(i8* %0)
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @close(i32 %1)
br label %8
8: ; preds = %6, %3
%9 = icmp eq %struct.addrinfo* %2, null
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 @freeaddrinfo(%struct.addrinfo* %2)
br label %12
12: ; preds = %10, %8
%13 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyb(int key, int state) {
  if (state) {
    switch (key) {
    case 'q':
      exit(0);
    default:
      break;
    }
  }
}


x86 assembly (clang, -O0):
<keyb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114a <keyb+0x3a>
mov    -0x4(%rbp),%eax
sub    $0x71,%eax
jne    1140 <keyb+0x30>
jmp    1139 <keyb+0x29>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1145 <keyb+0x35>
jmp    114a <keyb+0x3a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyb>:
cmp    $0x71,%edi
jne    1119 <keyb+0x9>
test   %esi,%esi
jne    111a <keyb+0xa>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyb(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
switch i32 %8, label %11 [
i32 113, label %9
]
9: ; preds = %7
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %7
br label %12
12: ; preds = %11
br label %13
13: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @keyb(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = icmp eq i32 %0, 113
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
bool nrf52_errata_191(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_191() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x24_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x24_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
scalar_t__ ESRCH;
scalar_t__ errno;
int kill(int /*<<< orphan*/, int /*<<< orphan*/);
int pidexists(int pid) {
  if (kill((pid_t)pid, 0) == -1) {
    if (errno == ESRCH)
      return 1;
    else
      return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<pidexists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <kill@plt>
cmp    $0xffffffff,%eax
jne    1160 <pidexists+0x50>
mov    0x2eab(%rip),%rax
mov    (%rax),%rax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%rax
jne    1154 <pidexists+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1167 <pidexists+0x57>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <pidexists+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pidexists>:
push   %rbx
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <kill@plt>
mov    0x2ebf(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2ea5(%rip),%rdx
xor    %esi,%esi
cmp    (%rdx),%rcx
sete   %sil
cmp    $0xffffffff,%eax
lea    -0x1(%rsi,%rsi,1),%eax
cmovne %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@errno = global i64 0
@ESRCH = global i64 0
define i32 @pidexists(i32 %0) {
%2 = tail call i32 @kill(i32 %0, i32 0)
%3 = icmp eq i32 %2, -1
%4 = load i64, i64* @errno
%5 = load i64, i64* @ESRCH
%6 = icmp eq i64 %4, %5
%7 = select i1 %6, i32 1, i32 -1
%8 = select i1 %3, i32 %7, i32 0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ add_command(unsigned int *, int, int);
int /*<<< orphan*/ ipfw_init(int, char **, unsigned int, char const *,
                             int /*<<< orphan*/);
scalar_t__ optind;
int ipfw_flush(int args, char **arglist, const char *chain) {
  unsigned int command = 0;
  add_command(&command, 0x0040U, 0x0000U);
  ipfw_init(args, arglist, command, chain, 0);
  optind = 0;
  return (0);
}


x86 assembly (clang, -O0):
<ipfw_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0x40,%esi
xor    %edx,%edx
call   1040 <add_command@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <ipfw_init@plt>
mov    0x2e81(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipfw_flush>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x40,%esi
xor    %edx,%edx
call   1040 <add_command@plt>
mov    0xc(%rsp),%edx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rcx
xor    %r8d,%r8d
call   1030 <ipfw_init@plt>
mov    0x2e84(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@optind = global i64 0
define i32 @ipfw_flush(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
store i32 0, i32* %7
%8 = call i32 @add_command(i32* %7, i32 64, i32 0)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = load i32, i32* %7
%12 = load i8*, i8** %6
%13 = call i32 @ipfw_init(i32 %9, i8** %10, i32 %11, i8* %12, i32 0)
store i64 0, i64* @optind
ret i32 0
}

LLVM IR (-O2):
@optind = global i64 0
define i32 @ipfw_flush(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @add_command(i32* %4, i32 64, i32 0)
%7 = load i32, i32* %4
%8 = call i32 @ipfw_init(i32 %0, i8** %1, i32 %7, i8* %2, i32 0)
store i64 0, i64* @optind
ret i32 0
}
/* Variables and functions */
int xatoll(char const *);
__attribute__((always_)) int xatoi(const char *str) { return xatoll(str); }


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

x86 assembly (clang, -O2):
<xatoi>:
jmp    1030 <xatoll@plt>

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

LLVM IR (-O2):
define i32 @xatoi(i8* %0) {
%2 = tail call i32 @xatoll(i8* %0)
ret i32 %2
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, long long,
                            int /*<<< orphan*/);
void timespec_print(struct timespec ts, char *buf, size_t buflen) {
  snprintf(buf, buflen, "%lld.%.9ld", (long long)ts.tv_sec, ts.tv_nsec);
}


x86 assembly (clang, -O0):
<timespec_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8d
lea    0xec2(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_print>:
mov    %rdx,%rax
mov    %rsi,%r9
mov    %edi,%r8d
lea    0xee0(%rip),%rdx
mov    %rax,%rdi
mov    %rcx,%rsi
mov    %r9,%rcx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@.str = [11 x i8] c"%lld.%.9ld\00"
define void @timespec_print(i32 %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca %struct.timespec
%6 = alloca i8*
%7 = alloca i64
%8 = bitcast %struct.timespec* %5 to { i32, i64 }*
%9 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %8, i32 0, i32 0
store i32 %0, i32* %9
%10 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
store i8* %2, i8** %6
store i64 %3, i64* %7
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i32 @snprintf(i8* %11, i64 %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %14, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%lld.%.9ld\00"
define void @timespec_print(i32 %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @snprintf(i8* %2, i64 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %1, i32 %0)
ret void
}
/* Variables and functions */
double log(float);
float log2f(float x) { return (log(x) * 1.44269504088896340736); }


x86 assembly (clang, -O0):
<log2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2f>:
push   %rax
call   1030 <log@plt>
mulsd  0xee2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @log(float %3)
%5 = fmul double %4, 0x3FF71547652B82FE
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @log2f(float %0) {
%2 = tail call double @log(float %0)
%3 = fmul double %2, 0x3FF71547652B82FE
%4 = fptrunc double %3 to float
ret float %4
}
int helper_function(int a, int b) {
  if (a) {
    return 42;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<helper_function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1120 <helper_function+0x20>
movl   $0x2a,-0x4(%rbp)
jmp    1126 <helper_function+0x26>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper_function>:
test   %edi,%edi
mov    $0x2a,%eax
cmove  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @helper_function(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 %1, i32 42
ret i32 %4
}
char init_kbd(void) { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @init_kbd() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @init_kbd() {
ret i8 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_stream_pi(int /*<<< orphan*/ *, int /*<<< orphan*/);
void test25(__m64 *p, __m64 a) { _mm_stream_pi(p, a); }


x86 assembly (clang, -O0):
<test25>:
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 <_mm_stream_pi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test25>:
jmp    1030 <_mm_stream_pi@plt>

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

LLVM IR (-O2):
define void @test25(i32* %0, i32 %1) {
%3 = tail call i32 @_mm_stream_pi(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
double pow(int /*<<< orphan*/, double);
int /*<<< orphan*/ rgamma(double, int);
double rgengamma(double a, double b, double c, double k) {
  return (pow(rgamma(c, 1), 1.0 / k) * b + a);
}


x86 assembly (clang, -O0):
<rgengamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <rgamma@plt>
mov    %eax,%edi
movsd  0xeab(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1040 <pow@plt>
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgengamma>:
sub    $0x18,%rsp
movsd  %xmm3,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movaps %xmm2,%xmm0
mov    $0x1,%edi
call   1030 <rgamma@plt>
movsd  0xeb6(%rip),%xmm0
divsd  (%rsp),%xmm0
mov    %eax,%edi
call   1040 <pow@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rgengamma(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = call i32 @rgamma(double %9, i32 1)
%11 = load double, double* %8
%12 = fdiv double 1.000000e+00, %11
%13 = call double @pow(i32 %10, double %12)
%14 = load double, double* %6
%15 = load double, double* %5
%16 = call double @llvm.fmuladd.f64(double %13, double %14, double %15)
ret double %16
}

LLVM IR (-O2):
define double @rgengamma(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @rgamma(double %2, i32 1)
%6 = fdiv double 1.000000e+00, %3
%7 = tail call double @pow(i32 %5, double %6)
%8 = tail call double @llvm.fmuladd.f64(double %7, double %1, double %0)
ret double %8
}
int f12(int x, int y) {
  if (y != -2)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xfffffffe,-0xc(%rbp)
je     1127 <f12+0x27>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    112e <f12+0x2e>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f12>:
mov    $0x22,%eax
cmp    $0xfffffffe,%esi
je     1113 <f12+0x13>
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @f12(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, -2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sub nsw i32 0, %1
%6 = srem i32 %0, %5
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 34, %2 ]
ret i32 %8
}
void test18(void) {
  int a;
  int b;
  int c;
  unsigned char d;
  if (c && (a = b)) {
  }
  if ((c = a) || a) {
  }
  if (c && (a || c)) {
  }
  d = c && (a = c);
}


x86 assembly (clang, -O0):
<test18>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,-0xc(%rbp)
je     1122 <test18+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1122 <test18+0x22>
jmp    1122 <test18+0x22>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    113b <test18+0x3b>
cmpl   $0x0,-0x4(%rbp)
je     1140 <test18+0x40>
jmp    1140 <test18+0x40>
cmpl   $0x0,-0xc(%rbp)
je     1163 <test18+0x63>
cmpl   $0x0,-0x4(%rbp)
jne    115e <test18+0x5e>
cmpl   $0x0,-0xc(%rbp)
je     1163 <test18+0x63>
jmp    1163 <test18+0x63>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xe(%rbp)
je     1181 <test18+0x81>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0xd(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test18() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %2
store i32 %8, i32* %1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %11
11: ; preds = %10, %7, %0
%12 = load i32, i32* %1
store i32 %12, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %1
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14, %11
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %3
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* %1
%23 = icmp ne i32 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %24, %21
br label %28
28: ; preds = %27, %24, %18
%29 = load i32, i32* %3
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i32, i32* %3
store i32 %32, i32* %1
%33 = icmp ne i32 %32, 0
br label %34
34: ; preds = %31, %28
%35 = phi i1 [ false, %28 ], [ %33, %31 ]
%36 = zext i1 %35 to i32
%37 = trunc i32 %36 to i8
store i8 %37, i8* %4
ret void
}

LLVM IR (-O2):
define void @test18() {
ret void
}
int fooinc2(int x) {
  if (x)
    return 1026;
  else
    return 1025;
}


x86 assembly (clang, -O0):
<fooinc2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <fooinc2+0x1d>
movl   $0x402,-0x4(%rbp)
jmp    1124 <fooinc2+0x24>
movl   $0x401,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fooinc2>:
cmp    $0x1,%edi
mov    $0x402,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @fooinc2(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1025, i32 1026
ret i32 %3
}
void Conditionals(int a) {
  a ? 0 : 1;
  a ?: 0;
}


x86 assembly (clang, -O0):
<Conditionals>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1118 <Conditionals+0x18>
jmp    111d <Conditionals+0x1d>
jmp    111d <Conditionals+0x1d>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Conditionals(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 0, i32 1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %9
%12 = phi i32 [ %7, %9 ], [ 0, %10 ]
ret void
}

LLVM IR (-O2):
define void @Conditionals(i32 %0) {
ret void
}
int stringLength(char *string) {
  char *c = string;
  while (*c) {
    ++c;
  }
  return c - string;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <stringLength+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <stringLength+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <stringLength+0x10>
ret

LLVM IR (-O0):
define i32 @stringLength(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %5
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @stringLength(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
int increment_px_2() {
  int x = 10;
  int *some_pointer;
  some_pointer = &x;
  printf("some_pointer = %u\n", some_pointer);
  ++*some_pointer;
  printf("some_pointer = %d\n", *some_pointer);
}


x86 assembly (clang, -O0):
<increment_px_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_px_2>:
push   %rax
movl   $0xa,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%esi
mov    %esi,0x4(%rsp)
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"some_pointer = %u\0A\00"
@.str.1 = [19 x i8] c"some_pointer = %d\0A\00"
define i32 @increment_px_2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 undef
}
/* Variables and functions */
char *strdup(char *);
char *empty_cmd() { return strdup(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @empty_cmd() {
%1 = call i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define noalias i8* @empty_cmd() {
%1 = tail call dereferenceable_or_null(1) i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ nxtWriteRawHS(char *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void TestPub() {
  char *json = "PUBnxt/test,{\"data\":\"test123\"}\n";
  nxtWriteRawHS(json, strlen(json), 0);
}


x86 assembly (clang, -O0):
<TestPub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1030 <nxtWriteRawHS@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestPub>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <nxtWriteRawHS@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"PUBnxt/test,{\22data\22:\22test123\22}\0A\00"
define void @TestPub() {
%1 = alloca i8*
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strlen(i8* %3)
%5 = call i32 @nxtWriteRawHS(i8* %2, i32 %4, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"PUBnxt/test,{\22data\22:\22test123\22}\0A\00"
define void @TestPub() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @nxtWriteRawHS(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1, i32 0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ ListTests();
int /*<<< orphan*/ StackTests();
int main(int argc, char **argv) {
  ListTests();
  StackTests();
  return EXIT_SUCCESS;
}


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)
mov    $0x0,%al
call   1030 <ListTests@plt>
mov    $0x0,%al
call   1040 <StackTests@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <ListTests@plt>
xor    %eax,%eax
call   1040 <StackTests@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @ListTests()
%7 = call i32 (...) @StackTests()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ListTests()
%4 = tail call i32 (...) @StackTests()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
const char *format_cpu_pct(double *cpu_pct) {
  *cpu_pct = 0;
  return "?";
}


x86 assembly (clang, -O0):
<format_cpu_pct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
lea    0xee6(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_cpu_pct>:
movq   $0x0,(%rdi)
lea    0xef2(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
define i8* @format_cpu_pct(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
store double 0.000000e+00, double* %3
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
define i8* @format_cpu_pct(double* nocapture writeonly %0) {
store double 0.000000e+00, double* %0
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int strlen(char const *);
char *str_copy(const char *origin) {
  char *str = malloc(strlen(origin) * sizeof(char));
  sprintf(str, "%s", origin);
  return str;
}


x86 assembly (clang, -O0):
<str_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9b(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_copy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i8* @str_copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 1
%8 = trunc i64 %7 to i32
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @str_copy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @malloc(i32 %2)
%4 = tail call i8* @strcpy(i8* dereferenceable(1) %3, i8* dereferenceable(1) %0)
ret i8* %3
}
void PERLinuxJoyNothing(void) {}


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

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

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

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