#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 */
typedef int /*<<< orphan*/ tabFloat;

/* Variables and functions */
int /*<<< orphan*/ mihp_adress(float *, int, int);
int /*<<< orphan*/ mihp_endLoop();
int /*<<< orphan*/ mihp_newIteration();
int /*<<< orphan*/ mihp_newLoop(char *, char *, int);
void twoLoops(float *tabFloat, size_t size) {
  if (tabFloat == NULL || size == 0)
    return;
  int i;
  mihp_newLoop("twoLoops", "main.c", 15);
  for (i = 0; i < size; ++i) {
    tabFloat[i] = 1.0;
    mihp_adress(&tabFloat[i], sizeof(tabFloat[i]), 1);
    mihp_newIteration();
  }
  mihp_endLoop();
  i = 0;
  mihp_newLoop("twoLoops", "main.c", 24);
  while (i < size) {
    tabFloat[i] = tabFloat[i - 1];
    mihp_adress(&tabFloat[i - 1], sizeof(tabFloat[i - 1]), 0);
    mihp_adress(&tabFloat[i], sizeof(tabFloat[i]), 1);
    ++i;
    mihp_newIteration();
  }
  mihp_endLoop();
}


x86 assembly (clang, -O0):
<twoLoops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <twoLoops+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    116b <twoLoops+0x2b>
jmp    128c <twoLoops+0x14c>
lea    0xe92(%rip),%rdi
lea    0xe94(%rip),%rsi
mov    $0xf,%edx
call   1060 <mihp_newLoop@plt>
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11e0 <twoLoops+0xa0>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  0xe58(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <mihp_adress@plt>
mov    $0x0,%al
call   1030 <mihp_newIteration@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118a <twoLoops+0x4a>
mov    $0x0,%al
call   1050 <mihp_endLoop@plt>
movl   $0x0,-0x14(%rbp)
lea    0xe0f(%rip),%rdi
lea    0xe11(%rip),%rsi
mov    $0x18,%edx
call   1060 <mihp_newLoop@plt>
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1285 <twoLoops+0x145>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <mihp_adress@plt>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <mihp_adress@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <mihp_newIteration@plt>
jmp    1206 <twoLoops+0xc6>
mov    $0x0,%al
call   1050 <mihp_endLoop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twoLoops>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1220 <twoLoops+0xe0>
mov    %rsi,%r14
test   %rsi,%rsi
je     1220 <twoLoops+0xe0>
mov    %rdi,%r15
lea    0xe99(%rip),%rdi
lea    0xe9b(%rip),%rsi
mov    $0xf,%edx
call   1060 <mihp_newLoop@plt>
mov    %r14,%r12
mov    %r15,%rbx
xchg   %ax,%ax
movl   $0x3f800000,(%rbx)
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <mihp_adress@plt>
xor    %eax,%eax
call   1030 <mihp_newIteration@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r12
jne    1180 <twoLoops+0x40>
xor    %eax,%eax
call   1050 <mihp_endLoop@plt>
lea    0xe49(%rip),%rdi
lea    0xe4b(%rip),%rsi
mov    $0x18,%edx
call   1060 <mihp_newLoop@plt>
nopl   0x0(%rax,%rax,1)
lea    -0x4(%r15),%rdi
movss  -0x4(%r15),%xmm0
movss  %xmm0,(%r15)
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <mihp_adress@plt>
mov    %r15,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <mihp_adress@plt>
xor    %eax,%eax
call   1030 <mihp_newIteration@plt>
add    $0x4,%r15
add    $0xffffffffffffffff,%r14
jne    11d0 <twoLoops+0x90>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1050 <mihp_endLoop@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"twoLoops\00"
@.str.1 = [7 x i8] c"main.c\00"
define void @twoLoops(float* %0, i64 %1) {
%3 = alloca float*
%4 = alloca i64
%5 = alloca i32
store float* %0, float** %3
store i64 %1, i64* %4
%6 = load float*, float** %3
%7 = icmp eq float* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i64, i64* %4
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8, %2
br label %68
12: ; preds = %8
%13 = call i32 @mihp_newLoop(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 15)
store i32 0, i32* %5
br label %14
14: ; preds = %30, %12
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = load i64, i64* %4
%18 = icmp ult i64 %16, %17
br i1 %18, label %19, label %33
19: ; preds = %14
%20 = load float*, float** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* %20, i64 %22
store float 1.000000e+00, float* %23
%24 = load float*, float** %3
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds float, float* %24, i64 %26
%28 = call i32 @mihp_adress(float* %27, i32 4, i32 1)
%29 = call i32 (...) @mihp_newIteration()
br label %30
30: ; preds = %19
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %14
33: ; preds = %14
%34 = call i32 (...) @mihp_endLoop()
store i32 0, i32* %5
%35 = call i32 @mihp_newLoop(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 24)
br label %36
36: ; preds = %41, %33
%37 = load i32, i32* %5
%38 = sext i32 %37 to i64
%39 = load i64, i64* %4
%40 = icmp ult i64 %38, %39
br i1 %40, label %41, label %66
41: ; preds = %36
%42 = load float*, float** %3
%43 = load i32, i32* %5
%44 = sub nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds float, float* %42, i64 %45
%47 = load float, float* %46
%48 = load float*, float** %3
%49 = load i32, i32* %5
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds float, float* %48, i64 %50
store float %47, float* %51
%52 = load float*, float** %3
%53 = load i32, i32* %5
%54 = sub nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds float, float* %52, i64 %55
%57 = call i32 @mihp_adress(float* %56, i32 4, i32 0)
%58 = load float*, float** %3
%59 = load i32, i32* %5
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds float, float* %58, i64 %60
%62 = call i32 @mihp_adress(float* %61, i32 4, i32 1)
%63 = load i32, i32* %5
%64 = add nsw i32 %63, 1
store i32 %64, i32* %5
%65 = call i32 (...) @mihp_newIteration()
br label %36
66: ; preds = %36
%67 = call i32 (...) @mihp_endLoop()
br label %68
68: ; preds = %66, %11
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"twoLoops\00"
@.str.1 = [7 x i8] c"main.c\00"
define void @twoLoops(float* %0, i64 %1) {
%3 = icmp eq float* %0, null
%4 = icmp eq i64 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %31, label %6
6: ; preds = %2
%7 = tail call i32 @mihp_newLoop(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 15)
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds float, float* %0, i64 %9
store float 1.000000e+00, float* %10
%11 = tail call i32 @mihp_adress(float* %10, i32 4, i32 1)
%12 = tail call i32 (...) @mihp_newIteration()
%13 = add nuw i64 %9, 1
%14 = icmp eq i64 %13, %1
br i1 %14, label %15, label %8
15: ; preds = %8
%16 = tail call i32 (...) @mihp_endLoop()
%17 = tail call i32 @mihp_newLoop(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 24)
br label %18
18: ; preds = %15, %18
%19 = phi i64 [ 0, %15 ], [ %26, %18 ]
%20 = add nsw i64 %19, -1
%21 = getelementptr inbounds float, float* %0, i64 %20
%22 = load float, float* %21
%23 = getelementptr inbounds float, float* %0, i64 %19
store float %22, float* %23
%24 = tail call i32 @mihp_adress(float* %21, i32 4, i32 0)
%25 = tail call i32 @mihp_adress(float* %23, i32 4, i32 1)
%26 = add nuw i64 %19, 1
%27 = tail call i32 (...) @mihp_newIteration()
%28 = icmp eq i64 %26, %1
br i1 %28, label %29, label %18
29: ; preds = %18
%30 = tail call i32 (...) @mihp_endLoop()
br label %31
31: ; preds = %2, %29
ret void
}