#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
void *aligned_alloc(size_t, size_t);
void multimap_failed(char *, char *, int);
void *multimap_aligned_alloc(size_t alignment, size_t size) {
  ((alignment)
       ? ((void)0)
       : multimap_failed("alignment",
                         "/scratch/repos/new/home/jordi_armengol_estape/"
                         "c-scraper/outputs/2022-01-22/02-19-57/repos/tregon/"
                         "multimap/refs/heads/develop/src/malloc.c",
                         52));
  ((size) ? ((void)0)
          : multimap_failed("size",
                            "/scratch/repos/new/home/jordi_armengol_estape/"
                            "c-scraper/outputs/2022-01-22/02-19-57/repos/"
                            "tregon/multimap/refs/heads/develop/src/malloc.c",
                            53));
  return aligned_alloc(alignment, size);
}


x86 assembly (clang, -O0):
<multimap_aligned_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <multimap_aligned_alloc+0x20>
jmp    1158 <multimap_aligned_alloc+0x38>
lea    0xeb9(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x34,%edx
call   1030 <multimap_failed@plt>
cmpq   $0x0,-0x10(%rbp)
je     1168 <multimap_aligned_alloc+0x48>
jmp    1180 <multimap_aligned_alloc+0x60>
lea    0xf25(%rip),%rdi
lea    0xe94(%rip),%rsi
mov    $0x35,%edx
call   1030 <multimap_failed@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <aligned_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multimap_aligned_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
je     1146 <multimap_aligned_alloc+0x26>
test   %r14,%r14
je     1163 <multimap_aligned_alloc+0x43>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <aligned_alloc@plt>
lea    0xeb3(%rip),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x34,%edx
call   1030 <multimap_failed@plt>
test   %r14,%r14
jne    1134 <multimap_aligned_alloc+0x14>
lea    0xf2a(%rip),%rdi
lea    0xe99(%rip),%rsi
mov    $0x35,%edx
call   1030 <multimap_failed@plt>
jmp    1134 <multimap_aligned_alloc+0x14>

LLVM IR (-O0):
@.str = [10 x i8] c"alignment\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tregon/multimap/refs/heads/develop/src/malloc.c\00"
@.str.2 = [5 x i8] c"size\00"
define i8* @multimap_aligned_alloc(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 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %9
8: ; preds = %2
br label %9
9: ; preds = %8, %7
%10 = load i64, i64* %4
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
br label %14
13: ; preds = %9
br label %14
14: ; preds = %13, %12
%15 = load i64, i64* %3
%16 = load i64, i64* %4
%17 = call i8* @aligned_alloc(i64 %15, i64 %16)
ret i8* %17
}

LLVM IR (-O2):
@.str = [10 x i8] c"alignment\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tregon/multimap/refs/heads/develop/src/malloc.c\00"
@.str.2 = [5 x i8] c"size\00"
define i8* @multimap_aligned_alloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @multimap_failed(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 52)
br label %5
5: ; preds = %2, %4
%6 = icmp eq i64 %1, 0
br i1 %6, label %7, label %8
7: ; preds = %5
tail call void @multimap_failed(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 53)
br label %8
8: ; preds = %5, %7
%9 = tail call i8* @aligned_alloc(i64 %0, i64 %1)
ret i8* %9
}