#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*/ test_generic(int, int, int);
void test_all(void) {
  for (int size = 1; size < 1024; size++) {
    for (int src_alignment = 0; src_alignment < 4; src_alignment++) {
      for (int dest_alignment = 0; dest_alignment < 4; dest_alignment++) {
        test_generic(size, src_alignment, dest_alignment);
      }
    }
  }
}


x86 assembly (clang, -O0):
<test_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x400,-0x4(%rbp)
jge    1190 <test_all+0x80>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    117d <test_all+0x6d>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    116a <test_all+0x5a>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <test_generic@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <test_all+0x34>
jmp    116f <test_all+0x5f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <test_all+0x23>
jmp    1182 <test_all+0x72>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_all+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all>:
push   %rbx
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <test_generic@plt>
mov    %ebx,%edi
mov    $0x3,%esi
mov    $0x3,%edx
call   1030 <test_generic@plt>
add    $0x1,%ebx
cmp    $0x400,%ebx
jne    1120 <test_all+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @test_all() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %19, %1 ]
%3 = tail call i32 @test_generic(i32 %2, i32 0, i32 0)
%4 = tail call i32 @test_generic(i32 %2, i32 0, i32 1)
%5 = tail call i32 @test_generic(i32 %2, i32 0, i32 2)
%6 = tail call i32 @test_generic(i32 %2, i32 0, i32 3)
%7 = tail call i32 @test_generic(i32 %2, i32 1, i32 0)
%8 = tail call i32 @test_generic(i32 %2, i32 1, i32 1)
%9 = tail call i32 @test_generic(i32 %2, i32 1, i32 2)
%10 = tail call i32 @test_generic(i32 %2, i32 1, i32 3)
%11 = tail call i32 @test_generic(i32 %2, i32 2, i32 0)
%12 = tail call i32 @test_generic(i32 %2, i32 2, i32 1)
%13 = tail call i32 @test_generic(i32 %2, i32 2, i32 2)
%14 = tail call i32 @test_generic(i32 %2, i32 2, i32 3)
%15 = tail call i32 @test_generic(i32 %2, i32 3, i32 0)
%16 = tail call i32 @test_generic(i32 %2, i32 3, i32 1)
%17 = tail call i32 @test_generic(i32 %2, i32 3, i32 2)
%18 = tail call i32 @test_generic(i32 %2, i32 3, i32 3)
%19 = add nuw nsw i32 %2, 1
%20 = icmp eq i32 %19, 1024
br i1 %20, label %21, label %1
21: ; preds = %1
ret void
}