xunge/DecIR huggingface dataset:
void error_double_autorelease(void *client_state, void *retainable) {}


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

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

LLVM IR (-O0):
define void @error_double_autorelease(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 @error_double_autorelease(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ queue_test_dequeuing();
int /*<<< orphan*/ queue_test_enqueuing();
int /*<<< orphan*/ queue_test_enqueuing_and_dequeuing();
int /*<<< orphan*/ queue_test_rapid_enqueuing_and_dequeuing();
void test_lfds611_queue(void) {
  printf("\n"
         "Queue Tests\n"
         "===========\n");
  queue_test_enqueuing();
  queue_test_dequeuing();
  queue_test_enqueuing_and_dequeuing();
  queue_test_rapid_enqueuing_and_dequeuing();
  return;
}


x86 assembly (clang, -O0):
<test_lfds611_queue>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1070 <queue_test_enqueuing@plt>
mov    $0x0,%al
call   1040 <queue_test_dequeuing@plt>
mov    $0x0,%al
call   1060 <queue_test_enqueuing_and_dequeuing@plt>
mov    $0x0,%al
call   1050 <queue_test_rapid_enqueuing_and_dequeuing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lfds611_queue>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <queue_test_enqueuing@plt>
xor    %eax,%eax
call   1040 <queue_test_dequeuing@plt>
xor    %eax,%eax
call   1060 <queue_test_enqueuing_and_dequeuing@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <queue_test_rapid_enqueuing_and_dequeuing@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0AQueue Tests\0A===========\0A\00"
define void @test_lfds611_queue() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @queue_test_enqueuing()
%3 = call i32 (...) @queue_test_dequeuing()
%4 = call i32 (...) @queue_test_enqueuing_and_dequeuing()
%5 = call i32 (...) @queue_test_rapid_enqueuing_and_dequeuing()
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"\0AQueue Tests\0A===========\00"
define void @test_lfds611_queue() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @queue_test_enqueuing()
%3 = tail call i32 (...) @queue_test_dequeuing()
%4 = tail call i32 (...) @queue_test_enqueuing_and_dequeuing()
%5 = tail call i32 (...) @queue_test_rapid_enqueuing_and_dequeuing()
ret void
}
/* Variables and functions */
size_t __attribute__((always_)) mystrlen(const char *str) {
  const char *s;
  for (s = str; *s; ++s) {
  }
  return (s - str);
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <mystrlen+0x33>
jmp    1122 <mystrlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <mystrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <mystrlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @mystrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
long long test_00(long long a) { return a << 1; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    (%rdi,%rdi,1),%rax
ret

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

LLVM IR (-O2):
define i64 @test_00(i64 %0) {
%2 = shl i64 %0, 1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ Merge(char *, int, int, int);
void Merge_Sort(char *str, int low, int high) {
  if (low < high) {
    int mid = (low + high) / 2;
    Merge_Sort(str, low, mid);
    Merge_Sort(str, mid + 1, high);
    Merge(str, low, mid, high);
  }
}


x86 assembly (clang, -O0):
<Merge_Sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <Merge_Sort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <Merge_Sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <Merge_Sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <Merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Merge_Sort>:
cmp    %edx,%esi
jge    1172 <Merge_Sort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <Merge_Sort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <Merge_Sort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <Merge@plt>
ret

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

LLVM IR (-O2):
define void @Merge_Sort(i8* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @Merge_Sort(i8* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @Merge_Sort(i8* %0, i32 %9, i32 %2)
%10 = tail call i32 @Merge(i8* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
int t(int *a) {
  int i;
  for (i = 0; i < 1000000; i++)
    a[i]++;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xf4240,-0x14(%rbp)
jge    113b <t+0x3b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <t+0xf>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
mov    $0xc,%eax
pcmpeqd %xmm0,%xmm0
nopl   0x0(%rax)
movdqu -0x30(%rdi,%rax,4),%xmm1
movdqu -0x20(%rdi,%rax,4),%xmm2
movdqu -0x10(%rdi,%rax,4),%xmm3
movdqu (%rdi,%rax,4),%xmm4
psubd  %xmm0,%xmm1
psubd  %xmm0,%xmm2
movdqu %xmm1,-0x30(%rdi,%rax,4)
movdqu %xmm2,-0x20(%rdi,%rax,4)
psubd  %xmm0,%xmm3
psubd  %xmm0,%xmm4
movdqu %xmm3,-0x10(%rdi,%rax,4)
movdqu %xmm4,(%rdi,%rax,4)
add    $0x10,%rax
cmp    $0xf424c,%rax
jne    1110 <t+0x10>
ret

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

LLVM IR (-O2):
define i32 @t(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %25, %2 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = bitcast i32* %4 to <4 x i32>*
%6 = load <4 x i32>, <4 x i32>* %5
%7 = getelementptr inbounds i32, i32* %4, i64 4
%8 = bitcast i32* %7 to <4 x i32>*
%9 = load <4 x i32>, <4 x i32>* %8
%10 = add nsw <4 x i32> %6, <i32 1, i32 1, i32 1, i32 1>
%11 = add nsw <4 x i32> %9, <i32 1, i32 1, i32 1, i32 1>
%12 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> %10, <4 x i32>* %12
%13 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %13
%14 = or i64 %3, 8
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = bitcast i32* %15 to <4 x i32>*
%17 = load <4 x i32>, <4 x i32>* %16
%18 = getelementptr inbounds i32, i32* %15, i64 4
%19 = bitcast i32* %18 to <4 x i32>*
%20 = load <4 x i32>, <4 x i32>* %19
%21 = add nsw <4 x i32> %17, <i32 1, i32 1, i32 1, i32 1>
%22 = add nsw <4 x i32> %20, <i32 1, i32 1, i32 1, i32 1>
%23 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> %21, <4 x i32>* %23
%24 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> %22, <4 x i32>* %24
%25 = add nuw nsw i64 %3, 16
%26 = icmp eq i64 %25, 1000000
br i1 %26, label %27, label %2
27: ; preds = %2
ret i32 undef
}
/* Variables and functions */
int RAND_MAX;
int rand();
short rand_bool() { return rand() < (RAND_MAX >> 1); }


x86 assembly (clang, -O0):
<rand_bool>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rcx
mov    (%rcx),%ecx
sar    $0x1,%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_bool>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%edx
sar    %edx
xor    %ecx,%ecx
cmp    %edx,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define signext i16 @rand_bool() {
%1 = call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = ashr i32 %2, 1
%4 = icmp slt i32 %1, %3
%5 = zext i1 %4 to i32
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define signext i16 @rand_bool() {
%1 = tail call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = ashr i32 %2, 1
%4 = icmp slt i32 %1, %3
%5 = zext i1 %4 to i16
ret i16 %5
}
/* Variables and functions */
unsigned long mfspr(int);
int /*<<< orphan*/ mtspr(int, unsigned long);
void cache_dflush(void) {
  unsigned long sr = mfspr((17));
  mtspr((17), sr | (1 << 18));
}


x86 assembly (clang, -O0):
<cache_dflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x11,%edi
call   1030 <mfspr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
or     $0x40000,%rsi
mov    $0x11,%edi
call   1040 <mtspr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_dflush>:
push   %rax
mov    $0x11,%edi
call   1030 <mfspr@plt>
or     $0x40000,%rax
mov    $0x11,%edi
mov    %rax,%rsi
pop    %rax
jmp    1040 <mtspr@plt>

LLVM IR (-O0):
define void @cache_dflush() {
%1 = alloca i64
%2 = call i64 @mfspr(i32 17)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = or i64 %3, 262144
%5 = call i32 @mtspr(i32 17, i64 %4)
ret void
}

LLVM IR (-O2):
define void @cache_dflush() {
%1 = tail call i64 @mfspr(i32 17)
%2 = or i64 %1, 262144
%3 = tail call i32 @mtspr(i32 17, i64 %2)
ret void
}
unsigned xrop3_147_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & D;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_147_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %4, %5
%7 = xor i32 %6, -1
ret i32 %7
}
void __DELETE_java_lang_reflect_AccessibleObject(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_lang_reflect_AccessibleObject(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_lang_reflect_AccessibleObject(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
struct ListNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mk_list(struct ListNode **, int *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  struct ListNode *head = NULL;
  int a[] = {};
  mk_list(&head, a, 0);
  return 0;
}


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)
movq   $0x0,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
lea    -0x18(%rbp),%rdi
xor    %edx,%edx
call   1030 <mk_list@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
xor    %edx,%edx
call   1030 <mk_list@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.ListNode*
%7 = alloca [0 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.ListNode* null, %struct.ListNode** %6
%8 = bitcast [0 x i32]* %7 to i8*
%9 = getelementptr inbounds [0 x i32], [0 x i32]* %7, i64 0, i64 0
%10 = call i32 @mk_list(%struct.ListNode** %6, i32* %9, i32 0)
ret i32 0
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [0 x i32]
%4 = alloca %struct.ListNode*
%5 = bitcast %struct.ListNode** %4 to i8*
store %struct.ListNode* null, %struct.ListNode** %4
%6 = bitcast [0 x i32]* %3 to i8*
%7 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 0
%8 = call i32 @mk_list(%struct.ListNode** %4, i32* %7, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void labelIfEnd(int number) { printf(".L%dE:\n", number); }


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

x86 assembly (clang, -O2):
<labelIfEnd>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c".L%dE:\0A\00"
define void @labelIfEnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c".L%dE:\0A\00"
define void @labelIfEnd(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void enable_intr(void) { __asm__ volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @enable_intr() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void p7_carrier_atexit(struct p7_carrier *self) {}


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

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

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

LLVM IR (-O2):
%struct.p7_carrier = type opaque
define void @p7_carrier_atexit(%struct.p7_carrier* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wgetopt_internal(int, int /*<<< orphan*/ *const *,
                                    int /*<<< orphan*/ const *,
                                    int /*<<< orphan*/);
wchar_t wgetopt(int nargc, wchar_t *const *nargv, const wchar_t *options) {
  return (wgetopt_internal(nargc, nargv, options, 0));
}


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

x86 assembly (clang, -O2):
<wgetopt>:
xor    %ecx,%ecx
jmp    1030 <wgetopt_internal@plt>

LLVM IR (-O0):
define i32 @wgetopt(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 = load i32*, i32** %6
%10 = call i32 @wgetopt_internal(i32 %7, i32** %8, i32* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @wgetopt(i32 %0, i32** %1, i32* %2) {
%4 = tail call i32 @wgetopt_internal(i32 %0, i32** %1, i32* %2, i32 0)
ret i32 %4
}
__attribute__((no, noclone)) unsigned __int128 t164_3sub(unsigned __int128 y) {
  unsigned __int128 r;
  if (__builtin_sub_overflow((unsigned __int128)(15), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t164_3sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
xor    %ecx,%ecx
mov    $0xf,%edx
sub    %rsi,%rdx
sbb    %rax,%rcx
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    115d <t164_3sub+0x4d>
jmp    1164 <t164_3sub+0x54>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t164_3sub>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
mov    $0xf,%ebx
sub    %rdi,%rbx
sbb    %rsi,%r14
jae    112b <t164_3sub+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t164_3sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 15, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t164_3sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.usub.with.overflow.i128(i128 15, i128 %6)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
int sqlite3Strlen30(const char *z) {
  const char *z2 = z;
  if (z == 0) {
    return 0;
  }
  while (*z2) {
    z2++;
  }
  return 0x3fffffff & (int)(z2 - z);
}


x86 assembly (clang, -O0):
<sqlite3Strlen30>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1127 <sqlite3Strlen30+0x27>
movl   $0x0,-0x4(%rbp)
jmp    115d <sqlite3Strlen30+0x5d>
jmp    112c <sqlite3Strlen30+0x2c>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <sqlite3Strlen30+0x4a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <sqlite3Strlen30+0x2c>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
and    $0x3fffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3Strlen30>:
test   %rdi,%rdi
je     1122 <sqlite3Strlen30+0x22>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <sqlite3Strlen30+0x10>
and    $0x3fffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sqlite3Strlen30(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = and i32 %12, 1073741823
br label %14
14: ; preds = %1, %8
%15 = phi i32 [ %13, %8 ], [ 0, %1 ]
ret i32 %15
}
int test_imm_77int8_mem(signed char *val) {
  return ((*val) & (-0x77 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_77int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -119
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void switch_s2_select(const uint32_t repeat_count) { (void)repeat_count; }


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

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

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

LLVM IR (-O2):
define void @switch_s2_select(i32 %0) {
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
bool is_whitespace(int8_t byte) {
  bool is_space = false;
  switch (byte) {
  case ' ':
  case '\t':
  case '\n':
  case '\r':
    is_space = true;
    break;
  default:
    break;
  }
  return is_space;
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1147 <is_whitespace+0x47>
jmp    1125 <is_whitespace+0x25>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     1147 <is_whitespace+0x47>
jmp    1136 <is_whitespace+0x36>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    1153 <is_whitespace+0x53>
jmp    1147 <is_whitespace+0x47>
movl   $0x1,-0x8(%rbp)
jmp    1158 <is_whitespace+0x58>
jmp    1158 <is_whitespace+0x58>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
xor    %eax,%eax
cmp    $0x20,%edi
ja     111e <is_whitespace+0x1e>
mov    %edi,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111e <is_whitespace+0x1e>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_whitespace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 32, label %5
i32 9, label %5
i32 10, label %5
i32 13, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %3
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_whitespace(i32 %0) {
switch i32 %0, label %3 [
i32 32, label %2
i32 9, label %2
i32 10, label %2
i32 13, label %2
]
2: ; preds = %1, %1, %1, %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 0, %1 ], [ 1, %2 ]
ret i32 %4
}
int b_twist_u_on_midperm(mperm)
int mperm;
{ return mperm; }


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

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

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

LLVM IR (-O2):
define i32 @b_twist_u_on_midperm(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_rtclock_age() {
  printf("NOT IMPLEMENTED:"
         "pa_rtclock_age"
         "\n");
}


x86 assembly (clang, -O0):
<pa_rtclock_age>:
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_rtclock_age>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_rtclock_age\00"
define i32 @pa_rtclock_age() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ dosomething(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num = 0;
  int *p;
  p = &num;
  dosomething(p);
  printf("%d", *p);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <dosomething@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @dosomething(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void ASN1_UNIVERSALSTRING_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_UNIVERSALSTRING_free() {
ret void
}
/* Variables and functions */
void *s;
void *ck_alloc(unsigned int len) {
  void *calloc(), *s;
  if ((s = calloc(len, 1)) == NULL)
    return (NULL);
  return (s);
}


x86 assembly (clang, -O0):
<ck_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1145 <ck_alloc+0x35>
movq   $0x0,-0x8(%rbp)
jmp    114d <ck_alloc+0x3d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ck_alloc>:
mov    %edi,%edi
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
@s = global i8* null
define i8* @ck_alloc(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = call i8* @calloc(i64 %6, i64 1)
store i8* %7, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* null, i8** %2
br label %12
10: ; preds = %1
%11 = load i8*, i8** %4
store i8* %11, i8** %2
br label %12
12: ; preds = %10, %9
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@s = global i8* null
define noalias i8* @ck_alloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @calloc(i64 %2, i64 1)
ret i8* %3
}
/* Variables and functions */
int get_clcsbb4(int, int, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void print_clcsbb4(int a, int b, int mask) {
  int f, r;
  f = get_clcsbb4(a, b, &r);
  f &= mask;
  printf("clcsbb"
         " 4"
         " %08x %08x %08x %08x %08x\n",
         a, b, r, f, mask);
}


x86 assembly (clang, -O0):
<print_clcsbb4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x14(%rbp),%rdx
call   1030 <get_clcsbb4@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_clcsbb4>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rdx
call   1030 <get_clcsbb4@plt>
and    %r14d,%eax
mov    0xc(%rsp),%ecx
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%r8d
mov    %r14d,%r9d
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"clcsbb 4 %08x %08x %08x %08x %08x\0A\00"
define void @print_clcsbb4(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @get_clcsbb4(i32 %9, i32 %10, i32* %8)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = and i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"clcsbb 4 %08x %08x %08x %08x %08x\0A\00"
define void @print_clcsbb4(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @get_clcsbb4(i32 %0, i32 %1, i32* %4)
%7 = and i32 %6, %2
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %8, i32 %7, i32 %2)
ret void
}
void OOC_ArrayC_open(void) {}


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

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

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

LLVM IR (-O2):
define void @OOC_ArrayC_open() {
ret void
}
/* Variables and functions */
int ymd_to_scalar(int, int, int);
int wg_ymd_to_date(void *db, int yr, int mo, int day) {
  if (yr < 0 || mo < 1 || mo > 12 || day < 1 || day > 31)
    return -1;
  return ymd_to_scalar(yr, mo, day);
}


x86 assembly (clang, -O0):
<wg_ymd_to_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1157 <wg_ymd_to_date+0x47>
cmpl   $0x1,-0x18(%rbp)
jl     1157 <wg_ymd_to_date+0x47>
cmpl   $0xc,-0x18(%rbp)
jg     1157 <wg_ymd_to_date+0x47>
cmpl   $0x1,-0x1c(%rbp)
jl     1157 <wg_ymd_to_date+0x47>
cmpl   $0x1f,-0x1c(%rbp)
jle    1163 <wg_ymd_to_date+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <wg_ymd_to_date+0x64>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <ymd_to_scalar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wg_ymd_to_date>:
lea    -0x20(%rcx),%eax
cmp    $0xffffffe1,%eax
jb     112f <wg_ymd_to_date+0x1f>
test   %esi,%esi
js     112f <wg_ymd_to_date+0x1f>
lea    -0xd(%rdx),%eax
cmp    $0xfffffff4,%eax
jb     112f <wg_ymd_to_date+0x1f>
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
jmp    1030 <ymd_to_scalar@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @wg_ymd_to_date(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %1, 0
%6 = add i32 %2, -13
%7 = icmp ult i32 %6, -12
%8 = or i1 %5, %7
%9 = add i32 %3, -32
%10 = icmp ult i32 %9, -31
%11 = or i1 %10, %8
br i1 %11, label %14, label %12
12: ; preds = %4
%13 = tail call i32 @ymd_to_scalar(i32 %1, i32 %2, i32 %3)
br label %14
14: ; preds = %4, %12
%15 = phi i32 [ %13, %12 ], [ -1, %4 ]
ret i32 %15
}
/* Type definitions */
typedef scalar_t__ __v8hi;
typedef scalar_t__ __m128i;

/* Variables and functions */
__m128i __attribute__((__always___, __nodebug__))
_mm_add_epi16(__m128i a, __m128i b) {
  return (__m128i)((__v8hi)a + (__v8hi)b);
}


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

x86 assembly (clang, -O2):
<_mm_add_epi16>:
lea    (%rdi,%rsi,1),%rax
ret

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

LLVM IR (-O2):
define i64 @_mm_add_epi16(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
float SQR(float x) { return x * x; }


x86 assembly (clang, -O0):
<SQR>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SQR>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @SQR(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ create_letter_distribution_diagram();
void main(void) { create_letter_distribution_diagram(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @create_letter_distribution_diagram()
ret void
}
int xisminf(double x) { return x == -__builtin_inf(); }


x86 assembly (clang, -O0):
<xisminf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisminf>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @xisminf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0xFFF0000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @xisminf(double %0) {
%2 = fcmp oeq double %0, 0xFFF0000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *get_default_domain();
int __rpc_get_default_domain(char **domain) {
  if ((*domain = get_default_domain()) != NULL)
    return (0);
  return (-1);
}


x86 assembly (clang, -O0):
<__rpc_get_default_domain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_default_domain@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
je     1140 <__rpc_get_default_domain+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1147 <__rpc_get_default_domain+0x37>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rpc_get_default_domain>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_default_domain@plt>
mov    %rax,(%rbx)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__rpc_get_default_domain(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = call i8* (...) @get_default_domain()
%5 = load i8**, i8*** %3
store i8* %4, i8** %5
%6 = icmp ne i8* %4, null
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 @__rpc_get_default_domain(i8** nocapture writeonly %0) {
%2 = tail call i8* (...) @get_default_domain()
store i8* %2, i8** %0
%3 = icmp eq i8* %2, null
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) { puts("h"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"h\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
const char *dlopen_simgen_name() { return "dlopen"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"dlopen\00"
define i8* @dlopen_simgen_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"dlopen\00"
define i8* @dlopen_simgen_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void _char_emitter(char c, void *pData __attribute__((unused))) { putchar(c); }


x86 assembly (clang, -O0):
<_char_emitter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_char_emitter>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @_char_emitter(i8 signext %0, i8* nocapture readnone %1) {
%3 = tail call i32 @putchar(i8 signext %0)
ret void
}
/* Variables and functions */
scalar_t__ lin_hello();
int main() { return (int)lin_hello(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @lin_hello()
%2 = trunc i64 %1 to i32
ret i32 %2
}
float tempC(short int tmp) {
  short int tmpd;
  float f;
  tmpd = tmp & 0x7F;
  tmp >>= 7;
  f = (float)tmp + (float)tmpd / 128;
  return f;
}


x86 assembly (clang, -O0):
<tempC>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x7f,%eax
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
shr    $0x7,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cvtsi2ss %eax,%xmm0
movswl -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm1
movss  0xec7(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempC>:
mov    %edi,%eax
sar    $0x7,%eax
cvtsi2ss %eax,%xmm1
and    $0x7f,%edi
cvtsi2ss %edi,%xmm0
mulss  0xee8(%rip),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @tempC(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca float
store i16 %0, i16* %2
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = and i32 %6, 127
%8 = trunc i32 %7 to i16
store i16 %8, i16* %3
%9 = load i16, i16* %2
%10 = sext i16 %9 to i32
%11 = ashr i32 %10, 7
%12 = trunc i32 %11 to i16
store i16 %12, i16* %2
%13 = load i16, i16* %2
%14 = sitofp i16 %13 to float
%15 = load i16, i16* %3
%16 = sitofp i16 %15 to float
%17 = fdiv float %16, 1.280000e+02
%18 = fadd float %14, %17
store float %18, float* %4
%19 = load float, float* %4
ret float %19
}

LLVM IR (-O2):
define float @tempC(i16 signext %0) {
%2 = and i16 %0, 127
%3 = ashr i16 %0, 7
%4 = sitofp i16 %3 to float
%5 = sitofp i16 %2 to float
%6 = fmul float %5, 7.812500e-03
%7 = fadd float %6, %4
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ log_f(char *);
int keyb_none_poll() {
  log_f("keyb:none: keyb_none_poll()\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"keyb:none: keyb_none_poll()\0A\00"
define i32 @keyb_none_poll() {
%1 = call i32 @log_f(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"keyb:none: keyb_none_poll()\0A\00"
define i32 @keyb_none_poll() {
%1 = tail call i32 @log_f(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}