#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 atoi(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int mult_argument(char *argument, char *arg) {
  char *pdot;
  int number;
  for (pdot = argument; *pdot != '\0'; pdot++) {
    if (*pdot == '*') {
      *pdot = '\0';
      number = atoi(argument);
      *pdot = '*';
      strcpy(arg, pdot + 1);
      return number;
    }
  }
  strcpy(arg, argument);
  return 1;
}


x86 assembly (clang, -O0):
<mult_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11a4 <mult_argument+0x84>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    118e <mult_argument+0x6e>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x2a,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b8 <mult_argument+0x98>
jmp    1193 <mult_argument+0x73>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1138 <mult_argument+0x18>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult_argument>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rsi
lea    0x1(%rdi),%rbx
xchg   %ax,%ax
movzbl -0x1(%rbx),%eax
test   %al,%al
je     1142 <mult_argument+0x22>
cmp    $0x2a,%al
je     1151 <mult_argument+0x31>
add    $0x1,%rbx
jmp    1130 <mult_argument+0x10>
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    $0x1,%eax
jmp    1170 <mult_argument+0x50>
movb   $0x0,-0x1(%rbx)
mov    %rsi,%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
movb   $0x2a,-0x1(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mult_argument(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
br label %9
9: ; preds = %30, %2
%10 = load i8*, i8** %6
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %33
14: ; preds = %9
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 42
br i1 %18, label %19, label %29
19: ; preds = %14
%20 = load i8*, i8** %6
store i8 0, i8* %20
%21 = load i8*, i8** %4
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %7
%23 = load i8*, i8** %6
store i8 42, i8* %23
%24 = load i8*, i8** %5
%25 = load i8*, i8** %6
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = call i32 @strcpy(i8* %24, i8* %26)
%28 = load i32, i32* %7
store i32 %28, i32* %3
br label %37
29: ; preds = %14
br label %30
30: ; preds = %29
%31 = load i8*, i8** %6
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %6
br label %9
33: ; preds = %9
%34 = load i8*, i8** %5
%35 = load i8*, i8** %4
%36 = call i32 @strcpy(i8* %34, i8* %35)
store i32 1, i32* %3
br label %37
37: ; preds = %33, %19
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
define i32 @mult_argument(i8* %0, i8* %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i8* [ %0, %2 ], [ %11, %10 ]
%5 = load i8, i8* %4
switch i8 %5, label %10 [
i8 0, label %12
i8 42, label %6
]
6: ; preds = %3
store i8 0, i8* %4
%7 = tail call i32 @atoi(i8* %0)
store i8 42, i8* %4
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = tail call i32 @strcpy(i8* %1, i8* %8)
br label %14
10: ; preds = %3
%11 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
12: ; preds = %3
%13 = tail call i32 @strcpy(i8* %1, i8* %0)
br label %14
14: ; preds = %12, %6
%15 = phi i32 [ %7, %6 ], [ 1, %12 ]
ret i32 %15
}