#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 hermite(long, long);
int /*<<< orphan*/ printf(char *, ...);
long strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  long n, x;
  if (argc != 3) {
    printf("n and x needed\n");
    return 1;
  }
  if (argv[1] && argv[2]) {
    n = strtol(argv[1], NULL, 10);
    x = strtol(argv[2], NULL, 10);
  } else {
    printf("n and x needed\n");
    return 1;
  }
  printf("Hermite(n,x) = %d\n", hermite(n, x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     116a <main+0x3a>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11ff <main+0xcf>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     11c1 <main+0x91>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     11c1 <main+0x91>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,-0x20(%rbp)
jmp    11db <main+0xab>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11ff <main+0xcf>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <hermite@plt>
mov    %eax,%esi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x3,%edi
jne    119c <main+0x5c>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     119c <main+0x5c>
cmpq   $0x0,0x10(%rbx)
je     119c <main+0x5c>
xor    %r14d,%r14d
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %rax,%r15
mov    0x10(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1050 <hermite@plt>
lea    0xe6f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ae <main+0x6e>
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"n and x needed\0A\00"
@.str.1 = [19 x i8] c"Hermite(n,x) = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %38
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %31
17: ; preds = %12
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %31
22: ; preds = %17
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i64 @strtol(i8* %25, i32* null, i32 10)
store i64 %26, i64* %6
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%29 = load i8*, i8** %28
%30 = call i64 @strtol(i8* %29, i32* null, i32 10)
store i64 %30, i64* %7
br label %33
31: ; preds = %17, %12
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %38
33: ; preds = %22
%34 = load i64, i64* %6
%35 = load i64, i64* %7
%36 = call i32 @hermite(i64 %34, i64 %35)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %36)
store i32 0, i32* %3
br label %38
38: ; preds = %33, %31, %10
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"Hermite(n,x) = %d\0A\00"
@str.2 = [15 x i8] c"n and x needed\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
br label %22
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %20, label %10
10: ; preds = %6
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %20, label %14
14: ; preds = %10
%15 = tail call i64 @strtol(i8* nocapture %8, i32* null, i32 10)
%16 = load i8*, i8** %11
%17 = tail call i64 @strtol(i8* nocapture %16, i32* null, i32 10)
%18 = tail call i32 @hermite(i64 %15, i64 %17)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %22
20: ; preds = %10, %6
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
br label %22
22: ; preds = %14, %20, %4
%23 = phi i32 [ 1, %4 ], [ 0, %14 ], [ 1, %20 ]
ret i32 %23
}