#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*/ prf235_(int *, int *, int *, int *, int *);
int roundup(const int nzdes) {
  int n, nz = nzdes, ip, iq, ir, ipqr2;
  if (nz != 1) {
    do {
      n = nz;
      (prf235_(&n, &ip, &iq, &ir, &ipqr2));
      nz += (n) ? 0 : 2;
    } while (n == 0);
  }
  return nz;
}


x86 assembly (clang, -O0):
<roundup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1174 <roundup+0x64>
jmp    1130 <roundup+0x20>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1030 <prf235_@plt>
mov    -0x8(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1130 <roundup+0x20>
jmp    1174 <roundup+0x64>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     1191 <roundup+0x81>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0x4(%rsp),%r14
lea    0x14(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xc(%rsp),%r13
lea    0x8(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,0x4(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbp,%r8
call   1030 <prf235_@plt>
mov    0x4(%rsp),%edx
xor    %eax,%eax
test   %edx,%edx
sete   %cl
add    $0x2,%ebx
test   %edx,%edx
je     1150 <roundup+0x40>
mov    %cl,%al
add    %eax,%eax
add    %ebx,%eax
add    $0xfffffffe,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @roundup(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = icmp eq i32 %0, 1
br i1 %12, label %20, label %13
13: ; preds = %1, %13
%14 = phi i32 [ %19, %13 ], [ %0, %1 ]
store i32 %14, i32* %2
%15 = call i32 @prf235_(i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i32 2, i32 0
%19 = add nsw i32 %18, %14
br i1 %17, label %13, label %20
20: ; preds = %13, %1
%21 = phi i32 [ 1, %1 ], [ %19, %13 ]
ret i32 %21
}