#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 */
int /*<<< orphan*/ bench_assertion_failed(char *, int, char *);
void *memalign(int, size_t);
void *bench_malloc(size_t n) {
  void *p;
  if (n == 0)
    n = 1;
  p = memalign(16, n);
  (void)((p) ||
         (bench_assertion_failed(
              "p", 215,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/abrahamneben/orbcomm_beam_mapping/"
              "refs/heads/master/cinelerra-4.6/cinelerra-4.6.mod/thirdparty/"
              "fftw-3.0.1/libbench2/util.c"),
          0));
  return p;
}


x86 assembly (clang, -O0):
<bench_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113f <bench_malloc+0x1f>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x10,%edi
call   1040 <memalign@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jne    117e <bench_malloc+0x5e>
lea    0xe98(%rip),%rdi
mov    $0xd7,%esi
lea    0xe8e(%rip),%rdx
call   1030 <bench_assertion_failed@plt>
xor    %eax,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_malloc>:
push   %rbx
test   %rdi,%rdi
mov    $0x1,%esi
cmovne %rdi,%rsi
mov    $0x10,%edi
call   1040 <memalign@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1157 <bench_malloc+0x37>
lea    0xeba(%rip),%rdi
lea    0xeb5(%rip),%rdx
mov    $0xd7,%esi
call   1030 <bench_assertion_failed@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"p\00"
@.str.1 = [213 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/abrahamneben/orbcomm_beam_mapping/refs/heads/master/cinelerra-4.6/cinelerra-4.6.mod/thirdparty/fftw-3.0.1/libbench2/util.c\00"
define i8* @bench_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %7
7: ; preds = %6, %1
%8 = load i64, i64* %2
%9 = call i8* @memalign(i32 16, i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %7
%13 = call i32 @bench_assertion_failed(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 215, i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %7
%15 = phi i1 [ true, %7 ], [ false, %12 ]
%16 = zext i1 %15 to i32
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"p\00"
@.str.1 = [213 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/abrahamneben/orbcomm_beam_mapping/refs/heads/master/cinelerra-4.6/cinelerra-4.6.mod/thirdparty/fftw-3.0.1/libbench2/util.c\00"
define noalias i8* @bench_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call align 16 i8* @memalign(i32 16, i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @bench_assertion_failed(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 215, i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %4
}