xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strcpy(char *restrict dest, const char *restrict src) {
  size_t i;
  for (i = 0; src[i] != '\0'; i++)
    dest[i] = src[i];
  dest[i] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1150 <strcpy+0x50>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     1120 <strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = add i64 %7, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i64 [ 0, %2 ], [ %9, %5 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret i8* %0
}
/* Type definitions */
struct pevent {
  int dummy;
};

/* Variables and functions */
unsigned long long __data2host8(struct pevent *, unsigned long long);
int /*<<< orphan*/ memcpy(unsigned long long *, void const *, int);
unsigned long long data2host8(struct pevent *pevent, const void *ptr) {
  unsigned long long __val;
  memcpy(&__val, ptr, sizeof(unsigned long long));
  return __data2host8(pevent, __val);
}


x86 assembly (clang, -O0):
<data2host8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <__data2host8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data2host8>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <__data2host8@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.pevent = type { i32 }
define i64 @data2host8(%struct.pevent* %0, i8* %1) {
%3 = alloca %struct.pevent*
%4 = alloca i8*
%5 = alloca i64
store %struct.pevent* %0, %struct.pevent** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @memcpy(i64* %5, i8* %6, i32 8)
%8 = load %struct.pevent*, %struct.pevent** %3
%9 = load i64, i64* %5
%10 = call i64 @__data2host8(%struct.pevent* %8, i64 %9)
ret i64 %10
}

LLVM IR (-O2):
%struct.pevent = type { i32 }
define i64 @data2host8(%struct.pevent* %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @memcpy(i64* %3, i8* %1, i32 8)
%6 = load i64, i64* %3
%7 = call i64 @__data2host8(%struct.pevent* %0, i64 %6)
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int EINVAL;
int pthread_attr_getscope(const pthread_attr_t *attr, int *contentionscope) {
  (void)attr;
  (void)contentionscope;
  return EINVAL;
}


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

x86 assembly (clang, -O2):
<pthread_attr_getscope>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @pthread_attr_getscope(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
%7 = load i32, i32* @EINVAL
ret i32 %7
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pthread_attr_getscope(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
ret i32 %3
}
/* Variables and functions */
double gammp(long, double);
double chipercent(double chiSq, long fr) {
  return (gammp(fr / 2.0, chiSq / 2.0));
}


x86 assembly (clang, -O0):
<chipercent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
movsd  -0x8(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <gammp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chipercent>:
cvtsi2sd %rdi,%xmm1
movsd  0xee3(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rdi
mulsd  %xmm2,%xmm0
jmp    1030 <gammp@plt>

LLVM IR (-O0):
define double @chipercent(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = fdiv double %6, 2.000000e+00
%8 = fptosi double %7 to i64
%9 = load double, double* %3
%10 = fdiv double %9, 2.000000e+00
%11 = call double @gammp(i64 %8, double %10)
ret double %11
}

LLVM IR (-O2):
define double @chipercent(double %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = fmul double %3, 5.000000e-01
%5 = fptosi double %4 to i64
%6 = fmul double %0, 5.000000e-01
%7 = tail call double @gammp(i64 %5, double %6)
ret double %7
}
int get_clen(int n) {
  int counter = 1;
  while (n != 1) {
    counter += 1;
    if (n % 2)
      n = 3 * n + 1;
    else
      n = n / 2;
  }
  return counter;
}


x86 assembly (clang, -O0):
<get_clen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1157 <get_clen+0x57>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1144 <get_clen+0x44>
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <get_clen+0x52>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <get_clen+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_clen>:
mov    $0x1,%eax
cmp    $0x1,%edi
jne    110b <get_clen+0xb>
ret
mov    $0x1,%eax
jmp    1133 <get_clen+0x33>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
mov    %ecx,%edi
add    $0x1,%eax
cmp    $0x1,%edi
je     110a <get_clen+0xa>
test   $0x1,%dil
je     1120 <get_clen+0x20>
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
jmp    112b <get_clen+0x2b>

LLVM IR (-O0):
define i32 @get_clen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = srem i32 %10, 2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %7
%14 = load i32, i32* %2
%15 = mul nsw i32 3, %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %20
17: ; preds = %7
%18 = load i32, i32* %2
%19 = sdiv i32 %18, 2
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %13
br label %4
21: ; preds = %4
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_clen(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %14
%4 = phi i32 [ %6, %14 ], [ 1, %1 ]
%5 = phi i32 [ %15, %14 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = mul nsw i32 %5, 3
%11 = add nsw i32 %10, 1
br label %14
12: ; preds = %3
%13 = sdiv i32 %5, 2
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ %11, %9 ], [ %13, %12 ]
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %3
17: ; preds = %14, %1
%18 = phi i32 [ 1, %1 ], [ %6, %14 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ foo(unsigned int *);
int main(void) {
  unsigned int y[3];
  foo(y);
  if (y[0] != 7 || y[1] != 8 || y[2] != 9)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <foo@plt>
cmpl   $0x7,-0x10(%rbp)
jne    1156 <main+0x36>
cmpl   $0x8,-0xc(%rbp)
jne    1156 <main+0x36>
cmpl   $0x9,-0x8(%rbp)
je     115d <main+0x3d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rdi
call   1040 <foo@plt>
cmpl   $0x7,0xc(%rsp)
jne    114a <main+0x2a>
cmpl   $0x8,0x10(%rsp)
jne    114a <main+0x2a>
cmpl   $0x9,0x14(%rsp)
jne    114a <main+0x2a>
xor    %eax,%eax
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 7
br i1 %7, label %16, label %8
8: ; preds = %0
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 8
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, 9
br i1 %15, label %16, label %18
16: ; preds = %12, %8, %0
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 7
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 8
%10 = select i1 %6, i1 true, i1 %9
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 9
%14 = select i1 %10, i1 true, i1 %13
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void separator(char *s, char *sep) { sprintf(s, "%s%s", s, sep); }


x86 assembly (clang, -O0):
<separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xecd(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<separator>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rsi
mov    %rdi,%rdx
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define void @separator(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** %3
%7 = load i8*, i8** %4
%8 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define void @separator(i8* %0, i8* %1) {
%3 = 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* %0, i8* %1)
ret void
}
void INT_UART0_TX(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_UART0_TX() {
ret void
}
/* Variables and functions */
int custom(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("\nThe hash is %d", custom("ab"));
  printf("\nThe hash is %d", custom("ba"));
  return 0;
}


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)
lea    0xed3(%rip),%rdi
call   1040 <custom@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
call   1040 <custom@plt>
mov    %eax,%esi
lea    0xe9b(%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),%rdi
call   1040 <custom@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
call   1040 <custom@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\0AThe hash is %d\00"
@.str.1 = [3 x i8] c"ab\00"
@.str.2 = [3 x i8] c"ba\00"
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 @custom(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @custom(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0AThe hash is %d\00"
@.str.1 = [3 x i8] c"ab\00"
@.str.2 = [3 x i8] c"ba\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @custom(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @custom(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int do_217() { return 217; }


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

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

LLVM IR (-O0):
define i32 @do_217() {
ret i32 217
}

LLVM IR (-O2):
define i32 @do_217() {
ret i32 217
}
char *skipblanks(s)
char *s;
{
  while ((*s && *s <= ' '))
    s++;
  return (s);
}


x86 assembly (clang, -O0):
<skipblanks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <skipblanks+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skipblanks+0x3d>
jmp    114e <skipblanks+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skipblanks+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipblanks>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <skipblanks+0x21>
cmp    $0x21,%cl
jl     1110 <skipblanks+0x10>
ret

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

LLVM IR (-O2):
define i8* @skipblanks(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
%6 = icmp slt i8 %4, 33
%7 = and i1 %5, %6
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i8* %3
}
int strchrCount(char *s, char c) {
  int i;
  for (i = 0; s[i]; (s[i] == c) ? (void)i++ : (void)s++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strchrCount>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1163 <strchrCount+0x63>
jmp    112c <strchrCount+0x2c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1152 <strchrCount+0x52>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115e <strchrCount+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <strchrCount+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrCount>:
mov    (%rdi),%cl
test   %cl,%cl
je     1132 <strchrCount+0x32>
xor    %r8d,%r8d
nopl   0x0(%rax)
xor    %eax,%eax
xor    %edx,%edx
cmp    %sil,%cl
sete   %al
setne  %dl
add    %rdx,%rdi
mov    %r8d,%ecx
add    %rcx,%rax
movzbl (%rdi,%rax,1),%ecx
mov    %eax,%r8d
test   %cl,%cl
jne    1110 <strchrCount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strchrCount(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %17, %5 ], [ %3, %2 ]
%7 = phi i32 [ %14, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = xor i1 %9, true
%11 = zext i1 %10 to i64
%12 = getelementptr i8, i8* %8, i64 %11
%13 = zext i1 %9 to i32
%14 = add nuw nsw i32 %7, %13
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %5
19: ; preds = %5, %2
%20 = phi i32 [ 0, %2 ], [ %14, %5 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ ptr_free(void *);
void os_free(void *ptr) {
  if (ptr != NULL) {
    ptr_free(ptr);
  }
  return;
}


x86 assembly (clang, -O0):
<os_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <os_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <ptr_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_free>:
test   %rdi,%rdi
je     111a <os_free+0xa>
jmp    1030 <ptr_free@plt>
ret

LLVM IR (-O0):
define void @os_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @ptr_free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @os_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @ptr_free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRBC_get(void) { return U_WMRCORENONE_get("U_WMRBC"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRBC\00"
define i32 @U_WMRBC_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRBC\00"
define i32 @U_WMRBC_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int imin2(int x, int y) { return (x < y) ? x : y; }


x86 assembly (clang, -O0):
<imin2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <imin2+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imin2+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imin2>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @imin2(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
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @imin2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void myreset(int numbers[], int size) {
  int i = 0;
  for (i = 0; i < size; i++) {
    numbers[i] = 0;
  }
}


x86 assembly (clang, -O0):
<myreset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1142 <myreset+0x42>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <myreset+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<myreset>:
test   %esi,%esi
jle    1126 <myreset+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @myreset(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
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
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
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @myreset(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
struct object *z_primitive_quit(struct object *args) {
  exit(1);
}


x86 assembly (clang, -O0):
<z_primitive_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<z_primitive_quit>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
%struct.object = type { i32 }
define noalias %struct.object* @z_primitive_quit(%struct.object* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ read_ptr();
void do_call() { void (*ptr)() = (void *)read_ptr(); }


x86 assembly (clang, -O0):
<do_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <read_ptr@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_call() {
%1 = alloca void (...)*
%2 = call i64 (...) @read_ptr()
%3 = inttoptr i64 %2 to i8*
%4 = bitcast i8* %3 to void (...)*
store void (...)* %4, void (...)** %1
ret void
}

LLVM IR (-O2):
define void @do_call() {
%1 = tail call i64 (...) @read_ptr()
ret void
}
float elCollV2(float sp1, float sp2, float m1, float m2) {
  return ((sp2 * (m2 - m1)) + (2 * m1 * sp1)) / (m1 + m2);
}


x86 assembly (clang, -O0):
<elCollV2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
subss  -0xc(%rbp),%xmm2
movss  0xed1(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
addss  -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<elCollV2>:
movaps %xmm3,%xmm4
subss  %xmm2,%xmm4
movaps %xmm2,%xmm5
addss  %xmm2,%xmm5
mulss  %xmm5,%xmm0
mulss  %xmm1,%xmm4
addss  %xmm4,%xmm0
addss  %xmm3,%xmm2
divss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @elCollV2(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %6
%10 = load float, float* %8
%11 = load float, float* %7
%12 = fsub float %10, %11
%13 = load float, float* %7
%14 = fmul float 2.000000e+00, %13
%15 = load float, float* %5
%16 = fmul float %14, %15
%17 = call float @llvm.fmuladd.f32(float %9, float %12, float %16)
%18 = load float, float* %7
%19 = load float, float* %8
%20 = fadd float %18, %19
%21 = fdiv float %17, %20
ret float %21
}

LLVM IR (-O2):
define float @elCollV2(float %0, float %1, float %2, float %3) {
%5 = fsub float %3, %2
%6 = fmul float %2, 2.000000e+00
%7 = fmul float %6, %0
%8 = tail call float @llvm.fmuladd.f32(float %1, float %5, float %7)
%9 = fadd float %2, %3
%10 = fdiv float %8, %9
ret float %10
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t nmemb, size_t size) {
  void *ret = malloc(nmemb * size);
  memset(ret, 0, nmemb * size);
  return ret;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = call i32 @memset(i8* %10, i32 0, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf(" hello world \n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c" hello world \00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f2(int);
int f3(int);
int f1(int i) {
  if (i % 2 == 0) {
    return f2(i);
  } else {
    return f3(i);
  }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <f1+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <f2@plt>
mov    %eax,-0x4(%rbp)
jmp    115a <f1+0x3a>
mov    -0x8(%rbp),%edi
call   1040 <f3@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
test   $0x1,%dil
jne    112b <f1+0xb>
jmp    1030 <f2@plt>
jmp    1040 <f3@plt>

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @f2(i32 %8)
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @f3(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @f2(i32 %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @f3(i32 %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello world!");
  return 0;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
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 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__14__GeneralIO__set();
void HplSensirionSht11P__PWR__set(void) { Msp430GpioC__14__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @HplSensirionSht11P__PWR__set() {
%1 = tail call i32 (...) @Msp430GpioC__14__GeneralIO__set()
ret void
}
/* Variables and functions */
long sys_setgroups(unsigned int, int *);
long sys_initgroups(unsigned int size, int *gidset, int gmuid) {
  return sys_setgroups(size, gidset);
}


x86 assembly (clang, -O0):
<sys_initgroups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <sys_setgroups@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_initgroups>:
jmp    1030 <sys_setgroups@plt>

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

LLVM IR (-O2):
define i64 @sys_initgroups(i32 %0, i32* %1, i32 %2) {
%4 = tail call i64 @sys_setgroups(i32 %0, i32* %1)
ret i64 %4
}
int ft_chk_cmt(char *line) {
  if (!line)
    return (0);
  while (*line) {
    if (*line == '#' || *line == ';') {
      *line = '\0';
      return (0);
    }
    line++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_chk_cmt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <ft_chk_cmt+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    117c <ft_chk_cmt+0x7c>
jmp    1124 <ft_chk_cmt+0x24>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1175 <ft_chk_cmt+0x75>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     1151 <ft_chk_cmt+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    1164 <ft_chk_cmt+0x64>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    117c <ft_chk_cmt+0x7c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <ft_chk_cmt+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_chk_cmt>:
test   %rdi,%rdi
je     1128 <ft_chk_cmt+0x28>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%eax
test   %al,%al
je     1128 <ft_chk_cmt+0x28>
cmp    $0x3b,%al
je     1125 <ft_chk_cmt+0x25>
cmp    $0x23,%al
je     1125 <ft_chk_cmt+0x25>
add    $0x1,%rdi
jmp    1110 <ft_chk_cmt+0x10>
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_chk_cmt(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 35, label %6
i8 59, label %6
]
6: ; preds = %3, %3
store i8 0, i8* %4
br label %9
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
9: ; preds = %3, %1, %6
ret i32 0
}
/* Variables and functions */
int get_builto_value();
__attribute__((visibility("default"))) int get_stodep_value(void) {
  return get_builto_value();
}


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

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

LLVM IR (-O0):
define i32 @get_stodep_value() {
%1 = call i32 (...) @get_builto_value()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_stodep_value() {
%1 = tail call i32 (...) @get_builto_value()
ret i32 %1
}
/* Variables and functions */
unsigned int psr_get();
int /*<<< orphan*/ psr_set(unsigned int);
void psr_disable_interupt(void) {
  unsigned int psr = psr_get();
  psr &= ~(0xF << 8);
  psr_set(psr | (((0xF) & 0xF) << 8));
}


x86 assembly (clang, -O0):
<psr_disable_interupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <psr_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffff0ff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0xf00,%edi
call   1040 <psr_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psr_disable_interupt>:
push   %rax
xor    %eax,%eax
call   1030 <psr_get@plt>
or     $0xf00,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <psr_set@plt>

LLVM IR (-O0):
define void @psr_disable_interupt() {
%1 = alloca i32
%2 = call i32 (...) @psr_get()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -3841
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = or i32 %5, 3840
%7 = call i32 @psr_set(i32 %6)
ret void
}

LLVM IR (-O2):
define void @psr_disable_interupt() {
%1 = tail call i32 (...) @psr_get()
%2 = or i32 %1, 3840
%3 = tail call i32 @psr_set(i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ u_int32_t;

/* Variables and functions */
int array_caseless_compare(char const *const, char const *const,
                           scalar_t__ const);
__attribute__((__pure__)) int array_keycmp(const char *const a,
                                           const u_int32_t alen,
                                           const char *const b,
                                           const u_int32_t blen) {
  return alen < blen   ? -1
         : alen > blen ? 1
                       : array_caseless_compare(a, b, blen);
}


x86 assembly (clang, -O0):
<array_keycmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1143 <array_keycmp+0x33>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1178 <array_keycmp+0x68>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    115e <array_keycmp+0x4e>
mov    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1172 <array_keycmp+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <array_caseless_compare@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_keycmp>:
mov    $0xffffffff,%eax
cmp    %rcx,%rsi
jl     1121 <array_keycmp+0x11>
mov    $0x1,%eax
jle    1122 <array_keycmp+0x12>
ret
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <array_caseless_compare@plt>

LLVM IR (-O0):
define i32 @array_keycmp(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i64, i64* %6
%10 = load i64, i64* %8
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %4
br label %25
13: ; preds = %4
%14 = load i64, i64* %6
%15 = load i64, i64* %8
%16 = icmp sgt i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
br label %23
18: ; preds = %13
%19 = load i8*, i8** %5
%20 = load i8*, i8** %7
%21 = load i64, i64* %8
%22 = call i32 @array_caseless_compare(i8* %19, i8* %20, i64 %21)
br label %23
23: ; preds = %18, %17
%24 = phi i32 [ 1, %17 ], [ %22, %18 ]
br label %25
25: ; preds = %23, %12
%26 = phi i32 [ -1, %12 ], [ %24, %23 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @array_keycmp(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp slt i64 %1, %3
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = icmp sgt i64 %1, %3
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @array_caseless_compare(i8* %0, i8* %2, i64 %3)
br label %10
10: ; preds = %8, %6, %4
%11 = phi i32 [ -1, %4 ], [ %9, %8 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncasecmp(char const *, char const *, int /*<<< orphan*/);
bool str_starts_with(const char *str, const char *prefix) {
  if (str == NULL || prefix == NULL)
    return 0;
  return strncasecmp(str, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<str_starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <str_starts_with+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1152 <str_starts_with+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1189 <str_starts_with+0x69>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_starts_with>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1156 <str_starts_with+0x36>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1156 <str_starts_with+0x36>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @str_starts_with(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 = icmp eq i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 0, i32* %3
br label %20
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i8*, i8** %5
%16 = call i32 @strlen(i8* %15)
%17 = call i64 @strncasecmp(i8* %13, i8* %14, i32 %16)
%18 = icmp eq i64 %17, 0
%19 = zext i1 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %12, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @str_starts_with(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i64 @strncasecmp(i8* %0, i8* %1, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ 0, %2 ]
ret i32 %12
}
long double abs_val(long double value) {
  long double result = value;
  if (value < 0)
    result = -value;
  return result;
}


x86 assembly (clang, -O0):
<abs_val>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    112c <abs_val+0x2c>
jmp    1124 <abs_val+0x24>
fldt   -0x10(%rbp)
fchs
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_val>:
fldt   0x8(%rsp)
fldz
fucomip %st(1),%st
fld    %st(0)
fchs
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @abs_val(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
store x86_fp80 %4, x86_fp80* %3
%5 = load x86_fp80, x86_fp80* %2
%6 = fcmp olt x86_fp80 %5, 0xK00000000000000000000
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load x86_fp80, x86_fp80* %2
%9 = fneg x86_fp80 %8
store x86_fp80 %9, x86_fp80* %3
br label %10
10: ; preds = %7, %1
%11 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @abs_val(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
%3 = fneg x86_fp80 %0
%4 = select i1 %2, x86_fp80 %3, x86_fp80 %0
ret x86_fp80 %4
}
void UART1_TX_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @UART1_TX_intr() {
ret void
}
void test(void) {
  inline void inline_1(void);
  extern inline void inline_2(void);
  inline void inline_3(void);
  extern inline void inline_4(void);
  inline void inline_static_1(void);
  extern inline void inline_static_2(void);
  inline void inline_static_3(void);
  extern inline void inline_static_4(void);
}


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
char const *pp_time_unit() { return 1 ? "cycles" : "usec"; }


x86 assembly (clang, -O0):
<pp_time_unit>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pp_time_unit>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"cycles\00"
define i8* @pp_time_unit() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"cycles\00"
define i8* @pp_time_unit() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
void iowait() { asm volatile("outb %al, $0x80"); }


x86 assembly (clang, -O0):
<iowait>:
push   %rbp
mov    %rsp,%rbp
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<iowait>:
out    %al,$0x80
ret

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

LLVM IR (-O2):
define void @iowait() {
tail call void asm sideeffect "outb %al, $$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *__val;
};
typedef TYPE_1__ sigset_t;

/* Variables and functions */
int __sigsuspend(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int sigsuspend(const sigset_t *set) {
  return __sigsuspend(0, 0, set->__val[0]);
}


x86 assembly (clang, -O0):
<sigsuspend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <__sigsuspend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigsuspend>:
mov    (%rdi),%rax
mov    (%rax),%edx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <__sigsuspend@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32* }
define i32 @sigsuspend(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = call i32 @__sigsuspend(i32 0, i32 0, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32* }
define i32 @sigsuspend(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = tail call i32 @__sigsuspend(i32 0, i32 0, i32 %4)
ret i32 %5
}