#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*/ ST7735_Message(int, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int, char *);
int /*<<< orphan*/ sscanf(char *, char *, int *, int *, char *);
int Command_disp_message(char *args) {
  int disp, line, n;
  char str[64];
  sscanf(args, "%d %d %[^\t\r\n]", &disp, &line, str);
  printf("\n Got disp=%d\tline=%d, %s\n", disp, line, str);
  ST7735_Message(disp, line, str, 0);
  return -1;
}


x86 assembly (clang, -O0):
<Command_disp_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%r8
lea    0xeb5(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <sscanf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x60(%rbp),%rcx
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
lea    -0x60(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <ST7735_Message@plt>
mov    $0xffffffff,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Command_disp_message>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x10(%rsp),%rbx
mov    %rbx,%r8
call   1050 <sscanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xeac(%rip),%rdi
mov    %rbx,%rcx
call   1040 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1030 <ST7735_Message@plt>
mov    $0xffffffff,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%d %d %[^\09\0D\0A]\00"
@.str.1 = [27 x i8] c"\0A Got disp=%d\09line=%d, %s\0A\00"
define i32 @Command_disp_message(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [64 x i8]
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%9 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i8* %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i8* %12)
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%17 = call i32 @ST7735_Message(i32 %14, i32 %15, i8* %16, i32 0)
ret i32 -1
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d %d %[^\09\0D\0A]\00"
@.str.1 = [27 x i8] c"\0A Got disp=%d\09line=%d, %s\0A\00"
define i32 @Command_disp_message(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [64 x i8]
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%8 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i8* %7)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10, i8* %7)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @ST7735_Message(i32 %12, i32 %13, i8* %7, i32 0)
ret i32 -1
}