#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 _ada_use_c2phc(int, int *, int *, double *);
int /*<<< orphan*/ random_complex(double *, double *);
int new_slices(int k, int n) {
  int i, j, fail;
  double r[2];
  for (i = 0; i < k; i++)
    for (j = 0; j < n + 1; j++) {
      random_complex(&r[0], &r[1]);
      fail = _ada_use_c2phc(43, &i, &j, r);
    }
  return fail;
}


x86 assembly (clang, -O0):
<new_slices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11a4 <new_slices+0x84>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1191 <new_slices+0x71>
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
add    $0x8,%rsi
call   1030 <random_complex@plt>
lea    -0x30(%rbp),%rcx
mov    $0x2b,%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <new_slices+0x28>
jmp    1196 <new_slices+0x76>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <new_slices+0x15>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_slices>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movl   $0x0,0xc(%rsp)
test   %edi,%edi
jle    11b3 <new_slices+0x93>
mov    %esi,%ebx
mov    %edi,%r14d
xor    %ecx,%ecx
lea    0x18(%rsp),%r15
lea    0x10(%rsp),%rbp
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%r13
jmp    116c <new_slices+0x4c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %ecx,0xc(%rsp)
cmp    %r14d,%ecx
jge    11b3 <new_slices+0x93>
movl   $0x0,0x8(%rsp)
test   %ebx,%ebx
js     1160 <new_slices+0x40>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r15,%rsi
call   1030 <random_complex@plt>
mov    $0x2b,%edi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
call   1040 <_ada_use_c2phc@plt>
mov    0x8(%rsp),%ecx
lea    0x1(%rcx),%edx
mov    %edx,0x8(%rsp)
cmp    %ebx,%ecx
jl     1180 <new_slices+0x60>
mov    0xc(%rsp),%ecx
jmp    1160 <new_slices+0x40>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @new_slices(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [2 x double]
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %9
9: ; preds = %29, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %32
13: ; preds = %9
store i32 0, i32* %6
br label %14
14: ; preds = %25, %13
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %28
19: ; preds = %14
%20 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%21 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%22 = call i32 @random_complex(double* %20, double* %21)
%23 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%24 = call i32 @_ada_use_c2phc(i32 43, i32* %5, i32* %6, double* %23)
store i32 %24, i32* %7
br label %25
25: ; preds = %19
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %14
28: ; preds = %14
br label %29
29: ; preds = %28
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %9
32: ; preds = %9
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
define i32 @new_slices(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x double]
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast [2 x double]* %5 to i8*
store i32 0, i32* %3
%9 = icmp sgt i32 %0, 0
br i1 %9, label %10, label %30
10: ; preds = %2
%11 = icmp slt i32 %1, 0
%12 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%13 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 1
br label %14
14: ; preds = %10, %25
%15 = phi i32 [ 0, %10 ], [ %28, %25 ]
%16 = phi i32 [ undef, %10 ], [ %27, %25 ]
store i32 0, i32* %4
br i1 %11, label %25, label %17
17: ; preds = %14, %17
%18 = call i32 @random_complex(double* %12, double* %13)
%19 = call i32 @_ada_use_c2phc(i32 43, i32* %3, i32* %4, double* %12)
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
%22 = icmp slt i32 %20, %1
br i1 %22, label %17, label %23
23: ; preds = %17
%24 = load i32, i32* %3
br label %25
25: ; preds = %23, %14
%26 = phi i32 [ %15, %14 ], [ %24, %23 ]
%27 = phi i32 [ %16, %14 ], [ %19, %23 ]
%28 = add nsw i32 %26, 1
store i32 %28, i32* %3
%29 = icmp slt i32 %28, %0
br i1 %29, label %14, label %30
30: ; preds = %25, %2
%31 = phi i32 [ undef, %2 ], [ %27, %25 ]
ret i32 %31
}