#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 */
struct quad {
  int dummy;
};

/* Variables and functions */
int calculate(int /*<<< orphan*/);
int /*<<< orphan*/ compare(struct quad *, struct quad *);
struct quad *creat(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  struct quad *head, *next;
  int n, i, sum;
  int c;
  scanf("%d", &n);
  getchar();
  for (i = 0; i < n; i++) {
    sum = 0;
    head = creat(1);
    getchar();
    next = creat(1);
    getchar();
    printf("There are %d black pixels.\n", calculate(compare(head, next)));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11fa <main+0x9a>
movl   $0x0,-0x24(%rbp)
mov    $0x1,%edi
call   1070 <creat@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x1,%edi
call   1070 <creat@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <compare@plt>
mov    %eax,%edi
call   1040 <calculate@plt>
mov    %eax,%esi
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    118d <main+0x2d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xe92(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    11dd <main+0x7d>
lea    0xe76(%rip),%r14
xor    %ebp,%ebp
nop
mov    $0x1,%edi
call   1070 <creat@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1050 <getchar@plt>
mov    $0x1,%edi
call   1070 <creat@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <compare@plt>
mov    %eax,%edi
call   1040 <calculate@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1190 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.quad = type { i32 }
@.str = [3 x i8] c"%d\00"
@.str.1 = [28 x i8] c"There are %d black pixels.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.quad*
%3 = alloca %struct.quad*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%9 = call i32 (...) @getchar()
store i32 0, i32* %5
br label %10
10: ; preds = %24, %0
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %10
store i32 0, i32* %6
%15 = call %struct.quad* @creat(i32 1)
store %struct.quad* %15, %struct.quad** %2
%16 = call i32 (...) @getchar()
%17 = call %struct.quad* @creat(i32 1)
store %struct.quad* %17, %struct.quad** %3
%18 = call i32 (...) @getchar()
%19 = load %struct.quad*, %struct.quad** %2
%20 = load %struct.quad*, %struct.quad** %3
%21 = call i32 @compare(%struct.quad* %19, %struct.quad* %20)
%22 = call i32 @calculate(i32 %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %14
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %10
27: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
%struct.quad = type { i32 }
@.str = [3 x i8] c"%d\00"
@.str.1 = [28 x i8] c"There are %d black pixels.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 (...) @getchar()
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %0, %7
%8 = phi i32 [ %16, %7 ], [ 0, %0 ]
%9 = call %struct.quad* @creat(i32 1)
%10 = call i32 (...) @getchar()
%11 = call %struct.quad* @creat(i32 1)
%12 = call i32 (...) @getchar()
%13 = call i32 @compare(%struct.quad* %9, %struct.quad* %11)
%14 = call i32 @calculate(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = add nuw nsw i32 %8, 1
%17 = load i32, i32* %1
%18 = icmp slt i32 %16, %17
br i1 %18, label %7, label %19
19: ; preds = %7, %0
ret i32 0
}