xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t USBEndpointStatus(uint32_t ui32Base, uint32_t ui32Endpoint) {
  uint32_t ui32Status;
  ;

  ;
  ui32Status =
      (*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x00000112)));
  ui32Status |= (((*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) +
                                           0x00000116))))
                 << 16);
  return (ui32Status);
}


x86 assembly (clang, -O0):
<USBEndpointStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x10,%ecx
add    %ecx,%eax
add    $0x112,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x10,%ecx
add    %ecx,%eax
add    $0x116,%eax
cltq
mov    (%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointStatus>:
lea    (%rdi,%rsi,1),%eax
add    $0xfffffff0,%eax
cltq
mov    0x112(%rax),%ecx
mov    0x116(%rax),%eax
shl    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @USBEndpointStatus(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 16
%9 = add nsw i32 %6, %8
%10 = add nsw i32 %9, 274
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 16
%17 = add nsw i32 %14, %16
%18 = add nsw i32 %17, 278
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = load volatile i32, i32* %20
%22 = shl i32 %21, 16
%23 = load i32, i32* %5
%24 = or i32 %23, %22
store i32 %24, i32* %5
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @USBEndpointStatus(i32 %0, i32 %1) {
%3 = add i32 %0, -16
%4 = add i32 %3, %1
%5 = add nsw i32 %4, 274
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = add nsw i32 %4, 278
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = shl i32 %12, 16
%14 = or i32 %13, %8
ret i32 %14
}
void *thread_func(void *arg) { return 0; }


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_func(i8* nocapture readnone %0) {
ret i8* null
}
void __set_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % (4 * 8)));
  unsigned long *p = ((unsigned long *)addr) + ((nr) / (4 * 8));
  *p |= mask;
}


x86 assembly (clang, -O0):
<__set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_bit>:
mov    %edi,%ecx
lea    0x1f(%rcx),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%edx
and    $0xffffffe0,%edx
sub    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
sar    $0x5,%eax
cltq
or     %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
define void @__set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = srem i32 %7, 32
%9 = zext i32 %8 to i64
%10 = shl i64 1, %9
store i64 %10, i64* %5
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 32
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %11, i64 %14
store i64* %15, i64** %6
%16 = load i64, i64* %5
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
%19 = or i64 %18, %16
store i64 %19, i64* %17
ret void
}

LLVM IR (-O2):
define void @__set_bit(i32 %0, i64* nocapture %1) {
%3 = srem i32 %0, 32
%4 = zext i32 %3 to i64
%5 = shl nuw i64 1, %4
%6 = sdiv i32 %0, 32
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = or i64 %9, %5
store i64 %10, i64* %8
ret void
}
/* Variables and functions */
scalar_t__ exp(float);
void fvec_exp(float *v, long n) {
  long i;
  for (i = 0; i < n; i++) {
    v[i] = (float)exp(v[i]);
  }
}


x86 assembly (clang, -O0):
<fvec_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    116b <fvec_exp+0x5b>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <exp@plt>
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <fvec_exp+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvec_exp>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
jle    1152 <fvec_exp+0x42>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  (%r15,%rbx,4),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <fvec_exp+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fvec_exp(float* %0, i64 %1) {
%3 = alloca float*
%4 = alloca i64
%5 = alloca i64
store float* %0, float** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %20, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load float*, float** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds float, float* %11, i64 %12
%14 = load float, float* %13
%15 = call i64 @exp(float %14)
%16 = sitofp i64 %15 to float
%17 = load float*, float** %3
%18 = load i64, i64* %5
%19 = getelementptr inbounds float, float* %17, i64 %18
store float %16, float* %19
br label %20
20: ; preds = %10
%21 = load i64, i64* %5
%22 = add nsw i64 %21, 1
store i64 %22, i64* %5
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @fvec_exp(float* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds float, float* %0, i64 %5
%7 = load float, float* %6
%8 = tail call i64 @exp(float %7)
%9 = sitofp i64 %8 to float
store float %9, float* %6
%10 = add nuw nsw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
void _Jv_LookupJNIMethod() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_LookupJNIMethod() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove(void *, void const *,
                          int (*)(void const *, void const *), void *);
void _tdelete(const void *restrict key, void **restrict rootp,
              int (*compar)(const void *, const void *)) {
  remove((void *)rootp, key, compar, *rootp);
}


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

x86 assembly (clang, -O2):
<_tdelete>:
mov    %rdi,%rax
mov    (%rsi),%rcx
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <remove@plt>

LLVM IR (-O0):
define void @_tdelete(i8* noalias %0, i8** noalias %1, i32 (i8*, i8*)* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 (i8*, i8*)* %2, i32 (i8*, i8*)** %6
%7 = load i8**, i8*** %5
%8 = bitcast i8** %7 to i8*
%9 = load i8*, i8** %4
%10 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = call i32 @remove(i8* %8, i8* %9, i32 (i8*, i8*)* %10, i8* %12)
ret void
}

LLVM IR (-O2):
define void @_tdelete(i8* noalias %0, i8** noalias nocapture %1, i32 (i8*, i8*)* %2) {
%4 = bitcast i8** %1 to i8*
%5 = load i8*, i8** %1
%6 = tail call i32 @remove(i8* %4, i8* %0, i32 (i8*, i8*)* %2, i8* %5)
ret void
}
void CameraIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  if (ulIntFlags & 0x80000000) {
    (*((volatile unsigned long *)(0x44026000 + 0x00000094))) = ((1 << 8));
  }
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<CameraIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x80000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     1130 <CameraIntEnable+0x30>
mov    $0x44026094,%eax
movq   $0x100,(%rax)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CameraIntEnable>:
test   $0x80000000,%esi
je     1114 <CameraIntEnable+0x14>
movq   $0x100,0x44026094
or     %rsi,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @CameraIntEnable(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 = and i64 %5, 2147483648
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store volatile i64 256, i64* inttoptr (i64 1141006484 to i64*)
br label %9
9: ; preds = %8, %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = add i64 %11, 28
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %10
store volatile i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @CameraIntEnable(i64 %0, i64 %1) {
%3 = and i64 %1, 2147483648
%4 = icmp eq i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store volatile i64 256, i64* inttoptr (i64 1141006484 to i64*)
br label %6
6: ; preds = %5, %2
%7 = add i64 %0, 28
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %1
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
float __ocml_y0_f32(float);
float y0f(float x) { return __ocml_y0_f32(x); }


x86 assembly (clang, -O0):
<y0f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__ocml_y0_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<y0f>:
jmp    1030 <__ocml_y0_f32@plt>

LLVM IR (-O0):
define float @y0f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__ocml_y0_f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @y0f(float %0) {
%2 = tail call float @__ocml_y0_f32(float %0)
ret float %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t le_to_h_u32(const uint8_t *buf) {
  return (uint32_t)((uint32_t)buf[0] | (uint32_t)buf[1] << 8 |
                    (uint32_t)buf[2] << 16 | (uint32_t)buf[3] << 24);
}


x86 assembly (clang, -O0):
<le_to_h_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_h_u32>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @le_to_h_u32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void rtpx_set_header(uint8_t *p_rtpx, uint16_t i_header) {
  p_rtpx[0] = (i_header >> 8) & 0xff;
  p_rtpx[1] = i_header & 0xff;
}


x86 assembly (clang, -O0):
<rtpx_set_header>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtpx_set_header>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @rtpx_set_header(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @rtpx_set_header(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x60() {
  Assert_real((isdigit(96) == 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_isdigit.c",
              485, ("isdigit should be 0 for `"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x60>:
push   %rax
mov    $0x60,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1e5,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for `\00"
define void @t_isdigit_0x60() {
%1 = call i64 @isdigit(i32 96)
%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 485, i8* getelementptr inbounds ([26 x i8], [26 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for `\00"
define void @t_isdigit_0x60() {
%1 = tail call i64 @isdigit(i32 96)
%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 485, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int /*<<< orphan*/ to_lower(char *, char *);
int strcmp_lower(char *s1, char *s2) {
  char a1[1000];
  char a2[1000];
  to_lower(s1, a1);
  to_lower(s2, a2);
  return strcmp(a1, a2);
}


x86 assembly (clang, -O0):
<strcmp_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x400(%rbp),%rsi
call   1030 <to_lower@plt>
mov    -0x10(%rbp),%rdi
lea    -0x7f0(%rbp),%rsi
call   1030 <to_lower@plt>
lea    -0x400(%rbp),%rdi
lea    -0x7f0(%rbp),%rsi
call   1040 <strcmp@plt>
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_lower>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
mov    %rsi,%rbx
lea    0x3f0(%rsp),%r14
mov    %r14,%rsi
call   1030 <to_lower@plt>
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <to_lower@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @strcmp_lower(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1000 x i8]
%6 = alloca [1000 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%9 = call i32 @to_lower(i8* %7, i8* %8)
%10 = load i8*, i8** %4
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%12 = call i32 @to_lower(i8* %10, i8* %11)
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @strcmp_lower(i8* %0, i8* %1) {
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%7 = call i32 @to_lower(i8* %0, i8* %5)
%8 = call i32 @to_lower(i8* %1, i8* %6)
%9 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %9
}
int fun240() { return 240; }


x86 assembly (clang, -O0):
<fun240>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun240>:
mov    $0xf0,%eax
ret

LLVM IR (-O0):
define i32 @fun240() {
ret i32 240
}

LLVM IR (-O2):
define i32 @fun240() {
ret i32 240
}
int sfpr_isblank(int ch) {
  if (ch == ' ' || ch == '\t')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<sfpr_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     111b <sfpr_isblank+0x1b>
cmpl   $0x9,-0x8(%rbp)
jne    1127 <sfpr_isblank+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <sfpr_isblank+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfpr_isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @sfpr_isblank(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 32
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 9
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 1, i32* %2
br label %11
10: ; preds = %6
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 @sfpr_isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
char is_skip_signal(int *signals_to_keep, int nb_signals_to_keep, int signal) {
  int i;
  for (i = 0; i < nb_signals_to_keep; ++i) {
    if (signal == signals_to_keep[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_skip_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1151 <is_skip_signal+0x51>
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    113e <is_skip_signal+0x3e>
movb   $0x0,-0x1(%rbp)
jmp    1155 <is_skip_signal+0x55>
jmp    1143 <is_skip_signal+0x43>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <is_skip_signal+0x15>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_skip_signal>:
mov    $0x1,%al
test   %esi,%esi
jle    111e <is_skip_signal+0x1e>
mov    %esi,%ecx
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rsi,4)
je     111f <is_skip_signal+0x1f>
add    $0x1,%rsi
cmp    %rsi,%rcx
jne    1110 <is_skip_signal+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @is_skip_signal(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i8 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i8 %16
}
ispref(s1, s2) register char *s1, *s2;
{
  while (*s1++ == *s2)
    ;
  return (*s1 == '\0');
}


x86 assembly (clang, -O0):
<ispref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1132 <ispref+0x32>
jmp    110c <ispref+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispref>:
mov    (%rsi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rdi,%rcx
add    $0x1,%rdi
cmp    %al,(%rcx)
je     1110 <ispref+0x10>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @ispref(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %14, %2
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %15
14: ; preds = %5
br label %5
15: ; preds = %5
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @ispref(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ %0, %2 ], [ %6, %4 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = icmp eq i8 %7, %3
br i1 %8, label %4, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ enableInterrupts();
int /*<<< orphan*/ interrupt(int, int, char *, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ matchCommand(char *);
int main() {
  char line[256];
  enableInterrupts();
  while (1) {
    interrupt(0x21, 0, "Shell> ", 0, 0);
    interrupt(0x21, 1, line, 0, 0);
    matchCommand(line);
  }
  interrupt(0x21, 5, 0, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <enableInterrupts@plt>
mov    $0x21,%edi
xor    %r8d,%r8d
lea    0xea8(%rip),%rdx
mov    %r8d,%esi
mov    %r8d,%ecx
call   1030 <interrupt@plt>
lea    -0x110(%rbp),%rdx
mov    $0x21,%edi
mov    $0x1,%esi
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <interrupt@plt>
lea    -0x110(%rbp),%rdi
call   1050 <matchCommand@plt>
jmp    1149 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
xor    %eax,%eax
call   1040 <enableInterrupts@plt>
lea    0xeb8(%rip),%r14
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x21,%edi
xor    %esi,%esi
mov    %r14,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <interrupt@plt>
mov    $0x21,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <interrupt@plt>
mov    %rbx,%rdi
call   1050 <matchCommand@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [8 x i8] c"Shell> \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = call i32 (...) @enableInterrupts()
br label %4
4: ; preds = %0, %4
%5 = call i32 @interrupt(i32 33, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 @interrupt(i32 33, i32 1, i8* %6, i32 0, i32 0)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%9 = call i32 @matchCommand(i8* %8)
br label %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"Shell> \00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @enableInterrupts()
br label %4
4: ; preds = %4, %0
%5 = call i32 @interrupt(i32 33, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%6 = call i32 @interrupt(i32 33, i32 1, i8* %2, i32 0, i32 0)
%7 = call i32 @matchCommand(i8* %2)
br label %4
}
void relaySet(int channels) {}


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

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

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

LLVM IR (-O2):
define void @relaySet(i32 %0) {
ret void
}
int lol(const void *a, const void *b) {
  if ((unsigned long)a == (unsigned long)b)
    return 0;
  else if ((unsigned long)a > (unsigned long)b)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<lol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jne    1129 <lol+0x29>
movl   $0x0,-0x4(%rbp)
jmp    114d <lol+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jbe    1146 <lol+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <lol+0x4d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lol>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %rsi,%rdi
seta   %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @lol(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = select i1 %4, i32 1, i32 -1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int submain();
int main() { return submain(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <submain@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @submain()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @submain()
ret i32 %1
}
void ACC_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<ACC_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <ACC_IRQHandler+0x9>
jmp    1109 <ACC_IRQHandler+0x9>

x86 assembly (clang, -O2):
<ACC_IRQHandler>:
jmp    1100 <ACC_IRQHandler>

LLVM IR (-O0):
define void @ACC_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @ACC_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int toupper(unsigned char);
int toUpper(const char *ptr) { return toupper(*(unsigned char *)ptr); }


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

x86 assembly (clang, -O2):
<toUpper>:
movzbl (%rdi),%edi
jmp    1030 <toupper@plt>

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

LLVM IR (-O2):
define i32 @toUpper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @toupper(i8 zeroext %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *test_fun(void *arg) {
  printf("miccc2 ********** %d\n", *((int *)arg));
  return ((void *)0);
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"miccc2 ********** %d\0A\00"
define i8* @test_fun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i8* null
}

LLVM IR (-O2):
@.str = [22 x i8] c"miccc2 ********** %d\0A\00"
define noalias i8* @test_fun(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *alloc_string(char *str) {
  char *out = (char *)malloc(sizeof(char) * (strlen(str) + 1));
  strcpy(out, str);
  return out;
}


x86 assembly (clang, -O0):
<alloc_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @alloc_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @alloc_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ InitPointersToC();
void InitFunctionPointers(void) { InitPointersToC(); }


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

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

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

LLVM IR (-O2):
define void @InitFunctionPointers() {
%1 = tail call i32 (...) @InitPointersToC()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, ...);
void panel_utils_cvgate_pair_to_str(char *tempstr, int pair) {
  if (pair < 0 || pair >= 4) {
    sprintf(tempstr, "X");
  } else {
    sprintf(tempstr, "Pair %c", (pair + 65));
  }
}


x86 assembly (clang, -O0):
<panel_utils_cvgate_pair_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1133 <panel_utils_cvgate_pair_to_str+0x23>
cmpl   $0x4,-0xc(%rbp)
jl     114a <panel_utils_cvgate_pair_to_str+0x3a>
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    1162 <panel_utils_cvgate_pair_to_str+0x52>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x41,%edx
lea    0xea7(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panel_utils_cvgate_pair_to_str>:
cmp    $0x4,%esi
jb     111b <panel_utils_cvgate_pair_to_str+0xb>
movw   $0x58,(%rdi)
ret
mov    %esi,%edx
add    $0x41,%edx
lea    0xed9(%rip),%rsi
xor    %eax,%eax
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"X\00"
@.str.1 = [8 x i8] c"Pair %c\00"
define void @panel_utils_cvgate_pair_to_str(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 4
br i1 %9, label %10, label %13
10: ; preds = %7, %2
%11 = load i8*, i8** %3
%12 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %18
13: ; preds = %7
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 65
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"Pair %c\00"
define void @panel_utils_cvgate_pair_to_str(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp ugt i32 %1, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = bitcast i8* %0 to i16*
store i16 88, i16* %5
br label %9
6: ; preds = %2
%7 = add nuw nsw i32 %1, 65
%8 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(int argc, char *argv[]) {
  printf("usage: %s <filename>\n", argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rsi),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"usage: %s <filename>\0A\00"
define void @usage(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 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"usage: %s <filename>\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int a = 5;
  printf("SQUARE(%d) = %d\n", a, a * a);
  printf("SQUARE(%d) = %d\n", a + 2, a + 2 * a + 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
add    $0x2,%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    %eax,%edx
add    $0x2,%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x19,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x11,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"SQUARE(%d) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %6)
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 2
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = mul nsw i32 2, %11
%13 = add nsw i32 %10, %12
%14 = add nsw i32 %13, 2
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"SQUARE(%d) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 5, i32 25)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 7, i32 17)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delayms(int);
int /*<<< orphan*/ delayus(int);
int /*<<< orphan*/ gpio_high(int);
int /*<<< orphan*/ gpio_low(int);
void reset(void) {
  gpio_high(25);
  delayms(150);
  gpio_low(25);
  delayus(100);
}


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19,%edi
call   1060 <gpio_high@plt>
mov    $0x96,%edi
call   1050 <delayms@plt>
mov    $0x19,%edi
call   1030 <gpio_low@plt>
mov    $0x64,%edi
call   1040 <delayus@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
push   %rax
mov    $0x19,%edi
call   1060 <gpio_high@plt>
mov    $0x96,%edi
call   1050 <delayms@plt>
mov    $0x19,%edi
call   1030 <gpio_low@plt>
mov    $0x64,%edi
pop    %rax
jmp    1040 <delayus@plt>

LLVM IR (-O0):
define void @reset() {
%1 = call i32 @gpio_high(i32 25)
%2 = call i32 @delayms(i32 150)
%3 = call i32 @gpio_low(i32 25)
%4 = call i32 @delayus(i32 100)
ret void
}

LLVM IR (-O2):
define void @reset() {
%1 = tail call i32 @gpio_high(i32 25)
%2 = tail call i32 @delayms(i32 150)
%3 = tail call i32 @gpio_low(i32 25)
%4 = tail call i32 @delayus(i32 100)
ret void
}
int test_imm_1Euint32_mem(unsigned int *val) {
  return ((*val) & (0x1E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Euint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x1e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Euint32_mem>:
testb  $0x1e,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Euint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 30
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_1Euint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 30
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int xmlUCSIsGeorgian(int code) {
  return (((code >= 0x10A0) && (code <= 0x10FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsGeorgian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x10a0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsGeorgian+0x26>
cmpl   $0x10ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsGeorgian>:
add    $0xffffef60,%edi
xor    %eax,%eax
cmp    $0x60,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsGeorgian(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 4256
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 4351
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsGeorgian(i32 %0) {
%2 = add i32 %0, -4256
%3 = icmp ult i32 %2, 96
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdout;
char rrawkey() {
  int c, d;
  printf("k\n");
  fflush(stdout);
  scanf("%d", &c);
  return c;
}


x86 assembly (clang, -O0):
<rrawkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xeaa(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrawkey>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xeae(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"k\0A\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define signext i8 @rrawkey() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@str = [2 x i8] c"k\00"
define signext i8 @rrawkey() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = trunc i32 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ domath();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  domath();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <domath@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <domath@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @domath()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @domath()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int ar71xx_pci_init(void) { return 0; }


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

x86 assembly (clang, -O2):
<ar71xx_pci_init>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ar71xx_pci_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ar71xx_pci_init() {
ret i32 0
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c))
    c -= 32;
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1136 <toupper+0x26>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 32
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}