batch(name) char *name;
{
  char buf[256];
  int rez;
  if (access("/usr/spool/infoserv/bin/server", 1)) {
    error("cannot execute %s", "/usr/spool/infoserv/bin/server");
    return (0);
  }
  sprintf(buf, "%s < %s", "/usr/spool/infoserv/bin/server", name);
  rez = system(buf);
  if (rez) {
    error("error %d while executing '%s'", rez, buf);
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<batch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1050 <access@plt>
cmp    $0x0,%eax
je     118c <batch+0x4c>
lea    0xead(%rip),%rdi
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1040 <error@plt>
movl   $0x0,-0x4(%rbp)
jmp    11fb <batch+0xbb>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rcx
lea    0xe93(%rip),%rsi
lea    0xe5b(%rip),%rdx
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x0,-0x114(%rbp)
je     11f4 <batch+0xb4>
mov    -0x114(%rbp),%esi
lea    -0x110(%rbp),%rdx
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <error@plt>
movl   $0x0,-0x4(%rbp)
jmp    11fb <batch+0xbb>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<batch>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%r14
lea    0xeaa(%rip),%rdi
mov    $0x1,%ebx
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <access@plt>
test   %eax,%eax
je     1182 <batch+0x42>
lea    0xead(%rip),%rdi
lea    0xe87(%rip),%rsi
xor    %eax,%eax
call   1040 <error@plt>
jmp    11c1 <batch+0x81>
lea    0xea8(%rip),%rsi
lea    0xe70(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r14,%rcx
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <system@plt>
test   %eax,%eax
je     11c3 <batch+0x83>
lea    0xe84(%rip),%rdi
mov    %rsp,%rdx
mov    %eax,%esi
xor    %eax,%eax
call   1040 <error@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [31 x i8] c"/usr/spool/infoserv/bin/server\00"
@.str.1 = [18 x i8] c"cannot execute %s\00"
@.str.2 = [8 x i8] c"%s < %s\00"
@.str.3 = [30 x i8] c"error %d while executing '%s'\00"
define i32 @batch(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [256 x i8]
%5 = alloca i32
store i8* %0, i8** %3
%6 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @access to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %23
10: ; preds = %1
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%12 = load i8*, i8** %3
%13 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %14)
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %10
%19 = load i32, i32* %5
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%21 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %19, i8* %20)
store i32 0, i32* %2
br label %23
22: ; preds = %10
store i32 1, i32* %2
br label %23
23: ; preds = %22, %18, %8
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@.str = [31 x i8] c"/usr/spool/infoserv/bin/server\00"
@.str.1 = [18 x i8] c"cannot execute %s\00"
@.str.2 = [8 x i8] c"%s < %s\00"
@.str.3 = [30 x i8] c"error %d while executing '%s'\00"
define i32 @batch(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @access to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %14
8: ; preds = %1
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %3)
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %10, i8* %3)
br label %14
14: ; preds = %8, %12, %6
%15 = phi i32 [ 0, %6 ], [ 0, %12 ], [ 1, %8 ]
ret i32 %15
}