#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 */
long *alloca(int);
int /*<<< orphan*/ differences_loop(long *, long *, size_t);
int parse_strings(long *, char **, size_t);
int /*<<< orphan*/ print_help(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  long int *buffer1;
  long int *buffer2;
  size_t size;
  int ret;
  if (argc <= 1)
    goto usagefail;
  size = argc - 1;
  buffer1 = alloca(sizeof(*buffer1) * size);
  buffer2 = alloca(sizeof(*buffer2) * size);
  ret = parse_strings(buffer1, argv + 1, size);
  if (ret) {
    printf("failed to parse numbers\n");
    goto usagefail;
  }
  differences_loop(buffer1, buffer2, size);
  return 0;
usagefail:
  print_help(argv[0]);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1175 <main+0x25>
jmp    11f7 <main+0xa7>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <alloca@plt>
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <alloca@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x28(%rbp),%rdx
call   1060 <parse_strings@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     11da <main+0x8a>
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
jmp    11f7 <main+0xa7>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <differences_loop@plt>
movl   $0x0,-0x4(%rbp)
jmp    120a <main+0xba>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <print_help@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jl     119e <main+0x4e>
lea    -0x1(%rdi),%r14d
lea    -0x8(,%rdi,8),%ebp
mov    %ebp,%edi
call   1050 <alloca@plt>
mov    %rax,%r15
mov    %ebp,%edi
call   1050 <alloca@plt>
mov    %rax,%r12
lea    0x8(%rbx),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
call   1060 <parse_strings@plt>
test   %eax,%eax
je     11ad <main+0x5d>
lea    0xe67(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rdi
call   1070 <print_help@plt>
mov    $0x1,%eax
jmp    11bd <main+0x6d>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1040 <differences_loop@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"failed to parse numbers\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %2
br label %39
13: ; preds = %2
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
store i64 %16, i64* %8
%17 = load i64, i64* %8
%18 = mul i64 8, %17
%19 = trunc i64 %18 to i32
%20 = call i64* @alloca(i32 %19)
store i64* %20, i64** %6
%21 = load i64, i64* %8
%22 = mul i64 8, %21
%23 = trunc i64 %22 to i32
%24 = call i64* @alloca(i32 %23)
store i64* %24, i64** %7
%25 = load i64*, i64** %6
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i64, i64* %8
%29 = call i32 @parse_strings(i64* %25, i8** %27, i64 %28)
store i32 %29, i32* %9
%30 = load i32, i32* %9
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %13
%33 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %39
34: ; preds = %13
%35 = load i64*, i64** %6
%36 = load i64*, i64** %7
%37 = load i64, i64* %8
%38 = call i32 @differences_loop(i64* %35, i64* %36, i64 %37)
store i32 0, i32* %3
br label %44
39: ; preds = %32, %12
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 0
%42 = load i8*, i8** %41
%43 = call i32 @print_help(i8* %42)
store i32 1, i32* %3
br label %44
44: ; preds = %39, %34
%45 = load i32, i32* %3
ret i32 %45
}

LLVM IR (-O2):
@str = [24 x i8] c"failed to parse numbers\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i64
%7 = shl i32 %5, 3
%8 = tail call i64* @alloca(i32 %7)
%9 = tail call i64* @alloca(i32 %7)
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = tail call i32 @parse_strings(i64* %8, i8** %10, i64 %6)
%12 = icmp eq i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %4
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %17
15: ; preds = %4
%16 = tail call i32 @differences_loop(i64* %8, i64* %9, i64 %6)
br label %20
17: ; preds = %2, %13
%18 = load i8*, i8** %1
%19 = tail call i32 @print_help(i8* %18)
br label %20
20: ; preds = %17, %15
%21 = phi i32 [ 1, %17 ], [ 0, %15 ]
ret i32 %21
}