#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*/ mgrSendMessageToLedController(char *);
int /*<<< orphan*/ mgrSendMessageToSndModule(int, char *, void *);
int mgrRecStopped(int code, void *arg1, void *arg2) {
  ;
  mgrSendMessageToLedController("/led/red/off");
  if (code == 0) {
    mgrSendMessageToSndModule((8100), "/uploader/upload/start", arg1);
  } else {
    mgrSendMessageToLedController("/led/orange/blink/fast");
  }
  return 0;
}


x86 assembly (clang, -O0):
<mgrRecStopped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec6(%rip),%rdi
call   1040 <mgrSendMessageToLedController@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1163 <mgrRecStopped+0x43>
mov    -0x10(%rbp),%rdx
mov    $0x1fa4,%edi
lea    0xeb4(%rip),%rsi
call   1030 <mgrSendMessageToSndModule@plt>
jmp    116f <mgrRecStopped+0x4f>
lea    0xeba(%rip),%rdi
call   1040 <mgrSendMessageToLedController@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgrRecStopped>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
call   1040 <mgrSendMessageToLedController@plt>
test   %ebp,%ebp
je     1146 <mgrRecStopped+0x26>
lea    0xee5(%rip),%rdi
call   1040 <mgrSendMessageToLedController@plt>
jmp    115a <mgrRecStopped+0x3a>
lea    0xec0(%rip),%rsi
mov    $0x1fa4,%edi
mov    %rbx,%rdx
call   1030 <mgrSendMessageToSndModule@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/led/red/off\00"
@.str.1 = [23 x i8] c"/uploader/upload/start\00"
@.str.2 = [23 x i8] c"/led/orange/blink/fast\00"
define i32 @mgrRecStopped(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = call i32 @mgrSendMessageToSndModule(i32 8100, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %3
%14 = call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"/led/red/off\00"
@.str.1 = [23 x i8] c"/uploader/upload/start\00"
@.str.2 = [23 x i8] c"/led/orange/blink/fast\00"
define i32 @mgrRecStopped(i32 %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @mgrSendMessageToSndModule(i32 8100, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %10
8: ; preds = %3
%9 = tail call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}