#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 main() {
  int a = -5, b = -5, c = -5, d = -5;
  int count = 0;
  int min = -5;
  int max = 0;
  for (a = min; a < max + 1; a++) {
    for (b = min; b < max + 1; b++) {
      for (c = min; c < max + 1; c++) {
        for (d = min; d < max + 1; d++) {
          if (a + b + c + d == -5) {
            count++;
            printf("%d %d %d %d sum:%d no.%d\n", a, b, c, d, a + b + c + d,
                   count);
          }
        }
      }
    }
  }
  printf("program ends.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffb,-0x8(%rbp)
movl   $0xfffffffb,-0xc(%rbp)
movl   $0xfffffffb,-0x10(%rbp)
movl   $0xfffffffb,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0xfffffffb,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1247 <main+0x137>
mov    -0x1c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1234 <main+0x124>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1221 <main+0x111>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    120e <main+0xfe>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
cmp    $0xfffffffb,%eax
jne    11fb <main+0xeb>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x8(%rbp),%r9d
add    -0xc(%rbp),%r9d
add    -0x10(%rbp),%r9d
add    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%eax
lea    0xe0f(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1200 <main+0xf0>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119b <main+0x8b>
jmp    1213 <main+0x103>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1184 <main+0x74>
jmp    1226 <main+0x116>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <main+0x5d>
jmp    1239 <main+0x129>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <main+0x46>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0xfffffffb,%r15d
mov    $0xfffffff1,%ecx
lea    0xec0(%rip),%r13
xor    %ebp,%ebp
jmp    1167 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x1(%r15),%eax
mov    0x14(%rsp),%ecx
add    $0x1,%ecx
test   %r15d,%r15d
mov    %eax,%r15d
je     1269 <main+0x149>
mov    %ecx,0x14(%rsp)
mov    %ecx,%r12d
mov    $0xfffffffb,%ebx
jmp    118d <main+0x6d>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rbx),%eax
add    $0x1,%r12d
test   %ebx,%ebx
mov    %eax,%ebx
je     1150 <main+0x30>
xor    %r14d,%r14d
jmp    11c7 <main+0xa7>
add    $0x1,%ebp
mov    %ebp,(%rsp)
lea    0xe79(%rip),%rdi
mov    %r15d,%esi
mov    %ebx,%edx
xor    %r8d,%r8d
nopw   0x0(%rax,%rax,1)
mov    $0xfffffffb,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14d
cmp    $0x6,%r14d
je     1180 <main+0x60>
lea    (%r12,%r14,1),%eax
add    $0x5,%eax
cmp    $0x5,%eax
ja     11bd <main+0x9d>
lea    -0x5(%r14),%ecx
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
add    $0x1,%ebp
mov    %ebp,(%rsp)
lea    0xe2a(%rip),%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    $0xffffffff,%r8d
jmp    11b0 <main+0x90>
add    $0x1,%ebp
mov    %ebp,(%rsp)
lea    0xe10(%rip),%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    $0xfffffffe,%r8d
jmp    11b0 <main+0x90>
add    $0x1,%ebp
mov    %ebp,(%rsp)
lea    0xdf6(%rip),%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    $0xfffffffd,%r8d
jmp    11b0 <main+0x90>
add    $0x1,%ebp
mov    %ebp,(%rsp)
lea    0xddc(%rip),%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    $0xfffffffc,%r8d
jmp    11b0 <main+0x90>
add    $0x1,%ebp
mov    %ebp,(%rsp)
lea    0xdbf(%rip),%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    $0xfffffffb,%r8d
jmp    11b0 <main+0x90>
lea    0xdc2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"%d %d %d %d sum:%d no.%d\0A\00"
@.str.1 = [15 x i8] c"program ends.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 -5, i32* %2
store i32 -5, i32* %3
store i32 -5, i32* %4
store i32 -5, i32* %5
store i32 0, i32* %6
store i32 -5, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %7
store i32 %9, i32* %2
br label %10
10: ; preds = %74, %0
%11 = load i32, i32* %2
%12 = load i32, i32* %8
%13 = add nsw i32 %12, 1
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %77
15: ; preds = %10
%16 = load i32, i32* %7
store i32 %16, i32* %3
br label %17
17: ; preds = %70, %15
%18 = load i32, i32* %3
%19 = load i32, i32* %8
%20 = add nsw i32 %19, 1
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %73
22: ; preds = %17
%23 = load i32, i32* %7
store i32 %23, i32* %4
br label %24
24: ; preds = %66, %22
%25 = load i32, i32* %4
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
%28 = icmp slt i32 %25, %27
br i1 %28, label %29, label %69
29: ; preds = %24
%30 = load i32, i32* %7
store i32 %30, i32* %5
br label %31
31: ; preds = %62, %29
%32 = load i32, i32* %5
%33 = load i32, i32* %8
%34 = add nsw i32 %33, 1
%35 = icmp slt i32 %32, %34
br i1 %35, label %36, label %65
36: ; preds = %31
%37 = load i32, i32* %2
%38 = load i32, i32* %3
%39 = add nsw i32 %37, %38
%40 = load i32, i32* %4
%41 = add nsw i32 %39, %40
%42 = load i32, i32* %5
%43 = add nsw i32 %41, %42
%44 = icmp eq i32 %43, -5
br i1 %44, label %45, label %61
45: ; preds = %36
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
%48 = load i32, i32* %2
%49 = load i32, i32* %3
%50 = load i32, i32* %4
%51 = load i32, i32* %5
%52 = load i32, i32* %2
%53 = load i32, i32* %3
%54 = add nsw i32 %52, %53
%55 = load i32, i32* %4
%56 = add nsw i32 %54, %55
%57 = load i32, i32* %5
%58 = add nsw i32 %56, %57
%59 = load i32, i32* %6
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %48, i32 %49, i32 %50, i32 %51, i32 %58, i32 %59)
br label %61
61: ; preds = %45, %36
br label %62
62: ; preds = %61
%63 = load i32, i32* %5
%64 = add nsw i32 %63, 1
store i32 %64, i32* %5
br label %31
65: ; preds = %31
br label %66
66: ; preds = %65
%67 = load i32, i32* %4
%68 = add nsw i32 %67, 1
store i32 %68, i32* %4
br label %24
69: ; preds = %24
br label %70
70: ; preds = %69
%71 = load i32, i32* %3
%72 = add nsw i32 %71, 1
store i32 %72, i32* %3
br label %17
73: ; preds = %17
br label %74
74: ; preds = %73
%75 = load i32, i32* %2
%76 = add nsw i32 %75, 1
store i32 %76, i32* %2
br label %10
77: ; preds = %10
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"%d %d %d %d sum:%d no.%d\0A\00"
@str = [14 x i8] c"program ends.\00"
define i32 @main() {
br label %1
1: ; preds = %0, %37
%2 = phi i32 [ -5, %0 ], [ %38, %37 ]
%3 = phi i32 [ 0, %0 ], [ %31, %37 ]
br label %4
4: ; preds = %1, %34
%5 = phi i32 [ -5, %1 ], [ %35, %34 ]
%6 = phi i32 [ %3, %1 ], [ %31, %34 ]
%7 = add nsw i32 %5, %2
br label %8
8: ; preds = %4, %30
%9 = phi i32 [ %6, %4 ], [ %31, %30 ]
%10 = phi i32 [ -5, %4 ], [ %32, %30 ]
%11 = add nsw i32 %7, %10
switch i32 %11, label %30 [
i32 0, label %12
i32 -1, label %15
i32 -2, label %18
i32 -3, label %21
i32 -4, label %24
i32 -5, label %27
]
12: ; preds = %8
%13 = add nsw i32 %9, 1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5, i32 %10, i32 -5, i32 -5, i32 %13)
br label %30
15: ; preds = %8
%16 = add nsw i32 %9, 1
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5, i32 %10, i32 -4, i32 -5, i32 %16)
br label %30
18: ; preds = %8
%19 = add nsw i32 %9, 1
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5, i32 %10, i32 -3, i32 -5, i32 %19)
br label %30
21: ; preds = %8
%22 = add nsw i32 %9, 1
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5, i32 %10, i32 -2, i32 -5, i32 %22)
br label %30
24: ; preds = %8
%25 = add nsw i32 %9, 1
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5, i32 %10, i32 -1, i32 -5, i32 %25)
br label %30
27: ; preds = %8
%28 = add nsw i32 %9, 1
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5, i32 %10, i32 0, i32 -5, i32 %28)
br label %30
30: ; preds = %8, %15, %12, %18, %21, %24, %27
%31 = phi i32 [ %28, %27 ], [ %25, %24 ], [ %22, %21 ], [ %19, %18 ], [ %13, %12 ], [ %16, %15 ], [ %9, %8 ]
%32 = add nsw i32 %10, 1
%33 = icmp eq i32 %10, 0
br i1 %33, label %34, label %8
34: ; preds = %30
%35 = add nsw i32 %5, 1
%36 = icmp eq i32 %5, 0
br i1 %36, label %37, label %4
37: ; preds = %34
%38 = add nsw i32 %2, 1
%39 = icmp eq i32 %2, 0
br i1 %39, label %40, label %1
40: ; preds = %37
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}