xunge/DecIR huggingface dataset:
/* Variables and functions */
double asinh(double);
double fabs(double);
double kernel_indefinite(double x, double y) {
  return fabs(x) * asinh(y / x) + fabs(y) * asinh(x / y);
}


x86 assembly (clang, -O0):
<kernel_indefinite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xed2(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <asinh@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xea9(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <asinh@plt>
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_indefinite>:
sub    $0x58,%rsp
movapd %xmm1,0x20(%rsp)
movapd %xmm0,%xmm2
movapd %xmm0,0x30(%rsp)
movapd 0xed4(%rip),%xmm3
movapd %xmm3,(%rsp)
andpd  %xmm3,%xmm0
movapd %xmm0,0x40(%rsp)
movapd %xmm1,%xmm0
divsd  %xmm2,%xmm0
call   1030 <asinh@plt>
movsd  %xmm0,0x18(%rsp)
movapd (%rsp),%xmm0
movapd 0x20(%rsp),%xmm1
andpd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
movapd 0x30(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <asinh@plt>
mulsd  (%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  0x40(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
define double @kernel_indefinite(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @llvm.fabs.f64(double %5)
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fdiv double %7, %8
%10 = call double @asinh(double %9)
%11 = load double, double* %4
%12 = call double @llvm.fabs.f64(double %11)
%13 = load double, double* %3
%14 = load double, double* %4
%15 = fdiv double %13, %14
%16 = call double @asinh(double %15)
%17 = fmul double %12, %16
%18 = call double @llvm.fmuladd.f64(double %6, double %10, double %17)
ret double %18
}

LLVM IR (-O2):
define double @kernel_indefinite(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = fdiv double %1, %0
%5 = tail call double @asinh(double %4)
%6 = tail call double @llvm.fabs.f64(double %1)
%7 = fdiv double %0, %1
%8 = tail call double @asinh(double %7)
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %5, double %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ test_forth_comment_entities();
void all_forth_tests() { test_forth_comment_entities(); }


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

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

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

LLVM IR (-O2):
define void @all_forth_tests() {
%1 = tail call i32 (...) @test_forth_comment_entities()
ret void
}
void app_path(char *path, unsigned int path_size, const char *path_append) {}


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

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

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

LLVM IR (-O2):
define void @app_path(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
int str_map(char ch, int *p_str_bmap, int len) {
  int index = (int)ch;
  if (p_str_bmap[index]) {
    return 1;
  }
  p_str_bmap[index] = 1;
  return 0;
}


x86 assembly (clang, -O0):
<str_map>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1136 <str_map+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114c <str_map+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_map>:
movslq %edi,%rcx
mov    $0x1,%eax
cmpl   $0x0,(%rsi,%rcx,4)
je     110f <str_map+0xf>
ret
movl   $0x1,(%rsi,%rcx,4)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_map(i8 signext %0, i32* nocapture %1, i32 %2) {
%4 = sext i8 %0 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
store i32 1, i32* %5
br label %9
9: ; preds = %3, %8
%10 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int runSupAssertTests();
int runSupFileServiceTests();
int BRRunSupTests(void) {
  printf("==== SUP\n");
  int success = 1;
  success &= runSupFileServiceTests();
  success &= runSupAssertTests();
  return success;
}


x86 assembly (clang, -O0):
<BRRunSupTests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <runSupFileServiceTests@plt>
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <runSupAssertTests@plt>
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BRRunSupTests>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <runSupFileServiceTests@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <runSupAssertTests@plt>
and    %ebx,%eax
and    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [9 x i8] c"==== SUP\00"
define i32 @BRRunSupTests() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @runSupFileServiceTests()
%3 = and i32 %2, 1
%4 = tail call i32 (...) @runSupAssertTests()
%5 = and i32 %3, %4
ret i32 %5
}
/* Variables and functions */
char *countAndSay(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *ret = countAndSay(30);
  printf("%s\n", ret);
  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)
mov    $0x1e,%edi
call   1040 <countAndSay@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1e,%edi
call   1040 <countAndSay@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @countAndSay(i32 30)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int msm_fsusb_rpc_close(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @msm_fsusb_rpc_close() {
ret i32 0
}

LLVM IR (-O2):
define i32 @msm_fsusb_rpc_close() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Bin2Dec(char *, char *);
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char *argv[]) {
  char s[64] = "";
  Bin2Dec(argv[1], s);
  printf("<%s>2 = <%s>10 \n", argv[1], s);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    0x8(%rsi),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1040 <Bin2Dec@plt>
mov    0x8(%rbx),%rsi
lea    0xea6(%rip),%rdi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"<%s>2 = <%s>10 \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [64 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [64 x i8]* %6 to i8*
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%12 = call i32 @Bin2Dec(i8* %10, i8* %11)
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16)
%18 = load i32, i32* @EXIT_SUCCESS
ret i32 %18
}

LLVM IR (-O2):
@.str = [17 x i8] c"<%s>2 = <%s>10 \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @Bin2Dec(i8* %6, i8* %4)
%8 = load i8*, i8** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %4)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
/* Type definitions */
struct gpio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gpio_mode(struct gpio *, int, int);
void gpio_c_input(int bit) { gpio_mode((struct gpio *)0x40011000, bit, 0x4); }


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

x86 assembly (clang, -O2):
<gpio_c_input>:
mov    %edi,%esi
mov    $0x40011000,%edi
mov    $0x4,%edx
jmp    1030 <gpio_mode@plt>

LLVM IR (-O0):
%struct.gpio = type { i32 }
define void @gpio_c_input(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073811456 to %struct.gpio*), i32 %3, i32 4)
ret void
}

LLVM IR (-O2):
%struct.gpio = type { i32 }
define void @gpio_c_input(i32 %0) {
%2 = tail call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073811456 to %struct.gpio*), i32 %0, i32 4)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *calloc(size_t n1, size_t n2) { return malloc(n1 * n2); }


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

x86 assembly (clang, -O2):
<calloc>:
imul   %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @calloc(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 = mul i64 %5, %6
%8 = call i8* @malloc(i64 %7)
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
ret i8* %4
}
void jg1() {}


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

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

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

LLVM IR (-O2):
define void @jg1() {
ret void
}
int countDigits(long a) {
  int count = 0;
  while (a) {
    a /= 10;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<countDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <countDigits+0x3a>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <countDigits+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigits>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     1144 <countDigits+0x44>
movabs $0x6666666666666667,%rsi
66 66 66
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
imul   %rsi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    $0x1,%ecx
add    $0x9,%rdi
cmp    $0x12,%rdi
mov    %rdx,%rdi
ja     1120 <countDigits+0x20>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @countDigits(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i64, i64* %2
%9 = sdiv i64 %8, 10
store i64 %9, i64* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @countDigits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i64 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i64 %5, 9
%9 = icmp ult i64 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushNumber(int);
void basBitwiseOr() {
  int a, b;
  a = popNumber();
  b = popNumber();
  pushNumber(a | b);
}


x86 assembly (clang, -O0):
<basBitwiseOr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <popNumber@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
or     -0x8(%rbp),%edi
call   1030 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basBitwiseOr>:
push   %rbx
xor    %eax,%eax
call   1040 <popNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <popNumber@plt>
or     %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <pushNumber@plt>

LLVM IR (-O0):
define void @basBitwiseOr() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @popNumber()
store i32 %3, i32* %1
%4 = call i32 (...) @popNumber()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = or i32 %5, %6
%8 = call i32 @pushNumber(i32 %7)
ret void
}

LLVM IR (-O2):
define void @basBitwiseOr() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 (...) @popNumber()
%3 = or i32 %2, %1
%4 = tail call i32 @pushNumber(i32 %3)
ret void
}
void mlx5_sf_driver_unregister(void) {}


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

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

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

LLVM IR (-O2):
define void @mlx5_sf_driver_unregister() {
ret void
}
int check_expr() { return (0); }


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

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

LLVM IR (-O0):
define i32 @check_expr() {
ret i32 0
}

LLVM IR (-O2):
define i32 @check_expr() {
ret i32 0
}
int main(void) {
  int ten = 10, twenty = 20;
  return (ten != ten) + (twenty != twenty) + (twenty != ten);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0xc(%rbp),%ecx
cmp    -0xc(%rbp),%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %4, %5
%7 = zext i1 %6 to i32
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = icmp ne i32 %8, %9
%11 = zext i1 %10 to i32
%12 = add nsw i32 %7, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp ne i32 %13, %14
%16 = zext i1 %15 to i32
%17 = add nsw i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned long long *);
void free_arr(unsigned long long int *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @free_arr(i64* nocapture %0) {
%2 = tail call i32 @free(i64* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ block();
int /*<<< orphan*/ emitln(char *);
int /*<<< orphan*/ matchString(char *);
void doProgram() {
  block();
  matchString("END");
  emitln("END");
}


x86 assembly (clang, -O0):
<doProgram>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <block@plt>
lea    0xebe(%rip),%rdi
call   1050 <matchString@plt>
lea    0xeb2(%rip),%rdi
call   1030 <emitln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doProgram>:
push   %rbx
xor    %eax,%eax
call   1040 <block@plt>
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
call   1050 <matchString@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"END\00"
define void @doProgram() {
%1 = call i32 (...) @block()
%2 = call i32 @matchString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @emitln(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"END\00"
define void @doProgram() {
%1 = tail call i32 (...) @block()
%2 = tail call i32 @matchString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\n\nHello! I am Destructor.\nI will kill you!\nha ha ha\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@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 = [54 x i8] c"\0A\0AHello! I am Destructor.\0AI will kill you!\0Aha ha ha\0A\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [53 x i8] c"\0A\0AHello! I am Destructor.\0AI will kill you!\0Aha ha ha\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int is_optchar(c)
char c;
{
  if (((c) >= 'A' && (c) <= 'Z'))
    return 1;
  if (((c) >= 'a' && (c) <= 'z'))
    return 1;
  if (c == '-')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_optchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1130 <is_optchar+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1130 <is_optchar+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1176 <is_optchar+0x76>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1156 <is_optchar+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1156 <is_optchar+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1176 <is_optchar+0x76>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    116f <is_optchar+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    1176 <is_optchar+0x76>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_optchar>:
shl    $0x18,%edi
mov    %edi,%eax
and    $0xdf000000,%eax
add    $0xbfffffff,%eax
cmp    $0x1affffff,%eax
setb   %al
cmp    $0x2d000000,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_optchar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 65
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 90
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %28
13: ; preds = %8, %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 122
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 1, i32* %2
br label %28
22: ; preds = %17, %13
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 45
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 1, i32* %2
br label %28
27: ; preds = %22
store i32 0, i32* %2
br label %28
28: ; preds = %27, %26, %21, %12
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @is_optchar(i32 %0) {
%2 = shl i32 %0, 24
%3 = and i32 %2, -553648128
%4 = add i32 %3, -1073741825
%5 = icmp ult i32 %4, 452984831
%6 = icmp eq i32 %2, 754974720
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
void foo_low(void) {
  asm("foo_low_label: .globl foo_low_label");
  baz();
  asm("foo_low_label2: .globl foo_low_label2");
}


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

x86 assembly (clang, -O2):
<foo_low>:
push   %rax

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

LLVM IR (-O2):
define void @foo_low() {
tail call void asm sideeffect "foo_low_label: .globl foo_low_label", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @baz()
tail call void asm sideeffect "foo_low_label2: .globl foo_low_label2", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qbyte(char);
int /*<<< orphan*/ qhexdigit(char);
void qhex(char c) {
  qbyte('<');
  qhexdigit(c >> 4);
  qhexdigit(c);
  qbyte('>');
}


x86 assembly (clang, -O0):
<qhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3c,%edi
call   1030 <qbyte@plt>
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
movsbl %al,%edi
call   1040 <qhexdigit@plt>
movsbl -0x1(%rbp),%edi
call   1040 <qhexdigit@plt>
mov    $0x3e,%edi
call   1030 <qbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qhex>:
push   %rbx
mov    %edi,%ebx
mov    $0x3c,%edi
call   1030 <qbyte@plt>
mov    %ebx,%eax
sar    $0x4,%al
movsbl %al,%edi
call   1040 <qhexdigit@plt>
mov    %ebx,%edi
call   1040 <qhexdigit@plt>
mov    $0x3e,%edi
pop    %rbx
jmp    1030 <qbyte@plt>

LLVM IR (-O0):
define void @qhex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @qbyte(i8 signext 60)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = ashr i32 %5, 4
%7 = trunc i32 %6 to i8
%8 = call i32 @qhexdigit(i8 signext %7)
%9 = load i8, i8* %2
%10 = call i32 @qhexdigit(i8 signext %9)
%11 = call i32 @qbyte(i8 signext 62)
ret void
}

LLVM IR (-O2):
define void @qhex(i8 signext %0) {
%2 = tail call i32 @qbyte(i8 signext 60)
%3 = ashr i8 %0, 4
%4 = tail call i32 @qhexdigit(i8 signext %3)
%5 = tail call i32 @qhexdigit(i8 signext %0)
%6 = tail call i32 @qbyte(i8 signext 62)
ret void
}
__attribute__((naked)) void bar(void) {
  asm("xorl %eax, %eax\n\t"
      "xorl %edx, %edx\n\t"
      "xorl %ecx, %ecx\n\t"
      "xorl %esi, %esi\n\t"
      "xorl %edi, %edi\n\t"
      "xorl %r8d, %r8d\n\t"
      "xorl %r9d, %r9d\n\t"
      "xorl %r10d, %r10d\n\t"
      "xorl %r11d, %r11d\n\t"
      "ret");
}


x86 assembly (clang, -O0):
<bar>:
xor    %eax,%eax
xor    %edx,%edx
xor    %ecx,%ecx
xor    %esi,%esi
xor    %edi,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %r10d,%r10d
xor    %r11d,%r11d
ret

x86 assembly (clang, -O2):
<bar>:
xor    %eax,%eax
xor    %edx,%edx
xor    %ecx,%ecx
xor    %esi,%esi
xor    %edi,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %r10d,%r10d
xor    %r11d,%r11d
ret

LLVM IR (-O0):
define void @bar() {
unreachable
}

LLVM IR (-O2):
define void @bar() {
tail call void asm sideeffect "xorl %eax, %eax\0A\09xorl %edx, %edx\0A\09xorl %ecx, %ecx\0A\09xorl %esi, %esi\0A\09xorl %edi, %edi\0A\09xorl %r8d, %r8d\0A\09xorl %r9d, %r9d\0A\09xorl %r10d, %r10d\0A\09xorl %r11d, %r11d\0A\09ret", "~{dirflag},~{fpsr},~{flags}"()
unreachable
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ p;

/* Variables and functions */
uint32_t _sha256_be32dec(const void *pp) {
  const uint8_t *p = (uint8_t const *)pp;
  return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +
          ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24));
}


x86 assembly (clang, -O0):
<_sha256_be32dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sha256_be32dec>:
mov    0x10(%rdi),%ecx
shl    $0x8,%ecx
add    0x18(%rdi),%ecx
mov    (%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
add    %ecx,%edx
shl    $0x18,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @_sha256_be32dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 24
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds i8, i8* %0, i64 16
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = add nsw i32 %11, %6
%13 = getelementptr inbounds i8, i8* %0, i64 8
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 16
%18 = add nsw i32 %12, %17
%19 = load i64, i64* %2
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 24
%22 = add nsw i32 %18, %21
ret i32 %22
}
double radius_effective(int mode, double radius, double thickness) {
  return radius + thickness;
}


x86 assembly (clang, -O0):
<radius_effective>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_effective>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @radius_effective(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %6
%9 = fadd double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @radius_effective(i32 %0, double %1, double %2) {
%4 = fadd double %1, %2
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: integration -n <number> -t <number>\n"
         "Flags:\n"
         "\tn: number of steps\n"
         "\tt: number of threads"
         "\th: help (show this output)\n"
         "\t--help: same as -h\n");
}


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

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

LLVM IR (-O0):
@.str = [140 x i8] c"Usage: integration -n <number> -t <number>\0AFlags:\0A\09n: number of steps\0A\09t: number of threads\09h: help (show this output)\0A\09--help: same as -h\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [139 x i8] c"Usage: integration -n <number> -t <number>\0AFlags:\0A\09n: number of steps\0A\09t: number of threads\09h: help (show this output)\0A\09--help: same as -h\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([139 x i8], [139 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CMGR_finalize();
int /*<<< orphan*/ finalize_dl_handle();
int /*<<< orphan*/ handle_cache_finalize();
void posix_io_finalize(void) {
  CMGR_finalize();
  finalize_dl_handle();
  handle_cache_finalize();
  ;
}


x86 assembly (clang, -O0):
<posix_io_finalize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <CMGR_finalize@plt>
mov    $0x0,%al
call   1040 <finalize_dl_handle@plt>
mov    $0x0,%al
call   1030 <handle_cache_finalize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_io_finalize>:
push   %rax
xor    %eax,%eax
call   1050 <CMGR_finalize@plt>
xor    %eax,%eax
call   1040 <finalize_dl_handle@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <handle_cache_finalize@plt>

LLVM IR (-O0):
define void @posix_io_finalize() {
%1 = call i32 (...) @CMGR_finalize()
%2 = call i32 (...) @finalize_dl_handle()
%3 = call i32 (...) @handle_cache_finalize()
ret void
}

LLVM IR (-O2):
define void @posix_io_finalize() {
%1 = tail call i32 (...) @CMGR_finalize()
%2 = tail call i32 (...) @finalize_dl_handle()
%3 = tail call i32 (...) @handle_cache_finalize()
ret void
}
void replacestr(char *s, int a, int b) {
  for (; *s; s++)
    if (*s == a)
      *s = b;
}


x86 assembly (clang, -O0):
<replacestr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <replacestr+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1136 <replacestr+0x36>
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    113b <replacestr+0x3b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <replacestr+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<replacestr>:
mov    (%rdi),%al
test   %al,%al
je     1127 <replacestr+0x27>
add    $0x1,%rdi
jmp    111b <replacestr+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1127 <replacestr+0x27>
movsbl %al,%eax
cmp    %esi,%eax
jne    1110 <replacestr+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <replacestr+0x10>
ret

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

LLVM IR (-O2):
define void @replacestr(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %3
%7 = trunc i32 %2 to i8
br label %8
8: ; preds = %6, %14
%9 = phi i8 [ %4, %6 ], [ %16, %14 ]
%10 = phi i8* [ %0, %6 ], [ %15, %14 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %14
13: ; preds = %8
store i8 %7, i8* %10
br label %14
14: ; preds = %8, %13
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %14, %3
ret void
}
int netSend(char *src, int indexsrc, int lentosend, int lensrc, char *macdst,
            int inddst, int lendst, int speed) {}


x86 assembly (clang, -O0):
<netSend>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @netSend(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i8* %0, i8** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i8* %4, i8** %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
%18 = load i32, i32* %9
ret i32 %18
}

LLVM IR (-O2):
define i32 @netSend(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i32 %5, i32 %6, i32 %7) {
ret i32 undef
}
int test_imm_65int32_mem(int *val) {
  return ((*val) & (0x65 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_65int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 101
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t _upper_multiple(size_t v, size_t m) {
  register size_t mod = v % m;
  return v + ((0) ^ (((m - mod) ^ (0)) & -(mod != 0)));
}


x86 assembly (clang, -O0):
<_upper_multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    -0x18(%rbp),%rcx
xor    $0x0,%rcx
cmpq   $0x0,-0x18(%rbp)
setne  %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
movslq %edx,%rdx
and    %rdx,%rcx
xor    $0x0,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_upper_multiple>:
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1116 <_upper_multiple+0x16>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    111c <_upper_multiple+0x1c>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rsi
test   %rdx,%rdx
cmove  %rdx,%rsi
add    %rdi,%rsi
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @_upper_multiple(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = sub i64 %10, %11
%13 = xor i64 %12, 0
%14 = load i64, i64* %5
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i32
%17 = sub nsw i32 0, %16
%18 = sext i32 %17 to i64
%19 = and i64 %13, %18
%20 = xor i64 0, %19
%21 = add i64 %9, %20
ret i64 %21
}

LLVM IR (-O2):
define i64 @_upper_multiple(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = sub i64 %1, %3
%5 = icmp eq i64 %3, 0
%6 = select i1 %5, i64 0, i64 %4
%7 = add i64 %6, %0
ret i64 %7
}
/* Variables and functions */
scalar_t__ isdigit(int);
scalar_t__ isxdigit(int);
char toupper(int);
int xdigitvalue(int c) {
  if (isdigit(c))
    return (c - '0');
  if (isxdigit(c))
    return (toupper(c) - 'A' + 10);
  return (0);
}


x86 assembly (clang, -O0):
<xdigitvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     115b <xdigitvalue+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    118d <xdigitvalue+0x5d>
mov    -0x8(%rbp),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%rax
je     1186 <xdigitvalue+0x56>
mov    -0x8(%rbp),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    118d <xdigitvalue+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdigitvalue>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1142 <xdigitvalue+0x12>
add    $0xffffffd0,%ebx
jmp    115f <xdigitvalue+0x2f>
mov    %ebx,%edi
call   1050 <isxdigit@plt>
test   %rax,%rax
je     115d <xdigitvalue+0x2d>
mov    %ebx,%edi
call   1040 <toupper@plt>
movsbl %al,%ebx
add    $0xffffffc9,%ebx
jmp    115f <xdigitvalue+0x2f>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @xdigitvalue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isdigit(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 48
store i32 %9, i32* %2
br label %21
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i64 @isxdigit(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i32, i32* %3
%16 = call signext i8 @toupper(i32 %15)
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 65
%19 = add nsw i32 %18, 10
store i32 %19, i32* %2
br label %21
20: ; preds = %10
store i32 0, i32* %2
br label %21
21: ; preds = %20, %14, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @xdigitvalue(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add nsw i32 %0, -48
br label %13
6: ; preds = %1
%7 = tail call i64 @isxdigit(i32 %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call signext i8 @toupper(i32 %0)
%11 = sext i8 %10 to i32
%12 = add nsw i32 %11, -55
br label %13
13: ; preds = %6, %9, %4
%14 = phi i32 [ %5, %4 ], [ %12, %9 ], [ 0, %6 ]
ret i32 %14
}
void g0(void) { __alignof__(f0()); }


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

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

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

LLVM IR (-O2):
define void @g0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glp_assert_(char *, char *, int);
void _glp_xdlclose(void *h) {
  ((void)((h != h) ||
          (glp_assert_(
               "h != h",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/Erez-Buchnik/Bouma2/refs/"
               "heads/master/dep/glpk/glpenv08.c",
               150),
           1)));
  return;
}


x86 assembly (clang, -O0):
<_glp_xdlclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmp    -0x8(%rbp),%rcx
mov    %al,-0x9(%rbp)
jne    114c <_glp_xdlclose+0x3c>
lea    0xeca(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x96,%edx
call   1030 <glp_assert_@plt>
mov    $0x1,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glp_xdlclose>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x96,%edx
jmp    1030 <glp_assert_@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"h != h\00"
@.str.1 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Erez-Buchnik/Bouma2/refs/heads/master/dep/glpk/glpenv08.c\00"
define void @_glp_xdlclose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %3, %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @glp_assert_(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.1, i64 0, i64 0), i32 150)
br label %8
8: ; preds = %6, %1
%9 = phi i1 [ true, %1 ], [ true, %6 ]
%10 = zext i1 %9 to i32
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"h != h\00"
@.str.1 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Erez-Buchnik/Bouma2/refs/heads/master/dep/glpk/glpenv08.c\00"
define void @_glp_xdlclose(i8* nocapture readnone %0) {
%2 = tail call i32 @glp_assert_(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.1, i64 0, i64 0), i32 150)
ret void
}
void *rawmemchr(const void *s, int c) {
  unsigned const char *p = s;
  while (1) {
    if (*p == c)
      return (void *)p;
    p++;
  }
}


x86 assembly (clang, -O0):
<rawmemchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1129 <rawmemchr+0x29>
mov    -0x18(%rbp),%rax
pop    %rbp
ret
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <rawmemchr+0x13>

x86 assembly (clang, -O2):
<rawmemchr>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <rawmemchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @rawmemchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, %1
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ euler_problem_10();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  printf("%llu\n", euler_problem_10());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <euler_problem_10@plt>
mov    %eax,%esi
lea    0xec1(%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 <euler_problem_10@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%llu\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @euler_problem_10()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _fail(char const *, int const);
int /*<<< orphan*/ string_not_equal_display_error(char const *const,
                                                  char const *const);
void _assert_string_not_equal(const char *const a, const char *const b,
                              const char *file, const int line) {
  if (!string_not_equal_display_error(a, b)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_string_not_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <string_not_equal_display_error@plt>
cmp    $0x0,%eax
jne    1159 <_assert_string_not_equal+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_string_not_equal>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1040 <string_not_equal_display_error@plt>
test   %eax,%eax
je     1138 <_assert_string_not_equal+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_fail@plt>

LLVM IR (-O0):
define void @_assert_string_not_equal(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @string_not_equal_display_error(i8* %9, i8* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %4
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @_fail(i8* %14, i32 %15)
br label %17
17: ; preds = %13, %4
ret void
}

LLVM IR (-O2):
define void @_assert_string_not_equal(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @string_not_equal_display_error(i8* %0, i8* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @_fail(i8* %2, i32 %3)
br label %9
9: ; preds = %7, %4
ret void
}