#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*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ test_output(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *,
                               int, int /*<<< orphan*/ *, int /*<<< orphan*/,
                               int, int);
void PHC_test() {
  int i;
  uint8_t j = 0;
  for (i = 0; i < 256; i++)
    test_output((uint8_t *)&i, 1, &j, 1, NULL, 0, 10, 32);
  for (i = 0; i < 256; i++)
    test_output(&j, 1, (uint8_t *)&i, 1, NULL, 0, 10, 32);
}


x86 assembly (clang, -O0):
<PHC_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    116c <PHC_test+0x5c>
lea    -0x4(%rbp),%rdi
mov    $0x1,%ecx
lea    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %ecx,%esi
movl   $0xa,(%rsp)
movl   $0x20,0x8(%rsp)
call   1030 <test_output@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <PHC_test+0x16>
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    11b9 <PHC_test+0xa9>
lea    -0x8(%rbp),%rdi
mov    $0x1,%ecx
lea    -0x4(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %ecx,%esi
movl   $0xa,(%rsp)
movl   $0x20,0x8(%rsp)
call   1030 <test_output@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <PHC_test+0x63>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PHC_test>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rsp,%r14
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x20
push   $0xa
call   1030 <test_output@plt>
add    $0x10,%rsp
mov    (%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rsp)
cmp    $0xff,%eax
jl     1130 <PHC_test+0x20>
movl   $0x0,(%rsp)
lea    0x4(%rsp),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x20
push   $0xa
call   1030 <test_output@plt>
add    $0x10,%rsp
mov    (%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rsp)
cmp    $0xff,%eax
jl     1180 <PHC_test+0x70>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @PHC_test() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @test_output(i32* %1, i32 1, i32* %2, i32 1, i32* null, i32 0, i32 10, i32 32)
br label %8
8: ; preds = %6
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
store i32 0, i32* %1
br label %12
12: ; preds = %17, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 256
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = call i32 @test_output(i32* %2, i32 1, i32* %1, i32 1, i32* null, i32 0, i32 10, i32 32)
br label %17
17: ; preds = %15
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %12
20: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @PHC_test() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
store i32 0, i32* %1
br label %6
5: ; preds = %6
store i32 0, i32* %1
br label %11
6: ; preds = %0, %6
%7 = call i32 @test_output(i32* %1, i32 1, i32* %2, i32 1, i32* null, i32 0, i32 10, i32 32)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = icmp slt i32 %8, 255
br i1 %10, label %6, label %5
11: ; preds = %5, %11
%12 = call i32 @test_output(i32* %2, i32 1, i32* %1, i32 1, i32* null, i32 0, i32 10, i32 32)
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
%15 = icmp slt i32 %13, 255
br i1 %15, label %11, label %16
16: ; preds = %11
ret void
}