#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*/ fftw_assertion_failed(char *, int, char *);
void *fftw_malloc(size_t);
void *fftw_malloc_plain(size_t n) {
  void *p;
  if (n == 0)
    n = 1;
  p = fftw_malloc(n);
  (void)((p) || (fftw_assertion_failed(
                     "p", 384,
                     "/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/kernel/alloc.c"),
                 0));
  return p;
}


x86 assembly (clang, -O0):
<fftw_malloc_plain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113f <fftw_malloc_plain+0x1f>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fftw_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jne    1179 <fftw_malloc_plain+0x59>
lea    0xe9d(%rip),%rdi
mov    $0x180,%esi
lea    0xe93(%rip),%rdx
call   1030 <fftw_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):
<fftw_malloc_plain>:
push   %rbx
test   %rdi,%rdi
mov    $0x1,%eax
cmove  %rax,%rdi
call   1040 <fftw_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1152 <fftw_malloc_plain+0x32>
lea    0xebf(%rip),%rdi
lea    0xeba(%rip),%rdx
mov    $0x180,%esi
call   1030 <fftw_assertion_failed@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"p\00"
@.str.1 = [211 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/kernel/alloc.c\00"
define i8* @fftw_malloc_plain(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* @fftw_malloc(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 @fftw_assertion_failed(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 384, i8* getelementptr inbounds ([211 x i8], [211 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 = [211 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/kernel/alloc.c\00"
define i8* @fftw_malloc_plain(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @fftw_malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @fftw_assertion_failed(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 384, i8* getelementptr inbounds ([211 x i8], [211 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %4
}