#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 */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int, int, int, int, ...);
int proc_1(int /*<<< orphan*/, int, int, int, int);
int setjmp(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
main(int argc, char **argv) {
  jmp_buf env;
  int sj;
  int i, j, k, l;
  if (argc != 5) {
    fprintf(stderr, "usage: sj2 i j k l\n");
    exit(1);
  }
  sj = setjmp(env);
  if (sj != 0) {
    printf("Error -- bad value of i (%d), j (%d), k (%d), l (%d)\n", i, j, k,
           l);
    exit(0);
  }
  i = atoi(argv[1]);
  j = atoi(argv[2]);
  k = atoi(argv[3]);
  l = atoi(argv[4]);
  printf("proc_1(%d, %d, %d, %d) = %d\n", i, j, k, l, proc_1(env, i, j, k, l));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x4(%rbp)
je     1198 <main+0x38>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
lea    0xe77(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x14(%rbp),%edi
call   1060 <setjmp@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11cf <main+0x6f>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
call   1040 <proc_1@plt>
mov    -0x38(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
mov    %eax,%r9d
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x5,%edi
jne    11e7 <main+0x87>
mov    %rsi,%rbx
call   1060 <setjmp@plt>
test   %eax,%eax
jne    1206 <main+0xa6>
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%r14d
mov    0x10(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%r15d
mov    0x18(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
mov    0x20(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebx
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1040 <proc_1@plt>
mov    %eax,%r9d
lea    0xe85(%rip),%rdi
xor    %r12d,%r12d
mov    %r12d,%eax
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1030 <printf@plt>
mov    %r12d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
lea    0xe09(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    0xe07(%rip),%rdi
xor    %ebx,%ebx
mov    %ebx,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"usage: sj2 i j k l\0A\00"
@.str.1 = [54 x i8] c"Error -- bad value of i (%d), j (%d), k (%d), l (%d)\0A\00"
@.str.2 = [29 x i8] c"proc_1(%d, %d, %d, %d) = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 5
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = load i32, i32* %5
%19 = call i32 @setjmp(i32 %18)
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = load i32, i32* %9
%26 = load i32, i32* %10
%27 = call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %24, i32 %25, i32 %26)
%28 = call i32 @exit(i32 0)
unreachable
29: ; preds = %17
%30 = load i8**, i8*** %4
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @atoi(i8* %32)
store i32 %33, i32* %7
%34 = load i8**, i8*** %4
%35 = getelementptr inbounds i8*, i8** %34, i64 2
%36 = load i8*, i8** %35
%37 = call i32 @atoi(i8* %36)
store i32 %37, i32* %8
%38 = load i8**, i8*** %4
%39 = getelementptr inbounds i8*, i8** %38, i64 3
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
store i32 %41, i32* %9
%42 = load i8**, i8*** %4
%43 = getelementptr inbounds i8*, i8** %42, i64 4
%44 = load i8*, i8** %43
%45 = call i32 @atoi(i8* %44)
store i32 %45, i32* %10
%46 = load i32, i32* %7
%47 = load i32, i32* %8
%48 = load i32, i32* %9
%49 = load i32, i32* %10
%50 = load i32, i32* %5
%51 = load i32, i32* %7
%52 = load i32, i32* %8
%53 = load i32, i32* %9
%54 = load i32, i32* %10
%55 = call i32 @proc_1(i32 %50, i32 %51, i32 %52, i32 %53, i32 %54)
%56 = call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %46, i32 %47, i32 %48, i32 %49, i32 %55)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"usage: sj2 i j k l\0A\00"
@.str.1 = [54 x i8] c"Error -- bad value of i (%d), j (%d), k (%d), l (%d)\0A\00"
@.str.2 = [29 x i8] c"proc_1(%d, %d, %d, %d) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 5
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = call i32 @setjmp(i32 undef)
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 undef, i32 undef, i32 undef, i32 undef)
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %8
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
%21 = getelementptr inbounds i8*, i8** %1, i64 3
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
%24 = getelementptr inbounds i8*, i8** %1, i64 4
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
%27 = call i32 @proc_1(i32 undef, i32 %17, i32 %20, i32 %23, i32 %26)
%28 = call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %20, i32 %23, i32 %26, i32 %27)
ret i32 0
}