xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int cap1166_get_polarity();
int /*<<< orphan*/ cap1166_polarity(unsigned int);
void led_polarity(int i, int s) {
  unsigned int l, j;
  l = cap1166_get_polarity();
  if (s == 0) {
    l &= ~(1 << (i));
  } else {
    l |= (1 << (i));
  };
  cap1166_polarity(l);
}


x86 assembly (clang, -O0):
<led_polarity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <cap1166_get_polarity@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115a <led_polarity+0x3a>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    116a <led_polarity+0x4a>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <cap1166_polarity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_polarity>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <cap1166_get_polarity@plt>
mov    %eax,%edi
btr    %ebp,%edi
bts    %ebp,%eax
test   %ebx,%ebx
cmovne %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <cap1166_polarity@plt>

LLVM IR (-O0):
define void @led_polarity(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 (...) @cap1166_get_polarity()
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %3
%12 = shl i32 1, %11
%13 = xor i32 %12, -1
%14 = load i32, i32* %5
%15 = and i32 %14, %13
store i32 %15, i32* %5
br label %21
16: ; preds = %2
%17 = load i32, i32* %3
%18 = shl i32 1, %17
%19 = load i32, i32* %5
%20 = or i32 %19, %18
store i32 %20, i32* %5
br label %21
21: ; preds = %16, %10
%22 = load i32, i32* %5
%23 = call i32 @cap1166_polarity(i32 %22)
ret void
}

LLVM IR (-O2):
define void @led_polarity(i32 %0, i32 %1) {
%3 = tail call i32 (...) @cap1166_get_polarity()
%4 = icmp eq i32 %1, 0
%5 = shl nuw i32 1, %0
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
%8 = or i32 %3, %5
%9 = select i1 %4, i32 %7, i32 %8
%10 = tail call i32 @cap1166_polarity(i32 %9)
ret void
}
void __DELETE_java_util_Collections_SynchronizedMap(void *me,
                                                    void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_util_Collections_SynchronizedMap(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int test_or(int, int, int);
int main() { return test_or(9, 5, 3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x9,%edi
mov    $0x5,%esi
mov    $0x3,%edx
call   1030 <test_or@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x9,%edi
mov    $0x5,%esi
mov    $0x3,%edx
jmp    1030 <test_or@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_or(i32 9, i32 5, i32 3)
ret i32 %1
}
char TestB() {
  char r;
  __asm__("cmp $2, %1" : "=@ccb"(r) : "r"(1));
  if (r) {
    __asm__("cmp $0, %1" : "=@ccnb"(r) : "r"(1));
    if (r) {
      __asm__("cmp $1, %1" : "=@ccnb"(r) : "r"(1));
      if (r)
        return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<TestB>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
cmp    $0x2,%eax
setb   %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     115f <TestB+0x5f>
mov    $0x1,%eax
cmp    $0x0,%eax
setae  %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     115a <TestB+0x5a>
mov    $0x1,%eax
cmp    $0x1,%eax
setae  %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1155 <TestB+0x55>
movb   $0x1,-0x1(%rbp)
jmp    1163 <TestB+0x63>
jmp    115a <TestB+0x5a>
jmp    115f <TestB+0x5f>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestB>:
mov    $0x1,%eax
cmp    $0x2,%eax
jae    111c <TestB+0x1c>
cmp    $0x0,%eax
jb     111c <TestB+0x1c>
mov    $0x1,%eax
cmp    $0x1,%eax
mov    $0x1,%al
jb     111c <TestB+0x1c>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @TestB() {
%1 = alloca i8
%2 = alloca i8
%3 = call i8 asm "cmp $$2, $1", "={@ccb},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %0
%7 = call i8 asm "cmp $$0, $1", "={@ccnb},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = call i8 asm "cmp $$1, $1", "={@ccnb},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %11, i8* %2
%12 = load i8, i8* %2
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i8 1, i8* %1
br label %18
15: ; preds = %10
br label %16
16: ; preds = %15, %6
br label %17
17: ; preds = %16, %0
store i8 0, i8* %1
br label %18
18: ; preds = %17, %14
%19 = load i8, i8* %1
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @TestB() {
%1 = tail call i8 asm "cmp $$2, $1", "={@ccb},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%2 = icmp eq i8 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i8 asm "cmp $$0, $1", "={@ccnb},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i8 asm "cmp $$1, $1", "={@ccnb},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3, %6, %0
br label %10
10: ; preds = %6, %9
%11 = phi i8 [ 0, %9 ], [ 1, %6 ]
ret i8 %11
}
unsigned long insert_raq(unsigned long insn, long value,
                         int dialect __attribute__((unused)),
                         const char **errmsg) {
  long rtvalue = (insn & (0x1f << 21)) >> 21;
  if (value == rtvalue)
    *errmsg = "source and target register operands must be different";
  return insn | ((value & 0x1f) << 16);
}


x86 assembly (clang, -O0):
<insert_raq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3e00000,%rax
shr    $0x15,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1141 <insert_raq+0x41>
mov    -0x20(%rbp),%rax
lea    0xec2(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_raq>:
mov    %rsi,%rax
mov    %edi,%edx
shr    $0x15,%edx
and    $0x1f,%edx
cmp    %rsi,%rdx
jne    111a <insert_raq+0x1a>
lea    0xee9(%rip),%rdx
mov    %rdx,(%rcx)
and    $0x1f,%eax
shl    $0x10,%rax
or     %rdi,%rax
ret

LLVM IR (-O0):
@.str = [54 x i8] c"source and target register operands must be different\00"
define i64 @insert_raq(i64 %0, i64 %1, i32 %2, i8** %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%10 = load i64, i64* %5
%11 = and i64 %10, 65011712
%12 = lshr i64 %11, 21
store i64 %12, i64* %9
%13 = load i64, i64* %6
%14 = load i64, i64* %9
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %4
%17 = load i8**, i8*** %8
store i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8** %17
br label %18
18: ; preds = %16, %4
%19 = load i64, i64* %5
%20 = load i64, i64* %6
%21 = and i64 %20, 31
%22 = shl i64 %21, 16
%23 = or i64 %19, %22
ret i64 %23
}

LLVM IR (-O2):
@.str = [54 x i8] c"source and target register operands must be different\00"
define i64 @insert_raq(i64 %0, i64 %1, i32 %2, i8** nocapture writeonly %3) {
%5 = lshr i64 %0, 21
%6 = and i64 %5, 31
%7 = icmp eq i64 %6, %1
br i1 %7, label %8, label %9
8: ; preds = %4
store i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %4
%10 = shl i64 %1, 16
%11 = and i64 %10, 2031616
%12 = or i64 %11, %0
ret i64 %12
}
int sum_of_squares_swig(int N) {
  int sum = 0.0;
  for (int i = 1; i < N + 1; ++i)
    sum += i * i;
  return sum;
}


x86 assembly (clang, -O0):
<sum_of_squares_swig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1141 <sum_of_squares_swig+0x41>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <sum_of_squares_swig+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_of_squares_swig>:
test   %edi,%edi
jle    112d <sum_of_squares_swig+0x2d>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
lea    -0x3(%rdi),%eax
imul   %rcx,%rax
shr    %rax
imul   $0x55555556,%eax,%eax
shr    %rcx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
lea    (%rcx,%rdi,4),%eax
add    $0xfffffffd,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum_of_squares_swig(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %22, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = add nsw i32 %0, -3
%10 = zext i32 %9 to i33
%11 = mul i33 %8, %10
%12 = lshr i33 %11, 1
%13 = trunc i33 %12 to i32
%14 = mul i32 %13, 1431655766
%15 = lshr i33 %8, 1
%16 = trunc i33 %15 to i32
%17 = mul i32 %16, 5
%18 = add i32 %14, %17
%19 = shl i32 %0, 2
%20 = add i32 %18, %19
%21 = add i32 %20, -3
br label %22
22: ; preds = %3, %1
%23 = phi i32 [ 0, %1 ], [ %21, %3 ]
ret i32 %23
}
void sysview_init() {}


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

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

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

LLVM IR (-O2):
define void @sysview_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  for (int i = 0; i < 100; i++) {
    for (int k = 0; k < 1000; k++) {
      assert(k == 0);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1176 <main+0x66>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1163 <main+0x53>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
jmp    1168 <main+0x58>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x3e8,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
cmp    $0x3e8,%ebp
sete   %dil
call   1030 <assert@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x20>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %20, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %23
7: ; preds = %4
store i32 0, i32* %3
br label %8
8: ; preds = %16, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 1000
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %8
19: ; preds = %8
br label %20
20: ; preds = %19
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %4
23: ; preds = %4
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %4
%2 = phi i32 [ 0, %0 ], [ %5, %4 ]
br label %7
3: ; preds = %4
ret i32 0
4: ; preds = %7
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %3, label %1
7: ; preds = %1, %7
%8 = phi i32 [ 0, %1 ], [ %12, %7 ]
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = add nuw nsw i32 %8, 1
%13 = icmp eq i32 %12, 1000
br i1 %13, label %4, label %7
}
/* Type definitions */
struct frozen {
  int dummy;
};

/* Variables and functions */
int cur(struct frozen *);
int test_no_skip(struct frozen *f, int expected) {
  int ch = cur(f);
  if (ch == expected) {
    return 0;
  }
  return ch == (-1) ? -2 : -1;
}


x86 assembly (clang, -O0):
<test_no_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cur@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1143 <test_no_skip+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1159 <test_no_skip+0x49>
mov    -0x18(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0xfffffffe,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_skip>:
push   %rbx
mov    %esi,%ebx
call   1030 <cur@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
xor    %edx,%edx
cmp    %ebx,%eax
not    %ecx
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.frozen = type { i32 }
define i32 @test_no_skip(%struct.frozen* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.frozen*
%5 = alloca i32
%6 = alloca i32
store %struct.frozen* %0, %struct.frozen** %4
store i32 %1, i32* %5
%7 = load %struct.frozen*, %struct.frozen** %4
%8 = call i32 @cur(%struct.frozen* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %18
13: ; preds = %2
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, -1
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 -2, i32 -1
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.frozen = type { i32 }
define i32 @test_no_skip(%struct.frozen* %0, i32 %1) {
%3 = tail call i32 @cur(%struct.frozen* %0)
%4 = icmp eq i32 %3, %1
%5 = icmp eq i32 %3, -1
%6 = select i1 %5, i32 -2, i32 -1
%7 = select i1 %4, i32 0, i32 %6
ret i32 %7
}
/* Variables and functions */
void *calloc(int, size_t);
void *new (int num, size_t size) {
  void *v = calloc(num, size);
  return v;
}


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

x86 assembly (clang, -O2):
<new>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @new(i32 %0, i64 %1) {
%3 = tail call i8* @calloc(i32 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ClearExtensionVariables();
int /*<<< orphan*/ ProcExtsFromExtList();
void ogl_CheckExtensions() {
  ClearExtensionVariables();
  ProcExtsFromExtList();
}


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

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

LLVM IR (-O0):
define void @ogl_CheckExtensions() {
%1 = call i32 (...) @ClearExtensionVariables()
%2 = call i32 (...) @ProcExtsFromExtList()
ret void
}

LLVM IR (-O2):
define void @ogl_CheckExtensions() {
%1 = tail call i32 (...) @ClearExtensionVariables()
%2 = tail call i32 (...) @ProcExtsFromExtList()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, size_t);
void *malloc(size_t);
void *calloc(size_t c, size_t s) {
  void *mem = malloc(c * s);
  bzero(mem, c * s);
  return mem;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
imul   -0x10(%rbp),%rsi
call   1040 <bzero@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
imul   %rdi,%rbx
mov    %rbx,%rdi
call   1030 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <bzero@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = call i32 @bzero(i8* %10, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @bzero(i8* %4, i64 %3)
ret i8* %4
}
/* Variables and functions */
char const *_auth_timestamp() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @_auth_timestamp() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_auth_timestamp() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Bom dia!\n");
  printf("Olá mundo\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Bom dia!\0A\00"
@.str.1 = [12 x i8] c"Ol\C3\A1 mundo\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"Bom dia!\00"
@str.2 = [11 x i8] c"Ol\C3\A1 mundo\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ func(int /*<<< orphan*/ *);
int main() {
  FILE *fp = fopen("test", "r");
  if (fp != NULL) {
    func(fp);
  }
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116a <main+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <func@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1154 <main+0x24>
mov    %rbx,%rdi
call   1040 <func@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @func(i32* %1)
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ checkSystem();
int /*<<< orphan*/ printf(char *);
int main() {
  if (checkSystem()) {
    printf("当前系统为小端模式\n");
  } else {
    printf("当前系统为大端模式\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <checkSystem@plt>
cmp    $0x0,%rax
je     1151 <main+0x31>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <main+0x3d>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"\E5\BD\93\E5\89\8D\E7\B3\BB\E7\BB\9F\E4\B8\BA\E5\B0\8F\E7\AB\AF\E6\A8\A1\E5\BC\8F\0A\00"
@.str.1 = [29 x i8] c"\E5\BD\93\E5\89\8D\E7\B3\BB\E7\BB\9F\E4\B8\BA\E5\A4\A7\E7\AB\AF\E6\A8\A1\E5\BC\8F\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @checkSystem()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"\E5\BD\93\E5\89\8D\E7\B3\BB\E7\BB\9F\E4\B8\BA\E5\A4\A7\E7\AB\AF\E6\A8\A1\E5\BC\8F\00"
@str.2 = [28 x i8] c"\E5\BD\93\E5\89\8D\E7\B3\BB\E7\BB\9F\E4\B8\BA\E5\B0\8F\E7\AB\AF\E6\A8\A1\E5\BC\8F\00"
define i32 @main() {
%1 = tail call i64 (...) @checkSystem()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
int isOdd(int a) {
  if (a % 2 != 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<isOdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1127 <isOdd+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <isOdd+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOdd>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isOdd(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_set_event_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_set_event_callback"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_stream_set_event_callback\0A\00"
define i32 @pa_stream_set_event_callback() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_stream_set_event_callback\00"
define i32 @pa_stream_set_event_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ print32(int);
int /*<<< orphan*/ serial_putc(char);
int /*<<< orphan*/ serial_puts(char *);
void show_reg(char *msg, int *addr) {
  serial_puts(msg);
  serial_putc(' ');
  print32((int)addr);
  serial_putc(' ');
  print32(*addr);
  serial_putc('\n');
}


x86 assembly (clang, -O0):
<show_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <serial_puts@plt>
mov    $0x20,%edi
call   1030 <serial_putc@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1050 <print32@plt>
mov    $0x20,%edi
call   1030 <serial_putc@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1050 <print32@plt>
mov    $0xa,%edi
call   1030 <serial_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_reg>:
push   %rbx
mov    %rsi,%rbx
call   1040 <serial_puts@plt>
mov    $0x20,%edi
call   1030 <serial_putc@plt>
mov    %ebx,%edi
call   1050 <print32@plt>
mov    $0x20,%edi
call   1030 <serial_putc@plt>
mov    (%rbx),%edi
call   1050 <print32@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <serial_putc@plt>

LLVM IR (-O0):
define void @show_reg(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = call i32 @serial_puts(i8* %5)
%7 = call i32 @serial_putc(i8 signext 32)
%8 = load i32*, i32** %4
%9 = ptrtoint i32* %8 to i32
%10 = call i32 @print32(i32 %9)
%11 = call i32 @serial_putc(i8 signext 32)
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = call i32 @print32(i32 %13)
%15 = call i32 @serial_putc(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @show_reg(i8* %0, i32* %1) {
%3 = tail call i32 @serial_puts(i8* %0)
%4 = tail call i32 @serial_putc(i8 signext 32)
%5 = ptrtoint i32* %1 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @print32(i32 %6)
%8 = tail call i32 @serial_putc(i8 signext 32)
%9 = load i32, i32* %1
%10 = tail call i32 @print32(i32 %9)
%11 = tail call i32 @serial_putc(i8 signext 10)
ret void
}
__attribute__((constructor)) void fb_ctor__astznodezuop(void) {
label$0:;
label$1:;
}


x86 assembly (clang, -O0):
<fb_ctor__astznodezuop>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fb_ctor__astznodezuop+0x9>
jmp    110e <fb_ctor__astznodezuop+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fb_ctor__astznodezuop, i8* null }]
define void @fb_ctor__astznodezuop() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
define void @fb_ctor__astznodezuop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void text(int fd, char *s) { write(fd, s, strlen(s)); }


x86 assembly (clang, -O0):
<text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @text(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @text(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int sys_mknod(char *, int, int);
int main(void) {
  if (sizeof(int) != 4)
    exit(0);
  return sys_mknod("test", 1, 0x12345678);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x12345678,%edx
call   1030 <sys_mknod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
mov    $0x12345678,%edx
jmp    1030 <sys_mknod@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sys_mknod(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1, i32 305419896)
ret i32 %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = tail call i32 @sys_mknod(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1, i32 305419896)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgdefb(int v) { ngen("%s\t%d", ".byte", v); }


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

x86 assembly (clang, -O2):
<cgdefb>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s\09%d\00"
@.str.1 = [6 x i8] c".byte\00"
define void @cgdefb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s\09%d\00"
@.str.1 = [6 x i8] c".byte\00"
define void @cgdefb(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printd(int);
int main(void) {
  printd(123);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7b,%edi
call   1030 <printd@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printd(i32 123)
ret i32 0
}
/* Variables and functions */
double atof_(char *);
int /*<<< orphan*/ printf(char *, double);
int main() {
  char *source = "3.145e-2";
  printf("%f\n", atof_(source));
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"3.145e-2\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call double @atof_(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"3.145e-2\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call double @atof_(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ display_anagrams(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("Nombre de parametres insuffisants\n");
    return 1;
  }
  display_anagrams(argv[1]);
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1165 <main+0x45>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <display_anagrams@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1139 <main+0x19>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1040 <display_anagrams@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Nombre de parametres insuffisants\0A\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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @display_anagrams(i8* %13)
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@str = [34 x i8] c"Nombre de parametres insuffisants\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @display_anagrams(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %11
}
void create_adk() { return; }


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

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

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

LLVM IR (-O2):
define void @create_adk() {
ret void
}
/* Variables and functions */
float pow(float, float);
float stretch(float n, float stretch) {
  if (n < 0) {
    return -pow(-n, stretch);
  } else {
    return pow(n, stretch);
  }
}


x86 assembly (clang, -O0):
<stretch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1162 <stretch+0x52>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <pow@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1176 <stretch+0x66>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <pow@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stretch>:
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
jbe    112e <stretch+0x1e>
push   %rax
xorps  0xee0(%rip),%xmm0
call   1030 <pow@plt>
xorps  0xed4(%rip),%xmm0
pop    %rax
ret
jmp    1030 <pow@plt>

LLVM IR (-O0):
define float @stretch(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load float, float* %4
%10 = fneg float %9
%11 = load float, float* %5
%12 = call float @pow(float %10, float %11)
%13 = fneg float %12
store float %13, float* %3
br label %18
14: ; preds = %2
%15 = load float, float* %4
%16 = load float, float* %5
%17 = call float @pow(float %15, float %16)
store float %17, float* %3
br label %18
18: ; preds = %14, %8
%19 = load float, float* %3
ret float %19
}

LLVM IR (-O2):
define float @stretch(float %0, float %1) {
%3 = fcmp olt float %0, 0.000000e+00
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = fneg float %0
%6 = tail call float @pow(float %5, float %1)
%7 = fneg float %6
br label %10
8: ; preds = %2
%9 = tail call float @pow(float %0, float %1)
br label %10
10: ; preds = %8, %4
%11 = phi float [ %7, %4 ], [ %9, %8 ]
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ test_buffer_cannot_hold_nul_returns_false();
int /*<<< orphan*/ test_buffer_overflow_returns_false();
int /*<<< orphan*/ test_empty_buffer_writes_nothing();
int /*<<< orphan*/ test_no_data_makes_empty_string();
int /*<<< orphan*/ test_simple_case();
void ws_base_64_enc_test(void) {
  test_no_data_makes_empty_string();
  test_buffer_overflow_returns_false();
  test_buffer_cannot_hold_nul_returns_false();
  test_empty_buffer_writes_nothing();
  test_simple_case();
}


x86 assembly (clang, -O0):
<ws_base_64_enc_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <test_no_data_makes_empty_string@plt>
mov    $0x0,%al
call   1040 <test_buffer_overflow_returns_false@plt>
mov    $0x0,%al
call   1060 <test_buffer_cannot_hold_nul_returns_false@plt>
mov    $0x0,%al
call   1030 <test_empty_buffer_writes_nothing@plt>
mov    $0x0,%al
call   1050 <test_simple_case@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ws_base_64_enc_test>:
push   %rax
xor    %eax,%eax
call   1070 <test_no_data_makes_empty_string@plt>
xor    %eax,%eax
call   1040 <test_buffer_overflow_returns_false@plt>
xor    %eax,%eax
call   1060 <test_buffer_cannot_hold_nul_returns_false@plt>
xor    %eax,%eax
call   1030 <test_empty_buffer_writes_nothing@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_simple_case@plt>

LLVM IR (-O0):
define void @ws_base_64_enc_test() {
%1 = call i32 (...) @test_no_data_makes_empty_string()
%2 = call i32 (...) @test_buffer_overflow_returns_false()
%3 = call i32 (...) @test_buffer_cannot_hold_nul_returns_false()
%4 = call i32 (...) @test_empty_buffer_writes_nothing()
%5 = call i32 (...) @test_simple_case()
ret void
}

LLVM IR (-O2):
define void @ws_base_64_enc_test() {
%1 = tail call i32 (...) @test_no_data_makes_empty_string()
%2 = tail call i32 (...) @test_buffer_overflow_returns_false()
%3 = tail call i32 (...) @test_buffer_cannot_hold_nul_returns_false()
%4 = tail call i32 (...) @test_empty_buffer_writes_nothing()
%5 = tail call i32 (...) @test_simple_case()
ret void
}
void RTStrToUpper(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToUpper() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ answerTheQuestion(int, int);
int getRandomNum();
void askQuestions(int n) {
  int i, a, b;
  for (i = 0; i < n; i++) {
    a = getRandomNum();
    b = getRandomNum();
    answerTheQuestion(a, b);
  }
}


x86 assembly (clang, -O0):
<askQuestions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116b <askQuestions+0x4b>
mov    $0x0,%al
call   1030 <getRandomNum@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getRandomNum@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <answerTheQuestion@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <askQuestions+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<askQuestions>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    114e <askQuestions+0x2e>
mov    %edi,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getRandomNum@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <getRandomNum@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <answerTheQuestion@plt>
add    $0xffffffff,%ebx
jne    1130 <askQuestions+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @askQuestions(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @getRandomNum()
%6 = tail call i32 (...) @getRandomNum()
%7 = tail call i32 @answerTheQuestion(i32 %5, i32 %6)
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
ret void
}
/* Variables and functions */
size_t func_inputs_max(void) { return 3; }


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

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

LLVM IR (-O0):
define i64 @func_inputs_max() {
ret i64 3
}

LLVM IR (-O2):
define i64 @func_inputs_max() {
ret i64 3
}
int test_imm_B6int16_reg(short val) {
  return ((val) & (-0xB6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B6int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff4a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B6int16_reg>:
test   $0xff4a,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B6int16_reg(i16 signext %0) {
%2 = and i16 %0, -182
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int *v_zap_int(int *v, int n) {
  int i;
  for (i = 0; i < n; i++)
    v[i] = 0;
  return (v);
}


x86 assembly (clang, -O0):
<v_zap_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <v_zap_int+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <v_zap_int+0x12>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_zap_int>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
jle    1128 <v_zap_int+0x18>
mov    %esi,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @v_zap_int(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 = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
%19 = load i32*, i32** %3
ret i32* %19
}

LLVM IR (-O2):
define i32* @v_zap_int(i32* returned writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret i32* %0
}
OP(fd, ed) {
  illegal_1();
  op_ed();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_ed@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_ed()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ed()
ret i32 undef
}