#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 add(int, int);
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int a, b, c, d, e;
  int i, f;
  f = 1;
  for (i = 7; i > 0; i = i - 1) {
    a = add(i, 0);
    b = add(a, 1);
    c = add(2, b);
    d = add(c, -5);
    e = add(d, 1);
    f = f * add(e, 1);
  }
  print_int(f);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x1c(%rbp)
movl   $0x7,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    11c9 <main+0x99>
mov    -0x18(%rbp),%edi
xor    %esi,%esi
call   1030 <add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1030 <add@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0xfffffffb,%esi
call   1030 <add@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1146 <main+0x16>
mov    -0x1c(%rbp),%edi
call   1050 <print_int@plt>
lea    0xe28(%rip),%rdi
call   1040 <print_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    $0x2,%edi
mov    %eax,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0xfffffffb,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%ebp
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    $0x2,%edi
mov    %eax,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0xfffffffb,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
imul   %eax,%ebp
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    $0x2,%edi
mov    %eax,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0xfffffffb,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%ebx
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    $0x2,%edi
mov    %eax,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0xfffffffb,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
imul   %eax,%ebx
imul   %ebp,%ebx
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    $0x2,%edi
mov    %eax,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0xfffffffb,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%ebp
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    $0x2,%edi
mov    %eax,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0xfffffffb,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
imul   %eax,%ebp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    $0x2,%edi
mov    %eax,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0xfffffffb,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <add@plt>
imul   %eax,%ebp
imul   %ebx,%ebp
mov    %ebp,%edi
call   1050 <print_int@plt>
lea    0xcaf(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 1, i32* %7
store i32 7, i32* %6
br label %8
8: ; preds = %26, %0
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i32, i32* %6
%13 = call i32 @add(i32 %12, i32 0)
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = call i32 @add(i32 %14, i32 1)
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = call i32 @add(i32 2, i32 %16)
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = call i32 @add(i32 %18, i32 -5)
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = call i32 @add(i32 %20, i32 1)
store i32 %21, i32* %5
%22 = load i32, i32* %7
%23 = load i32, i32* %5
%24 = call i32 @add(i32 %23, i32 1)
%25 = mul nsw i32 %22, %24
store i32 %25, i32* %7
br label %26
26: ; preds = %11
%27 = load i32, i32* %6
%28 = sub nsw i32 %27, 1
store i32 %28, i32* %6
br label %8
29: ; preds = %8
%30 = load i32, i32* %7
%31 = call i32 @print_int(i32 %30)
%32 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @add(i32 7, i32 0)
%2 = tail call i32 @add(i32 %1, i32 1)
%3 = tail call i32 @add(i32 2, i32 %2)
%4 = tail call i32 @add(i32 %3, i32 -5)
%5 = tail call i32 @add(i32 %4, i32 1)
%6 = tail call i32 @add(i32 %5, i32 1)
%7 = tail call i32 @add(i32 6, i32 0)
%8 = tail call i32 @add(i32 %7, i32 1)
%9 = tail call i32 @add(i32 2, i32 %8)
%10 = tail call i32 @add(i32 %9, i32 -5)
%11 = tail call i32 @add(i32 %10, i32 1)
%12 = tail call i32 @add(i32 %11, i32 1)
%13 = mul nsw i32 %12, %6
%14 = tail call i32 @add(i32 5, i32 0)
%15 = tail call i32 @add(i32 %14, i32 1)
%16 = tail call i32 @add(i32 2, i32 %15)
%17 = tail call i32 @add(i32 %16, i32 -5)
%18 = tail call i32 @add(i32 %17, i32 1)
%19 = tail call i32 @add(i32 %18, i32 1)
%20 = mul nsw i32 %19, %13
%21 = tail call i32 @add(i32 4, i32 0)
%22 = tail call i32 @add(i32 %21, i32 1)
%23 = tail call i32 @add(i32 2, i32 %22)
%24 = tail call i32 @add(i32 %23, i32 -5)
%25 = tail call i32 @add(i32 %24, i32 1)
%26 = tail call i32 @add(i32 %25, i32 1)
%27 = mul nsw i32 %26, %20
%28 = tail call i32 @add(i32 3, i32 0)
%29 = tail call i32 @add(i32 %28, i32 1)
%30 = tail call i32 @add(i32 2, i32 %29)
%31 = tail call i32 @add(i32 %30, i32 -5)
%32 = tail call i32 @add(i32 %31, i32 1)
%33 = tail call i32 @add(i32 %32, i32 1)
%34 = mul nsw i32 %33, %27
%35 = tail call i32 @add(i32 2, i32 0)
%36 = tail call i32 @add(i32 %35, i32 1)
%37 = tail call i32 @add(i32 2, i32 %36)
%38 = tail call i32 @add(i32 %37, i32 -5)
%39 = tail call i32 @add(i32 %38, i32 1)
%40 = tail call i32 @add(i32 %39, i32 1)
%41 = mul nsw i32 %40, %34
%42 = tail call i32 @add(i32 1, i32 0)
%43 = tail call i32 @add(i32 %42, i32 1)
%44 = tail call i32 @add(i32 2, i32 %43)
%45 = tail call i32 @add(i32 %44, i32 -5)
%46 = tail call i32 @add(i32 %45, i32 1)
%47 = tail call i32 @add(i32 %46, i32 1)
%48 = mul nsw i32 %47, %41
%49 = tail call i32 @print_int(i32 %48)
%50 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}