#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 INT_MAX;
int INT_MIN;
scalar_t__ first_digit(int);
int /*<<< orphan*/ print_char(scalar_t__);
int main(void) {
  print_char('0' + first_digit(1024));
  print_char('0' + first_digit(-3));
  print_char('0' + first_digit(3024));
  print_char('0' + first_digit(-7000000));
  print_char('0' + first_digit(0));
  print_char('0' + first_digit(INT_MAX));
  print_char('0' + first_digit(INT_MIN));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x400,%edi
call   1030 <first_digit@plt>
mov    %rax,%rdi
add    $0x30,%rdi
call   1040 <print_char@plt>
mov    $0xfffffffd,%edi
call   1030 <first_digit@plt>
mov    %rax,%rdi
add    $0x30,%rdi
call   1040 <print_char@plt>
mov    $0xbd0,%edi
call   1030 <first_digit@plt>
mov    %rax,%rdi
add    $0x30,%rdi
call   1040 <print_char@plt>
mov    $0xff953040,%edi
call   1030 <first_digit@plt>
mov    %rax,%rdi
add    $0x30,%rdi
call   1040 <print_char@plt>
xor    %edi,%edi
call   1030 <first_digit@plt>
mov    %rax,%rdi
add    $0x30,%rdi
call   1040 <print_char@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
call   1030 <first_digit@plt>
mov    %rax,%rdi
add    $0x30,%rdi
call   1040 <print_char@plt>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
call   1030 <first_digit@plt>
mov    %rax,%rdi
add    $0x30,%rdi
call   1040 <print_char@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x400,%edi
call   1030 <first_digit@plt>
lea    0x30(%rax),%rdi
call   1040 <print_char@plt>
mov    $0xfffffffd,%edi
call   1030 <first_digit@plt>
lea    0x30(%rax),%rdi
call   1040 <print_char@plt>
mov    $0xbd0,%edi
call   1030 <first_digit@plt>
lea    0x30(%rax),%rdi
call   1040 <print_char@plt>
mov    $0xff953040,%edi
call   1030 <first_digit@plt>
lea    0x30(%rax),%rdi
call   1040 <print_char@plt>
xor    %edi,%edi
call   1030 <first_digit@plt>
lea    0x30(%rax),%rdi
call   1040 <print_char@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1030 <first_digit@plt>
lea    0x30(%rax),%rdi
call   1040 <print_char@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
call   1030 <first_digit@plt>
lea    0x30(%rax),%rdi
call   1040 <print_char@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @first_digit(i32 1024)
%3 = add nsw i64 48, %2
%4 = call i32 @print_char(i64 %3)
%5 = call i64 @first_digit(i32 -3)
%6 = add nsw i64 48, %5
%7 = call i32 @print_char(i64 %6)
%8 = call i64 @first_digit(i32 3024)
%9 = add nsw i64 48, %8
%10 = call i32 @print_char(i64 %9)
%11 = call i64 @first_digit(i32 -7000000)
%12 = add nsw i64 48, %11
%13 = call i32 @print_char(i64 %12)
%14 = call i64 @first_digit(i32 0)
%15 = add nsw i64 48, %14
%16 = call i32 @print_char(i64 %15)
%17 = load i32, i32* @INT_MAX
%18 = call i64 @first_digit(i32 %17)
%19 = add nsw i64 48, %18
%20 = call i32 @print_char(i64 %19)
%21 = load i32, i32* @INT_MIN
%22 = call i64 @first_digit(i32 %21)
%23 = add nsw i64 48, %22
%24 = call i32 @print_char(i64 %23)
ret i32 0
}

LLVM IR (-O2):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define i32 @main() {
%1 = tail call i64 @first_digit(i32 1024)
%2 = add nsw i64 %1, 48
%3 = tail call i32 @print_char(i64 %2)
%4 = tail call i64 @first_digit(i32 -3)
%5 = add nsw i64 %4, 48
%6 = tail call i32 @print_char(i64 %5)
%7 = tail call i64 @first_digit(i32 3024)
%8 = add nsw i64 %7, 48
%9 = tail call i32 @print_char(i64 %8)
%10 = tail call i64 @first_digit(i32 -7000000)
%11 = add nsw i64 %10, 48
%12 = tail call i32 @print_char(i64 %11)
%13 = tail call i64 @first_digit(i32 0)
%14 = add nsw i64 %13, 48
%15 = tail call i32 @print_char(i64 %14)
%16 = load i32, i32* @INT_MAX
%17 = tail call i64 @first_digit(i32 %16)
%18 = add nsw i64 %17, 48
%19 = tail call i32 @print_char(i64 %18)
%20 = load i32, i32* @INT_MIN
%21 = tail call i64 @first_digit(i32 %20)
%22 = add nsw i64 %21, 48
%23 = tail call i32 @print_char(i64 %22)
ret i32 0
}