#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ turn_off_LED(char);
int /*<<< orphan*/ turn_on_LED(char);
int /*<<< orphan*/ wait_one_bit_interval();
void send_a_bit_out_the_LED(char which_LED, int bit_value) {
  switch (bit_value) {
  case 0:
    turn_off_LED(which_LED);
    break;
  case 1:
    turn_on_LED(which_LED);
    break;
  default:
    printf("In file %s at line %d, this should never happen.\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jloughry/optical_tempest/refs/heads/"
           "master/sl.c",
           98);
    exit(EXIT_FAILURE);
    break;
  }
  wait_one_bit_interval();
}


x86 assembly (clang, -O0):
<send_a_bit_out_the_LED>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1185 <send_a_bit_out_the_LED+0x35>
jmp    1174 <send_a_bit_out_the_LED+0x24>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1193 <send_a_bit_out_the_LED+0x43>
jmp    11a1 <send_a_bit_out_the_LED+0x51>
movsbl -0x1(%rbp),%edi
call   1030 <turn_off_LED@plt>
jmp    11c7 <send_a_bit_out_the_LED+0x77>
movsbl -0x1(%rbp),%edi
call   1070 <turn_on_LED@plt>
jmp    11c7 <send_a_bit_out_the_LED+0x77>
lea    0xe58(%rip),%rdi
lea    0xe83(%rip),%rsi
mov    $0x62,%edx
call   1040 <printf@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1050 <wait_one_bit_interval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_a_bit_out_the_LED>:
push   %rax
cmp    $0x1,%esi
je     1165 <send_a_bit_out_the_LED+0x15>
test   %esi,%esi
jne    1176 <send_a_bit_out_the_LED+0x26>
movsbl %dil,%edi
call   1030 <turn_off_LED@plt>
jmp    116e <send_a_bit_out_the_LED+0x1e>
movsbl %dil,%edi
call   1070 <turn_on_LED@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <wait_one_bit_interval@plt>
lea    0xe83(%rip),%rdi
lea    0xeae(%rip),%rsi
mov    $0x62,%edx
call   1040 <printf@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"In file %s at line %d, this should never happen.\0A\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jloughry/optical_tempest/refs/heads/master/sl.c\00"
@EXIT_FAILURE = global i32 0
define void @send_a_bit_out_the_LED(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %12 [
i32 0, label %6
i32 1, label %9
]
6: ; preds = %2
%7 = load i8, i8* %3
%8 = call i32 @turn_off_LED(i8 signext %7)
br label %16
9: ; preds = %2
%10 = load i8, i8* %3
%11 = call i32 @turn_on_LED(i8 signext %10)
br label %16
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 98)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %9, %6
%17 = call i32 (...) @wait_one_bit_interval()
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"In file %s at line %d, this should never happen.\0A\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jloughry/optical_tempest/refs/heads/master/sl.c\00"
@EXIT_FAILURE = global i32 0
define void @send_a_bit_out_the_LED(i8 signext %0, i32 %1) {
switch i32 %1, label %7 [
i32 0, label %3
i32 1, label %5
]
3: ; preds = %2
%4 = tail call i32 @turn_off_LED(i8 signext %0)
br label %11
5: ; preds = %2
%6 = tail call i32 @turn_on_LED(i8 signext %0)
br label %11
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 98)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %5, %3
%12 = tail call i32 (...) @wait_one_bit_interval()
ret void
}