void get_char_arg(argv, j, i, numarg2, str) int i, j, numarg2;
char **argv, *str;
{
  char *comp;
  comp = char_alloc(32);
  sprintf(comp, ": Missing argument (%s) ", argv[j]);
  if (i == numarg2)
    error_syntax(argv, comp);
  if (argv[j + 1][0] == '-')
    error_syntax(argv, comp);
  strcpy(str, argv[j + 1]);
  free((void *)comp);
}


x86 assembly (clang, -O0):
<get_char_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    $0x20,%edi
mov    $0x0,%al
call   1050 <char_alloc@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe6e(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11b4 <get_char_arg+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1060 <error_syntax@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11e0 <get_char_arg+0x90>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1060 <error_syntax@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char_arg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x20,%edi
xor    %eax,%eax
call   1050 <char_alloc@plt>
movslq %eax,%r15
movslq %ebp,%rbp
mov    (%rbx,%rbp,8),%rdx
lea    0xe7a(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <sprintf@plt>
cmp    %r12d,%r13d
jne    11a2 <get_char_arg+0x52>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <error_syntax@plt>
mov    0x8(%rbx,%rbp,8),%rsi
cmpb   $0x2d,(%rsi)
jne    11c1 <get_char_arg+0x71>
add    $0x1,%rbp
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <error_syntax@plt>
mov    (%rbx,%rbp,8),%rsi
mov    %r14,%rdi
call   1040 <strcpy@plt>
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [25 x i8] c": Missing argument (%s) \00"
define void @get_char_arg(i8** %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i8** %0, i8*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = call i32 (i32, ...) bitcast (i32 (...)* @char_alloc to i32 (i32, ...)*)(i32 32)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %11
%15 = load i8*, i8** %11
%16 = load i8**, i8*** %6
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = load i32, i32* %8
%23 = load i32, i32* %9
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %29
25: ; preds = %5
%26 = load i8**, i8*** %6
%27 = load i8*, i8** %11
%28 = call i32 (i8**, i8*, ...) bitcast (i32 (...)* @error_syntax to i32 (i8**, i8*, ...)*)(i8** %26, i8* %27)
br label %29
29: ; preds = %25, %5
%30 = load i8**, i8*** %6
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %30, i64 %33
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8, i8* %35, i64 0
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 45
br i1 %39, label %40, label %44
40: ; preds = %29
%41 = load i8**, i8*** %6
%42 = load i8*, i8** %11
%43 = call i32 (i8**, i8*, ...) bitcast (i32 (...)* @error_syntax to i32 (i8**, i8*, ...)*)(i8** %41, i8* %42)
br label %44
44: ; preds = %40, %29
%45 = load i8*, i8** %10
%46 = load i8**, i8*** %6
%47 = load i32, i32* %7
%48 = add nsw i32 %47, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %46, i64 %49
%51 = load i8*, i8** %50
%52 = call i8* @strcpy(i8* %45, i8* %51)
%53 = load i8*, i8** %11
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c": Missing argument (%s) \00"
define void @get_char_arg(i8** %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @char_alloc to i32 (i32, ...)*)(i32 32)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = icmp eq i32 %2, %3
br i1 %13, label %14, label %16
14: ; preds = %5
%15 = tail call i32 (i8**, i8*, ...) bitcast (i32 (...)* @error_syntax to i32 (i8**, i8*, ...)*)(i8** %0, i8* %8)
br label %16
16: ; preds = %14, %5
%17 = add nsw i32 %1, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %0, i64 %18
%20 = load i8*, i8** %19
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 45
br i1 %22, label %23, label %26
23: ; preds = %16
%24 = tail call i32 (i8**, i8*, ...) bitcast (i32 (...)* @error_syntax to i32 (i8**, i8*, ...)*)(i8** %0, i8* %8)
%25 = load i8*, i8** %19
br label %26
26: ; preds = %23, %16
%27 = phi i8* [ %25, %23 ], [ %20, %16 ]
%28 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %27)
tail call void @free(i8* %8)
ret void
}