xunge/DecIR huggingface dataset:
void rop3_208_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S | stk3;
  stk1 = T & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_208_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_208_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %sil,%cl
not    %cl
and    %dl,%cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_208_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = and i32 %35, %37
%39 = or i32 %32, %38
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %4
store i8 %40, i8* %41
ret void
}

LLVM IR (-O2):
define void @rop3_208_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = xor i8 %5, -1
%7 = and i8 %6, %2
%8 = and i8 %4, %1
%9 = or i8 %7, %8
store i8 %9, i8* %0
ret void
}
void g_timeout_add() {}


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

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

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

LLVM IR (-O2):
define void @g_timeout_add() {
ret void
}
alloc_buf(fd, buf, size) int fd;
char **buf;
int size;
{
  if (fd != -1)
    *buf = (char *)malloc(size);
}


x86 assembly (clang, -O0):
<alloc_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     113f <alloc_buf+0x2f>
movslq -0x14(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_buf>:
cmp    $0xffffffff,%edi
je     1125 <alloc_buf+0x15>
push   %rbx
mov    %rsi,%rbx
movslq %edx,%rdi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @alloc_buf(i32 %0, i8** nocapture writeonly %1, i32 %2) {
%4 = icmp eq i32 %0, -1
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = tail call i8* @malloc(i64 %6)
store i8* %7, i8** %1
br label %8
8: ; preds = %5, %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  char *command = "echo -n \"O\" > /dev/ttyACM0";
  system(command);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"echo -n \22O\22 > /dev/ttyACM0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @system(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"echo -n \22O\22 > /dev/ttyACM0\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long lrand48();
int gen_number(int range) {
  long tmp;
  long __cil_tmp3;
  long __cil_tmp4;
  {
    { tmp = lrand48(); }
    {
      __cil_tmp3 = (long)range;
      __cil_tmp4 = tmp % __cil_tmp3;
      return ((int)__cil_tmp4);
    }
  }
}


x86 assembly (clang, -O0):
<gen_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <lrand48@plt>
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_number>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <lrand48@plt>
movslq %ebx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1133 <gen_number+0x23>
cqto
idiv   %rcx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gen_number(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = call i64 (...) @lrand48()
store i64 %6, i64* %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
store i64 %8, i64* %4
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = srem i64 %9, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @gen_number(i32 %0) {
%2 = tail call i64 (...) @lrand48()
%3 = sext i32 %0 to i64
%4 = srem i64 %2, %3
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, float);
void printHumidity(const char *name, float value) {
  if (value == 0xFF)
    return;
  printf("H%s: %02.1f ", name, value);
}


x86 assembly (clang, -O0):
<printHumidity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xed2(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1142 <printHumidity+0x32>
jp     1142 <printHumidity+0x32>
jmp    1157 <printHumidity+0x47>
mov    -0x8(%rbp),%rsi
movss  -0xc(%rbp),%xmm0
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHumidity>:
ucomiss 0xee9(%rip),%xmm0
jne    111c <printHumidity+0xc>
jp     111c <printHumidity+0xc>
ret
mov    %rdi,%rsi
lea    0xede(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"H%s: %02.1f \00"
define void @printHumidity(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fcmp oeq float %5, 2.550000e+02
br i1 %6, label %7, label %8
7: ; preds = %2
br label %12
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %9, float %10)
br label %12
12: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"H%s: %02.1f \00"
define void @printHumidity(i8* %0, float %1) {
%3 = fcmp oeq float %1, 2.550000e+02
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, float %1)
br label %6
6: ; preds = %2, %4
ret void
}
int(ars_d_set_ipopt_lsrr)(struct ars_packet *pkt, int layer, char *f, char *v) {
  return 0;
}


x86 assembly (clang, -O0):
<ars_d_set_ipopt_lsrr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ars_packet = type opaque
define i32 @ars_d_set_ipopt_lsrr(%struct.ars_packet* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.ars_packet*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.ars_packet* %0, %struct.ars_packet** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
%struct.ars_packet = type opaque
define i32 @ars_d_set_ipopt_lsrr(%struct.ars_packet* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
long dtls1_default_timeout(void) { return (60 * 60 * 2); }


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

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

LLVM IR (-O0):
define i64 @dtls1_default_timeout() {
ret i64 7200
}

LLVM IR (-O2):
define i64 @dtls1_default_timeout() {
ret i64 7200
}
/* Type definitions */
typedef int /*<<< orphan*/ tz;
struct timezone {
  int tz_minuteswest;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ memset(struct timezone *, int /*<<< orphan*/, int);
int get_tz_min(void) {
  struct timezone tz;
  struct timeval tv;
  memset(&tz, 0, sizeof(tz));
  gettimeofday(&tv, &tz);
  return tz.tz_minuteswest;
}


x86 assembly (clang, -O0):
<get_tz_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tz_min>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timezone = type { i32 }
%struct.timeval = type { i32 }
define i32 @get_tz_min() {
%1 = alloca %struct.timezone
%2 = alloca %struct.timeval
%3 = call i32 @memset(%struct.timezone* %1, i32 0, i32 4)
%4 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %1)
%5 = getelementptr inbounds %struct.timezone, %struct.timezone* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.timezone = type { i32 }
%struct.timeval = type { i32 }
define i32 @get_tz_min() {
%1 = alloca %struct.timezone
%2 = alloca %struct.timeval
%3 = bitcast %struct.timezone* %1 to i8*
%4 = bitcast %struct.timeval* %2 to i8*
%5 = call i32 @memset(%struct.timezone* %1, i32 0, i32 4)
%6 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %1)
%7 = getelementptr inbounds %struct.timezone, %struct.timezone* %1, i64 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ static_assert(int);
scalar_t__ unknown1();
int unknown2();
int main() {
  int k = 1;
  int w = 1;
  while (unknown1()) {
    int z = unknown2();
    if (z > 5)
      w++;
    k += w;
  }
  static_assert(k > 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    $0x0,%al
call   1030 <unknown1@plt>
cmp    $0x0,%rax
je     1189 <main+0x59>
mov    $0x0,%al
call   1040 <unknown2@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jle    117b <main+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x1d>
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <static_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <unknown1@plt>
test   %rax,%rax
je     1155 <main+0x25>
xor    %eax,%eax
call   1040 <unknown2@plt>
jmp    1140 <main+0x10>
mov    $0x1,%edi
call   1050 <static_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @unknown1()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @unknown2()
%5 = tail call i64 (...) @unknown1()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
%8 = tail call i32 @static_assert(i32 1)
ret i32 0
}
int BLAS_char_check_uplo(char uplo) {
  return uplo == 'L' || uplo == 'l' || uplo == 'U' || uplo == 'u';
}


x86 assembly (clang, -O0):
<BLAS_char_check_uplo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x4c,%ecx
mov    %al,-0x2(%rbp)
je     114d <BLAS_char_check_uplo+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6c,%ecx
mov    %al,-0x2(%rbp)
je     114d <BLAS_char_check_uplo+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x55,%ecx
mov    %al,-0x2(%rbp)
je     114d <BLAS_char_check_uplo+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x75,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BLAS_char_check_uplo>:
lea    -0x4c(%rdi),%ecx
cmp    $0x20,%cl
ja     1121 <BLAS_char_check_uplo+0x21>
mov    $0x1,%eax
movzbl %cl,%ecx
movabs $0x100000201,%rdx
bt     %rcx,%rdx
jae    1121 <BLAS_char_check_uplo+0x21>
ret
xor    %eax,%eax
cmp    $0x75,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @BLAS_char_check_uplo(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 76
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 108
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 85
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 117
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @BLAS_char_check_uplo(i8 signext %0) {
switch i8 %0, label %2 [
i8 108, label %5
i8 85, label %5
i8 76, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 117
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
struct cmd_info {
  int dummy;
};

/* Variables and functions */
int pci_list_procfs();
int pci_list_sysfs();
int pci_list(int argc, const char *argv[], const struct cmd_info *info) {
  int ret = pci_list_sysfs();
  if (ret < 0) {
    ret = pci_list_procfs();
  }
  return ret;
}


x86 assembly (clang, -O0):
<pci_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <pci_list_sysfs@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1151 <pci_list+0x31>
mov    $0x0,%al
call   1030 <pci_list_procfs@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_list>:
push   %rax
xor    %eax,%eax
call   1040 <pci_list_sysfs@plt>
test   %eax,%eax
js     112e <pci_list+0xe>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <pci_list_procfs@plt>

LLVM IR (-O0):
%struct.cmd_info = type { i32 }
define i32 @pci_list(i32 %0, i8** %1, %struct.cmd_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.cmd_info*
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.cmd_info* %2, %struct.cmd_info** %6
%8 = call i32 (...) @pci_list_sysfs()
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 (...) @pci_list_procfs()
store i32 %12, i32* %7
br label %13
13: ; preds = %11, %3
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
%struct.cmd_info = type { i32 }
define i32 @pci_list(i32 %0, i8** nocapture readnone %1, %struct.cmd_info* nocapture readnone %2) {
%4 = tail call i32 (...) @pci_list_sysfs()
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @pci_list_procfs()
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ %4, %3 ]
ret i32 %9
}
/* Variables and functions */
int maiorFator(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("O maior fator primo de 74463226 eh: %d\n", maiorFator(74463226));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x47037fa,%edi
call   1040 <maiorFator@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [40 x i8] c"O maior fator primo de 74463226 eh: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @maiorFator(i32 74463226)
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"O maior fator primo de 74463226 eh: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @maiorFator(i32 74463226)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led0Off();
void TestAppP__Leds__led0Off(void) { LedsP__Leds__led0Off(); }


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

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

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

LLVM IR (-O2):
define void @TestAppP__Leds__led0Off() {
%1 = tail call i32 (...) @LedsP__Leds__led0Off()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printError();
int /*<<< orphan*/ printError2();
int main() {
  printError();
  printError();
  printError2();
  printError2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <printError@plt>
mov    $0x0,%al
call   1040 <printError@plt>
mov    $0x0,%al
call   1030 <printError2@plt>
mov    $0x0,%al
call   1030 <printError2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <printError@plt>
xor    %eax,%eax
call   1040 <printError@plt>
xor    %eax,%eax
call   1030 <printError2@plt>
xor    %eax,%eax
call   1030 <printError2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printError()
%2 = tail call i32 (...) @printError()
%3 = tail call i32 (...) @printError2()
%4 = tail call i32 (...) @printError2()
ret i32 0
}
unsigned char containsDubiousChars(char *name) {
  unsigned char cdc = 0;
  for (; *name != '\0'; name++)
    if (*name == '?' || *name == '*')
      cdc = 1;
  return cdc;
}


x86 assembly (clang, -O0):
<containsDubiousChars>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1156 <containsDubiousChars+0x56>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3f,%eax
je     113c <containsDubiousChars+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    1140 <containsDubiousChars+0x40>
movb   $0x1,-0x9(%rbp)
jmp    1145 <containsDubiousChars+0x45>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <containsDubiousChars+0xc>
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<containsDubiousChars>:
xor    %eax,%eax
jmp    1116 <containsDubiousChars+0x16>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%al
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x2a,%cl
je     1110 <containsDubiousChars+0x10>
cmp    $0x3f,%cl
je     1110 <containsDubiousChars+0x10>
test   %cl,%cl
jne    1112 <containsDubiousChars+0x12>
ret

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

LLVM IR (-O2):
define zeroext i8 @containsDubiousChars(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %9, %7 ]
%4 = phi i8 [ 0, %1 ], [ %8, %7 ]
%5 = load i8, i8* %3
switch i8 %5, label %7 [
i8 0, label %10
i8 63, label %6
i8 42, label %6
]
6: ; preds = %2, %2
br label %7
7: ; preds = %2, %6
%8 = phi i8 [ 1, %6 ], [ %4, %2 ]
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
ret i8 %4
}
/* Type definitions */
struct list_item {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ remove(struct list *, struct list_item *);
void list_remove_nolock(struct list *list, struct list_item *item) {
  remove(list, item);
}


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

x86 assembly (clang, -O2):
<list_remove_nolock>:
jmp    1030 <remove@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
%struct.list_item = type { i32 }
define void @list_remove_nolock(%struct.list* %0, %struct.list_item* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list_item*
store %struct.list* %0, %struct.list** %3
store %struct.list_item* %1, %struct.list_item** %4
%5 = load %struct.list*, %struct.list** %3
%6 = load %struct.list_item*, %struct.list_item** %4
%7 = call i32 @remove(%struct.list* %5, %struct.list_item* %6)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.list_item = type { i32 }
define void @list_remove_nolock(%struct.list* nocapture %0, %struct.list_item* %1) {
%3 = tail call i32 @remove(%struct.list* %0, %struct.list_item* %1)
ret void
}
int cmp(const void *a, const void *b) {
  unsigned int *aa = (unsigned int *)a;
  unsigned int *bb = (unsigned int *)b;
  return *aa - *bb;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
scalar_t__ ioctl(int, int, void *);
int /*<<< orphan*/ stderr;
void cooked_ioctl(int fd, int req, void *arg, const char *name) {
  if (ioctl(fd, req, arg) < 0) {
    fprintf(stderr, "Failed %s ioctl: %m\n", name);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<cooked_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1182 <cooked_ioctl+0x52>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cooked_ioctl>:
push   %rbx
mov    %rcx,%rbx
call   1030 <ioctl@plt>
test   %rax,%rax
js     1140 <cooked_ioctl+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Failed %s ioctl: %m\0A\00"
define void @cooked_ioctl(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = call i64 @ioctl(i32 %9, i32 %10, i8* %11)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %4
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %8
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Failed %s ioctl: %m\0A\00"
define void @cooked_ioctl(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i64 @ioctl(i32 %0, i32 %1, i8* %2)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   void *(*)(void *), void *);
int my_pthread_create(pthread_t *thread, const pthread_attr_t *__attr,
                      void *(*start_routine)(void *), void *arg) {
  pthread_attr_t *realattr = NULL;
  if (__attr != NULL)
    realattr = (pthread_attr_t *)*(unsigned int *)__attr;
  return pthread_create(thread, realattr, start_routine, arg);
}


x86 assembly (clang, -O0):
<my_pthread_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <my_pthread_create+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <pthread_create@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_create>:
test   %rsi,%rsi
je     111c <my_pthread_create+0xc>
mov    (%rsi),%esi
jmp    1030 <pthread_create@plt>
xor    %esi,%esi
jmp    1030 <pthread_create@plt>

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

LLVM IR (-O2):
define i32 @my_pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = icmp eq i32* %1, null
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = load i32, i32* %1
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
br label %10
10: ; preds = %6, %4
%11 = phi i32* [ %9, %6 ], [ null, %4 ]
%12 = tail call i32 @pthread_create(i32* %0, i32* %11, i8* (i8*)* %2, i8* %3)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Key_KeynumToString(int);
int /*<<< orphan*/ Q_strncpyz(char *, int /*<<< orphan*/, int);
void Key_KeynumToStringBuf(int keynum, char *buf, int buflen) {
  Q_strncpyz(buf, Key_KeynumToString(keynum), buflen);
}


x86 assembly (clang, -O0):
<Key_KeynumToStringBuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Key_KeynumToString@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x14(%rbp),%edx
call   1040 <Q_strncpyz@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key_KeynumToStringBuf>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1030 <Key_KeynumToString@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <Q_strncpyz@plt>

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

LLVM IR (-O2):
define void @Key_KeynumToStringBuf(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @Key_KeynumToString(i32 %0)
%5 = tail call i32 @Q_strncpyz(i8* %1, i32 %4, i32 %2)
ret void
}
void console_no_ticks(void) {}


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

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

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

LLVM IR (-O2):
define void @console_no_ticks() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Entities_InitRespawnable(int /*<<< orphan*/ (*)());
int /*<<< orphan*/ func_breakable_respawn();
int /*<<< orphan*/ func_wall();
void func_breakable(void) {
  func_wall();
  func_breakable_respawn();
  Entities_InitRespawnable(func_breakable_respawn);
}


x86 assembly (clang, -O0):
<func_breakable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <func_wall@plt>
mov    $0x0,%al
call   1050 <func_breakable_respawn@plt>
mov    0x2eaf(%rip),%rdi
call   1030 <Entities_InitRespawnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_breakable>:
push   %rax
xor    %eax,%eax
call   1040 <func_wall@plt>
xor    %eax,%eax
call   1050 <func_breakable_respawn@plt>
mov    0x2eb2(%rip),%rdi
pop    %rax
jmp    1030 <Entities_InitRespawnable@plt>

LLVM IR (-O0):
define void @func_breakable() {
%1 = call i32 (...) @func_wall()
%2 = call i32 (...) @func_breakable_respawn()
%3 = call i32 @Entities_InitRespawnable(i32 (...)* @func_breakable_respawn)
ret void
}

LLVM IR (-O2):
define void @func_breakable() {
%1 = tail call i32 (...) @func_wall()
%2 = tail call i32 (...) @func_breakable_respawn()
%3 = tail call i32 @Entities_InitRespawnable(i32 (...)* @func_breakable_respawn)
ret void
}
int test_imm_6Aint32_mem(int *val) {
  return ((*val) & (0x6A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Aint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 106
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void stack_array_destroy(struct Stack *s) {}


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

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

LLVM IR (-O0):
%struct.Stack = type opaque
define void @stack_array_destroy(%struct.Stack* %0) {
%2 = alloca %struct.Stack*
store %struct.Stack* %0, %struct.Stack** %2
ret void
}

LLVM IR (-O2):
%struct.Stack = type opaque
define void @stack_array_destroy(%struct.Stack* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ isnumber(char);
int isNumber(char *str) {
  int i = 0;
  while (str[i] != 0) {
    if (isnumber(str[i])) {
      return 1;
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116d <isNumber+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isnumber@plt>
cmp    $0x0,%rax
je     115f <isNumber+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1174 <isNumber+0x64>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <isNumber+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
xor    %ebp,%ebp
test   %al,%al
je     114f <isNumber+0x3f>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isnumber@plt>
test   %rax,%rax
jne    114a <isNumber+0x3a>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isNumber+0x20>
jmp    114f <isNumber+0x3f>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = tail call i64 @isnumber(i8 signext %10)
%12 = icmp eq i64 %11, 0
%13 = add nuw i64 %9, 1
br i1 %12, label %4, label %14
14: ; preds = %8, %4, %1
%15 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %8 ]
ret i32 %15
}
/* Type definitions */
struct child_process {
  int dummy;
};

/* Variables and functions */
int finish_command(struct child_process *);
int start_command(struct child_process *);
int run_command(struct child_process *cmd) {
  int code = start_command(cmd);
  if (code)
    return code;
  return finish_command(cmd);
}


x86 assembly (clang, -O0):
<run_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <start_command@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114d <run_command+0x2d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <run_command+0x39>
mov    -0x10(%rbp),%rdi
call   1040 <finish_command@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_command>:
push   %rbx
mov    %rdi,%rbx
call   1030 <start_command@plt>
test   %eax,%eax
je     112f <run_command+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <finish_command@plt>

LLVM IR (-O0):
%struct.child_process = type { i32 }
define i32 @run_command(%struct.child_process* %0) {
%2 = alloca i32
%3 = alloca %struct.child_process*
%4 = alloca i32
store %struct.child_process* %0, %struct.child_process** %3
%5 = load %struct.child_process*, %struct.child_process** %3
%6 = call i32 @start_command(%struct.child_process* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load %struct.child_process*, %struct.child_process** %3
%13 = call i32 @finish_command(%struct.child_process* %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.child_process = type { i32 }
define i32 @run_command(%struct.child_process* %0) {
%2 = tail call i32 @start_command(%struct.child_process* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @finish_command(%struct.child_process* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %7
}
unsigned int strhash(const char *a) {
  unsigned long hash = 5381;
  int c;
  while ('\0' != (c = (*(unsigned char *)a++))) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%ecx
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
je     114b <strhash+0x4b>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strhash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = trunc i64 %11 to i32
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 5381, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ test_slist_iter_add();
int /*<<< orphan*/ test_slist_iter_remove();
void test_slist_iter() {
  test_slist_iter_add();
  test_slist_iter_remove();
}


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

x86 assembly (clang, -O2):
<test_slist_iter>:
push   %rax
xor    %eax,%eax
call   1040 <test_slist_iter_add@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_slist_iter_remove@plt>

LLVM IR (-O0):
define void @test_slist_iter() {
%1 = call i32 (...) @test_slist_iter_add()
%2 = call i32 (...) @test_slist_iter_remove()
ret void
}

LLVM IR (-O2):
define void @test_slist_iter() {
%1 = tail call i32 (...) @test_slist_iter_add()
%2 = tail call i32 (...) @test_slist_iter_remove()
ret void
}
int lib1t32(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @lib1t32() {
ret i32 4
}

LLVM IR (-O2):
define i32 @lib1t32() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int const, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  const int N = 4;
  char inp[N];
  fgets(inp, N, stdin);
  printf("Read in: %s\n", inp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x4,-0x4(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <fgets@plt>
lea    0xeac(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <fgets@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [13 x i8] c"Read in: %s\0A\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 4, i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
unsigned fnv_32a_str(char *str, unsigned hval) {
  unsigned char *s = (unsigned char *)str;
  while (*s) {
    hval ^= (unsigned)*s++;
    hval *= 16777619U;
  }
  return hval;
}


x86 assembly (clang, -O0):
<fnv_32a_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <fnv_32a_str+0x47>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x1000193,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1113 <fnv_32a_str+0x13>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnv_32a_str>:
mov    %esi,%eax
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <fnv_32a_str+0x26>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl %cl,%ecx
xor    %eax,%ecx
imul   $0x1000193,%ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <fnv_32a_str+0x10>
ret

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

LLVM IR (-O2):
define i32 @fnv_32a_str(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i32 [ %12, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = zext i8 %6 to i32
%11 = xor i32 %8, %10
%12 = mul i32 %11, 16777619
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ %1, %2 ], [ %12, %5 ]
ret i32 %16
}
void swansong_nonfatal(int code) {}


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

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

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

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