#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*/ led_clear();
int /*<<< orphan*/ led_set_blink(unsigned char);
int /*<<< orphan*/ led_set_code(unsigned char, int /*<<< orphan*/);
void display_detonate(void) {
  unsigned char i;
  led_clear();
  for (i = 0; i < 6; i++) {
    led_set_code(i, '0');
    led_set_blink(i);
  }
}


x86 assembly (clang, -O0):
<display_detonate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <led_clear@plt>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x6,%eax
jge    1174 <display_detonate+0x44>
mov    $0x30,%esi
movzbl -0x1(%rbp),%edi
call   1040 <led_set_code@plt>
movzbl -0x1(%rbp),%edi
call   1050 <led_set_blink@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    1143 <display_detonate+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_detonate>:
push   %rax
xor    %eax,%eax
call   1030 <led_clear@plt>
xor    %edi,%edi
mov    $0x30,%esi
call   1040 <led_set_code@plt>
xor    %edi,%edi
call   1050 <led_set_blink@plt>
mov    $0x1,%edi
mov    $0x30,%esi
call   1040 <led_set_code@plt>
mov    $0x1,%edi
call   1050 <led_set_blink@plt>
mov    $0x2,%edi
mov    $0x30,%esi
call   1040 <led_set_code@plt>
mov    $0x2,%edi
call   1050 <led_set_blink@plt>
mov    $0x3,%edi
mov    $0x30,%esi
call   1040 <led_set_code@plt>
mov    $0x3,%edi
call   1050 <led_set_blink@plt>
mov    $0x4,%edi
mov    $0x30,%esi
call   1040 <led_set_code@plt>
mov    $0x4,%edi
call   1050 <led_set_blink@plt>
mov    $0x5,%edi
mov    $0x30,%esi
call   1040 <led_set_code@plt>
mov    $0x5,%edi
pop    %rax
jmp    1050 <led_set_blink@plt>

LLVM IR (-O0):
define void @display_detonate() {
%1 = alloca i8
%2 = call i32 (...) @led_clear()
store i8 0, i8* %1
br label %3
3: ; preds = %12, %0
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 6
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i8, i8* %1
%9 = call i32 @led_set_code(i8 zeroext %8, i32 48)
%10 = load i8, i8* %1
%11 = call i32 @led_set_blink(i8 zeroext %10)
br label %12
12: ; preds = %7
%13 = load i8, i8* %1
%14 = add i8 %13, 1
store i8 %14, i8* %1
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @display_detonate() {
%1 = tail call i32 (...) @led_clear()
%2 = tail call i32 @led_set_code(i8 zeroext 0, i32 48)
%3 = tail call i32 @led_set_blink(i8 zeroext 0)
%4 = tail call i32 @led_set_code(i8 zeroext 1, i32 48)
%5 = tail call i32 @led_set_blink(i8 zeroext 1)
%6 = tail call i32 @led_set_code(i8 zeroext 2, i32 48)
%7 = tail call i32 @led_set_blink(i8 zeroext 2)
%8 = tail call i32 @led_set_code(i8 zeroext 3, i32 48)
%9 = tail call i32 @led_set_blink(i8 zeroext 3)
%10 = tail call i32 @led_set_code(i8 zeroext 4, i32 48)
%11 = tail call i32 @led_set_blink(i8 zeroext 4)
%12 = tail call i32 @led_set_code(i8 zeroext 5, i32 48)
%13 = tail call i32 @led_set_blink(i8 zeroext 5)
ret void
}