xunge/DecIR huggingface dataset:
void nobits(long long x, int *y) {
  (*y)++;
  if (x == 0) {
    *y = 0;
    return;
  }
  if (x == 1)
    return;
  nobits(x / 2, y);
}


x86 assembly (clang, -O0):
<nobits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <nobits+0x35>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    116f <nobits+0x5f>
cmpq   $0x1,-0x8(%rbp)
jne    1155 <nobits+0x45>
jmp    116f <nobits+0x5f>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <nobits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nobits>:
mov    (%rsi),%eax
add    $0x1,%eax
test   %rdi,%rdi
je     112e <nobits+0x2e>
nopw   0x0(%rax,%rax,1)
cmp    $0x1,%rdi
je     1130 <nobits+0x30>
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
sar    %rcx
add    $0x1,%eax
mov    %rcx,%rdi
test   %rdi,%rdi
jne    1110 <nobits+0x10>
xor    %eax,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @nobits(i64 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
br label %4
4: ; preds = %8, %2
%5 = phi i32 [ %3, %2 ], [ %7, %8 ]
%6 = phi i64 [ %0, %2 ], [ %9, %8 ]
%7 = add nsw i32 %5, 1
switch i64 %6, label %8 [
i64 0, label %11
i64 1, label %10
]
8: ; preds = %4
%9 = sdiv i64 %6, 2
br label %4
10: ; preds = %4
br label %11
11: ; preds = %4, %10
%12 = phi i32 [ %7, %10 ], [ 0, %4 ]
store i32 %12, i32* %1
ret void
}
/* Variables and functions */
int fun_3(int, int);
int main() { return fun_3(5, 6); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x6,%esi
jmp    1030 <fun_3@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fun_3(i32 5, i32 6)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sgen(char *, char *, char *);
void cgldga(char *s) { sgen("%s\t$%s,%%eax", "movl", s); }


x86 assembly (clang, -O0):
<cgldga>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <sgen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgldga>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <sgen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09$%s,%%eax\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgldga(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sgen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09$%s,%%eax\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgldga(i8* %0) {
%2 = tail call i32 @sgen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_2Aint64_highword_reg(long long val) {
  return ((val >> 32) & (0x2A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Aint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x2a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Aint64_highword_reg>:
movabs $0x2a00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Aint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 42
%6 = icmp ne i64 %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_2Aint64_highword_reg(i64 %0) {
%2 = and i64 %0, 180388626432
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t calculate_index(size_t bucketCount, int hash) {
  return ((size_t)hash) & (bucketCount - 1);
}


x86 assembly (clang, -O0):
<calculate_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_index>:
movslq %esi,%rcx
lea    -0x1(%rdi),%rax
and    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @calculate_index(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = load i64, i64* %3
%8 = sub i64 %7, 1
%9 = and i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @calculate_index(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = add i64 %0, -1
%5 = and i64 %4, %3
ret i64 %5
}
/* Variables and functions */
scalar_t__ AddrSpac_Init();
int /*<<< orphan*/ EmulatedHardwareZap();
scalar_t__ ROM_Init();
scalar_t__ RTC_Init();
int InitEmulation(void) {
  if (RTC_Init())
    if (ROM_Init())
      if (AddrSpac_Init()) {
        EmulatedHardwareZap();
        return 1;
      }
  return 0;
}


x86 assembly (clang, -O0):
<InitEmulation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <RTC_Init@plt>
cmp    $0x0,%rax
je     1198 <InitEmulation+0x58>
mov    $0x0,%al
call   1060 <ROM_Init@plt>
cmp    $0x0,%rax
je     1193 <InitEmulation+0x53>
mov    $0x0,%al
call   1040 <AddrSpac_Init@plt>
cmp    $0x0,%rax
je     118e <InitEmulation+0x4e>
mov    $0x0,%al
call   1050 <EmulatedHardwareZap@plt>
movl   $0x1,-0x4(%rbp)
jmp    119f <InitEmulation+0x5f>
jmp    1193 <InitEmulation+0x53>
jmp    1198 <InitEmulation+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitEmulation>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <RTC_Init@plt>
test   %rax,%rax
je     1177 <InitEmulation+0x37>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <ROM_Init@plt>
test   %rax,%rax
je     1177 <InitEmulation+0x37>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <AddrSpac_Init@plt>
test   %rax,%rax
je     1177 <InitEmulation+0x37>
xor    %eax,%eax
call   1050 <EmulatedHardwareZap@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @InitEmulation() {
%1 = tail call i64 (...) @RTC_Init()
%2 = icmp eq i64 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0
%4 = tail call i64 (...) @ROM_Init()
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i64 (...) @AddrSpac_Init()
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 (...) @EmulatedHardwareZap()
br label %11
11: ; preds = %0, %6, %3, %9
%12 = phi i32 [ 1, %9 ], [ 0, %3 ], [ 0, %6 ], [ 0, %0 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ isdigit(char const);
char tolower(char const);
char from_hex(const char ch) {
  return isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10;
}


x86 assembly (clang, -O0):
<from_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1150 <from_hex+0x30>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <from_hex+0x45>
movsbl -0x1(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_hex>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1132 <from_hex+0x12>
lea    -0x30(%rbx),%eax
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <tolower@plt>
add    $0xa9,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @from_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %16
10: ; preds = %1
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 10
br label %16
16: ; preds = %10, %6
%17 = phi i32 [ %9, %6 ], [ %15, %10 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @from_hex(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add i8 %0, -48
br label %9
6: ; preds = %1
%7 = tail call signext i8 @tolower(i8 signext %0)
%8 = add i8 %7, -87
br label %9
9: ; preds = %6, %4
%10 = phi i8 [ %5, %4 ], [ %8, %6 ]
ret i8 %10
}
void gtk_font_button_get_show_size() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_button_get_show_size() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zero0(float *, int);
void zero(float *rho, float *v[3], int n) {
  enum { X, Y, Z };
  zero0(rho, n);
  zero0(v[X], n);
  zero0(v[Y], n);
  zero0(v[Z], n);
}


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <zero0@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
call   1030 <zero0@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x14(%rbp),%esi
call   1030 <zero0@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x14(%rbp),%esi
call   1030 <zero0@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edx,%esi
call   1030 <zero0@plt>
mov    (%r14),%rdi
mov    %ebx,%esi
call   1030 <zero0@plt>
mov    0x8(%r14),%rdi
mov    %ebx,%esi
call   1030 <zero0@plt>
mov    0x10(%r14),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <zero0@plt>

LLVM IR (-O0):
define void @zero(float* %0, float** %1, i32 %2) {
%4 = alloca float*
%5 = alloca float**
%6 = alloca i32
store float* %0, float** %4
store float** %1, float*** %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load i32, i32* %6
%9 = call i32 @zero0(float* %7, i32 %8)
%10 = load float**, float*** %5
%11 = getelementptr inbounds float*, float** %10, i64 0
%12 = load float*, float** %11
%13 = load i32, i32* %6
%14 = call i32 @zero0(float* %12, i32 %13)
%15 = load float**, float*** %5
%16 = getelementptr inbounds float*, float** %15, i64 1
%17 = load float*, float** %16
%18 = load i32, i32* %6
%19 = call i32 @zero0(float* %17, i32 %18)
%20 = load float**, float*** %5
%21 = getelementptr inbounds float*, float** %20, i64 2
%22 = load float*, float** %21
%23 = load i32, i32* %6
%24 = call i32 @zero0(float* %22, i32 %23)
ret void
}

LLVM IR (-O2):
define void @zero(float* %0, float** nocapture %1, i32 %2) {
%4 = tail call i32 @zero0(float* %0, i32 %2)
%5 = load float*, float** %1
%6 = tail call i32 @zero0(float* %5, i32 %2)
%7 = getelementptr inbounds float*, float** %1, i64 1
%8 = load float*, float** %7
%9 = tail call i32 @zero0(float* %8, i32 %2)
%10 = getelementptr inbounds float*, float** %1, i64 2
%11 = load float*, float** %10
%12 = tail call i32 @zero0(float* %11, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glColor4f(float, float, float, float);
void Color4f(float r, float g, float b, float a) { glColor4f(r, g, b, a); }


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

x86 assembly (clang, -O2):
<Color4f>:
jmp    1030 <glColor4f@plt>

LLVM IR (-O0):
define void @Color4f(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
%13 = call i32 @glColor4f(float %9, float %10, float %11, float %12)
ret void
}

LLVM IR (-O2):
define void @Color4f(float %0, float %1, float %2, float %3) {
%5 = tail call i32 @glColor4f(float %0, float %1, float %2, float %3)
ret void
}
void gtk_entry_completion_get_popup_completion() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_completion_get_popup_completion() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void sigchld(int sig) {
  signal(SIGCHLD, sigchld);
  wait(NULL);
}


x86 assembly (clang, -O0):
<sigchld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2e95(%rip),%rsi
call   1030 <signal@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rsi
call   1030 <signal@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <wait@plt>

LLVM IR (-O0):
@SIGCHLD = global i32 0
define void @sigchld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGCHLD
%4 = call i32 @signal(i32 %3, void (i32)* @sigchld)
%5 = call i32 @wait(i32* null)
ret void
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
define void @sigchld(i32 %0) {
%2 = load i32, i32* @SIGCHLD
%3 = tail call i32 @signal(i32 %2, void (i32)* @sigchld)
%4 = tail call i32 @wait(i32* null)
ret void
}
/* Variables and functions */
int rand01();
int randrange(int start, int end) {
  return (int)(rand01() * (end - start) + start);
}


x86 assembly (clang, -O0):
<randrange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand01@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
imul   %ecx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randrange>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand01@plt>
sub    %ebp,%ebx
imul   %ebx,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randrange(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand01()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = mul nsw i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @randrange(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand01()
%4 = sub nsw i32 %1, %0
%5 = mul nsw i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ disp_color_str(char *, int);
int /*<<< orphan*/ disp_int(int /*<<< orphan*/);
int /*<<< orphan*/ get_ticks();
int /*<<< orphan*/ milli_delay(int);
void TestB() {
  int i = 0x1000;
  while (1) {
    disp_color_str("B.", 0x08 | (0x0 | 0x4));
    disp_int(get_ticks());
    milli_delay(200);
  }
}


x86 assembly (clang, -O0):
<TestB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1000,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0xc,%esi
call   1030 <disp_color_str@plt>
mov    $0x0,%al
call   1040 <get_ticks@plt>
mov    %eax,%edi
call   1060 <disp_int@plt>
mov    $0xc8,%edi
call   1050 <milli_delay@plt>
jmp    114f <TestB+0xf>

x86 assembly (clang, -O2):
<TestB>:
push   %rbx
lea    0xeb8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <disp_color_str@plt>
xor    %eax,%eax
call   1040 <get_ticks@plt>
mov    %eax,%edi
call   1060 <disp_int@plt>
mov    $0xc8,%edi
call   1050 <milli_delay@plt>
jmp    1150 <TestB+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"B.\00"
define void @TestB() {
%1 = alloca i32
store i32 4096, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @disp_color_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 12)
%4 = call i32 (...) @get_ticks()
%5 = call i32 @disp_int(i32 %4)
%6 = call i32 @milli_delay(i32 200)
br label %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"B.\00"
define void @TestB() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @disp_color_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = tail call i32 (...) @get_ticks()
%4 = tail call i32 @disp_int(i32 %3)
%5 = tail call i32 @milli_delay(i32 200)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int boundary(unsigned int, size_t, int);
int /*<<< orphan*/ convert(unsigned long, unsigned int, char *, size_t);
int ultostr(unsigned long value, unsigned int base, char *converted,
            size_t size) {
  int i;
  if ((i = boundary(base, size, sizeof(value))))
    return i;
  convert(value, base, &(converted[0]), size);
  return 0;
}


x86 assembly (clang, -O0):
<ultostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    $0x8,%edx
call   1040 <boundary@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
je     115f <ultostr+0x3f>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <ultostr+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <convert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ultostr>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r12
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%r15
mov    %esi,%edi
mov    %rcx,%rsi
mov    $0x8,%edx
call   1040 <boundary@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1158 <ultostr+0x38>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %r12,%rcx
call   1030 <convert@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ultostr(i64 %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i32 @boundary(i32 %1, i64 %3, i32 8)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @convert(i64 %0, i32 %1, i8* %2, i64 %3)
br label %9
9: ; preds = %4, %7
ret i32 %5
}
/* Variables and functions */
int pigpio_command(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int wave_clear(int pi) { return pigpio_command(pi, 27, 0, 0, 1); }


x86 assembly (clang, -O0):
<wave_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1b,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%edx
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_clear>:
mov    $0x1b,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @wave_clear(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 27, i32 0, i32 0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ findProductExSelf();
int main() { findProductExSelf(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @findProductExSelf()
ret i32 0
}
/* Variables and functions */
float _exp2f(float);
float exp2f(float x) { return _exp2f(x); }


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

x86 assembly (clang, -O2):
<exp2f>:
jmp    1030 <_exp2f@plt>

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

LLVM IR (-O2):
define float @exp2f(float %0) {
%2 = tail call float @_exp2f(float %0)
ret float %2
}
/* Variables and functions */
float __nv_fast_powf(float, float);
float __powf(float __a, float __b) { return __nv_fast_powf(__a, __b); }


x86 assembly (clang, -O0):
<__powf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__nv_fast_powf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__powf>:
jmp    1030 <__nv_fast_powf@plt>

LLVM IR (-O0):
define float @__powf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__nv_fast_powf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__powf(float %0, float %1) {
%3 = tail call float @__nv_fast_powf(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
scalar_t__ sysconf(int /*<<< orphan*/);
void *arena_start(void *p, size_t page_size) {
  if (!page_size)
    page_size = (size_t)sysconf(_SC_PAGESIZE);
  return (void *)((size_t)p / page_size * page_size);
}


x86 assembly (clang, -O0):
<arena_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113d <arena_start+0x2d>
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
imul   -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arena_start>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
jne    112a <arena_start+0x1a>
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,%rsi
mov    %rbx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1140 <arena_start+0x30>
mov    %rbx,%rax
xor    %edx,%edx
div    %rsi
jmp    1146 <arena_start+0x36>
mov    %ebx,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i8* @arena_start(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @_SC_PAGESIZE
%6 = tail call i64 @sysconf(i32 %5)
br label %7
7: ; preds = %4, %2
%8 = phi i64 [ %1, %2 ], [ %6, %4 ]
%9 = ptrtoint i8* %0 to i64
%10 = urem i64 %9, %8
%11 = sub i64 %9, %10
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int chmod(const char *pathname, mode_t mode) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<chmod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmod>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @chmod(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @chmod(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ endmntent(int /*<<< orphan*/ *);
void iterator_end(FILE **fp) {
  endmntent(*fp);
  *fp = NULL;
}


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

x86 assembly (clang, -O2):
<iterator_end>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <endmntent@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @iterator_end(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = call i32 @endmntent(i32* %4)
%6 = load i32**, i32*** %2
store i32* null, i32** %6
ret void
}

LLVM IR (-O2):
define void @iterator_end(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = tail call i32 @endmntent(i32* %2)
store i32* null, i32** %0
ret void
}
void foo(int ***pppa) {
  pppa += 1;
  pppa = pppa - 1;
  *pppa = *pppa + 1;
  *pppa -= 1;
  **pppa = **pppa + 1;
  **pppa -= 1;
  ***pppa = 23;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movl   $0x17,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%rax
addq   $0x4,(%rax)
mov    (%rdi),%rax
addq   $0xfffffffffffffffc,(%rax)
mov    (%rdi),%rax
mov    (%rax),%rax
movl   $0x17,(%rax)
ret

LLVM IR (-O0):
define void @foo(i32*** %0) {
%2 = alloca i32***
store i32*** %0, i32**** %2
%3 = load i32***, i32**** %2
%4 = getelementptr inbounds i32**, i32*** %3, i64 1
store i32*** %4, i32**** %2
%5 = load i32***, i32**** %2
%6 = getelementptr inbounds i32**, i32*** %5, i64 -1
store i32*** %6, i32**** %2
%7 = load i32***, i32**** %2
%8 = load i32**, i32*** %7
%9 = getelementptr inbounds i32*, i32** %8, i64 1
%10 = load i32***, i32**** %2
store i32** %9, i32*** %10
%11 = load i32***, i32**** %2
%12 = load i32**, i32*** %11
%13 = getelementptr inbounds i32*, i32** %12, i64 -1
store i32** %13, i32*** %11
%14 = load i32***, i32**** %2
%15 = load i32**, i32*** %14
%16 = load i32*, i32** %15
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32***, i32**** %2
%19 = load i32**, i32*** %18
store i32* %17, i32** %19
%20 = load i32***, i32**** %2
%21 = load i32**, i32*** %20
%22 = load i32*, i32** %21
%23 = getelementptr inbounds i32, i32* %22, i64 -1
store i32* %23, i32** %21
%24 = load i32***, i32**** %2
%25 = load i32**, i32*** %24
%26 = load i32*, i32** %25
store i32 23, i32* %26
ret void
}

LLVM IR (-O2):
define void @foo(i32*** nocapture %0) {
%2 = load i32**, i32*** %0
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32* %4, i32** %2
%5 = load i32**, i32*** %0
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 -1
store i32* %7, i32** %5
%8 = load i32**, i32*** %0
%9 = load i32*, i32** %8
store i32 23, i32* %9
ret void
}
/* Variables and functions */
scalar_t__ SupportsAvx2();
int /*<<< orphan*/ printf(char *);
int main() {
  if (SupportsAvx2())
    printf("Yes\n");
  else
    printf("No\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 <SupportsAvx2@plt>
cmp    $0x0,%rax
je     1151 <main+0x31>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <main+0x3d>
lea    0xead(%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 <SupportsAvx2@plt>
test   %rax,%rax
lea    0xece(%rip),%rax
lea    0xeca(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Yes\0A\00"
@.str.1 = [4 x i8] c"No\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @SupportsAvx2()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"No\00"
@str.2 = [4 x i8] c"Yes\00"
define i32 @main() {
%1 = tail call i64 (...) @SupportsAvx2()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
size_t znload_int(void *, size_t, int /*<<< orphan*/ *, int);
size_t znload_i32(void *__restrict dst, size_t sz, int32_t x) {
  return znload_int(dst, sz, &x, sizeof(x));
}


x86 assembly (clang, -O0):
<znload_i32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <znload_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<znload_i32>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
call   1030 <znload_int@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @znload_i32(i8* noalias %0, i64 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i64 @znload_int(i8* %0, i64 %1, i32* %4, i32 4)
ret i64 %5
}
void set_signals(void) {}


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

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

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

LLVM IR (-O2):
define void @set_signals() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x = 30, y = 20, z = 10;
  if (y > x || y > z)
    printf("y: %d is greater than x: %d or y: %d is greater than z: %d", y, x,
           y, z);
  else
    printf("expression return false");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1e,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114c <main+0x3c>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    116c <main+0x5c>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117a <main+0x6a>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x14,%esi
mov    $0x1e,%edx
mov    $0x14,%ecx
mov    $0xa,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [59 x i8] c"y: %d is greater than x: %d or y: %d is greater than z: %d\00"
@.str.1 = [24 x i8] c"expression return false\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 30, i32* %2
store i32 20, i32* %3
store i32 10, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp sgt i32 %5, %6
br i1 %7, label %12, label %8
8: ; preds = %0
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %8, %0
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15, i32 %16)
br label %20
18: ; preds = %8
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [59 x i8] c"y: %d is greater than x: %d or y: %d is greater than z: %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 20, i32 30, i32 20, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ z80_ed_56_im_1();
void z80_ed_76_im_1(void) { z80_ed_56_im_1(); }


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

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

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

LLVM IR (-O2):
define void @z80_ed_76_im_1() {
%1 = tail call i32 (...) @z80_ed_56_im_1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ckd_free_2da(void **ptr) {
  {
    free(*(ptr + 0));
    free((void *)ptr);
    return;
  }
}


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

x86 assembly (clang, -O2):
<ckd_free_2da>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ckd_free_2da(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
%4 = bitcast i8** %0 to i8*
%5 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
ranek() { printf("Rano wstan!\n"); }


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

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

LLVM IR (-O2):
@str = [12 x i8] c"Rano wstan!\00"
define i32 @ranek() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_E2int32_reg(int val) { return ((val) & (0xE2 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_E2int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xe2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E2int32_reg>:
test   $0xe2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E2int32_reg(i32 %0) {
%2 = and i32 %0, 226
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int factorial(int, int);
int main(int argc, char **argv) { return factorial(1, argc); }


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)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1030 <factorial@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = call i32 @factorial(i32 1, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @factorial(i32 1, i32 %0)
ret i32 %3
}
/* Variables and functions */
int istrsenvisx(char *, size_t *, char const *, int /*<<< orphan*/, int, char *,
                int /*<<< orphan*/ *);
int strnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags) {
  return istrsenvisx(mbdst, &dlen, mbsrc, 0, flags, "", NULL);
}


x86 assembly (clang, -O0):
<strnvis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r8d
lea    -0x10(%rbp),%rsi
xor    %ecx,%ecx
lea    0xec0(%rip),%r9
xor    %eax,%eax
movq   $0x0,(%rsp)
call   1030 <istrsenvisx@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnvis>:
sub    $0x18,%rsp
mov    %ecx,%r8d
mov    %rsi,0x10(%rsp)
movq   $0x0,(%rsp)
lea    0xed5(%rip),%r9
lea    0x10(%rsp),%rsi
xor    %ecx,%ecx
call   1030 <istrsenvisx@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @strnvis(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @istrsenvisx(i8* %9, i64* %6, i8* %10, i32 0, i32 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 %12
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @strnvis(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i64
store i64 %1, i64* %5
%6 = call i32 @istrsenvisx(i8* %0, i64* %5, i8* %2, i32 0, i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ buddy_init();
int /*<<< orphan*/ slab_cache_init();
void page_init(void) {
  buddy_init();
  slab_cache_init();
}


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

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

LLVM IR (-O0):
define void @page_init() {
%1 = call i32 (...) @buddy_init()
%2 = call i32 (...) @slab_cache_init()
ret void
}

LLVM IR (-O2):
define void @page_init() {
%1 = tail call i32 (...) @buddy_init()
%2 = tail call i32 (...) @slab_cache_init()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ get_pc();
uint32_t dbg_get_instr_addr() { return get_pc(); }


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

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

LLVM IR (-O0):
define i32 @dbg_get_instr_addr() {
%1 = call i32 (...) @get_pc()
ret i32 %1
}

LLVM IR (-O2):
define i32 @dbg_get_instr_addr() {
%1 = tail call i32 (...) @get_pc()
ret i32 %1
}
/* Type definitions */
typedef void state;

/* Variables and functions */
void mark_state_invalid(void **ptrs, int idx) {
  struct state *st = ptrs[idx];
  ptrs[idx] = (struct state *)((uintptr_t)st | 1);
}


x86 assembly (clang, -O0):
<mark_state_invalid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
or     $0x1,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark_state_invalid>:
movslq %esi,%rax
orb    $0x1,(%rdi,%rax,8)
ret

LLVM IR (-O0):
%struct.state = type opaque
define void @mark_state_invalid(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca %struct.state*
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i8**, i8*** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %6, i64 %8
%10 = load i8*, i8** %9
%11 = bitcast i8* %10 to %struct.state*
store %struct.state* %11, %struct.state** %5
%12 = load %struct.state*, %struct.state** %5
%13 = ptrtoint %struct.state* %12 to i64
%14 = or i64 %13, 1
%15 = inttoptr i64 %14 to %struct.state*
%16 = bitcast %struct.state* %15 to i8*
%17 = load i8**, i8*** %3
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
store i8* %16, i8** %20
ret void
}

LLVM IR (-O2):
%struct.state = type opaque
define void @mark_state_invalid(i8** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = bitcast i8** %4 to %struct.state**
%6 = load %struct.state*, %struct.state** %5
%7 = ptrtoint %struct.state* %6 to i64
%8 = or i64 %7, 1
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
int /*<<< orphan*/ motion_direction(int);
int /*<<< orphan*/ speed_control(unsigned int, unsigned int);
void circular_backward(unsigned int l_speed, unsigned int r_speed) {
  motion_direction(0b00001001);
  speed_control(l_speed, r_speed);
  _delay_us(10);
}


x86 assembly (clang, -O0):
<circular_backward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x9,%edi
call   1030 <motion_direction@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <speed_control@plt>
mov    $0xa,%edi
call   1040 <_delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circular_backward>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x9,%edi
call   1030 <motion_direction@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <speed_control@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_delay_us@plt>

LLVM IR (-O0):
define void @circular_backward(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @motion_direction(i32 9)
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @speed_control(i32 %6, i32 %7)
%9 = call i32 @_delay_us(i32 10)
ret void
}

LLVM IR (-O2):
define void @circular_backward(i32 %0, i32 %1) {
%3 = tail call i32 @motion_direction(i32 9)
%4 = tail call i32 @speed_control(i32 %0, i32 %1)
%5 = tail call i32 @_delay_us(i32 10)
ret void
}