xunge/DecIR huggingface dataset:
long _isqrt(long EV_a) {
  long EV_square;
  long EV_delta;
  EV_square = 1;
  EV_delta = 3;
  while ((EV_square <= EV_a)) {
    EV_square = (EV_square + EV_delta);
    EV_delta = (EV_delta + 2);
  }
  return ((EV_delta / 2) - 1);
}


x86 assembly (clang, -O0):
<_isqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x3,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     1143 <_isqrt+0x43>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <_isqrt+0x18>
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isqrt>:
test   %rdi,%rdi
jle    1131 <_isqrt+0x31>
mov    $0x1,%ecx
mov    $0x3,%edx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %rdx,%rcx
add    $0x2,%rdx
add    $0x1,%rax
cmp    %rdi,%rcx
jle    1120 <_isqrt+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @_isqrt(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 3, %1 ]
%5 = phi i64 [ %6, %3 ], [ 1, %1 ]
%6 = add nuw nsw i64 %4, %5
%7 = add nuw nsw i64 %4, 2
%8 = icmp sgt i64 %6, %0
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = lshr i64 %7, 1
%11 = add nsw i64 %10, -1
br label %12
12: ; preds = %9, %1
%13 = phi i64 [ 0, %1 ], [ %11, %9 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_RFM_CTL1_INPUT() { clear_io_bit(0x45, 6); }


x86 assembly (clang, -O0):
<TOSH_MAKE_RFM_CTL1_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
mov    $0x6,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_RFM_CTL1_INPUT>:
mov    $0x45,%edi
mov    $0x6,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_RFM_CTL1_INPUT() {
%1 = call i32 @clear_io_bit(i32 69, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_RFM_CTL1_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 69, i32 6)
ret void
}
int board_yywrap(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @board_yywrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @board_yywrap() {
ret i32 1
}
int test_imm_18int16_reg(short val) {
  return ((val) & (-0x18 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_18int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffe8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_18int16_reg>:
test   $0xffe8,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_18int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -24
%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_18int16_reg(i16 signext %0) {
%2 = and i16 %0, -24
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
char *malloc(size_t);
char *mallocChar(uintptr_t numChars) {
  char *temp = NULL;
  temp = malloc((size_t)numChars * sizeof(char));
  if (temp == NULL) {
    fatal("Memory allocation error.\n");
  }
  return temp;
}


x86 assembly (clang, -O0):
<mallocChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x0,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <mallocChar+0x3c>
lea    0xea9(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocChar>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <mallocChar+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Memory allocation error.\0A\00"
define i8* @mallocChar(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = mul i64 %4, 1
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @fatal(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [26 x i8] c"Memory allocation error.\0A\00"
define noalias i8* @mallocChar(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void McASPTxRxClkSyncEnable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0xB0)))) &= ~(0x00000040u);
}


x86 assembly (clang, -O0):
<McASPTxRxClkSyncEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffbf,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPTxRxClkSyncEnable>:
add    $0xb0,%edi
andl   $0xffffffbf,(%rdi)
ret

LLVM IR (-O0):
define void @McASPTxRxClkSyncEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 176
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -65
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @McASPTxRxClkSyncEnable(i32 %0) {
%2 = add i32 %0, 176
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -65
store volatile i32 %6, i32* %4
ret void
}
char *strcat(char *s1, const register char *s2) {
  register char *dscan;
  for (dscan = s1; *dscan != '\0'; dscan++)
    continue;
  while ((*dscan++ = *s2++) != '\0')
    continue;
  return s1;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113a <strcat+0x3a>
jmp    1129 <strcat+0x29>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    113f <strcat+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1172 <strcat+0x72>
jmp    113f <strcat+0x3f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
void sigalrmHandler(int sig) { return; }


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

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

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

LLVM IR (-O2):
define void @sigalrmHandler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rintf(float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  while (1) {
    int a;
    float f;
    scanf("%f", &f);
    a = rintf(f);
    printf("%d\n", a);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
call   1040 <rintf@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xeb7(%rip),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
call   1040 <rintf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
br label %4
4: ; preds = %0, %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%6 = load float, float* %3
%7 = call i32 @rintf(float %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call i32 @rintf(float %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ Q_strncpyz(char *, char const *, int);
int strlen(char *);
void Q_strcat(char *dest, int size, const char *src) {
  int l1;
  l1 = strlen(dest);
  Q_strncpyz(dest + l1, src, size - l1);
}


x86 assembly (clang, -O0):
<Q_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
sub    -0x1c(%rbp),%edx
call   1040 <Q_strncpyz@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strcat>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rax,%rbx
sub    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <Q_strncpyz@plt>

LLVM IR (-O0):
define void @Q_strcat(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i8*, i8** %4
%11 = load i32, i32* %7
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8*, i8** %6
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = sub nsw i32 %15, %16
%18 = call i32 @Q_strncpyz(i8* %13, i8* %14, i32 %17)
ret void
}

LLVM IR (-O2):
define void @Q_strcat(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = sub nsw i32 %1, %4
%8 = tail call i32 @Q_strncpyz(i8* %6, i8* %2, i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int EBUSY;
int pthread_mutex_trylock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
int rtpp_mutex_islocked(pthread_mutex_t *mutex) {
  int rval;
  rval = pthread_mutex_trylock(mutex);
  if (rval != 0) {
    if (rval == EBUSY)
      return (1);
    return (-1);
  }
  pthread_mutex_unlock(mutex);
  return (0);
}


x86 assembly (clang, -O0):
<rtpp_mutex_islocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <pthread_mutex_trylock@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116c <rtpp_mutex_islocked+0x4c>
mov    -0x14(%rbp),%eax
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%eax
jne    1160 <rtpp_mutex_islocked+0x40>
movl   $0x1,-0x4(%rbp)
jmp    117c <rtpp_mutex_islocked+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <rtpp_mutex_islocked+0x5c>
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtpp_mutex_islocked>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pthread_mutex_trylock@plt>
test   %eax,%eax
je     1143 <rtpp_mutex_islocked+0x23>
mov    0x2eac(%rip),%rcx
xor    %edx,%edx
cmp    (%rcx),%eax
sete   %dl
lea    (%rdx,%rdx,1),%eax
add    $0xffffffff,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <pthread_mutex_unlock@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EBUSY = global i32 0
define i32 @rtpp_mutex_islocked(i32* %0) {
%2 = tail call i32 @pthread_mutex_trylock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @EBUSY
%6 = icmp eq i32 %2, %5
%7 = select i1 %6, i32 1, i32 -1
br label %10
8: ; preds = %1
%9 = tail call i32 @pthread_mutex_unlock(i32* %0)
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ 0, %8 ], [ %7, %4 ]
ret i32 %11
}
unsigned char get_vernal_equinox(unsigned char year) {
  return year == 3 || (year < 64 && (year & 3) == 3) ||
                 (year < 36 && (year & 3) == 2)
             ? 21
             : 20;
}


x86 assembly (clang, -O0):
<get_vernal_equinox>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3,%ecx
mov    %al,-0x2(%rbp)
je     1166 <get_vernal_equinox+0x66>
movzbl -0x1(%rbp),%eax
cmp    $0x40,%eax
jge    113e <get_vernal_equinox+0x3e>
movzbl -0x1(%rbp),%ecx
and    $0x3,%ecx
mov    $0x1,%al
cmp    $0x3,%ecx
mov    %al,-0x2(%rbp)
je     1166 <get_vernal_equinox+0x66>
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x24,%ecx
mov    %al,-0x3(%rbp)
jge    1160 <get_vernal_equinox+0x60>
movzbl -0x1(%rbp),%eax
and    $0x3,%eax
cmp    $0x2,%eax
sete   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
mov    $0x14,%eax
mov    $0x15,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_vernal_equinox>:
mov    $0x15,%al
cmp    $0x3,%dil
je     1126 <get_vernal_equinox+0x26>
mov    %edi,%ecx
and    $0xc3,%cl
cmp    $0x3,%cl
je     1126 <get_vernal_equinox+0x26>
mov    %edi,%eax
and    $0x3,%al
cmp    $0x24,%dil
setb   %cl
cmp    $0x2,%al
sete   %al
and    %cl,%al
or     $0x14,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_vernal_equinox(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 3
br i1 %5, label %26, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %8, 64
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = and i32 %12, 3
%14 = icmp eq i32 %13, 3
br i1 %14, label %26, label %15
15: ; preds = %10, %6
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = icmp slt i32 %17, 36
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8, i8* %2
%21 = zext i8 %20 to i32
%22 = and i32 %21, 3
%23 = icmp eq i32 %22, 2
br label %24
24: ; preds = %19, %15
%25 = phi i1 [ false, %15 ], [ %23, %19 ]
br label %26
26: ; preds = %24, %10, %1
%27 = phi i1 [ true, %10 ], [ true, %1 ], [ %25, %24 ]
%28 = zext i1 %27 to i64
%29 = select i1 %27, i32 21, i32 20
%30 = trunc i32 %29 to i8
ret i8 %30
}

LLVM IR (-O2):
define zeroext i8 @get_vernal_equinox(i8 zeroext %0) {
%2 = icmp eq i8 %0, 3
%3 = and i8 %0, -61
%4 = icmp eq i8 %3, 3
%5 = or i1 %2, %4
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = and i8 %0, 3
%8 = icmp ult i8 %0, 36
%9 = icmp eq i8 %7, 2
%10 = and i1 %8, %9
%11 = select i1 %10, i8 21, i8 20
br label %12
12: ; preds = %6, %1
%13 = phi i8 [ 21, %1 ], [ %11, %6 ]
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char const);
void disasm_imm16(char *dst, const unsigned char *src) {
  sprintf(dst, "%04X", (((src[1]) << 8) | (src[0])));
}


x86 assembly (clang, -O0):
<disasm_imm16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
lea    0xec1(%rip),%rsi
movzbl %al,%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_imm16>:
movzbl (%rsi),%edx
lea    0xee6(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%04X\00"
define void @disasm_imm16(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %10, %14
%16 = trunc i32 %15 to i8
%17 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %16)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%04X\00"
define void @disasm_imm16(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void *getMessagesThread(void *arg) {
  while (1) {
    usleep(2 * 1000 * 1000);
  }
}


x86 assembly (clang, -O0):
<getMessagesThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1e8480,%edi
call   1030 <usleep@plt>
jmp    111c <getMessagesThread+0xc>

x86 assembly (clang, -O2):
<getMessagesThread>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1e8480,%edi
call   1030 <usleep@plt>
jmp    1120 <getMessagesThread+0x10>

LLVM IR (-O0):
define i8* @getMessagesThread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @usleep(i32 2000000)
br label %3
}

LLVM IR (-O2):
define noalias i8* @getMessagesThread(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @usleep(i32 2000000)
br label %2
}
/* Variables and functions */
int implicitConversion(unsigned int);
int main(int argc, char **argv) { return implicitConversion(~0U); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%edi
jmp    1030 <implicitConversion@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @implicitConversion(i32 -1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @implicitConversion(i32 -1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void dump(int *arr, int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%08d\n", arr[i]);
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <dump+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <dump+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <dump+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%08d\0A\00"
define void @dump(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
double f4_cb_send_double(double (*cb)(double)) {
  double r = 66.0;
  return cb(r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
call   *%rax
movsd  0xed4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_double>:
push   %rax
movsd  0xef7(%rip),%xmm0
call   *%rdi
addsd  0xef5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_double(double (double)* %0) {
%2 = alloca double (double)*
%3 = alloca double
store double (double)* %0, double (double)** %2
store double 6.600000e+01, double* %3
%4 = load double (double)*, double (double)** %2
%5 = load double, double* %3
%6 = call double %4(double %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_double(double (double)* nocapture %0) {
%2 = tail call double %0(double 6.600000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_36(void) {
  if ((*(uint32_t *)0x10000130ul == 0x8ul) &&
      (*(uint32_t *)0x10000134ul == 0x0ul)) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_36>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0x8,%rax
jne    1134 <errata_36+0x34>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_36+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <errata_36+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_36>:
cmpl   $0x8,0x10000130
08
jne    1114 <errata_36+0x14>
cmpl   $0x0,0x10000134
je     1117 <errata_36+0x17>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @errata_36() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 8
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %11
10: ; preds = %5, %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @errata_36() {
%1 = load i32, i32* inttoptr (i64 268435760 to i32*)
%2 = icmp eq i32 %1, 8
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* inttoptr (i64 268435764 to i32*)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
int save_xattrs() { return 1; }


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

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

LLVM IR (-O0):
define i32 @save_xattrs() {
ret i32 1
}

LLVM IR (-O2):
define i32 @save_xattrs() {
ret i32 1
}
/* Type definitions */
struct piecewise_traj_compressed {
  int dummy;
};

/* Variables and functions */
float start_time_of_current_piece(struct piecewise_traj_compressed const *);
float time_relative_to_start_of_current_piece(
    const struct piecewise_traj_compressed *traj, float t) {
  return t - start_time_of_current_piece(traj);
}


x86 assembly (clang, -O0):
<time_relative_to_start_of_current_piece>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <start_time_of_current_piece@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_relative_to_start_of_current_piece>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <start_time_of_current_piece@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.piecewise_traj_compressed = type { i32 }
define float @time_relative_to_start_of_current_piece(%struct.piecewise_traj_compressed* %0, float %1) {
%3 = alloca %struct.piecewise_traj_compressed*
%4 = alloca float
store %struct.piecewise_traj_compressed* %0, %struct.piecewise_traj_compressed** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load %struct.piecewise_traj_compressed*, %struct.piecewise_traj_compressed** %3
%7 = call float @start_time_of_current_piece(%struct.piecewise_traj_compressed* %6)
%8 = fsub float %5, %7
ret float %8
}

LLVM IR (-O2):
%struct.piecewise_traj_compressed = type { i32 }
define float @time_relative_to_start_of_current_piece(%struct.piecewise_traj_compressed* %0, float %1) {
%3 = tail call float @start_time_of_current_piece(%struct.piecewise_traj_compressed* %0)
%4 = fsub float %1, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ creat(char *, int);
int /*<<< orphan*/ mkdir(char *, int);
int main() {
  chdir("/home/shahas/Desktop/");
  mkdir("new_dir1", 0777);
  chdir("new_dir1");
  creat("file.txt", 0777);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <chdir@plt>
lea    0xecf(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
lea    0xebe(%rip),%rdi
call   1040 <chdir@plt>
lea    0xebb(%rip),%rdi
mov    $0x1ff,%esi
call   1050 <creat@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <chdir@plt>
lea    0xed2(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
mov    %rbx,%rdi
call   1040 <chdir@plt>
lea    0xebf(%rip),%rdi
mov    $0x1ff,%esi
call   1050 <creat@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/home/shahas/Desktop/\00"
@.str.1 = [9 x i8] c"new_dir1\00"
@.str.2 = [9 x i8] c"file.txt\00"
define i32 @main() {
%1 = call i32 @chdir(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @mkdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 511)
%3 = call i32 @chdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @creat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 511)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"/home/shahas/Desktop/\00"
@.str.1 = [9 x i8] c"new_dir1\00"
@.str.2 = [9 x i8] c"file.txt\00"
define i32 @main() {
%1 = tail call i32 @chdir(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @mkdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 511)
%3 = tail call i32 @chdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @creat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 511)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hi() { printf("hi\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"hi\00"
define void @say_hi() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
int isLetter(char c) {
  if (c >= 'A' && c <= 'Z')
    return 1;
  if (c >= 'a' && c <= 'z')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1130 <isLetter+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1130 <isLetter+0x30>
movl   $0x1,-0x4(%rbp)
jmp    115d <isLetter+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1156 <isLetter+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1156 <isLetter+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <isLetter+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLetter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isLetter(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %22
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 97
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %22
21: ; preds = %16, %12
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %11
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @isLetter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void test_system_shell_exists(void) {
  const char *const shell = "sh";
  const int exists = external_command_exists(shell);
  do {
    seatest_assert_true(exists, __FUNCTION__, 14);
  } while (0);
}


x86 assembly (clang, -O0):
<test_system_shell_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <external_command_exists@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xeb5(%rip),%rsi
mov    $0xe,%edx
mov    $0x0,%al
call   1030 <seatest_assert_true@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_system_shell_exists>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <external_command_exists@plt>
lea    0xecd(%rip),%rsi
mov    %eax,%edi
mov    $0xe,%edx
xor    %eax,%eax
pop    %rcx
jmp    1030 <seatest_assert_true@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"sh\00"
@__FUNCTION__.test_system_shell_exists = [25 x i8] c"test_system_shell_exists\00"
define void @test_system_shell_exists() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @external_command_exists to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0))
store i32 %3, i32* %2
br label %4
4: ; preds = %0
%5 = load i32, i32* %2
%6 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_true to i32 (i32, i8*, i32, ...)*)(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__FUNCTION__.test_system_shell_exists, i64 0, i64 0), i32 14)
br label %7
7: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"sh\00"
@__FUNCTION__.test_system_shell_exists = [25 x i8] c"test_system_shell_exists\00"
define void @test_system_shell_exists() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @external_command_exists to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_true to i32 (i32, i8*, i32, ...)*)(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__FUNCTION__.test_system_shell_exists, i64 0, i64 0), i32 14)
ret void
}
void alarm_handler() { return; }


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

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

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

LLVM IR (-O2):
define void @alarm_handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPI1_DriverIRQHandler();
__attribute__((weak)) void SPI1_IRQHandler(void) { SPI1_DriverIRQHandler(); }


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

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

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

LLVM IR (-O2):
define weak void @SPI1_IRQHandler() {
%1 = tail call i32 (...) @SPI1_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
size_t strxfrm(char *s1, const char *s2, size_t n) {
  size_t xn = strlen(s2);
  if (n > xn)
    n = xn;
  memcpy(s1, s2, n);
  return xn;
}


x86 assembly (clang, -O0):
<strxfrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    1157 <strxfrm+0x37>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strxfrm>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%r12
cmp    %rbx,%rax
cmovb  %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @strxfrm(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %4, %2
%6 = select i1 %5, i64 %4, i64 %2
%7 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %6)
ret i64 %4
}
/* Variables and functions */
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void echo(void) {
  int fdout, fdin;
  char c;
  fdout = open("/dev/tty0/out", 0);
  fdin = open("/dev/tty0/in", 0);
  while (1) {
    read(fdin, &c, 1);
    write(fdout, &c, 1);
  }
}


x86 assembly (clang, -O0):
<echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
xor    %esi,%esi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
lea    0xebe(%rip),%rdi
xor    %esi,%esi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
mov    -0x4(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    115a <echo+0x2a>

x86 assembly (clang, -O2):
<echo>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
xor    %esi,%esi
call   1050 <open@plt>
mov    %eax,%r14d
lea    0xebe(%rip),%rdi
xor    %esi,%esi
call   1050 <open@plt>
mov    %eax,%ebp
lea    0xf(%rsp),%rbx
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1160 <echo+0x30>

LLVM IR (-O0):
@.str = [14 x i8] c"/dev/tty0/out\00"
@.str.1 = [13 x i8] c"/dev/tty0/in\00"
define void @echo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
store i32 %4, i32* %1
%5 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 0)
store i32 %5, i32* %2
br label %6
6: ; preds = %0, %6
%7 = load i32, i32* %2
%8 = call i32 @read(i32 %7, i8* %3, i32 1)
%9 = load i32, i32* %1
%10 = call i32 @write(i32 %9, i8* %3, i32 1)
br label %6
}

LLVM IR (-O2):
@.str = [14 x i8] c"/dev/tty0/out\00"
@.str.1 = [13 x i8] c"/dev/tty0/in\00"
define void @echo() {
%1 = alloca i8
%2 = tail call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %4
4: ; preds = %4, %0
%5 = call i32 @read(i32 %3, i8* %1, i32 1)
%6 = call i32 @write(i32 %2, i8* %1, i32 1)
br label %4
}
OP(fd, b9) { op_b9(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_b9@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_b9()
ret i32 undef
}
void outportw(unsigned int port, unsigned int value) {
  __asm__ __volatile__("outw %%ax,%%dx" ::"d"(port), "a"(value));
}


x86 assembly (clang, -O0):
<outportw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%eax
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportw>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outportw(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 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @outportw(i32 %0, i32 %1) {
tail call void asm sideeffect "outw %ax,%dx", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
float linear_io(float, float, float);
float linear_f_io(float step, float max_steps, float max_val) {
  return linear_io(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<linear_f_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <linear_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_f_io>:
jmp    1030 <linear_io@plt>

LLVM IR (-O0):
define float @linear_f_io(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @linear_io(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @linear_f_io(float %0, float %1, float %2) {
%4 = tail call float @linear_io(float %0, float %1, float %2)
ret float %4
}
txt_chanpressure(chan, press) {
  prtime();
  printf("Channel pressure, chan=%d pressure=%d\n", chan + 1, press);
}


x86 assembly (clang, -O0):
<txt_chanpressure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_chanpressure>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <prtime@plt>
add    $0x1,%ebp
lea    0xec8(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Channel pressure, chan=%d pressure=%d\0A\00"
define i32 @txt_chanpressure(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @prtime()
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [39 x i8] c"Channel pressure, chan=%d pressure=%d\0A\00"
define i32 @txt_chanpressure(i32 %0, i32 %1) {
%3 = tail call i32 (...) @prtime()
%4 = add nsw i32 %0, 1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %1)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ cmd;

/* Variables and functions */
int getpid();
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ system(char *);
void dump_maps(void) {
  char cmd[32];
  snprintf(cmd, sizeof(cmd), "cat /proc/%d/maps", getpid());
  system(cmd);
}


x86 assembly (clang, -O0):
<dump_maps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%ecx
mov    $0x20,%esi
lea    0xea7(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <system@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_maps>:
push   %rbx
sub    $0x20,%rsp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xebd(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %eax,%ecx
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"cat /proc/%d/maps\00"
define void @dump_maps() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 (...) @getpid()
%4 = call i32 @snprintf(i8* %2, i32 32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"cat /proc/%d/maps\00"
define void @dump_maps() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @getpid()
%4 = call i32 @snprintf(i8* %2, i32 32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @system(i8* %2)
ret void
}