#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 */
scalar_t__ EOF;
int /*<<< orphan*/ magic_formula(long, long, long, long, long);
scalar_t__ scanf(char *, long *, long *, long *, long *, long *);
int main() {
  long int a, b, c, d, l;
  while (scanf("%ld %ld %ld %ld %ld", &a, &b, &c, &d, &l) != EOF) {
    if (a == 0 && b == 0 && c == 0 && d == 0 && l == 0)
      break;
    magic_formula(a, b, c, d, l);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
call   1030 <scanf@plt>
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     11b9 <main+0x99>
cmpq   $0x0,-0x10(%rbp)
jne    119b <main+0x7b>
cmpq   $0x0,-0x18(%rbp)
jne    119b <main+0x7b>
cmpq   $0x0,-0x20(%rbp)
jne    119b <main+0x7b>
cmpq   $0x0,-0x28(%rbp)
jne    119b <main+0x7b>
cmpq   $0x0,-0x30(%rbp)
jne    119b <main+0x7b>
jmp    11b9 <main+0x99>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1040 <magic_formula@plt>
jmp    112f <main+0xf>
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    $0x28,%rsp
lea    0xecb(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %rsp,%r9
call   1030 <scanf@plt>
mov    0x2e90(%rip),%r14
cmp    (%r14),%rax
je     11d6 <main+0xb6>
lea    0x20(%rsp),%r15
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0x8(%rsp),%rbx
mov    %rsp,%rbp
jmp    11a5 <main+0x85>
cs nopw 0x0(%rax,%rax,1)
call   1040 <magic_formula@plt>
lea    0xe74(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %rbp,%r9
call   1030 <scanf@plt>
cmp    (%r14),%rax
je     11d6 <main+0xb6>
mov    0x20(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    0x8(%rsp),%rcx
mov    (%rsp),%r8
test   %rdi,%rdi
jne    1180 <main+0x60>
test   %rsi,%rsi
jne    1180 <main+0x60>
test   %rdx,%rdx
jne    1180 <main+0x60>
test   %rcx,%rcx
jne    1180 <main+0x60>
test   %r8,%r8
jne    1180 <main+0x60>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"%ld %ld %ld %ld %ld\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = bitcast i64* %1 to i8*
%7 = bitcast i64* %2 to i8*
%8 = bitcast i64* %3 to i8*
%9 = bitcast i64* %4 to i8*
%10 = bitcast i64* %5 to i8*
%11 = call i64 @scanf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2, i64* %3, i64* %4, i64* %5)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %34, label %14
14: ; preds = %0, %29
%15 = load i64, i64* %1
%16 = icmp eq i64 %15, 0
%17 = load i64, i64* %2
%18 = icmp eq i64 %17, 0
%19 = select i1 %16, i1 %18, i1 false
%20 = load i64, i64* %3
%21 = icmp eq i64 %20, 0
%22 = select i1 %19, i1 %21, i1 false
%23 = load i64, i64* %4
%24 = icmp eq i64 %23, 0
%25 = select i1 %22, i1 %24, i1 false
%26 = load i64, i64* %5
%27 = icmp eq i64 %26, 0
%28 = select i1 %25, i1 %27, i1 false
br i1 %28, label %34, label %29
29: ; preds = %14
%30 = call i32 @magic_formula(i64 %15, i64 %17, i64 %20, i64 %23, i64 %26)
%31 = call i64 @scanf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2, i64* %3, i64* %4, i64* %5)
%32 = load i64, i64* @EOF
%33 = icmp eq i64 %31, %32
br i1 %33, label %34, label %14
34: ; preds = %29, %14, %0
ret i32 0
}