#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*/ printf(char *, char *);
int /*<<< orphan*/ sscanf(char *, char *, char *, char *);
int main(int argc, char *argv[]) {
  char num[20] = "18612491570";
  char msg[20] = "123456";
  char *data = "18612491570+123456";
  sscanf(data, "%[^+]+%s", num, msg);
  printf("%s\n", num);
  printf("%s\n", msg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x40(%rbp)
lea    0xeb9(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x50(%rbp),%rcx
lea    0xeb5(%rip),%rsi
call   1040 <sscanf@plt>
lea    -0x30(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x0,0x30(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0xedd(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0x20(%rsp),%r15
mov    %rsp,%r14
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <sscanf@plt>
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.num = [20 x i8] c"18612491570\00\00\00\00\00\00\00\00\00"
@__const.main.msg = [20 x i8] c"123456\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [19 x i8] c"18612491570+123456\00"
@.str.1 = [9 x i8] c"%[^+]+%s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8]
%7 = alloca [20 x i8]
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [20 x i8]* %6 to i8*
%10 = bitcast [20 x i8]* %7 to i8*
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %8
%11 = load i8*, i8** %8
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%14 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %12, i8* %13)
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %17)
ret i32 0
}

LLVM IR (-O2):
@__const.main.num = [20 x i8] c"18612491570\00\00\00\00\00\00\00\00\00"
@__const.main.msg = [20 x i8] c"123456\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [19 x i8] c"18612491570+123456\00"
@.str.1 = [9 x i8] c"%[^+]+%s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = call i32 @sscanf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}