#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*/ devide(int *, int, int, int);
void devideNum(int *arr, int len, int remain, int thr) {
  int i;
  if (remain < thr) {
    thr = remain;
  }
  for (i = 1; i <= thr; ++i) {
    devide(arr, len, remain, i);
  }
}


x86 assembly (clang, -O0):
<devideNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1137 <devideNum+0x27>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     116a <devideNum+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <devide@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113e <devideNum+0x2e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devideNum>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%ebx
cmp    %ecx,%edx
cmovl  %edx,%ebx
test   %ebx,%ebx
jle    1162 <devideNum+0x52>
mov    %edx,%r12d
mov    %esi,%r14d
mov    %rdi,%r15
neg    %ebx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %r14d,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
call   1030 <devide@plt>
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
jne    1140 <devideNum+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @devideNum(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i32, i32* %7
store i32 %14, i32* %8
br label %15
15: ; preds = %13, %4
store i32 1, i32* %9
br label %16
16: ; preds = %26, %15
%17 = load i32, i32* %9
%18 = load i32, i32* %8
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = load i32*, i32** %5
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = load i32, i32* %9
%25 = call i32 @devide(i32* %21, i32 %22, i32 %23, i32 %24)
br label %26
26: ; preds = %20
%27 = load i32, i32* %9
%28 = add nsw i32 %27, 1
store i32 %28, i32* %9
br label %16
29: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @devideNum(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, %3
%6 = select i1 %5, i32 %2, i32 %3
%7 = icmp slt i32 %6, 1
br i1 %7, label %13, label %8
8: ; preds = %4, %8
%9 = phi i32 [ %11, %8 ], [ 1, %4 ]
%10 = tail call i32 @devide(i32* %0, i32 %1, i32 %2, i32 %9)
%11 = add nuw i32 %9, 1
%12 = icmp eq i32 %9, %6
br i1 %12, label %13, label %8
13: ; preds = %8, %4
ret void
}