#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int max(int, int, int, int, int, int, int, int, int, int, int);
int min(int, int, int, int, int, int, int, int, int, int, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int sum(int, int, int, int, int, int, int, int, int, int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int test_implementations_by_sending_ten_elements() {
  srand(time(NULL));
  int elements[10];
  elements[0] = rand() % (1000000 - 1 + 1) + 1;
  elements[1] = rand() % (1000000 - 1 + 1) + 1;
  elements[2] = rand() % (1000000 - 1 + 1) + 1;
  elements[3] = rand() % (1000000 - 1 + 1) + 1;
  elements[4] = rand() % (1000000 - 1 + 1) + 1;
  elements[5] = rand() % (1000000 - 1 + 1) + 1;
  elements[6] = rand() % (1000000 - 1 + 1) + 1;
  elements[7] = rand() % (1000000 - 1 + 1) + 1;
  elements[8] = rand() % (1000000 - 1 + 1) + 1;
  elements[9] = rand() % (1000000 - 1 + 1) + 1;
  fprintf(stderr, "Sending following ten elements:\n");
  for (int i = 0; i < 10; i++) {
    fprintf(stderr, "%d\n", elements[i]);
  }
  int elements_sum =
      sum(10, elements[0], elements[1], elements[2], elements[3], elements[4],
          elements[5], elements[6], elements[7], elements[8], elements[9]);
  int minimum_element =
      min(10, elements[0], elements[1], elements[2], elements[3], elements[4],
          elements[5], elements[6], elements[7], elements[8], elements[9]);
  int maximum_element =
      max(10, elements[0], elements[1], elements[2], elements[3], elements[4],
          elements[5], elements[6], elements[7], elements[8], elements[9]);
  fprintf(stderr, "Your output is:\n");
  fprintf(stderr, "Elements sum is %d\n", elements_sum);
  fprintf(stderr, "Minimum element is %d\n", minimum_element);
  fprintf(stderr, "Maximum element is %d\n\n", maximum_element);
  int expected_elements_sum = 0;
  for (int i = 0; i < 10; i++) {
    if (elements[i] < minimum_element) {
      return 0;
    }
    if (elements[i] > maximum_element) {
      return 0;
    }
    expected_elements_sum += elements[i];
  }
  return elements_sum == expected_elements_sum;
}


x86 assembly (clang, -O0):
<test_implementations_by_sending_ten_elements>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x40(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x3c(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x38(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x34(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x30(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x28(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
mov    0x2d7c(%rip),%rax
mov    (%rax),%edi
lea    0xd93(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    12b2 <test_implementations_by_sending_ten_elements+0x142>
mov    0x2d54(%rip),%rax
mov    (%rax),%edi
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xda5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    127b <test_implementations_by_sending_ten_elements+0x10b>
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    -0x2c(%rbp),%r14d
mov    -0x28(%rbp),%ebx
mov    -0x24(%rbp),%r11d
mov    -0x20(%rbp),%r10d
mov    -0x1c(%rbp),%eax
mov    $0xa,%edi
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1070 <sum@plt>
mov    %eax,-0x48(%rbp)
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    -0x2c(%rbp),%r14d
mov    -0x28(%rbp),%ebx
mov    -0x24(%rbp),%r11d
mov    -0x20(%rbp),%r10d
mov    -0x1c(%rbp),%eax
mov    $0xa,%edi
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1030 <min@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    -0x2c(%rbp),%r14d
mov    -0x28(%rbp),%ebx
mov    -0x24(%rbp),%r11d
mov    -0x20(%rbp),%r10d
mov    -0x1c(%rbp),%eax
mov    $0xa,%edi
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1040 <max@plt>
mov    %eax,-0x50(%rbp)
mov    0x2c55(%rip),%rax
mov    (%rax),%edi
lea    0xc8d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c3e(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%edx
lea    0xc84(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c24(%rip),%rax
mov    (%rax),%edi
mov    -0x4c(%rbp),%edx
lea    0xc7e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c0a(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%edx
lea    0xc7b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
cmpl   $0xa,-0x58(%rbp)
jge    1457 <test_implementations_by_sending_ten_elements+0x2e7>
movslq -0x58(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
cmp    -0x4c(%rbp),%eax
jge    141e <test_implementations_by_sending_ten_elements+0x2ae>
movl   $0x0,-0x14(%rbp)
jmp    1468 <test_implementations_by_sending_ten_elements+0x2f8>
movslq -0x58(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
cmp    -0x50(%rbp),%eax
jle    143b <test_implementations_by_sending_ten_elements+0x2cb>
movl   $0x0,-0x14(%rbp)
jmp    1468 <test_implementations_by_sending_ten_elements+0x2f8>
movslq -0x58(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
add    -0x54(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    13f7 <test_implementations_by_sending_ten_elements+0x287>
mov    -0x48(%rbp),%eax
cmp    -0x54(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_implementations_by_sending_ten_elements>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%rcx
imul   $0x431bde83,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
sar    $0x12,%edx
add    %ecx,%edx
imul   $0xf4240,%edx,%ecx
mov    %ecx,0x54(%rsp)
neg    %ecx
mov    %rax,0xb8(%rsp)
lea    (%rax,%rcx,1),%r14d
add    $0x1,%r14d
mov    %r14d,0x1c(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%rcx
imul   $0x431bde83,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
sar    $0x12,%edx
add    %ecx,%edx
imul   $0xf4240,%edx,%ecx
mov    %ecx,0x50(%rsp)
neg    %ecx
mov    %rax,0xb0(%rsp)
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x18(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%rcx
imul   $0x431bde83,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
sar    $0x12,%edx
add    %ecx,%edx
imul   $0xf4240,%edx,%ecx
mov    %ecx,0x4c(%rsp)
neg    %ecx
mov    %rax,0xa8(%rsp)
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x14(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%rcx
imul   $0x431bde83,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
sar    $0x12,%edx
add    %ecx,%edx
imul   $0xf4240,%edx,%ecx
mov    %ecx,0x48(%rsp)
neg    %ecx
mov    %rax,0xa0(%rsp)
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x10(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%rcx
imul   $0x431bde83,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
sar    $0x12,%edx
add    %ecx,%edx
imul   $0xf4240,%edx,%ecx
mov    %ecx,0x44(%rsp)
neg    %ecx
mov    %rax,0x98(%rsp)
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0xc(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%rcx
imul   $0x431bde83,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
sar    $0x12,%edx
add    %ecx,%edx
imul   $0xf4240,%edx,%ecx
mov    %ecx,0x40(%rsp)
neg    %ecx
mov    %rax,0x90(%rsp)
add    %ecx,%eax
add    $0x1,%eax
mov    %rax,0x68(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%rcx
imul   $0x431bde83,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
sar    $0x12,%edx
add    %ecx,%edx
imul   $0xf4240,%edx,%ecx
mov    %ecx,0x3c(%rsp)
neg    %ecx
mov    %rax,0x88(%rsp)
add    %ecx,%eax
add    $0x1,%eax
mov    %rax,0x28(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%rcx
imul   $0x431bde83,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
sar    $0x12,%edx
add    %ecx,%edx
imul   $0xf4240,%edx,%ecx
mov    %ecx,0x38(%rsp)
neg    %ecx
mov    %rax,0x80(%rsp)
lea    (%rax,%rcx,1),%r12d
add    $0x1,%r12d
mov    %r12,0x60(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%rcx
imul   $0x431bde83,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
sar    $0x12,%edx
add    %ecx,%edx
imul   $0xf4240,%edx,%ecx
mov    %ecx,0x34(%rsp)
neg    %ecx
mov    %rax,0x78(%rsp)
add    %ecx,%eax
add    $0x1,%eax
mov    %rax,0x20(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%rcx
imul   $0x431bde83,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
sar    $0x12,%edx
add    %ecx,%edx
imul   $0xf4240,%edx,%ecx
mov    %ecx,0x30(%rsp)
neg    %ecx
mov    %rax,0x70(%rsp)
lea    (%rax,%rcx,1),%r15d
add    $0x1,%r15d
mov    0x2bda(%rip),%rbx
mov    (%rbx),%edi
lea    0xbf1(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xc23(%rip),%rbp
mov    %rbp,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %rbp,%rsi
mov    0x18(%rsp),%r13d
mov    %r13d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %rbp,%rsi
mov    0x14(%rsp),%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %rbp,%rsi
mov    0x10(%rsp),%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %rbp,%rsi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %rbp,%rsi
mov    0x68(%rsp),%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %rbp,%rsi
mov    0x28(%rsp),%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %rbp,%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %rbp,%rsi
mov    0x20(%rsp),%r12
mov    %r12d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %rbp,%rsi
mov    %r15,0xc0(%rsp)
mov    %r15d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
sub    $0x8,%rsp
mov    $0xa,%edi
mov    0x24(%rsp),%ebp
mov    %ebp,%esi
mov    %r13d,%edx
mov    0x1c(%rsp),%ebx
mov    %ebx,%ecx
mov    0x18(%rsp),%r14d
mov    %r14d,%r8d
mov    0x14(%rsp),%r9d
push   %r15
push   %r12
mov    0x78(%rsp),%r12
push   %r12
push   0x48(%rsp)
mov    0x90(%rsp),%r15
push   %r15
call   1070 <sum@plt>
add    $0x30,%rsp
mov    %eax,0x58(%rsp)
sub    $0x8,%rsp
mov    $0xa,%edi
mov    %ebp,%esi
mov    %r13d,%edx
mov    %ebx,%ecx
mov    %r14d,%r8d
mov    0x14(%rsp),%r9d
mov    0xc8(%rsp),%rbx
push   %rbx
push   0x30(%rsp)
push   %r12
mov    0x48(%rsp),%rbp
push   %rbp
push   %r15
call   1030 <min@plt>
add    $0x30,%rsp
mov    %eax,0x5c(%rsp)
sub    $0x8,%rsp
mov    $0xa,%edi
mov    0x24(%rsp),%esi
mov    %r13d,%edx
mov    0x1c(%rsp),%ecx
mov    0x60(%rsp),%r13d
mov    %r14d,%r8d
mov    0x14(%rsp),%r9d
mov    %rbx,%r14
push   %rbx
push   0x30(%rsp)
push   %r12
push   %rbp
mov    %r15,%r12
push   %r15
call   1040 <max@plt>
add    $0x30,%rsp
mov    %eax,%r15d
mov    0x2a49(%rip),%rbx
mov    (%rbx),%edi
lea    0xa81(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xa82(%rip),%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xa83(%rip),%rsi
mov    0x5c(%rsp),%ebp
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xa84(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x1c(%rsp),%ecx
cmp    %ebp,%ecx
jl     1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0xb8(%rsp),%rax
sub    0x54(%rsp),%eax
cmp    %r15d,%eax
jge    1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    %ebp,%ebx
cmp    %ebp,0x18(%rsp)
jl     1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0xb0(%rsp),%rax
sub    0x50(%rsp),%eax
cmp    %r15d,%eax
jge    1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0x14(%rsp),%edx
cmp    %ebx,%edx
jl     1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0xa8(%rsp),%rax
sub    0x4c(%rsp),%eax
cmp    %r15d,%eax
jge    1734 <test_implementations_by_sending_ten_elements+0x5c4>
cmp    %ebx,0x10(%rsp)
jl     1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0xa0(%rsp),%rax
sub    0x48(%rsp),%eax
cmp    %r15d,%eax
jge    1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0xc(%rsp),%esi
cmp    %ebx,%esi
jl     1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0x98(%rsp),%rax
sub    0x44(%rsp),%eax
cmp    %r15d,%eax
jge    1734 <test_implementations_by_sending_ten_elements+0x5c4>
cmp    %ebx,%r12d
jl     1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0x90(%rsp),%rax
sub    0x40(%rsp),%eax
cmp    %r15d,%eax
jge    1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0x28(%rsp),%rdi
cmp    %ebx,%edi
jl     1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0x88(%rsp),%rax
sub    0x3c(%rsp),%eax
cmp    %r15d,%eax
jge    1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0x60(%rsp),%rbp
cmp    %ebx,%ebp
jl     1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0x80(%rsp),%rax
sub    0x38(%rsp),%eax
cmp    %r15d,%eax
jge    1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0x20(%rsp),%r8
cmp    %ebx,%r8d
jl     1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0x78(%rsp),%rax
sub    0x34(%rsp),%eax
cmp    %r15d,%eax
jge    1734 <test_implementations_by_sending_ten_elements+0x5c4>
cmp    %ebx,%r14d
jl     1734 <test_implementations_by_sending_ten_elements+0x5c4>
mov    0x70(%rsp),%rax
sub    0x30(%rsp),%eax
cmp    %r15d,%eax
mov    $0x0,%eax
jge    1736 <test_implementations_by_sending_ten_elements+0x5c6>
mov    0x18(%rsp),%eax
add    %ecx,%eax
add    %eax,%edx
mov    0x10(%rsp),%eax
add    %edx,%eax
add    %eax,%esi
add    %esi,%r12d
add    %r12d,%edi
add    %edi,%ebp
add    %ebp,%r8d
add    %r8d,%r14d
xor    %eax,%eax
cmp    %r14d,%r13d
sete   %al
jmp    1736 <test_implementations_by_sending_ten_elements+0x5c6>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Sending following ten elements:\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [17 x i8] c"Your output is:\0A\00"
@.str.3 = [20 x i8] c"Elements sum is %d\0A\00"
@.str.4 = [23 x i8] c"Minimum element is %d\0A\00"
@.str.5 = [24 x i8] c"Maximum element is %d\0A\0A\00"
define i32 @test_implementations_by_sending_ten_elements() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = call i32 @time(i32* null)
%10 = call i32 @srand(i32 %9)
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 1000000
%13 = add nsw i32 %12, 1
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 %13, i32* %14
%15 = call i32 (...) @rand()
%16 = srem i32 %15, 1000000
%17 = add nsw i32 %16, 1
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
store i32 %17, i32* %18
%19 = call i32 (...) @rand()
%20 = srem i32 %19, 1000000
%21 = add nsw i32 %20, 1
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
store i32 %21, i32* %22
%23 = call i32 (...) @rand()
%24 = srem i32 %23, 1000000
%25 = add nsw i32 %24, 1
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
store i32 %25, i32* %26
%27 = call i32 (...) @rand()
%28 = srem i32 %27, 1000000
%29 = add nsw i32 %28, 1
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
store i32 %29, i32* %30
%31 = call i32 (...) @rand()
%32 = srem i32 %31, 1000000
%33 = add nsw i32 %32, 1
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
store i32 %33, i32* %34
%35 = call i32 (...) @rand()
%36 = srem i32 %35, 1000000
%37 = add nsw i32 %36, 1
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
store i32 %37, i32* %38
%39 = call i32 (...) @rand()
%40 = srem i32 %39, 1000000
%41 = add nsw i32 %40, 1
%42 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
store i32 %41, i32* %42
%43 = call i32 (...) @rand()
%44 = srem i32 %43, 1000000
%45 = add nsw i32 %44, 1
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
store i32 %45, i32* %46
%47 = call i32 (...) @rand()
%48 = srem i32 %47, 1000000
%49 = add nsw i32 %48, 1
%50 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
store i32 %49, i32* %50
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %53
53: ; preds = %63, %0
%54 = load i32, i32* %3
%55 = icmp slt i32 %54, 10
br i1 %55, label %56, label %66
56: ; preds = %53
%57 = load i32, i32* @stderr
%58 = load i32, i32* %3
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %56
%64 = load i32, i32* %3
%65 = add nsw i32 %64, 1
store i32 %65, i32* %3
br label %53
66: ; preds = %53
%67 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%68 = load i32, i32* %67
%69 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%70 = load i32, i32* %69
%71 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%72 = load i32, i32* %71
%73 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%74 = load i32, i32* %73
%75 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%76 = load i32, i32* %75
%77 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%78 = load i32, i32* %77
%79 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%80 = load i32, i32* %79
%81 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%82 = load i32, i32* %81
%83 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%84 = load i32, i32* %83
%85 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%86 = load i32, i32* %85
%87 = call i32 @sum(i32 10, i32 %68, i32 %70, i32 %72, i32 %74, i32 %76, i32 %78, i32 %80, i32 %82, i32 %84, i32 %86)
store i32 %87, i32* %4
%88 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%89 = load i32, i32* %88
%90 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%91 = load i32, i32* %90
%92 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%93 = load i32, i32* %92
%94 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%95 = load i32, i32* %94
%96 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%97 = load i32, i32* %96
%98 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%99 = load i32, i32* %98
%100 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%101 = load i32, i32* %100
%102 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%103 = load i32, i32* %102
%104 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%105 = load i32, i32* %104
%106 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%107 = load i32, i32* %106
%108 = call i32 @min(i32 10, i32 %89, i32 %91, i32 %93, i32 %95, i32 %97, i32 %99, i32 %101, i32 %103, i32 %105, i32 %107)
store i32 %108, i32* %5
%109 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%110 = load i32, i32* %109
%111 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%112 = load i32, i32* %111
%113 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%114 = load i32, i32* %113
%115 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%116 = load i32, i32* %115
%117 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%118 = load i32, i32* %117
%119 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%120 = load i32, i32* %119
%121 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%122 = load i32, i32* %121
%123 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%124 = load i32, i32* %123
%125 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%126 = load i32, i32* %125
%127 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%128 = load i32, i32* %127
%129 = call i32 @max(i32 10, i32 %110, i32 %112, i32 %114, i32 %116, i32 %118, i32 %120, i32 %122, i32 %124, i32 %126, i32 %128)
store i32 %129, i32* %6
%130 = load i32, i32* @stderr
%131 = call i32 (i32, i8*, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%132 = load i32, i32* @stderr
%133 = load i32, i32* %4
%134 = call i32 (i32, i8*, ...) @fprintf(i32 %132, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %133)
%135 = load i32, i32* @stderr
%136 = load i32, i32* %5
%137 = call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %136)
%138 = load i32, i32* @stderr
%139 = load i32, i32* %6
%140 = call i32 (i32, i8*, ...) @fprintf(i32 %138, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %139)
store i32 0, i32* %7
store i32 0, i32* %8
br label %141
141: ; preds = %167, %66
%142 = load i32, i32* %8
%143 = icmp slt i32 %142, 10
br i1 %143, label %144, label %170
144: ; preds = %141
%145 = load i32, i32* %8
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %146
%148 = load i32, i32* %147
%149 = load i32, i32* %5
%150 = icmp slt i32 %148, %149
br i1 %150, label %151, label %152
151: ; preds = %144
store i32 0, i32* %1
br label %175
152: ; preds = %144
%153 = load i32, i32* %8
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %154
%156 = load i32, i32* %155
%157 = load i32, i32* %6
%158 = icmp sgt i32 %156, %157
br i1 %158, label %159, label %160
159: ; preds = %152
store i32 0, i32* %1
br label %175
160: ; preds = %152
%161 = load i32, i32* %8
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %162
%164 = load i32, i32* %163
%165 = load i32, i32* %7
%166 = add nsw i32 %165, %164
store i32 %166, i32* %7
br label %167
167: ; preds = %160
%168 = load i32, i32* %8
%169 = add nsw i32 %168, 1
store i32 %169, i32* %8
br label %141
170: ; preds = %141
%171 = load i32, i32* %4
%172 = load i32, i32* %7
%173 = icmp eq i32 %171, %172
%174 = zext i1 %173 to i32
store i32 %174, i32* %1
br label %175
175: ; preds = %170, %159, %151
%176 = load i32, i32* %1
ret i32 %176
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Sending following ten elements:\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [17 x i8] c"Your output is:\0A\00"
@.str.3 = [20 x i8] c"Elements sum is %d\0A\00"
@.str.4 = [23 x i8] c"Minimum element is %d\0A\00"
@.str.5 = [24 x i8] c"Maximum element is %d\0A\0A\00"
define i32 @test_implementations_by_sending_ten_elements() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 1000000
%5 = add nsw i32 %4, 1
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 1000000
%8 = add nsw i32 %7, 1
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 1000000
%11 = add nsw i32 %10, 1
%12 = tail call i32 (...) @rand()
%13 = srem i32 %12, 1000000
%14 = add nsw i32 %13, 1
%15 = tail call i32 (...) @rand()
%16 = srem i32 %15, 1000000
%17 = add nsw i32 %16, 1
%18 = tail call i32 (...) @rand()
%19 = srem i32 %18, 1000000
%20 = add nsw i32 %19, 1
%21 = tail call i32 (...) @rand()
%22 = srem i32 %21, 1000000
%23 = add nsw i32 %22, 1
%24 = tail call i32 (...) @rand()
%25 = srem i32 %24, 1000000
%26 = add nsw i32 %25, 1
%27 = tail call i32 (...) @rand()
%28 = srem i32 %27, 1000000
%29 = add nsw i32 %28, 1
%30 = tail call i32 (...) @rand()
%31 = srem i32 %30, 1000000
%32 = add nsw i32 %31, 1
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%35 = load i32, i32* @stderr
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%37 = load i32, i32* @stderr
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%39 = load i32, i32* @stderr
%40 = tail call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%41 = load i32, i32* @stderr
%42 = tail call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%43 = load i32, i32* @stderr
%44 = tail call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%45 = load i32, i32* @stderr
%46 = tail call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%47 = load i32, i32* @stderr
%48 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%49 = load i32, i32* @stderr
%50 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%51 = load i32, i32* @stderr
%52 = tail call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%53 = load i32, i32* @stderr
%54 = tail call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%55 = tail call i32 @sum(i32 10, i32 %5, i32 %8, i32 %11, i32 %14, i32 %17, i32 %20, i32 %23, i32 %26, i32 %29, i32 %32)
%56 = tail call i32 @min(i32 10, i32 %5, i32 %8, i32 %11, i32 %14, i32 %17, i32 %20, i32 %23, i32 %26, i32 %29, i32 %32)
%57 = tail call i32 @max(i32 10, i32 %5, i32 %8, i32 %11, i32 %14, i32 %17, i32 %20, i32 %23, i32 %26, i32 %29, i32 %32)
%58 = load i32, i32* @stderr
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%60 = load i32, i32* @stderr
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %55)
%62 = load i32, i32* @stderr
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %56)
%64 = load i32, i32* @stderr
%65 = tail call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %57)
%66 = icmp slt i32 %5, %56
%67 = icmp sge i32 %4, %57
%68 = select i1 %66, i1 true, i1 %67
br i1 %68, label %117, label %69
69: ; preds = %0
%70 = icmp slt i32 %8, %56
%71 = icmp sge i32 %7, %57
%72 = select i1 %70, i1 true, i1 %71
br i1 %72, label %117, label %73
73: ; preds = %69
%74 = icmp slt i32 %11, %56
%75 = icmp sge i32 %10, %57
%76 = select i1 %74, i1 true, i1 %75
br i1 %76, label %117, label %77
77: ; preds = %73
%78 = icmp slt i32 %14, %56
%79 = icmp sge i32 %13, %57
%80 = select i1 %78, i1 true, i1 %79
br i1 %80, label %117, label %81
81: ; preds = %77
%82 = icmp slt i32 %17, %56
%83 = icmp sge i32 %16, %57
%84 = select i1 %82, i1 true, i1 %83
br i1 %84, label %117, label %85
85: ; preds = %81
%86 = icmp slt i32 %20, %56
%87 = icmp sge i32 %19, %57
%88 = select i1 %86, i1 true, i1 %87
br i1 %88, label %117, label %89
89: ; preds = %85
%90 = icmp slt i32 %23, %56
%91 = icmp sge i32 %22, %57
%92 = select i1 %90, i1 true, i1 %91
br i1 %92, label %117, label %93
93: ; preds = %89
%94 = icmp slt i32 %26, %56
%95 = icmp sge i32 %25, %57
%96 = select i1 %94, i1 true, i1 %95
br i1 %96, label %117, label %97
97: ; preds = %93
%98 = icmp slt i32 %29, %56
%99 = icmp sge i32 %28, %57
%100 = select i1 %98, i1 true, i1 %99
br i1 %100, label %117, label %101
101: ; preds = %97
%102 = icmp slt i32 %32, %56
%103 = icmp sge i32 %31, %57
%104 = select i1 %102, i1 true, i1 %103
br i1 %104, label %117, label %105
105: ; preds = %101
%106 = add nsw i32 %8, %5
%107 = add nsw i32 %11, %106
%108 = add nsw i32 %14, %107
%109 = add nsw i32 %17, %108
%110 = add nsw i32 %20, %109
%111 = add nsw i32 %23, %110
%112 = add nsw i32 %26, %111
%113 = add nsw i32 %29, %112
%114 = add nsw i32 %32, %113
%115 = icmp eq i32 %55, %114
%116 = zext i1 %115 to i32
br label %117
117: ; preds = %0, %69, %73, %77, %81, %85, %89, %93, %97, %101, %105
%118 = phi i32 [ %116, %105 ], [ 0, %101 ], [ 0, %97 ], [ 0, %93 ], [ 0, %89 ], [ 0, %85 ], [ 0, %81 ], [ 0, %77 ], [ 0, %73 ], [ 0, %69 ], [ 0, %0 ]
ret i32 %118
}