#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*/ lcd_cursor_blink();
int /*<<< orphan*/ lcd_cursor_off();
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ syntax_error();
void cmd_cursor(char *args) {
  if (strcmp("on", args) == 0) {
    lcd_cursor_blink();
  } else if (strcmp("off", args) == 0) {
    lcd_cursor_off();
  } else {
    syntax_error();
  }
}


x86 assembly (clang, -O0):
<cmd_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1172 <cmd_cursor+0x32>
mov    $0x0,%al
call   1040 <lcd_cursor_blink@plt>
jmp    11a4 <cmd_cursor+0x64>
mov    -0x8(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1198 <cmd_cursor+0x58>
mov    $0x0,%al
call   1030 <lcd_cursor_off@plt>
jmp    119f <cmd_cursor+0x5f>
mov    $0x0,%al
call   1060 <syntax_error@plt>
jmp    11a4 <cmd_cursor+0x64>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_cursor>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1174 <cmd_cursor+0x34>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     117c <cmd_cursor+0x3c>
xor    %eax,%eax
pop    %rbx
jmp    1060 <syntax_error@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <lcd_cursor_blink@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <lcd_cursor_off@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define void @cmd_cursor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @lcd_cursor_blink()
br label %17
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @lcd_cursor_off()
br label %16
14: ; preds = %8
%15 = call i32 (...) @syntax_error()
br label %16
16: ; preds = %14, %12
br label %17
17: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define void @cmd_cursor(i8* %0) {
%2 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @lcd_cursor_blink()
br label %13
6: ; preds = %1
%7 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 (...) @lcd_cursor_off()
br label %13
11: ; preds = %6
%12 = tail call i32 (...) @syntax_error()
br label %13
13: ; preds = %9, %11, %4
ret void
}