#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*/ printf(char *, int, int, int);
int main(void) {
  int x;
  int y;
  int z;
  for (x = 0; x <= 100; x++) {
    for (y = 0; y <= 100; y++) {
      z = 100 - x - y;
      if (z % 3 == 0 && 5 * x + 3 * y + z / 3 == 100) {
        printf("公鸡%d,母鸡%d,小鸡%d\n", x, y, z);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     11c6 <main+0xb6>
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jg     11b3 <main+0xa3>
mov    $0x64,%eax
sub    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a0 <main+0x90>
imul   $0x5,-0x8(%rbp),%eax
imul   $0x3,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
cmp    $0x64,%eax
jne    11a0 <main+0x90>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    11a5 <main+0x95>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
jmp    11b8 <main+0xa8>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r15d,%r15d
mov    $0x64,%r14d
mov    $0x64,%r13d
jmp    1142 <main+0x32>
nopl   0x0(%rax)
add    $0x1,%r15d
add    $0xffffffff,%r13d
add    $0xfffffffb,%r14d
cmp    $0x65,%r15d
je     11a2 <main+0x92>
mov    %r14d,%r12d
mov    %r13d,%ebp
xor    %ebx,%ebx
jmp    115f <main+0x4f>
nopl   0x0(%rax)
add    $0x1,%ebx
add    $0xffffffff,%ebp
add    $0xfffffffd,%r12d
cmp    $0x65,%ebx
je     1130 <main+0x20>
imul   $0xaaaaaaab,%ebp,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555554,%eax
ja     1150 <main+0x40>
movslq %ebp,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
cmp    %r12d,%eax
jne    1150 <main+0x40>
lea    0xe6c(%rip),%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
jmp    1150 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\E5\85\AC\E9\B8\A1%d,\E6\AF\8D\E9\B8\A1%d,\E5\B0\8F\E9\B8\A1%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %40, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 100
br i1 %7, label %8, label %43
8: ; preds = %5
store i32 0, i32* %3
br label %9
9: ; preds = %36, %8
%10 = load i32, i32* %3
%11 = icmp sle i32 %10, 100
br i1 %11, label %12, label %39
12: ; preds = %9
%13 = load i32, i32* %2
%14 = sub nsw i32 100, %13
%15 = load i32, i32* %3
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = srem i32 %17, 3
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %35
20: ; preds = %12
%21 = load i32, i32* %2
%22 = mul nsw i32 5, %21
%23 = load i32, i32* %3
%24 = mul nsw i32 3, %23
%25 = add nsw i32 %22, %24
%26 = load i32, i32* %4
%27 = sdiv i32 %26, 3
%28 = add nsw i32 %25, %27
%29 = icmp eq i32 %28, 100
br i1 %29, label %30, label %35
30: ; preds = %20
%31 = load i32, i32* %2
%32 = load i32, i32* %3
%33 = load i32, i32* %4
%34 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %31, i32 %32, i32 %33)
br label %35
35: ; preds = %30, %20, %12
br label %36
36: ; preds = %35
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %9
39: ; preds = %9
br label %40
40: ; preds = %39
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %5
43: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"\E5\85\AC\E9\B8\A1%d,\E6\AF\8D\E9\B8\A1%d,\E5\B0\8F\E9\B8\A1%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %21
%2 = phi i32 [ 0, %0 ], [ %22, %21 ]
%3 = mul nuw nsw i32 %2, 5
br label %4
4: ; preds = %1, %18
%5 = phi i32 [ 0, %1 ], [ %19, %18 ]
%6 = add nuw nsw i32 %2, %5
%7 = sub nsw i32 100, %6
%8 = srem i32 %7, 3
%9 = sdiv i32 %7, 3
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = mul nuw nsw i32 %5, 3
%13 = add nuw nsw i32 %12, %3
%14 = add nsw i32 %13, %9
%15 = icmp eq i32 %14, 100
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5, i32 %7)
br label %18
18: ; preds = %4, %11, %16
%19 = add nuw nsw i32 %5, 1
%20 = icmp eq i32 %19, 101
br i1 %20, label %21, label %4
21: ; preds = %18
%22 = add nuw nsw i32 %2, 1
%23 = icmp eq i32 %22, 101
br i1 %23, label %24, label %1
24: ; preds = %21
ret i32 0
}