xunge/DecIR huggingface dataset:
void ARGBToUVRow_Any_AVX2() {}


x86 assembly (clang, -O0):
<ARGBToUVRow_Any_AVX2>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ARGBToUVRow_Any_AVX2>:
ret

LLVM IR (-O0):
define void @ARGBToUVRow_Any_AVX2() {
ret void
}

LLVM IR (-O2):
define void @ARGBToUVRow_Any_AVX2() {
ret void
}
void d_fetchsw(const unsigned char **ptr, signed short *dest) {
  *dest = (((signed short)(*ptr)[0] << 8) | ((unsigned short)(*ptr)[1] << 0));
  *ptr += 2;
}


x86 assembly (clang, -O0):
<d_fetchsw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
cwtl
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movzbl 0x1(%rcx),%ecx
movzwl %cx,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_fetchsw>:
mov    (%rdi),%rax
movzwl (%rax),%ecx
rol    $0x8,%cx
mov    %cx,(%rsi)
add    $0x2,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @d_fetchsw(i8** %0, i16* %1) {
%3 = alloca i8**
%4 = alloca i16*
store i8** %0, i8*** %3
store i16* %1, i16** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i16
%10 = sext i16 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i16
%17 = zext i16 %16 to i32
%18 = shl i32 %17, 0
%19 = or i32 %11, %18
%20 = trunc i32 %19 to i16
%21 = load i16*, i16** %4
store i16 %20, i16* %21
%22 = load i8**, i8*** %3
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 2
store i8* %24, i8** %22
ret void
}

LLVM IR (-O2):
define void @d_fetchsw(i8** nocapture %0, i16* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i16
%10 = or i16 %6, %9
store i16 %10, i16* %1
%11 = getelementptr inbounds i8, i8* %3, i64 2
store i8* %11, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART5_ERR_DriverIRQHandler();
__attribute__((weak)) void UART5_ERR_IRQHandler(void) {
  UART5_ERR_DriverIRQHandler();
}


x86 assembly (clang, -O0):
<UART5_ERR_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <UART5_ERR_DriverIRQHandler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART5_ERR_IRQHandler>:
xor    %eax,%eax
jmp    1030 <UART5_ERR_DriverIRQHandler@plt>

LLVM IR (-O0):
define weak void @UART5_ERR_IRQHandler() {
%1 = call i32 (...) @UART5_ERR_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @UART5_ERR_IRQHandler() {
%1 = tail call i32 (...) @UART5_ERR_DriverIRQHandler()
ret void
}
/* Variables and functions */
void *h2o_mem__set_secure(void *, int, size_t);
void *h2o_mem_set_secure(void *b, int c, size_t len) {
  return h2o_mem__set_secure(b, c, len);
}


x86 assembly (clang, -O0):
<h2o_mem_set_secure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <h2o_mem__set_secure@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_set_secure>:
jmp    1030 <h2o_mem__set_secure@plt>

LLVM IR (-O0):
define i8* @h2o_mem_set_secure(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i64, i64* %6
%10 = call i8* @h2o_mem__set_secure(i8* %7, i32 %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @h2o_mem_set_secure(i8* %0, i32 %1, i64 %2) {
%4 = tail call i8* @h2o_mem__set_secure(i8* %0, i32 %1, i64 %2)
ret i8* %4
}
void signal_handler(int sig) {}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
ret

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
ret void
}
/* Variables and functions */
float abs(float);
int /*<<< orphan*/ getid(float);
int /*<<< orphan*/ printid(float);
void main() {
  float a, x, e;
  e = 1e-5;
  getid(a);
  x = a / 2;
  do
    x = (1.0 / 2.0) * (x + a / x);
  while (abs(x * x) - a > e);
  printid(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <getid@plt>
movss  -0x4(%rbp),%xmm0
movss  0xea4(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe84(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
call   1030 <abs@plt>
subss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
ja     1165 <main+0x35>
movss  -0x8(%rbp),%xmm0
call   1050 <printid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <getid@plt>
movss  0xec2(%rip),%xmm0
call   1030 <abs@plt>
movss  0xeb5(%rip),%xmm0
pop    %rax
jmp    1050 <printid@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
store float 0x3EE4F8B580000000, float* %3
%4 = load float, float* %1
%5 = call i32 @getid(float %4)
%6 = load float, float* %1
%7 = fdiv float %6, 2.000000e+00
store float %7, float* %2
br label %8
8: ; preds = %17, %0
%9 = load float, float* %2
%10 = load float, float* %1
%11 = load float, float* %2
%12 = fdiv float %10, %11
%13 = fadd float %9, %12
%14 = fpext float %13 to double
%15 = fmul double 5.000000e-01, %14
%16 = fptrunc double %15 to float
store float %16, float* %2
br label %17
17: ; preds = %8
%18 = load float, float* %2
%19 = load float, float* %2
%20 = fmul float %18, %19
%21 = call float @abs(float %20)
%22 = load float, float* %1
%23 = fsub float %21, %22
%24 = load float, float* %3
%25 = fcmp ogt float %23, %24
br i1 %25, label %8, label %26
26: ; preds = %17
%27 = load float, float* %2
%28 = call i32 @printid(float %27)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @getid(float undef)
%2 = tail call float @abs(float 0x7FF8000000000000)
%3 = tail call i32 @printid(float 0x7FF8000000000000)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, scalar_t__);
void print_mk_devsign(uint32_t devsign, uint32_t alternate) {
  if (0 == alternate) {
    printf(" BF1DEVSIGN0 = 0x%08X\n", devsign);
  } else {
    printf(" BF2DEVSIGN0 = 0x%08X\n", devsign);
  }
}


x86 assembly (clang, -O0):
<print_mk_devsign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1141 <print_mk_devsign+0x31>
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <print_mk_devsign+0x41>
mov    -0x8(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mk_devsign>:
mov    %rdi,%rax
test   %rsi,%rsi
lea    0xee3(%rip),%rcx
lea    0xef3(%rip),%rdi
cmove  %rcx,%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c" BF1DEVSIGN0 = 0x%08X\0A\00"
@.str.1 = [23 x i8] c" BF2DEVSIGN0 = 0x%08X\0A\00"
define void @print_mk_devsign(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 0, %5
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %13
10: ; preds = %2
%11 = load i64, i64* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c" BF1DEVSIGN0 = 0x%08X\0A\00"
@.str.1 = [23 x i8] c" BF2DEVSIGN0 = 0x%08X\0A\00"
define void @print_mk_devsign(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_2() { printf("hello\n"); }


x86 assembly (clang, -O0):
<test_2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_2>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define void @test_2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @test_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ch8_OS_Start();
void ch8_StartVM() { ch8_OS_Start(); }


x86 assembly (clang, -O0):
<ch8_StartVM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ch8_OS_Start@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch8_StartVM>:
xor    %eax,%eax
jmp    1030 <ch8_OS_Start@plt>

LLVM IR (-O0):
define void @ch8_StartVM() {
%1 = call i32 (...) @ch8_OS_Start()
ret void
}

LLVM IR (-O2):
define void @ch8_StartVM() {
%1 = tail call i32 (...) @ch8_OS_Start()
ret void
}
void GOMAXPROCS(int n __attribute__((unused))) {}


x86 assembly (clang, -O0):
<GOMAXPROCS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GOMAXPROCS>:
ret

LLVM IR (-O0):
define void @GOMAXPROCS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @GOMAXPROCS(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint32_t unpack_from_h32(const void *v) {
  uint32_t u;
  memcpy(&u, v, sizeof(uint32_t));
  return u;
}


x86 assembly (clang, -O0):
<unpack_from_h32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_from_h32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @unpack_from_h32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @unpack_from_h32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xed() {
  Assert_real((isupper(237) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1190, ("isupper should be 0 for 0xed"));
}


x86 assembly (clang, -O0):
<t_isupper_0xed>:
push   %rbp
mov    %rsp,%rbp
mov    $0xed,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4a6,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xed>:
push   %rax
mov    $0xed,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4a6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xed\00"
define void @t_isupper_0xed() {
%1 = call i64 @isupper(i32 237)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1190, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xed\00"
define void @t_isupper_0xed() {
%1 = tail call i64 @isupper(i32 237)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1190, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ start_state();
int main() { start_state(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <start_state@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <start_state@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @start_state()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start_state()
ret i32 0
}
void RTAvlPVDoWithAll(void) {}


x86 assembly (clang, -O0):
<RTAvlPVDoWithAll>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTAvlPVDoWithAll>:
ret

LLVM IR (-O0):
define void @RTAvlPVDoWithAll() {
ret void
}

LLVM IR (-O2):
define void @RTAvlPVDoWithAll() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int numberOfSetBits(uint32_t i) {
  i = i - ((i >> 1) & 0x55555555);
  i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
  return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
}


x86 assembly (clang, -O0):
<numberOfSetBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
sar    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberOfSetBits>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @numberOfSetBits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = sub nsw i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add nsw i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 4
%17 = add nsw i32 %14, %16
%18 = and i32 %17, 252645135
%19 = mul nsw i32 %18, 16843009
%20 = ashr i32 %19, 24
ret i32 %20
}

LLVM IR (-O2):
define i32 @numberOfSetBits(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub nsw i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul nsw i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
/* Variables and functions */
size_t strlcpy(void *, void const *, size_t);
int copyinstr(const void *uaddr, void *kaddr, size_t len, size_t *done) {
  size_t bytes;
  bytes = strlcpy(kaddr, uaddr, len);
  if (done != NULL)
    *done = bytes;
  return (0);
}


x86 assembly (clang, -O0):
<copyinstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strlcpy@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1153 <copyinstr+0x43>
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyinstr>:
push   %rbx
mov    %rcx,%rbx
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strlcpy@plt>
test   %rbx,%rbx
je     112a <copyinstr+0x1a>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @copyinstr(i8* %0, i8* %1, i64 %2, i64* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64*
%9 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64* %3, i64** %8
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = load i64, i64* %7
%13 = call i64 @strlcpy(i8* %10, i8* %11, i64 %12)
store i64 %13, i64* %9
%14 = load i64*, i64** %8
%15 = icmp ne i64* %14, null
br i1 %15, label %16, label %19
16: ; preds = %4
%17 = load i64, i64* %9
%18 = load i64*, i64** %8
store i64 %17, i64* %18
br label %19
19: ; preds = %16, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @copyinstr(i8* %0, i8* %1, i64 %2, i64* writeonly %3) {
%5 = tail call i64 @strlcpy(i8* %1, i8* %0, i64 %2)
%6 = icmp eq i64* %3, null
br i1 %6, label %8, label %7
7: ; preds = %4
store i64 %5, i64* %3
br label %8
8: ; preds = %7, %4
ret i32 0
}
void port2_ISR(void) {}


x86 assembly (clang, -O0):
<port2_ISR>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<port2_ISR>:
ret

LLVM IR (-O0):
define void @port2_ISR() {
ret void
}

LLVM IR (-O2):
define void @port2_ISR() {
ret void
}
/* Variables and functions */
char *tokenParser(char *, char *, int /*<<< orphan*/, char *);
char *singleWordParser(char *header) {
  return tokenParser(header, " \n", 0, "singleWordParser");
}


x86 assembly (clang, -O0):
<singleWordParser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
xor    %edx,%edx
lea    0xed3(%rip),%rcx
call   1030 <tokenParser@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<singleWordParser>:
lea    0xee9(%rip),%rsi
lea    0xee5(%rip),%rcx
xor    %edx,%edx
jmp    1030 <tokenParser@plt>

LLVM IR (-O0):
@.str = [3 x i8] c" \0A\00"
@.str.1 = [17 x i8] c"singleWordParser\00"
define i8* @singleWordParser(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @tokenParser(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c" \0A\00"
@.str.1 = [17 x i8] c"singleWordParser\00"
define i8* @singleWordParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
void SCR_EndLoadingPlaque(void) {}


x86 assembly (clang, -O0):
<SCR_EndLoadingPlaque>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCR_EndLoadingPlaque>:
ret

LLVM IR (-O0):
define void @SCR_EndLoadingPlaque() {
ret void
}

LLVM IR (-O2):
define void @SCR_EndLoadingPlaque() {
ret void
}
int validador(int x) {
  if (x >= 0 && x <= 100) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<validador>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1127 <validador+0x27>
cmpl   $0x64,-0x8(%rbp)
jg     1127 <validador+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <validador+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validador>:
xor    %eax,%eax
cmp    $0x65,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @validador(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 100
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @validador(i32 %0) {
%2 = icmp ult i32 %0, 101
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int u_is_ascii_only_impl(char const *, size_t, int);
bool u_is_ascii_only_n(const char *string, size_t n) {
  return u_is_ascii_only_impl(string, n, true);
}


x86 assembly (clang, -O0):
<u_is_ascii_only_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <u_is_ascii_only_impl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_is_ascii_only_n>:
mov    $0x1,%edx
jmp    1030 <u_is_ascii_only_impl@plt>

LLVM IR (-O0):
define i32 @u_is_ascii_only_n(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @u_is_ascii_only_impl(i8* %5, i64 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @u_is_ascii_only_n(i8* %0, i64 %1) {
%3 = tail call i32 @u_is_ascii_only_impl(i8* %0, i64 %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
main(int argc, char **argv) {
  setuid(strtoul(argv[1], 0, 0));
  system("id");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <strtoul@plt>
mov    %eax,%edi
call   1050 <setuid@plt>
lea    0xea2(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %eax,%edi
call   1050 <setuid@plt>
lea    0xeb4(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"id\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @strtoul(i8* %7, i32 0, i32 0)
%9 = call i32 @setuid(i32 %8)
%10 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"id\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strtoul(i8* %4, i32 0, i32 0)
%6 = tail call i32 @setuid(i32 %5)
%7 = tail call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int getaddrinfo(char const *, char const *, struct addrinfo const *,
                struct addrinfo **);
int getaddrinfo_ex(const char *nodename, const char *servname,
                   const struct addrinfo *hints, struct addrinfo **res) {
  return getaddrinfo(nodename, servname, hints, res);
}


x86 assembly (clang, -O0):
<getaddrinfo_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <getaddrinfo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getaddrinfo_ex>:
jmp    1030 <getaddrinfo@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define i32 @getaddrinfo_ex(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.addrinfo*
%8 = alloca %struct.addrinfo**
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.addrinfo* %2, %struct.addrinfo** %7
store %struct.addrinfo** %3, %struct.addrinfo*** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load %struct.addrinfo*, %struct.addrinfo** %7
%12 = load %struct.addrinfo**, %struct.addrinfo*** %8
%13 = call i32 @getaddrinfo(i8* %9, i8* %10, %struct.addrinfo* %11, %struct.addrinfo** %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define i32 @getaddrinfo_ex(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3) {
%5 = tail call i32 @getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3)
ret i32 %5
}
/* Type definitions */
typedef char uint32_t;
struct output {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ output_char(struct output *, char);
bool downcase_lithuanian_i(uint32_t c, uint32_t combiner,
                           struct output *output) {
  output_char(output, c);
  output_char(output, ((uint32_t)0x0307));
  if (combiner != '\0')
    output_char(output, combiner);
  return true;
}


x86 assembly (clang, -O0):
<downcase_lithuanian_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <output_char@plt>
mov    -0x10(%rbp),%rdi
mov    $0x7,%esi
call   1030 <output_char@plt>
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     115d <downcase_lithuanian_i+0x4d>
mov    -0x10(%rbp),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <output_char@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downcase_lithuanian_i>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %edi,%esi
mov    %rdx,%rdi
call   1030 <output_char@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <output_char@plt>
test   %bpl,%bpl
je     1140 <downcase_lithuanian_i+0x30>
movsbl %bpl,%esi
mov    %rbx,%rdi
call   1030 <output_char@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.output = type { i32 }
define i32 @downcase_lithuanian_i(i8 signext %0, i8 signext %1, %struct.output* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca %struct.output*
store i8 %0, i8* %4
store i8 %1, i8* %5
store %struct.output* %2, %struct.output** %6
%7 = load %struct.output*, %struct.output** %6
%8 = load i8, i8* %4
%9 = call i32 @output_char(%struct.output* %7, i8 signext %8)
%10 = load %struct.output*, %struct.output** %6
%11 = call i32 @output_char(%struct.output* %10, i8 signext 7)
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load %struct.output*, %struct.output** %6
%17 = load i8, i8* %5
%18 = call i32 @output_char(%struct.output* %16, i8 signext %17)
br label %19
19: ; preds = %15, %3
ret i32 1
}

LLVM IR (-O2):
%struct.output = type { i32 }
define i32 @downcase_lithuanian_i(i8 signext %0, i8 signext %1, %struct.output* %2) {
%4 = tail call i32 @output_char(%struct.output* %2, i8 signext %0)
%5 = tail call i32 @output_char(%struct.output* %2, i8 signext 7)
%6 = icmp eq i8 %1, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @output_char(%struct.output* %2, i8 signext %1)
br label %9
9: ; preds = %7, %3
ret i32 1
}
void RTStrToUInt16(void) {}


x86 assembly (clang, -O0):
<RTStrToUInt16>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTStrToUInt16>:
ret

LLVM IR (-O0):
define void @RTStrToUInt16() {
ret void
}

LLVM IR (-O2):
define void @RTStrToUInt16() {
ret void
}
void RTCritSectTryEnter(void) {}


x86 assembly (clang, -O0):
<RTCritSectTryEnter>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTCritSectTryEnter>:
ret

LLVM IR (-O0):
define void @RTCritSectTryEnter() {
ret void
}

LLVM IR (-O2):
define void @RTCritSectTryEnter() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
int isComment(char *buff) {
  int i = 0;
  while (isspace(buff[i])) {
    i++;
  }
  if (buff[i] == ';') {
    return 0;
  }
  return -2;
}


x86 assembly (clang, -O0):
<isComment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     114c <isComment+0x3c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <isComment+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3b,%eax
jne    116d <isComment+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1174 <isComment+0x64>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isComment>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <isspace@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <isComment+0x10>
mov    %ebx,%eax
xor    %ecx,%ecx
cmpb   $0x3b,(%r14,%rax,1)
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xfffffffe,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @isComment(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 signext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 59
br i1 %23, label %24, label %25
24: ; preds = %16
store i32 0, i32* %2
br label %26
25: ; preds = %16
store i32 -2, i32* %2
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @isComment(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %8, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = add nuw i64 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = and i64 %3, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 59
%14 = select i1 %13, i32 0, i32 -2
ret i32 %14
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned char *value;
};
typedef TYPE_1__ XTextProperty;

/* Variables and functions */
void set_XTextProperty_value(void *_p, void *_v) {
  ((XTextProperty *)_p)->value = (unsigned char *)_v;
}


x86 assembly (clang, -O0):
<set_XTextProperty_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XTextProperty_value>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i8* }
define void @set_XTextProperty_value(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i8* %5, i8** %8
ret void
}

LLVM IR (-O2):
define void @set_XTextProperty_value(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
void do_block_tests() {
  int cb = 12;
  {
    int foo;
    foo = 123;
    {
      int foo2;
      foo2 = 123;
      {
        int foo;
        foo = 321;
      }
      foo2 = 0;
    }
    foo = 0;
  }
  cb = 21;
}


x86 assembly (clang, -O0):
<do_block_tests>:
push   %rbp
mov    %rsp,%rbp
movl   $0xc,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
movl   $0x7b,-0xc(%rbp)
movl   $0x141,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x15,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_block_tests>:
ret

LLVM IR (-O0):
define void @do_block_tests() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 12, i32* %1
store i32 123, i32* %2
store i32 123, i32* %3
store i32 321, i32* %4
store i32 0, i32* %3
store i32 0, i32* %2
store i32 21, i32* %1
ret void
}

LLVM IR (-O2):
define void @do_block_tests() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_chld(int signo) { printf("caught SIGCHLD\n"); }


x86 assembly (clang, -O0):
<sig_chld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_chld>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"caught SIGCHLD\0A\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"caught SIGCHLD\00"
define void @sig_chld(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int read(int, char *, int);
int doread(const char *name, int fd, char *ptr, int size) {
  int n = read(fd, ptr, size);
  if (n == -1) {
    perror(name);
    exit(2);
  }
  return n;
}


x86 assembly (clang, -O0):
<doread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    1175 <doread+0x45>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doread>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <read@plt>
cmp    $0xffffffff,%eax
je     1147 <doread+0x17>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @doread(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @read(i32 %10, i8* %11, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %4
%17 = load i8*, i8** %5
%18 = call i32 @perror(i8* %17)
%19 = call i32 @exit(i32 2)
unreachable
20: ; preds = %4
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
define i32 @doread(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @read(i32 %1, i8* %2, i32 %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @perror(i8* %0)
%9 = tail call i32 @exit(i32 2)
unreachable
10: ; preds = %4
ret i32 %5
}
regx0indreg1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((p0[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jg     1145 <regx0indreg1+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <regx0indreg1+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0indreg1>:
movslq %edx,%rax
mov    (%r8,%rax,1),%cl
xor    %eax,%eax
cmp    (%r9),%cl
setbe  %al
ret

LLVM IR (-O0):
define i32 @regx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %12
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8*, i8** %13
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = icmp sle i32 %21, %24
br i1 %25, label %26, label %27
26: ; preds = %6
store i32 1, i32* %7
br label %28
27: ; preds = %6
store i32 0, i32* %7
br label %28
28: ; preds = %27, %26
%29 = load i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
define i32 @regx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = load i8, i8* %8
%10 = load i8, i8* %5
%11 = icmp ule i8 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
double lnfact(int);
double lnbico(int n, int k) { return (lnfact(n) - lnfact(k) - lnfact(n - k)); }


x86 assembly (clang, -O0):
<lnbico>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <lnfact@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <lnfact@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <lnfact@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnbico>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <lnfact@plt>
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
call   1030 <lnfact@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <lnfact@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @lnbico(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call double @lnfact(i32 %5)
%7 = load i32, i32* %4
%8 = call double @lnfact(i32 %7)
%9 = fsub double %6, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = call double @lnfact(i32 %12)
%14 = fsub double %9, %13
ret double %14
}

LLVM IR (-O2):
define double @lnbico(i32 %0, i32 %1) {
%3 = tail call double @lnfact(i32 %0)
%4 = tail call double @lnfact(i32 %1)
%5 = fsub double %3, %4
%6 = sub nsw i32 %0, %1
%7 = tail call double @lnfact(i32 %6)
%8 = fsub double %5, %7
ret double %8
}
void callme(int i) {}


x86 assembly (clang, -O0):
<callme>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<callme>:
ret

LLVM IR (-O0):
define void @callme(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @callme(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ new_xid_map(int, char, char const *);
int new_ugid_map(int pid, const char *uid_map, const char *gid_map) {
  if (new_xid_map(pid, 'u', uid_map) < 0)
    return -1;
  if (new_xid_map(pid, 'g', gid_map) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<new_ugid_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x75,%esi
call   1030 <new_xid_map@plt>
cmp    $0x0,%rax
jge    114a <new_ugid_map+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <new_ugid_map+0x68>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    $0x67,%esi
call   1030 <new_xid_map@plt>
cmp    $0x0,%rax
jge    1171 <new_ugid_map+0x61>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <new_ugid_map+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_ugid_map>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %edi,%ebp
mov    $0x75,%esi
call   1030 <new_xid_map@plt>
test   %rax,%rax
js     113f <new_ugid_map+0x2f>
mov    %ebp,%edi
mov    $0x67,%esi
mov    %rbx,%rdx
call   1030 <new_xid_map@plt>
sar    $0x3f,%rax
jmp    1144 <new_ugid_map+0x34>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @new_ugid_map(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i64 @new_xid_map(i32 %8, i8 signext 117, i8* %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 -1, i32* %4
br label %20
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i8*, i8** %7
%16 = call i64 @new_xid_map(i32 %14, i8 signext 103, i8* %15)
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 -1, i32* %4
br label %20
19: ; preds = %13
store i32 0, i32* %4
br label %20
20: ; preds = %19, %18, %12
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @new_ugid_map(i32 %0, i8* %1, i8* %2) {
%4 = tail call i64 @new_xid_map(i32 %0, i8 signext 117, i8* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @new_xid_map(i32 %0, i8 signext 103, i8* %2)
%8 = ashr i64 %7, 63
%9 = trunc i64 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ -1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ __LDREXH(scalar_t__ volatile *);
scalar_t__ __STREXH(scalar_t__, scalar_t__ volatile *);
uint16_t atomic_decr_u16(uint16_t *valuePtr, uint16_t delta) {
  uint16_t newValue;
  do {
    newValue = __LDREXH((volatile uint16_t *)valuePtr) - delta;
  } while (__STREXH(newValue, (volatile uint16_t *)valuePtr));
  return newValue;
}


x86 assembly (clang, -O0):
<atomic_decr_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__LDREXH@plt>
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <__STREXH@plt>
cmp    $0x0,%rax
jne    1130 <atomic_decr_u16+0x10>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_decr_u16>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <__LDREXH@plt>
mov    %rax,%rbx
sub    %r14,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <__STREXH@plt>
test   %rax,%rax
jne    1130 <atomic_decr_u16+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @atomic_decr_u16(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
br label %6
6: ; preds = %11, %2
%7 = load i64*, i64** %3
%8 = call i64 @__LDREXH(i64* %7)
%9 = load i64, i64* %4
%10 = sub nsw i64 %8, %9
store i64 %10, i64* %5
br label %11
11: ; preds = %6
%12 = load i64, i64* %5
%13 = load i64*, i64** %3
%14 = call i64 @__STREXH(i64 %12, i64* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %6, label %16
16: ; preds = %11
%17 = load i64, i64* %5
ret i64 %17
}

LLVM IR (-O2):
define i64 @atomic_decr_u16(i64* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @__LDREXH(i64* %0)
%5 = sub nsw i64 %4, %1
%6 = tail call i64 @__STREXH(i64 %5, i64* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i64 %5
}
void hal_debug_init(void) {}


x86 assembly (clang, -O0):
<hal_debug_init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hal_debug_init>:
ret

LLVM IR (-O0):
define void @hal_debug_init() {
ret void
}

LLVM IR (-O2):
define void @hal_debug_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_clojure_comments() {
  test_parser_verify_parse(test_parser_sourcefile("clojure", " ;;; comment"),
                           "clojure", "", ";;; comment", 0);
}


x86 assembly (clang, -O0):
<test_clojure_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec0(%rip),%rdx
lea    0xebb(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_clojure_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec9(%rip),%rdx
lea    0xec4(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"clojure\00"
@.str.1 = [13 x i8] c" ;;; comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [12 x i8] c";;; comment\00"
define void @test_clojure_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"clojure\00"
@.str.1 = [13 x i8] c" ;;; comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [12 x i8] c";;; comment\00"
define void @test_clojure_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int be_uint24_read(void const *);
unsigned cpu_uint24_read(const void *ptr) { return be_uint24_read(ptr); }


x86 assembly (clang, -O0):
<cpu_uint24_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <be_uint24_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_uint24_read>:
jmp    1030 <be_uint24_read@plt>

LLVM IR (-O0):
define i32 @cpu_uint24_read(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @be_uint24_read(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @cpu_uint24_read(i8* %0) {
%2 = tail call i32 @be_uint24_read(i8* %0)
ret i32 %2
}