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


x86 assembly (clang, -O0):
<rop3_147_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%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_147_0_1>:
mov    (%rdi),%al
and    %dl,%al
xor    %al,%sil
or     %dl,%sil
not    %sil
or     %al,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_147_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
%6 = xor i8 %5, %1
%7 = or i8 %6, %2
%8 = xor i8 %7, -1
%9 = or i8 %5, %8
store i8 %9, i8* %0
ret void
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ INADDR_NONE;
scalar_t__ inet_aton(char const *, struct in_addr *);
in_addr_t inet_addr(const char *cp) {
  struct in_addr val;
  if (inet_aton(cp, &val))
    return (val.s_addr);
  return (INADDR_NONE);
}


x86 assembly (clang, -O0):
<inet_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <inet_aton@plt>
cmp    $0x0,%rax
je     113e <inet_addr+0x2e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <inet_addr+0x3a>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_addr>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <inet_aton@plt>
test   %rax,%rax
jne    112e <inet_addr+0x1e>
mov    0x2eba(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@INADDR_NONE = global i32 0
define i32 @inet_addr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.in_addr
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @inet_aton(i8* %5, %struct.in_addr* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* @INADDR_NONE
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@INADDR_NONE = global i32 0
define i32 @inet_addr(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = call i64 @inet_aton(i8* %0, %struct.in_addr* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @INADDR_NONE
%9 = select i1 %5, i32 %8, i32 %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ blzrand_init();
void blzrand_free() { blzrand_init(); }


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

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

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

LLVM IR (-O2):
define void @blzrand_free() {
%1 = tail call i32 (...) @blzrand_init()
ret void
}
const char *db_create_all_jes_view_sql(void) {
  static const char *query = "CREATE VIEW all_jes AS"
                             "  SELECT"
                             "    l.je AS 'JE',"
                             "    j.entity AS 'En',"
                             "    l.account AS 'A/C No.',"
                             "    a.description AS 'Description',"
                             "    l.amount AS 'Amount'"
                             "    FROM jelines AS l"
                             "    INNER JOIN jes AS j"
                             "      ON j.id = l.je"
                             "    INNER JOIN nomaccts AS a"
                             "      ON a.num = l.account"
                             "    ORDER BY j.id ASC, l.account ASC";
  return query;
}


x86 assembly (clang, -O0):
<db_create_all_jes_view_sql>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_create_all_jes_view_sql>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@db_create_all_jes_view_sql.query = internal global i8* getelementptr inbounds ([309 x i8], [309 x i8]* @.str, i32 0, i32 0)
@.str = [309 x i8] c"CREATE VIEW all_jes AS SELECT l.je AS 'JE', j.entity AS 'En', l.account AS 'A/C No.', a.description AS 'Description', l.amount AS 'Amount' FROM jelines AS l INNER JOIN jes AS j ON j.id = l.je INNER JOIN nomaccts AS a ON a.num = l.account ORDER BY j.id ASC, l.account ASC\00"
define i8* @db_create_all_jes_view_sql() {
%1 = load i8*, i8** @db_create_all_jes_view_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [309 x i8] c"CREATE VIEW all_jes AS SELECT l.je AS 'JE', j.entity AS 'En', l.account AS 'A/C No.', a.description AS 'Description', l.amount AS 'Amount' FROM jelines AS l INNER JOIN jes AS j ON j.id = l.je INNER JOIN nomaccts AS a ON a.num = l.account ORDER BY j.id ASC, l.account ASC\00"
define i8* @db_create_all_jes_view_sql() {
ret i8* getelementptr inbounds ([309 x i8], [309 x i8]* @.str, i64 0, i64 0)
}
void fake_respond(volatile unsigned char *base_addr, char status) {
  *(base_addr + 1) = status;
  *base_addr &= ~128;
  *(base_addr + 0xFFF) = 1;
}


x86 assembly (clang, -O0):
<fake_respond>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
movzbl %cl,%ecx
and    $0xffffff7f,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x1,0xfff(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fake_respond>:
mov    %sil,0x1(%rdi)
andb   $0x7f,(%rdi)
movb   $0x1,0xfff(%rdi)
ret

LLVM IR (-O0):
define void @fake_respond(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
store volatile i8 %5, i8* %7
%8 = load i8*, i8** %3
%9 = load volatile i8, i8* %8
%10 = zext i8 %9 to i32
%11 = and i32 %10, -129
%12 = trunc i32 %11 to i8
store volatile i8 %12, i8* %8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 4095
store volatile i8 1, i8* %14
ret void
}

LLVM IR (-O2):
define void @fake_respond(i8* %0, i8 signext %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
store volatile i8 %1, i8* %3
%4 = load volatile i8, i8* %0
%5 = and i8 %4, 127
store volatile i8 %5, i8* %0
%6 = getelementptr inbounds i8, i8* %0, i64 4095
store volatile i8 1, i8* %6
ret void
}
int pow2(int n) { return 1 << n; }


x86 assembly (clang, -O0):
<pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @pow2(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
int main() {
  int m;
  int *pointer;
  m = 10;
  printf("This is the value for m: %1f", pointer);
  printf("This is the memory location for m: %1d", *pointer);
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"This is the value for m: %1f\00"
@.str.1 = [39 x i8] c"This is the memory location for m: %1d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 10, i32* %1
%3 = load i32*, i32** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"This is the value for m: %1f\00"
@.str.1 = [39 x i8] c"This is the memory location for m: %1d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32* undef)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int cio_bytein();
unsigned int cio_read(int n) {
  int i;
  unsigned int v;
  v = 0;
  for (i = n - 1; i >= 0; i--) {
    v += cio_bytein() << (i << 3);
  }
  return v;
}


x86 assembly (clang, -O0):
<cio_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1158 <cio_read+0x48>
mov    $0x0,%al
call   1030 <cio_bytein@plt>
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <cio_read+0x1b>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cio_read>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    114b <cio_read+0x3b>
mov    %edi,%ebx
add    $0x1,%ebx
lea    -0x8(,%rdi,8),%ebp
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <cio_bytein@plt>
mov    %ebp,%ecx
shl    %cl,%eax
add    %eax,%r14d
add    $0xffffffff,%ebx
add    $0xfffffff8,%ebp
cmp    $0x1,%ebx
ja     1130 <cio_read+0x20>
jmp    114e <cio_read+0x3e>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cio_read(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
br label %7
7: ; preds = %17, %1
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = call i32 (...) @cio_bytein()
%12 = load i32, i32* %3
%13 = shl i32 %12, 3
%14 = shl i32 %11, %13
%15 = load i32, i32* %4
%16 = add i32 %15, %14
store i32 %16, i32* %4
br label %17
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, -1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @cio_read(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 (...) @cio_bytein()
%8 = shl i32 %6, 3
%9 = shl i32 %7, %8
%10 = add i32 %9, %5
%11 = icmp ugt i32 %4, 1
br i1 %11, label %3, label %12
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %13
}
int idcTriggerZeroThroughDoubleAssignemnt(int i) { return 5 / i; }


x86 assembly (clang, -O0):
<idcTriggerZeroThroughDoubleAssignemnt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x5,%eax
cltd
idivl  -0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<idcTriggerZeroThroughDoubleAssignemnt>:
mov    $0x5,%eax
xor    %edx,%edx
idiv   %edi
ret

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

LLVM IR (-O2):
define i32 @idcTriggerZeroThroughDoubleAssignemnt(i32 %0) {
%2 = sdiv i32 5, %0
ret i32 %2
}
/* Variables and functions */
scalar_t__ __get_PRIMASK();
__attribute__((always_)) int irq_is_enabled(void) {
  return (__get_PRIMASK() == 0);
}


x86 assembly (clang, -O0):
<irq_is_enabled>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__get_PRIMASK@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @irq_is_enabled() {
%1 = call i64 (...) @__get_PRIMASK()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @irq_is_enabled() {
%1 = tail call i64 (...) @__get_PRIMASK()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int fun1071() { return 1071; }


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

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

LLVM IR (-O0):
define i32 @fun1071() {
ret i32 1071
}

LLVM IR (-O2):
define i32 @fun1071() {
ret i32 1071
}
int foo(unsigned int x, void *y) {
  register unsigned long r asm("rax");
  register unsigned long a1 asm("rdi");
  register unsigned long a2 asm("rsi");
  a1 = (unsigned long)x;
  a2 = (unsigned long)y;
  asm volatile("" : "=r"(r), "+r"(a1), "+r"(a2) : : "memory");
  return (int)r;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %rax,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%edi
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
store i64 %9, i64* %6
%10 = load i8*, i8** %4
%11 = ptrtoint i8* %10 to i64
store i64 %11, i64* %7
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = call { i64, i64, i64 } asm sideeffect "", "={rax},={rdi},={rsi},{rdi},{rsi},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %12, i64 %13)
%15 = extractvalue { i64, i64, i64 } %14, 0
%16 = extractvalue { i64, i64, i64 } %14, 1
%17 = extractvalue { i64, i64, i64 } %14, 2
store i64 %15, i64* %5
store i64 %16, i64* %6
store i64 %17, i64* %7
%18 = load i64, i64* %5
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i8* %1) {
%3 = zext i32 %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = tail call { i64, i64, i64 } asm sideeffect "", "={rax},={rdi},={rsi},{rdi},{rsi},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %3, i64 %4)
%6 = extractvalue { i64, i64, i64 } %5, 0
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: zxcvbn_cli [ -h ] [ -t \"31-12-2000 30-11-1999 ...\" ] [ -d "
         "\"word0 word1 ... wordN\" ] { password0 } [ password1 ] ... [ "
         "passwordN]\n");
}


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

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

LLVM IR (-O0):
@.str = [137 x i8] c"Usage: zxcvbn_cli [ -h ] [ -t \2231-12-2000 30-11-1999 ...\22 ] [ -d \22word0 word1 ... wordN\22 ] { password0 } [ password1 ] ... [ passwordN]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [136 x i8] c"Usage: zxcvbn_cli [ -h ] [ -t \2231-12-2000 30-11-1999 ...\22 ] [ -d \22word0 word1 ... wordN\22 ] { password0 } [ password1 ] ... [ passwordN]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([136 x i8], [136 x i8]* @str, i64 0, i64 0))
ret void
}
void XtName() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_h64_12_sse4() {
ret void
}
int returnStringValue(char *wordinput) {
  int total = 0;
  int wordCounter = 0;
  while (wordinput[wordCounter] != '\0') {
    total = total + (wordinput[wordCounter] + 0);
    wordCounter++;
  }
  return total;
}


x86 assembly (clang, -O0):
<returnStringValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1150 <returnStringValue+0x50>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    $0x0,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <returnStringValue+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<returnStringValue>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <returnStringValue+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <returnStringValue+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @returnStringValue(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %9, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nsw i32 %7, %8
%10 = add nuw nsw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %15
}
int last_largest_idx(int permutation[], int idx) {
  int i;
  for (i = 10 - 1; i >= idx; i--)
    if (permutation[i] > permutation[idx])
      return i;
  return i;
}


x86 assembly (clang, -O0):
<last_largest_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x9,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1158 <last_largest_idx+0x58>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1145 <last_largest_idx+0x45>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <last_largest_idx+0x5e>
jmp    114a <last_largest_idx+0x4a>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <last_largest_idx+0x12>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_largest_idx>:
mov    $0x9,%eax
cmp    $0x9,%esi
jg     1133 <last_largest_idx+0x33>
movslq %esi,%r8
mov    (%rdi,%r8,4),%edx
add    $0xffffffff,%esi
mov    $0x9,%eax
nopl   0x0(%rax)
cmp    %edx,(%rdi,%rax,4)
jg     1133 <last_largest_idx+0x33>
lea    -0x1(%rax),%rcx
cmp    %r8,%rax
mov    %rcx,%rax
jg     1120 <last_largest_idx+0x20>
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @last_largest_idx(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 9
br i1 %3, label %19, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = add i32 %1, -1
br label %9
9: ; preds = %4, %14
%10 = phi i64 [ 9, %4 ], [ %15, %14 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp sgt i32 %12, %7
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = add nsw i64 %10, -1
%16 = icmp sgt i64 %10, %5
br i1 %16, label %9, label %19
17: ; preds = %9
%18 = trunc i64 %10 to i32
br label %19
19: ; preds = %14, %17, %2
%20 = phi i32 [ 9, %2 ], [ %18, %17 ], [ %8, %14 ]
ret i32 %20
}
unsigned char f8(unsigned char x, long int y) {
  return (x << y) | (x >> (8 - y));
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
mov    %rsi,%rcx
mov    %edi,%eax
rol    %cl,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @f8(i8 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
void *test_anti_range_127(long n) {
  extern void *alloc_anti_range_127(long) __attribute__((alloc_size(1)));
  if ((-0x7fffffffffffffffL - 1) + 2 <= n && n <= 1)
    n = (-0x7fffffffffffffffL - 1) + 2 - 1;
  return alloc_anti_range_127(n);
}


x86 assembly (clang, -O0):
<test_anti_range_127>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000002,%rax
cmp    -0x8(%rbp),%rax
jg     1149 <test_anti_range_127+0x39>
cmpq   $0x1,-0x8(%rbp)
jg     1149 <test_anti_range_127+0x39>
movabs $0x8000000000000001,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_127@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_127>:
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
lea    0x3(%rax),%rcx
add    %rdi,%rax
cmovns %rcx,%rdi
jmp    1030 <alloc_anti_range_127@plt>

LLVM IR (-O0):
define i8* @test_anti_range_127(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 -9223372036854775806, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %5
store i64 -9223372036854775807, i64* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i64, i64* %2
%11 = call i8* @alloc_anti_range_127(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_127(i64 %0) {
%2 = add i64 %0, 9223372036854775806
%3 = icmp sgt i64 %2, -1
%4 = select i1 %3, i64 -9223372036854775807, i64 %0
%5 = tail call i8* @alloc_anti_range_127(i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void overprint(char *text) {
  fprintf(stderr, "%60s\r", text);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<overprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<overprint>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%60s\0D\00"
define void @overprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%60s\0D\00"
define void @overprint(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
__attribute__((__unused__)) void pair_udp_close(int fds[]) {
  close(fds[0]);
  close(fds[1]);
}


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

x86 assembly (clang, -O2):
<pair_udp_close>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <close@plt>
mov    0x4(%rbx),%edi
pop    %rbx
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @pair_udp_close(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @close(i32 %5)
ret void
}
void pcp_def_net_tcp_metrics(void) {}


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

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

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

LLVM IR (-O2):
define void @pcp_def_net_tcp_metrics() {
ret void
}
int main() {
  volatile int i = 0, j = 0;
  while (1) {
    i += 2;
    j += 4;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>

x86 assembly (clang, -O2):
<main>:
movl   $0x0,-0x4(%rsp)
movl   $0x0,-0x8(%rsp)
addl   $0x2,-0x4(%rsp)
addl   $0x4,-0x8(%rsp)
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store volatile i32 0, i32* %2
store volatile i32 0, i32* %3
br label %4
4: ; preds = %0, %4
%5 = load volatile i32, i32* %2
%6 = add nsw i32 %5, 2
store volatile i32 %6, i32* %2
%7 = load volatile i32, i32* %3
%8 = add nsw i32 %7, 4
store volatile i32 %8, i32* %3
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
br label %5
5: ; preds = %5, %0
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, 2
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %2
%9 = add nsw i32 %8, 4
store volatile i32 %9, i32* %2
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ free(size_t *);
void noto_free(void *p) {
  size_t *p2 = p;
  free(p2);
}


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

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

LLVM IR (-O0):
define void @noto_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = call i32 @free(i64* %6)
ret void
}

LLVM IR (-O2):
define void @noto_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = tail call i32 @free(i64* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(unsigned long);
void *realloc(void *, unsigned int);
void f3(int i) {
  unsigned long j = 10;
  void *ptr = malloc(j);
  if (i < 0)
    ptr = realloc(ptr, (unsigned)i);
  free(ptr);
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0xa,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    116a <f3+0x3a>
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1040 <malloc@plt>
test   %ebx,%ebx
jns    114b <f3+0x1b>
mov    %rax,%rdi
mov    %ebx,%esi
call   1050 <realloc@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @f3(i32 %0) {
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i64 10)
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @realloc(i8* %2, i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %5, %4 ], [ %2, %1 ]
%8 = tail call i32 @free(i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("calling lib routine\n");
  f1();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"calling lib routine\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @f1()
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"calling lib routine\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @f1()
ret i32 0
}
rvalue(lval) int *lval;
{
  if ((lval[0] != 0) & (lval[1] == 0))
    getmem(lval[0]);
  else
    indirect(lval[1]);
}


x86 assembly (clang, -O0):
<rvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x10(%rbp),%rcx
cmpl   $0x0,0x4(%rcx)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1169 <rvalue+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1040 <getmem@plt>
jmp    1177 <rvalue+0x57>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
mov    $0x0,%al
call   1030 <indirect@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rvalue>:
push   %rax
mov    %rdi,%rax
mov    (%rdi),%edi
mov    0x4(%rax),%eax
test   %edi,%edi
je     113a <rvalue+0x1a>
test   %eax,%eax
jne    113a <rvalue+0x1a>
xor    %eax,%eax
call   1040 <getmem@plt>
pop    %rcx
ret
mov    %eax,%edi
xor    %eax,%eax
call   1030 <indirect@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rvalue(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ne i32 %2, 0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = and i1 %3, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @getmem to i32 (i32, ...)*)(i32 %2)
br label %12
10: ; preds = %1
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @indirect to i32 (i32, ...)*)(i32 %5)
br label %12
12: ; preds = %10, %8
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int print_usage(char *prog_name) {
  printf("Usage:\n"
         "\t%s <program> [arguments]\n"
         "\t%s -a/--attach <pid>\n"
         "\t%s -h/--help\n",
         prog_name, prog_name, prog_name);
  return 0;
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rcx
lea    0xee5(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [70 x i8] c"Usage:\0A\09%s <program> [arguments]\0A\09%s -a/--attach <pid>\0A\09%s -h/--help\0A\00"
define i32 @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4, i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [70 x i8] c"Usage:\0A\09%s <program> [arguments]\0A\09%s -a/--attach <pid>\0A\09%s -h/--help\0A\00"
define i32 @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mck_set_finished(int);
void mck_glb_finish() { mck_set_finished(0xf1); }


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

x86 assembly (clang, -O2):
<mck_glb_finish>:
mov    $0xf1,%edi
jmp    1030 <mck_set_finished@plt>

LLVM IR (-O0):
define void @mck_glb_finish() {
%1 = call i32 @mck_set_finished(i32 241)
ret void
}

LLVM IR (-O2):
define void @mck_glb_finish() {
%1 = tail call i32 @mck_set_finished(i32 241)
ret void
}
unsigned xrop3_79_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = D | stk3;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_79_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_79_0_0>:
shl    $0x8,%edi
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_79_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %5
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
ret i32 %33
}

LLVM IR (-O2):
define i32 @xrop3_79_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -1
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ round_32();
int /*<<< orphan*/ round_64();
int /*<<< orphan*/ zeroes_128();
int /*<<< orphan*/ zeroes_32();
int /*<<< orphan*/ zeroes_64();
int main() {
  zeroes_32();
  zeroes_64();
  zeroes_128();
  round_32();
  round_64();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <zeroes_32@plt>
mov    $0x0,%al
call   1030 <zeroes_64@plt>
mov    $0x0,%al
call   1050 <zeroes_128@plt>
mov    $0x0,%al
call   1040 <round_32@plt>
mov    $0x0,%al
call   1070 <round_64@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <zeroes_32@plt>
xor    %eax,%eax
call   1030 <zeroes_64@plt>
xor    %eax,%eax
call   1050 <zeroes_128@plt>
xor    %eax,%eax
call   1040 <round_32@plt>
xor    %eax,%eax
call   1070 <round_64@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @zeroes_32()
%3 = call i32 (...) @zeroes_64()
%4 = call i32 (...) @zeroes_128()
%5 = call i32 (...) @round_32()
%6 = call i32 (...) @round_64()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @zeroes_32()
%2 = tail call i32 (...) @zeroes_64()
%3 = tail call i32 (...) @zeroes_128()
%4 = tail call i32 (...) @round_32()
%5 = tail call i32 (...) @round_64()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void logWarning(char *message) {
  printf("\x1b[33m");
  printf("[GCWarning]- %s\n", message);
  printf("\x1b[0m");
}


x86 assembly (clang, -O0):
<logWarning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logWarning>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[33m\00"
@.str.1 = [17 x i8] c"[GCWarning]- %s\0A\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @logWarning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[33m\00"
@.str.1 = [17 x i8] c"[GCWarning]- %s\0A\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @logWarning(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run_test();
int main() {
  run_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ togglejoinserver();
void togglejoingame() { togglejoinserver(); }


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

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

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

LLVM IR (-O2):
define void @togglejoingame() {
%1 = tail call i32 (...) @togglejoinserver()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int);
gid_t getegid(void) { return syscall(202); }


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

x86 assembly (clang, -O2):
<getegid>:
mov    $0xca,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @getegid() {
%1 = call i32 @syscall(i32 202)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getegid() {
%1 = tail call i32 @syscall(i32 202)
ret i32 %1
}
unsigned int isa_read32(unsigned short port) {
  return *(int *)((void *)(0xfe000000 | (port)));
}


x86 assembly (clang, -O0):
<isa_read32>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
or     $0xfe000000,%eax
mov    %eax,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isa_read32>:
mov    %edi,%eax
mov    $0xfe000000,%ecx
mov    (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
define i32 @isa_read32(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = or i32 -33554432, %4
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @isa_read32(i16 zeroext %0) {
%2 = zext i16 %0 to i64
%3 = or i64 %2, 4261412864
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}