xunge/DecIR huggingface dataset:
/* Type definitions */
struct vehicle {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
struct vehicle *delete_vehicle(struct vehicle *);
int /*<<< orphan*/ move(struct vehicle *, int, int, int);
struct vehicle *new_vehicle();
int /*<<< orphan*/ tick(struct vehicle *);
int main(int argc, char **argv) {
  struct vehicle *v = new_vehicle();
  tick(v);
  move(v, 1, 2, 3);
  v = delete_vehicle(v);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <new_vehicle@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <tick@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1060 <move@plt>
mov    -0x18(%rbp),%rdi
call   1030 <delete_vehicle@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e4a(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <new_vehicle@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <tick@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1060 <move@plt>
mov    %rbx,%rdi
call   1030 <delete_vehicle@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vehicle = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.vehicle*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call %struct.vehicle* (...) @new_vehicle()
store %struct.vehicle* %7, %struct.vehicle** %6
%8 = load %struct.vehicle*, %struct.vehicle** %6
%9 = call i32 @tick(%struct.vehicle* %8)
%10 = load %struct.vehicle*, %struct.vehicle** %6
%11 = call i32 @move(%struct.vehicle* %10, i32 1, i32 2, i32 3)
%12 = load %struct.vehicle*, %struct.vehicle** %6
%13 = call %struct.vehicle* @delete_vehicle(%struct.vehicle* %12)
store %struct.vehicle* %13, %struct.vehicle** %6
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
%struct.vehicle = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.vehicle* (...) @new_vehicle()
%4 = tail call i32 @tick(%struct.vehicle* %3)
%5 = tail call i32 @move(%struct.vehicle* %3, i32 1, i32 2, i32 3)
%6 = tail call %struct.vehicle* @delete_vehicle(%struct.vehicle* %3)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
int vde_chain_nm5_init(int *n_in, int *n_out, int *n_int, int *n_real) {
  if (n_in)
    *n_in = 4;
  if (n_out)
    *n_out = 3;
  if (n_int)
    *n_int = 0;
  if (n_real)
    *n_real = 0;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm5_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <vde_chain_nm5_init+0x29>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <vde_chain_nm5_init+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <vde_chain_nm5_init+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <vde_chain_nm5_init+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm5_init>:
test   %rdi,%rdi
je     110b <vde_chain_nm5_init+0xb>
movl   $0x4,(%rdi)
test   %rsi,%rsi
je     1116 <vde_chain_nm5_init+0x16>
movl   $0x3,(%rsi)
test   %rdx,%rdx
je     1121 <vde_chain_nm5_init+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <vde_chain_nm5_init+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vde_chain_nm5_init(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 4, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 3, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void zby_hit_bad_trap() {
  puts("\x1b[1m"
       "\x1b[31m"
       "HIT BAD TRAP"
       "\x1b[0m");
  exit(1);
}


x86 assembly (clang, -O0):
<zby_hit_bad_trap>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<zby_hit_bad_trap>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\1B[1m\1B[31mHIT BAD TRAP\1B[0m\00"
define void @zby_hit_bad_trap() {
%1 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"\1B[1m\1B[31mHIT BAD TRAP\1B[0m\00"
define void @zby_hit_bad_trap() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int f(int x, int y) { return 2 * x + y; }


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

x86 assembly (clang, -O2):
<f>:
lea    (%rsi,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = mul nsw i32 2, %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void xml_finish(FILE *xh) {
  fprintf(xh, "</testsuite>\n");
  fclose(xh);
}


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

x86 assembly (clang, -O2):
<xml_finish>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"</testsuite>\0A\00"
define void @xml_finish(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"</testsuite>\0A\00"
define void @xml_finish(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 13, i64 1, i32* %0)
%3 = tail call i32 @fclose(i32* %0)
ret void
}
void k(a, b) int a;
int b;
{}


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

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

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

LLVM IR (-O2):
define void @k(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
scalar_t__ i8086ReadStrConfig(char *, char const *, char const *);
int strtoul(char *, int /*<<< orphan*/ *, int);
int i8086ReadHexConfig(const char *filename, const char *name, int defValue) {
  char str[256];
  if (i8086ReadStrConfig(str, filename, name) != 0)
    return strtoul(str, NULL, 16);
  else
    return defValue;
}


x86 assembly (clang, -O0):
<i8086ReadHexConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <i8086ReadStrConfig@plt>
cmp    $0x0,%rax
je     1171 <i8086ReadHexConfig+0x51>
lea    -0x120(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %eax,-0x4(%rbp)
jmp    1177 <i8086ReadHexConfig+0x57>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8086ReadHexConfig>:
push   %rbx
sub    $0x100,%rsp
mov    %edx,%ebx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <i8086ReadStrConfig@plt>
test   %rax,%rax
je     114e <i8086ReadHexConfig+0x2e>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @i8086ReadHexConfig(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [256 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i64 @i8086ReadStrConfig(i8* %9, i8* %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%16 = call i32 @strtoul(i8* %15, i32* null, i32 16)
store i32 %16, i32* %4
br label %19
17: ; preds = %3
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %19
19: ; preds = %17, %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @i8086ReadHexConfig(i8* %0, i8* %1, i32 %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = call i64 @i8086ReadStrConfig(i8* %5, i8* %0, i8* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = call i32 @strtoul(i8* nocapture %5, i32* null, i32 16)
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ %9, %8 ], [ %2, %3 ]
ret i32 %11
}
char *genrb(char *rb) {
  int n;
  rb[0] = 'r' - 13;
  rb[1] = 'b' - 17;
  rb[2] = '\0';
  rb[0] += 13;
  rb[1] += 17;
}


x86 assembly (clang, -O0):
<genrb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x65,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x51,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0xd,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%ecx
add    $0x11,%ecx
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrb>:
movb   $0x0,0x2(%rdi)
movw   $0x6272,(%rdi)
ret

LLVM IR (-O0):
define i8* @genrb(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 101, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 81, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8 0, i8* %10
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, 13
%16 = trunc i32 %15 to i8
store i8 %16, i8* %12
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = add nsw i32 %20, 17
%22 = trunc i32 %21 to i8
store i8 %22, i8* %18
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define noalias i8* @genrb(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 0, i8* %3
store i8 114, i8* %0
store i8 98, i8* %2
ret i8* undef
}
void rop3_250_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D | T;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_250_1_1>:
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
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%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    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%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_250_1_1>:
ret

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

LLVM IR (-O2):
define void @rop3_250_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Type definitions */
typedef union quat {
  int dummy;
} quat;

/* Variables and functions */
int /*<<< orphan*/ quat_normalize(union quat *, union quat *);
void quat_normalize_self(union quat *q) { quat_normalize(q, q); }


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

x86 assembly (clang, -O2):
<quat_normalize_self>:
mov    %rdi,%rsi
jmp    1030 <quat_normalize@plt>

LLVM IR (-O0):
%union.quat = type { i32 }
define void @quat_normalize_self(%union.quat* %0) {
%2 = alloca %union.quat*
store %union.quat* %0, %union.quat** %2
%3 = load %union.quat*, %union.quat** %2
%4 = load %union.quat*, %union.quat** %2
%5 = call i32 @quat_normalize(%union.quat* %3, %union.quat* %4)
ret void
}

LLVM IR (-O2):
%union.quat = type { i32 }
define void @quat_normalize_self(%union.quat* %0) {
%2 = tail call i32 @quat_normalize(%union.quat* %0, %union.quat* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gaslint() { ol("ashl\t$2,r0,r0"); }


x86 assembly (clang, -O0):
<gaslint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"ashl\09$2,r0,r0\00"
define i32 @gaslint() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [14 x i8] c"ashl\09$2,r0,r0\00"
define i32 @gaslint() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int ser_init(char *, int);
int test_invalidDevice() {
  int retValue = ser_init("/dev/nodevice", 9600);
  if (retValue != -1)
    exit(1);
  return (0);
}


x86 assembly (clang, -O0):
<test_invalidDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x2580,%esi
call   1030 <ser_init@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1150 <test_invalidDevice+0x30>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_invalidDevice>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2580,%esi
call   1030 <ser_init@plt>
cmp    $0xffffffff,%eax
jne    113b <test_invalidDevice+0x1b>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"/dev/nodevice\00"
define i32 @test_invalidDevice() {
%1 = alloca i32
%2 = call i32 @ser_init(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 9600)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"/dev/nodevice\00"
define i32 @test_invalidDevice() {
%1 = tail call i32 @ser_init(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 9600)
%2 = icmp eq i32 %1, -1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void catchexit() { closelog(); }


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

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

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

LLVM IR (-O2):
define void @catchexit() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void TimerPrescaleMatchSet(uint32_t ui32Base, uint32_t ui32Timer,
                           uint32_t ui32Value) {
  ;

  ;
  ;
  if (ui32Timer & 0x000000ff) {
    (*((volatile unsigned long *)(ui32Base + 0x00000040))) = ui32Value;
  }
  if (ui32Timer & 0x0000ff00) {
    (*((volatile unsigned long *)(ui32Base + 0x00000044))) = ui32Value;
  }
}


x86 assembly (clang, -O0):
<TimerPrescaleMatchSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
je     112d <TimerPrescaleMatchSet+0x2d>
movslq -0xc(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
cltq
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
and    $0xff00,%eax
cmp    $0x0,%eax
je     114d <TimerPrescaleMatchSet+0x4d>
movslq -0xc(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    $0x44,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerPrescaleMatchSet>:
movslq %edx,%rax
movslq %edi,%rcx
test   %sil,%sil
je     110f <TimerPrescaleMatchSet+0xf>
mov    %rax,0x40(%rcx)
test   $0xff00,%esi
je     111b <TimerPrescaleMatchSet+0x1b>
mov    %rax,0x44(%rcx)
ret

LLVM IR (-O0):
define void @TimerPrescaleMatchSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = and i32 %7, 255
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 64
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i64*
store volatile i64 %12, i64* %16
br label %17
17: ; preds = %10, %3
%18 = load i32, i32* %5
%19 = and i32 %18, 65280
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 68
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i64*
store volatile i64 %23, i64* %27
br label %28
28: ; preds = %21, %17
ret void
}

LLVM IR (-O2):
define void @TimerPrescaleMatchSet(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 255
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = sext i32 %2 to i64
%8 = add nsw i32 %0, 64
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i64*
store volatile i64 %7, i64* %10
br label %11
11: ; preds = %6, %3
%12 = and i32 %1, 65280
%13 = icmp eq i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %11
%15 = sext i32 %2 to i64
%16 = add nsw i32 %0, 68
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i64*
store volatile i64 %15, i64* %18
br label %19
19: ; preds = %14, %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int *, int);
int main(void) {
  int e[9] = {-2, 1, -3, 4, -1, 2, 1, -5, 4};
  test(e, 9);
  int f[2] = {-2, -1};
  test(f, 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1040 <test@plt>
mov    0xed2(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
mov    $0x2,%esi
call   1040 <test@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x9,%esi
call   1030 <test@plt>
movq   $0xfffffffffffffffe,0x8(%rsp)
ff ff
lea    0x8(%rsp),%rdi
mov    $0x2,%esi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.e = [9 x i32] [i32 -2, i32 1, i32 -3, i32 4, i32 -1, i32 2, i32 1, i32 -5, i32 4]
@__const.main.f = [2 x i32] [i32 -2, i32 -1]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = alloca [2 x i32]
%3 = bitcast [9 x i32]* %1 to i8*
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%5 = call i32 @test(i32* %4, i32 9)
%6 = bitcast [2 x i32]* %2 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%8 = call i32 @test(i32* %7, i32 2)
ret i32 0
}

LLVM IR (-O2):
@__const.main.e = [9 x i32] [i32 -2, i32 1, i32 -3, i32 4, i32 -1, i32 2, i32 1, i32 -5, i32 4]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = alloca i64
%3 = bitcast [9 x i32]* %1 to i8*
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%5 = call i32 @test(i32* %4, i32 9)
%6 = bitcast i64* %2 to i8*
store i64 -2, i64* %2
%7 = bitcast i64* %2 to i32*
%8 = call i32 @test(i32* %7, i32 2)
ret i32 0
}
int do_617() { return 617; }


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

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

LLVM IR (-O0):
define i32 @do_617() {
ret i32 617
}

LLVM IR (-O2):
define i32 @do_617() {
ret i32 617
}
/* Variables and functions */
int /*<<< orphan*/ RevoCalibrationHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void RevoCalibrationRequestUpdate() {
  UAVObjRequestUpdate(RevoCalibrationHandle());
}


x86 assembly (clang, -O0):
<RevoCalibrationRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RevoCalibrationHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RevoCalibrationRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <RevoCalibrationHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @RevoCalibrationRequestUpdate() {
%1 = call i32 (...) @RevoCalibrationHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RevoCalibrationRequestUpdate() {
%1 = tail call i32 (...) @RevoCalibrationHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ print_idx_field_unicode(int /*<<< orphan*/, char *,
                                           int /*<<< orphan*/ const *, int);
int decode_buttons_status(uint8_t idx, const uint8_t *ptr, int len) {
  print_idx_field_unicode(idx, "Buttons status", ptr + 2, len - 2);
  return 0;
}


x86 assembly (clang, -O0):
<decode_buttons_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
add    $0x8,%rdx
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
lea    0xec6(%rip),%rsi
call   1030 <print_idx_field_unicode@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_buttons_status>:
push   %rax
lea    0x8(%rsi),%rax
lea    -0x2(%rdx),%ecx
lea    0xee1(%rip),%rsi
mov    %rax,%rdx
call   1030 <print_idx_field_unicode@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Buttons status\00"
define i32 @decode_buttons_status(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 2
%12 = call i32 @print_idx_field_unicode(i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %9, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Buttons status\00"
define i32 @decode_buttons_status(i32 %0, i32* %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = add nsw i32 %2, -2
%6 = tail call i32 @print_idx_field_unicode(i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %4, i32 %5)
ret i32 0
}
float foo(float x, float y, float z) {
  float a = __builtin_fmaf(x, y, z);
  float b = __builtin_fmaf(x, y, z);
  return a - b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <fmaf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <fmaf@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   1030 <fmaf@plt>
subss  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @foo(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %4
%10 = load float, float* %5
%11 = load float, float* %6
%12 = call float @llvm.fma.f32(float %9, float %10, float %11)
store float %12, float* %7
%13 = load float, float* %4
%14 = load float, float* %5
%15 = load float, float* %6
%16 = call float @llvm.fma.f32(float %13, float %14, float %15)
store float %16, float* %8
%17 = load float, float* %7
%18 = load float, float* %8
%19 = fsub float %17, %18
ret float %19
}

LLVM IR (-O2):
define float @foo(float %0, float %1, float %2) {
%4 = tail call float @llvm.fma.f32(float %0, float %1, float %2)
%5 = fsub float %4, %4
ret float %5
}
/* Variables and functions */
int five_negative();
char *test_five_negative() {
  int out = five_negative();
  do {
    if (!(out == -5))
      return "error, five_negative != -5";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_five_negative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <five_negative@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xfffffffb,-0xc(%rbp)
je     113c <test_five_negative+0x2c>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1149 <test_five_negative+0x39>
jmp    1141 <test_five_negative+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_five_negative>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <five_negative@plt>
cmp    $0xfffffffb,%eax
lea    0xedc(%rip),%rax
cmovne %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"error, five_negative != -5\00"
define i8* @test_five_negative() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 (...) @five_negative()
store i32 %3, i32* %2
br label %4
4: ; preds = %0
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -5
br i1 %6, label %8, label %7
7: ; preds = %4
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %1
br label %10
8: ; preds = %4
br label %9
9: ; preds = %8
store i8* null, i8** %1
br label %10
10: ; preds = %9, %7
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [27 x i8] c"error, five_negative != -5\00"
define i8* @test_five_negative() {
%1 = tail call i32 (...) @five_negative()
%2 = icmp eq i32 %1, -5
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
void foo181() {}


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

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

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

LLVM IR (-O2):
define void @foo181() {
ret void
}
/* Variables and functions */
char const *find_violation(char const *, int /*<<< orphan*/);
int strlen(char const *);
int is_in_violation(const char *s) {
  const char *end = s + strlen(s);
  if (find_violation(s, 0) != end)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_in_violation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <find_violation@plt>
cmp    -0x18(%rbp),%rax
je     116e <is_in_violation+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <is_in_violation+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_violation>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%r14
add    %rbx,%r14
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <find_violation@plt>
xor    %ecx,%ecx
cmp    %r14,%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @is_in_violation(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i8* @find_violation(i8* %0, i32 0)
%6 = icmp ne i8* %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
void _Jv_argv(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_argv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_NONBLOCK;
int /*<<< orphan*/ close(int);
scalar_t__ pipe2(int *, int /*<<< orphan*/);
int main(void) {
  int fds[2];
  if (pipe2(fds, O_NONBLOCK) == 0) {
    close(fds[0]);
    close(fds[1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
call   1040 <pipe2@plt>
cmp    $0x0,%rax
jne    115b <main+0x3b>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdi
call   1040 <pipe2@plt>
test   %rax,%rax
jne    1148 <main+0x28>
mov    (%rsp),%edi
call   1030 <close@plt>
mov    0x4(%rsp),%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_NONBLOCK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%4 = load i32, i32* @O_NONBLOCK
%5 = call i64 @pipe2(i32* %3, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %0
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %8
%10 = call i32 @close(i32 %9)
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%12 = load i32, i32* %11
%13 = call i32 @close(i32 %12)
br label %14
14: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
@O_NONBLOCK = global i32 0
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = load i32, i32* @O_NONBLOCK
%5 = call i64 @pipe2(i32* %3, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i32, i32* %3
%9 = call i32 @close(i32 %8)
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%11 = load i32, i32* %10
%12 = call i32 @close(i32 %11)
br label %13
13: ; preds = %7, %0
ret i32 0
}
int radish_continue_progressing_file_op(void *op) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @radish_continue_progressing_file_op(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *malloc(int);
void *_malloc_(int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<_malloc_>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @_malloc_(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
regx0adrx1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((p0[x0]) <= (((int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x14(%rbp),%rdx
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
jg     1141 <regx0adrx1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <regx0adrx1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adrx1>:
movslq %edx,%rax
mov    (%r8,%rax,4),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(,%rcx,4),%edx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @regx0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %10
%12 = load i32, i32* %11
%13 = icmp sle i32 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ hello(char *);
int main(int argc, char **argv) {
  hello("shreck");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"shreck\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @hello(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned xrop3_90_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = D ^ T;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_90_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 -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_90_0_0>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    $0xff,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_90_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, 255
ret i32 %5
}
void three(char **string) {
  *string = "ssssssssssssssssssssssssssssssssssssssssssssssssss";
}


x86 assembly (clang, -O0):
<three>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xeed(%rip),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [51 x i8] c"ssssssssssssssssssssssssssssssssssssssssssssssssss\00"
define void @three(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
store i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8** %3
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"ssssssssssssssssssssssssssssssssssssssssssssssssss\00"
define void @three(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8** %0
ret void
}
void yy_1_BolBlockContent(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_BolBlockContent(i8* nocapture %0, i32 %1) {
ret void
}
int regchar(unsigned char a, unsigned char c) {
  register unsigned char b = a + 1;
  register unsigned char d = c + 1;
  if (b & 0x11)
    return (0);
  else if (b & d)
    return (1);
  else if (b & 0x33)
    return (2);
  else
    return (3);
}


x86 assembly (clang, -O0):
<regchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x7(%rbp)
movzbl -0x6(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x8(%rbp)
movzbl -0x7(%rbp),%eax
and    $0x11,%eax
cmp    $0x0,%eax
je     1140 <regchar+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1182 <regchar+0x82>
movzbl -0x7(%rbp),%eax
movzbl -0x8(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115f <regchar+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1182 <regchar+0x82>
movzbl -0x7(%rbp),%eax
and    $0x33,%eax
cmp    $0x0,%eax
je     117b <regchar+0x7b>
movl   $0x2,-0x4(%rbp)
jmp    1182 <regchar+0x82>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regchar>:
add    $0x1,%dil
xor    %eax,%eax
test   $0x11,%dil
je     110d <regchar+0xd>
ret
add    $0x1,%sil
mov    $0x1,%eax
test   %dil,%sil
jne    110c <regchar+0xc>
xor    %eax,%eax
test   $0x33,%dil
sete   %al
or     $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @regchar(i8 zeroext %0, i8 zeroext %1) {
%3 = add i8 %0, 1
%4 = zext i8 %3 to i32
%5 = and i32 %4, 17
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = add i8 %1, 1
%9 = and i8 %8, %3
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = and i32 %4, 51
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 3, i32 2
br label %15
15: ; preds = %11, %7, %2
%16 = phi i32 [ 0, %2 ], [ 1, %7 ], [ %14, %11 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_indent(FILE *stream, int num) {
  int i;
  for (i = 0; i < num; i++) {
    fprintf(stream, "    ");
  }
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <print_indent+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_indent+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <print_indent+0x3a>
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xedb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1030 <fwrite@plt>
add    $0xffffffff,%ebx
jne    1130 <print_indent+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \00"
define void @print_indent(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
define void @print_indent(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int main() {
  char *argv[1] = {NULL};
  setuid(0);
  execvp("bash", argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
xor    %edi,%edi
call   1050 <setuid@plt>
lea    -0x10(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <execvp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xec9(%rip),%rdi
mov    %rsp,%rsi
call   1030 <execvp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"bash\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i8*]
store i32 0, i32* %1
%3 = bitcast [1 x i8*]* %2 to i8*
%4 = call i32 @setuid(i32 0)
%5 = getelementptr inbounds [1 x i8*], [1 x i8*]* %2, i64 0, i64 0
%6 = call i32 @execvp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"bash\00"
define i32 @main() {
%1 = alloca [1 x i8*]
%2 = bitcast [1 x i8*]* %1 to i8*
%3 = bitcast [1 x i8*]* %1 to i64*
store i64 0, i64* %3
%4 = tail call i32 @setuid(i32 0)
%5 = getelementptr inbounds [1 x i8*], [1 x i8*]* %1, i64 0, i64 0
%6 = call i32 @execvp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %5)
ret i32 0
}