#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ sscanf(char const *, char *, long *, long *, long *, long *,
                          long *, long *, long *);
int /*<<< orphan*/ stdout;
long syscall(long, long, long, long, long, long, long);
void fn_syscall(const char *line) {
  long args[7];
  sscanf(line, "%ld %ld %ld %ld %ld %ld %ld", &args[0], &args[1], &args[2],
         &args[3], &args[4], &args[5], &args[6]);
  long rc =
      syscall(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  printf("%ld\n", rc);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<fn_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    -0x40(%rbp),%rcx
add    $0x8,%rcx
lea    -0x40(%rbp),%r8
add    $0x10,%r8
lea    -0x40(%rbp),%r9
add    $0x18,%r9
lea    -0x40(%rbp),%r11
add    $0x20,%r11
lea    -0x40(%rbp),%r10
add    $0x28,%r10
lea    -0x40(%rbp),%rax
add    $0x30,%rax
lea    0xe75(%rip),%rsi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1060 <sscanf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <syscall@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_syscall>:
sub    $0x38,%rsp
lea    0x8(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0x18(%rsp),%r9
lea    0x20(%rsp),%r10
lea    0x28(%rsp),%r11
lea    0x30(%rsp),%rax
sub    $0x8,%rsp
lea    0xe93(%rip),%rsi
lea    0x8(%rsp),%rdx
push   %rax
push   %r11
push   %r10
call   1060 <sscanf@plt>
add    $0x20,%rsp
mov    (%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    0x18(%rsp),%rcx
mov    0x20(%rsp),%r8
mov    0x28(%rsp),%r9
sub    $0x8,%rsp
push   0x38(%rsp)
call   1040 <syscall@plt>
add    $0x10,%rsp
lea    0xe67(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"%ld %ld %ld %ld %ld %ld %ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
@stdout = global i32 0
define void @fn_syscall(i8* %0) {
%2 = alloca i8*
%3 = alloca [7 x i64]
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 0
%7 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 1
%8 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 2
%9 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 3
%10 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 4
%11 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 5
%12 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 6
%13 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64* %6, i64* %7, i64* %8, i64* %9, i64* %10, i64* %11, i64* %12)
%14 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 0
%15 = load i64, i64* %14
%16 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 1
%17 = load i64, i64* %16
%18 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 2
%19 = load i64, i64* %18
%20 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 3
%21 = load i64, i64* %20
%22 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 4
%23 = load i64, i64* %22
%24 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 5
%25 = load i64, i64* %24
%26 = getelementptr inbounds [7 x i64], [7 x i64]* %3, i64 0, i64 6
%27 = load i64, i64* %26
%28 = call i64 @syscall(i64 %15, i64 %17, i64 %19, i64 %21, i64 %23, i64 %25, i64 %27)
store i64 %28, i64* %4
%29 = load i64, i64* %4
%30 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %29)
%31 = load i32, i32* @stdout
%32 = call i32 @fflush(i32 %31)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%ld %ld %ld %ld %ld %ld %ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
@stdout = global i32 0
define void @fn_syscall(i8* nocapture %0) {
%2 = alloca [7 x i64]
%3 = bitcast [7 x i64]* %2 to i8*
%4 = getelementptr inbounds [7 x i64], [7 x i64]* %2, i64 0, i64 0
%5 = getelementptr inbounds [7 x i64], [7 x i64]* %2, i64 0, i64 1
%6 = getelementptr inbounds [7 x i64], [7 x i64]* %2, i64 0, i64 2
%7 = getelementptr inbounds [7 x i64], [7 x i64]* %2, i64 0, i64 3
%8 = getelementptr inbounds [7 x i64], [7 x i64]* %2, i64 0, i64 4
%9 = getelementptr inbounds [7 x i64], [7 x i64]* %2, i64 0, i64 5
%10 = getelementptr inbounds [7 x i64], [7 x i64]* %2, i64 0, i64 6
%11 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64* %4, i64* %5, i64* %6, i64* %7, i64* %8, i64* %9, i64* %10)
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = load i64, i64* %8
%17 = load i64, i64* %9
%18 = load i64, i64* %10
%19 = call i64 @syscall(i64 %12, i64 %13, i64 %14, i64 %15, i64 %16, i64 %17, i64 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %19)
%21 = load i32, i32* @stdout
%22 = call i32 @fflush(i32 %21)
ret void
}