#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*/ EINVAL;
int atoi(char *);
int check_arithmetic_seq(int *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  if (argc == 7 + 1) {
    int tab[7];
    for (int i = 1; i <= 7; i++) {
      tab[i - 1] = atoi(argv[i]);
    }
    printf("%d", check_arithmetic_seq(tab));
  } else {
    errno = EINVAL;
    perror("Wrong arguments number");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x8,-0x8(%rbp)
jne    11ba <main+0x7a>
movl   $0x1,-0x34(%rbp)
cmpl   $0x7,-0x34(%rbp)
jg     119e <main+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1167 <main+0x27>
lea    -0x30(%rbp),%rdi
call   1030 <check_arithmetic_seq@plt>
mov    %eax,%esi
lea    0xe50(%rip),%rdi
call   1040 <printf@plt>
jmp    11d8 <main+0x98>
mov    0x2e17(%rip),%rax
mov    (%rax),%ecx
mov    0x2e16(%rip),%rax
mov    %ecx,(%rax)
lea    0xe30(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
cmp    $0x8,%edi
jne    11c5 <main+0x85>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,(%rsp)
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,0x4(%rsp)
mov    0x18(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,0x8(%rsp)
mov    0x20(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,0xc(%rsp)
mov    0x28(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,0x10(%rsp)
mov    0x30(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,0x14(%rsp)
mov    0x38(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,0x18(%rsp)
mov    %rsp,%rdi
call   1030 <check_arithmetic_seq@plt>
lea    0xe4a(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret
mov    0x2e0c(%rip),%rax
mov    (%rax),%eax
mov    0x2e0b(%rip),%rcx
mov    %eax,(%rcx)
lea    0xe25(%rip),%rdi
call   1050 <perror@plt>
jmp    11bd <main+0x7d>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EINVAL = global i32 0
@errno = global i32 0
@.str.1 = [23 x i8] c"Wrong arguments number\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [7 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 8
br i1 %9, label %10, label %32
10: ; preds = %2
store i32 1, i32* %7
br label %11
11: ; preds = %25, %10
%12 = load i32, i32* %7
%13 = icmp sle i32 %12, 7
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = load i8**, i8*** %5
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
%21 = load i32, i32* %7
%22 = sub nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 %23
store i32 %20, i32* %24
br label %25
25: ; preds = %14
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %11
28: ; preds = %11
%29 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%30 = call i32 @check_arithmetic_seq(i32* %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %30)
br label %35
32: ; preds = %2
%33 = load i32, i32* @EINVAL
store i32 %33, i32* @errno
%34 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %32, %28
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EINVAL = global i32 0
@errno = global i32 0
@.str.1 = [23 x i8] c"Wrong arguments number\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [7 x i32]
%4 = icmp eq i32 %0, 8
br i1 %4, label %5, label %37
5: ; preds = %2
%6 = bitcast [7 x i32]* %3 to i8*
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
store i32 %9, i32* %10
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 2
store i32 %17, i32* %18
%19 = getelementptr inbounds i8*, i8** %1, i64 4
%20 = load i8*, i8** %19
%21 = tail call i32 @atoi(i8* %20)
%22 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 3
store i32 %21, i32* %22
%23 = getelementptr inbounds i8*, i8** %1, i64 5
%24 = load i8*, i8** %23
%25 = tail call i32 @atoi(i8* %24)
%26 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 4
store i32 %25, i32* %26
%27 = getelementptr inbounds i8*, i8** %1, i64 6
%28 = load i8*, i8** %27
%29 = tail call i32 @atoi(i8* %28)
%30 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 5
store i32 %29, i32* %30
%31 = getelementptr inbounds i8*, i8** %1, i64 7
%32 = load i8*, i8** %31
%33 = tail call i32 @atoi(i8* %32)
%34 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 6
store i32 %33, i32* %34
%35 = call i32 @check_arithmetic_seq(i32* %10)
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %35)
br label %40
37: ; preds = %2
%38 = load i32, i32* @EINVAL
store i32 %38, i32* @errno
%39 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %40
40: ; preds = %37, %5
ret i32 0
}