xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ count_up_to_n(int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello CAB202!\n");
  count_up_to_n(10);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1040 <count_up_to_n@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello CAB202!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @count_up_to_n(i32 10)
ret i32 0
}
void init_user_section() {}


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

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

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

LLVM IR (-O2):
define void @init_user_section() {
ret void
}
int ProcTimePlus(const int a, const int b) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ProcTimePlus(i32 %0, i32 %1) {
ret i32 0
}
unsigned char f80(unsigned char x, long int y) {
  return (x << y) + (x >> ((-y) & (8 * sizeof(unsigned char) - 1)));
}


x86 assembly (clang, -O0):
<f80>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x7,%rcx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f80>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0x7,%cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f80(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i64, i64* %4
%13 = sub nsw i64 0, %12
%14 = and i64 %13, 7
%15 = trunc i64 %14 to i32
%16 = ashr i32 %11, %15
%17 = add nsw i32 %9, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f80(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 7
%8 = lshr i32 %3, %7
%9 = add nsw i32 %8, %5
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Type definitions */
struct BMCReverb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BMCReverbUpdateMainFilter(struct BMCReverb *);
int /*<<< orphan*/ BMCReverbUpdateNumDelayUnits(struct BMCReverb *);
void BMCReverbUpdateSettings(struct BMCReverb *rv) {
  BMCReverbUpdateNumDelayUnits(rv);
  BMCReverbUpdateMainFilter(rv);
}


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

x86 assembly (clang, -O2):
<BMCReverbUpdateSettings>:
push   %rbx
mov    %rdi,%rbx
call   1040 <BMCReverbUpdateNumDelayUnits@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <BMCReverbUpdateMainFilter@plt>

LLVM IR (-O0):
%struct.BMCReverb = type { i32 }
define void @BMCReverbUpdateSettings(%struct.BMCReverb* %0) {
%2 = alloca %struct.BMCReverb*
store %struct.BMCReverb* %0, %struct.BMCReverb** %2
%3 = load %struct.BMCReverb*, %struct.BMCReverb** %2
%4 = call i32 @BMCReverbUpdateNumDelayUnits(%struct.BMCReverb* %3)
%5 = load %struct.BMCReverb*, %struct.BMCReverb** %2
%6 = call i32 @BMCReverbUpdateMainFilter(%struct.BMCReverb* %5)
ret void
}

LLVM IR (-O2):
%struct.BMCReverb = type { i32 }
define void @BMCReverbUpdateSettings(%struct.BMCReverb* %0) {
%2 = tail call i32 @BMCReverbUpdateNumDelayUnits(%struct.BMCReverb* %0)
%3 = tail call i32 @BMCReverbUpdateMainFilter(%struct.BMCReverb* %0)
ret void
}
int cndlookup(void) {
  int match = 1;
  return (match);
}


x86 assembly (clang, -O0):
<cndlookup>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cndlookup() {
ret i32 1
}
/* Variables and functions */
void *compare_short_context(void) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @compare_short_context() {
ret i8* null
}
void _eventloop_epoll_ctor(void) {}


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

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

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

LLVM IR (-O2):
define void @_eventloop_epoll_ctor() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY_CTX;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ *int_ctx_new(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                int);
EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e) {
  return int_ctx_new(pkey, e, -1);
}


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

x86 assembly (clang, -O2):
<EVP_PKEY_CTX_new>:
mov    $0xffffffff,%edx
jmp    1030 <int_ctx_new@plt>

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

LLVM IR (-O2):
define i32* @EVP_PKEY_CTX_new(i32* %0, i32* %1) {
%3 = tail call i32* @int_ctx_new(i32* %0, i32* %1, i32 -1)
ret i32* %3
}
void output_markup_chars(s, n) char *s;
unsigned n;
{
  for (; n > 0; --n)
    output_char((unsigned char)*s++, '!');
}


x86 assembly (clang, -O0):
<output_markup_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1155 <output_markup_chars+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
mov    $0x21,%esi
mov    $0x0,%al
call   1030 <output_char@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <output_markup_chars+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_markup_chars>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     114a <output_markup_chars+0x3a>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
mov    $0x21,%esi
xor    %eax,%eax
call   1030 <output_char@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <output_markup_chars+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @output_markup_chars(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i8* [ %7, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @output_char to i32 (i32, i32, ...)*)(i32 %9, i32 33)
%11 = add i32 %5, -1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
void foo_2_1_1_2_2_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_2_1_2_1_1() {
ret void
}
/* Variables and functions */
int strlen(char *);
void chomp(char str[]) {
  if (str[0] != '\0') {
    const size_t last_char_pos = strlen(str) - 1;
    if (str[last_char_pos] == '\n') {
      str[last_char_pos] = '\0';
    }
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <chomp+0x54>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    115f <chomp+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1164 <chomp+0x54>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
cmpb   $0x0,(%rdi)
je     112c <chomp+0x1c>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    112c <chomp+0x1c>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chomp(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %12
11: ; preds = %4
store i8 0, i8* %8
br label %12
12: ; preds = %4, %11, %1
ret void
}
/* Variables and functions */
char *ft_strcpy(char *dst, const char *src) {
  size_t index;
  index = 0;
  while (src[index]) {
    dst[index] = src[index];
    index++;
  }
  dst[index] = '\0';
  return (dst);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114d <ft_strcpy+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <ft_strcpy+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     1120 <ft_strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <ft_strcpy+0x10>
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = add i64 %7, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i64 [ 0, %2 ], [ %9, %5 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret i8* %0
}
void *threadmain(void *arg) {
  int val = *((int *)arg);
  int *r = malloc(sizeof(int));
  *r = val * val;
  return r;
}


x86 assembly (clang, -O0):
<threadmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadmain>:
push   %rbx
mov    (%rdi),%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
imul   %ebx,%ebx
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @threadmain(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%5 = bitcast i8* %4 to i32*
%6 = mul nsw i32 %3, %3
store i32 %6, i32* %5
ret i8* %4
}
/* Variables and functions */
void *mm_alloc_(unsigned int, int, int /*<<< orphan*/);
void *mm_alloc_s(unsigned int size) { return mm_alloc_(size, 1, 0); }


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

x86 assembly (clang, -O2):
<mm_alloc_s>:
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <mm_alloc_@plt>

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

LLVM IR (-O2):
define i8* @mm_alloc_s(i32 %0) {
%2 = tail call i8* @mm_alloc_(i32 %0, i32 1, i32 0)
ret i8* %2
}
void assert(int i) {
  if (i == 0) {
  ERROR:
    goto ERROR;
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <assert+0x1b>
jmp    1116 <assert+0x16>
jmp    1116 <assert+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1110 <assert+0x10>
ret
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <assert+0x10>

LLVM IR (-O0):
define void @assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
br label %6
6: ; preds = %6, %5
br label %6
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret void
}
unsigned long long unsignedlonglong_ignoring_shortint(unsigned long long x,
                                                      short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlonglong_ignoring_shortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedlonglong_ignoring_shortint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlonglong_ignoring_shortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_shortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int ft_strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void show_error_exit(char *str) {
  write(2, "Error: ", 8);
  write(2, str, ft_strlen(str));
  write(2, "\n", 2);
  exit(0);
}


x86 assembly (clang, -O0):
<show_error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
lea    0xeb8(%rip),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x2,%edx
lea    0xe89(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<show_error_exit>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
mov    $0x2,%edi
mov    $0x8,%edx
call   1030 <write@plt>
mov    %rbx,%rdi
call   1040 <ft_strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xea0(%rip),%rsi
mov    $0x2,%edi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Error: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @show_error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @write(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @ft_strlen(i8* %5)
%7 = call i32 @write(i32 2, i8* %4, i32 %6)
%8 = call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"Error: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @show_error_exit(i8* %0) {
%2 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 8)
%3 = tail call i32 @ft_strlen(i8* %0)
%4 = tail call i32 @write(i32 2, i8* %0, i32 %3)
%5 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
uint32_t multiply(int32_t a, int32_t b) { return a * b; }


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

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

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

LLVM IR (-O2):
define i32 @multiply(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32l14(uint32_t x) { return (x << 14) | (x >> 18); }


x86 assembly (clang, -O0):
<rot32l14>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xe,%eax
mov    -0x4(%rbp),%ecx
sar    $0x12,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32l14>:
mov    %edi,%eax
shl    $0xe,%eax
sar    $0x12,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32l14(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 14
%5 = load i32, i32* %2
%6 = ashr i32 %5, 18
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32l14(i32 %0) {
%2 = shl i32 %0, 14
%3 = ashr i32 %0, 18
%4 = or i32 %2, %3
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int lduw_be_p(const void *ptr) {
  const uint8_t *b = ptr;
  return ((b[0] << 8) | b[1]);
}


x86 assembly (clang, -O0):
<lduw_be_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lduw_be_p>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @lduw_be_p(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = or i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @lduw_be_p(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ log_warning(char *);
int /*<<< orphan*/ open_cfg_file();
int main() {
  open_cfg_file();
  log_warning("Teste de logagem");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <open_cfg_file@plt>
lea    0xece(%rip),%rdi
call   1030 <log_warning@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"Teste de logagem\00"
define i32 @main() {
%1 = tail call i32 (...) @open_cfg_file()
%2 = tail call i32 @log_warning(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long ftell(int /*<<< orphan*/ *);
long _sys_ftell(FILE *file) { return (ftell(file)); }


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

x86 assembly (clang, -O2):
<_sys_ftell>:
jmp    1030 <ftell@plt>

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

LLVM IR (-O2):
define i64 @_sys_ftell(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverseString(char *, int);
int main() {
  char s[10] = {'h', 'e', 'l', 'l', 'o'};
  reverseString(s, 5);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xa(%rbp),%rdi
mov    $0x5,%esi
call   1040 <reverseString@plt>
lea    -0xa(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6f6c6c6568,%rax
mov    %rax,(%rsp)
movw   $0x0,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <reverseString@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [10 x i8] c"hello\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = bitcast [10 x i8]* %1 to i8*
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @reverseString(i8* %3, i32 5)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [10 x i8] c"hello\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverseString(i8* %2, i32 5)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int ti_volatility_start(double const *options) { return (int)options[0]; }


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

x86 assembly (clang, -O2):
<ti_volatility_start>:
cvttsd2si (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ti_volatility_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ti_volatility_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 4 / 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
int test_imm_97uint8_mem(unsigned char *val) {
  return ((*val) & (-0x97 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_97uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 105
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xa2() {
  Assert_real((ispunct(162) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              815, ("ispunct should be 0 for 0xa2"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xa2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa2,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x32f,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xa2>:
push   %rax
mov    $0xa2,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x32f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xa2\00"
define void @t_ispunct_0xa2() {
%1 = call i64 @ispunct(i32 162)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 815, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xa2\00"
define void @t_ispunct_0xa2() {
%1 = tail call i64 @ispunct(i32 162)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 815, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int bitwise_not(int x) { return ~x; }


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

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

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

LLVM IR (-O2):
define i32 @bitwise_not(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
void intersect_set_io(char *args) {}


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

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

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

LLVM IR (-O2):
define void @intersect_set_io(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *strstr(char const *, char const *);
char *strcasestr(const char *h, const char *n) { return strstr(h, n); }


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

x86 assembly (clang, -O2):
<strcasestr>:
jmp    1030 <strstr@plt>

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

LLVM IR (-O2):
define i8* @strcasestr(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ led(int);
int /*<<< orphan*/ usleep(int);
void stop(long int len) {
  led(0x0);
  usleep(250000);
}


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <led@plt>
mov    $0x3d090,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop>:
push   %rax
xor    %edi,%edi
call   1030 <led@plt>
mov    $0x3d090,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @stop(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @led(i32 0)
%4 = call i32 @usleep(i32 250000)
ret void
}

LLVM IR (-O2):
define void @stop(i64 %0) {
%2 = tail call i32 @led(i32 0)
%3 = tail call i32 @usleep(i32 250000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("The magic number is %d\n", 43);
  return 0;
}


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

LLVM IR (-O0):
@.str = [24 x i8] c"The magic number is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 43)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"The magic number is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 43)
ret i32 0
}
int test_imm_71uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x71 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_71uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 113
%5 = icmp ne i64 %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_71uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 113
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int g_strcasecmp(const char *c1, const char *c2) { return strcasecmp(c1, c2); }


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

x86 assembly (clang, -O2):
<g_strcasecmp>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @g_strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
void INT_Excep_MTU4_TGID4(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU4_TGID4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void closeWithError(char *error) {
  perror(error);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<closeWithError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<closeWithError>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @closeWithError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @closeWithError(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
char *shift(char *buf) {
  char *result;
  result = buf;
  result++;
  return result;
}


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

x86 assembly (clang, -O2):
<shift>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @shift(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %3
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
define i8* @shift(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float stdlib_strided_sdsapxsumpw(int /*<<< orphan*/ const, float const,
                                 float const *, int /*<<< orphan*/ const);
float stdlib_strided_sdsapxsum(const int64_t N, const float alpha,
                               const float *X, const int64_t stride) {
  return stdlib_strided_sdsapxsumpw(N, alpha, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_sdsapxsum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <stdlib_strided_sdsapxsumpw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_sdsapxsum>:
jmp    1030 <stdlib_strided_sdsapxsumpw@plt>

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

LLVM IR (-O2):
define float @stdlib_strided_sdsapxsum(i32 %0, float %1, float* %2, i32 %3) {
%5 = tail call float @stdlib_strided_sdsapxsumpw(i32 %0, float %1, float* %2, i32 %3)
ret float %5
}
/* Variables and functions */
float sin(float);
float SineEaseIn(float p) { return sin((p - 1) * 1.57079632679489661923) + 1; }


x86 assembly (clang, -O0):
<SineEaseIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
movss  0xeb1(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SineEaseIn>:
push   %rax
addss  0xee7(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sin@plt>
addss  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @SineEaseIn(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 1.000000e+00
%5 = fpext float %4 to double
%6 = fmul double %5, 0x3FF921FB54442D18
%7 = fptrunc double %6 to float
%8 = call float @sin(float %7)
%9 = fadd float %8, 1.000000e+00
ret float %9
}

LLVM IR (-O2):
define float @SineEaseIn(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fpext float %2 to double
%4 = fmul double %3, 0x3FF921FB54442D18
%5 = fptrunc double %4 to float
%6 = tail call float @sin(float %5)
%7 = fadd float %6, 1.000000e+00
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char *str;
  str = malloc(1024);
  if (str == NULL)
    printf("%s", "malloc() failed");
  abort();
  ;
  printf("malloc() succeeded");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116d <main+0x3d>
lea    0xea1(%rip),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [16 x i8] c"malloc() failed\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 1024)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
char *changeCommaToPoint(char *str) {
  unsigned int i = 0;
  while (str[i] != '\0') {
    if (str[i] == ',') {
      str[i] = '.';
      break;
    }
    i++;
  }
  return str;
}


x86 assembly (clang, -O0):
<changeCommaToPoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1155 <changeCommaToPoint+0x55>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
jne    1147 <changeCommaToPoint+0x47>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0x2e,(%rax,%rcx,1)
jmp    1155 <changeCommaToPoint+0x55>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <changeCommaToPoint+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeCommaToPoint>:
mov    %rdi,%rax
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nop
mov    %esi,%edx
movzbl (%rax,%rdx,1),%ecx
test   %cl,%cl
je     1128 <changeCommaToPoint+0x28>
cmp    $0x2c,%cl
je     1124 <changeCommaToPoint+0x24>
add    $0x1,%esi
jmp    1110 <changeCommaToPoint+0x10>
movb   $0x2e,(%rax,%rdx,1)
ret

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

LLVM IR (-O2):
define i8* @changeCommaToPoint(i8* returned %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i32 [ 0, %1 ], [ %11, %10 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %10 [
i8 0, label %12
i8 44, label %7
]
7: ; preds = %2
%8 = zext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 46, i8* %9
br label %12
10: ; preds = %2
%11 = add i32 %3, 1
br label %2
12: ; preds = %2, %7
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ hello(int);
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
#pragma omp parallel
  {
#pragma omp single
    {
      for (int i = 0; i < 10; i++) {
#pragma omp task
        { hello(i); }
      }
    }
  }
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    114d <main+0x3d>
mov    -0x14(%rbp),%edi
call   1030 <hello@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <hello@plt>
mov    $0x1,%edi
call   1030 <hello@plt>
mov    $0x2,%edi
call   1030 <hello@plt>
mov    $0x3,%edi
call   1030 <hello@plt>
mov    $0x4,%edi
call   1030 <hello@plt>
mov    $0x5,%edi
call   1030 <hello@plt>
mov    $0x6,%edi
call   1030 <hello@plt>
mov    $0x7,%edi
call   1030 <hello@plt>
mov    $0x8,%edi
call   1030 <hello@plt>
mov    $0x9,%edi
call   1030 <hello@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @hello(i32 0)
%4 = tail call i32 @hello(i32 1)
%5 = tail call i32 @hello(i32 2)
%6 = tail call i32 @hello(i32 3)
%7 = tail call i32 @hello(i32 4)
%8 = tail call i32 @hello(i32 5)
%9 = tail call i32 @hello(i32 6)
%10 = tail call i32 @hello(i32 7)
%11 = tail call i32 @hello(i32 8)
%12 = tail call i32 @hello(i32 9)
ret i32 0
}