xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *cmd_name) {
  fprintf(stderr, "Usage: %s [PHYLIP-FILE]\n", cmd_name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s [PHYLIP-FILE]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s [PHYLIP-FILE]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void insl(int port, void *addr, int cnt) {
  asm volatile("rep insl;"
               : "+D"(addr), "+c"(cnt)
               : "d"(port)
               : "memory", "cc");
}


x86 assembly (clang, -O0):
<insl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    -0x4(%rbp),%edx
rep insl (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insl>:
mov    %edx,%ecx
mov    %edi,%edx
mov    %rsi,%rdi
rep insl (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insl(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = call { i8*, i32 } asm sideeffect "rep insl;", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i32 %8)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %5
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @insl(i32 %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "rep insl;", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int *array, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d\n", array[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
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 <print+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 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print+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 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print(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 ([4 x i8], [4 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 = [4 x i8] c"%d\0A\00"
define void @print(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 ([4 x i8], [4 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
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void print_hex(unsigned char *str, int len) {
  int i;
  for (i = 0; i < len; ++i)
    printf("%02x", str[i]);
}


x86 assembly (clang, -O0):
<print_hex>:
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    1158 <print_hex+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_hex+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%02x\00"
define void @print_hex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %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 i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %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 = [5 x i8] c"%02x\00"
define void @print_hex(i8* 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 i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %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
}
/* Variables and functions */
scalar_t__ fminf(float, float);
int /*<<< orphan*/ link_failure_fminf();
void test_fminf(float f1, float f2) {
  if (fminf(f1, f2) != fminf(f1, f2))
    link_failure_fminf();
}


x86 assembly (clang, -O0):
<test_fminf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <fminf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <fminf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_fminf+0x4b>
mov    $0x0,%al
call   1030 <link_failure_fminf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fminf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
call   1040 <fminf@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1040 <fminf@plt>
cmp    %rax,%rbx
jne    1155 <test_fminf+0x35>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_fminf@plt>

LLVM IR (-O0):
define void @test_fminf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i64 @fminf(float %5, float %6)
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call i64 @fminf(float %8, float %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_fminf()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_fminf(float %0, float %1) {
%3 = tail call i64 @fminf(float %0, float %1)
%4 = tail call i64 @fminf(float %0, float %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_fminf()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ event_init();
int /*<<< orphan*/ event_loop();
int /*<<< orphan*/ event_uninit();
int sat_init(int, char **);
int main(int argc, char *argv[]) {
  int ret;
  event_init();
  if (!(ret = sat_init(argc, argv)))
    event_loop();
  event_uninit();
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <event_init@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <sat_init@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    117c <main+0x3c>
mov    $0x0,%al
call   1040 <event_loop@plt>
mov    $0x0,%al
call   1060 <event_uninit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <event_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <sat_init@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1166 <main+0x26>
xor    %eax,%eax
call   1040 <event_loop@plt>
xor    %eax,%eax
call   1060 <event_uninit@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @event_init()
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @sat_init(i32 %8, i8** %9)
store i32 %10, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 (...) @event_loop()
br label %14
14: ; preds = %12, %2
%15 = call i32 (...) @event_uninit()
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @event_init()
%4 = tail call i32 @sat_init(i32 %0, i8** %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @event_loop()
br label %8
8: ; preds = %6, %2
%9 = tail call i32 (...) @event_uninit()
ret i32 %4
}
/* Variables and functions */
double CumSumSumSq(double *, int, double *);
double scalCumSumSumSq(double *xa, int n, double *sumSQ) {
  return CumSumSumSq(xa, n, sumSQ);
}


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

x86 assembly (clang, -O2):
<scalCumSumSumSq>:
jmp    1030 <CumSumSumSq@plt>

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

LLVM IR (-O2):
define double @scalCumSumSumSq(double* %0, i32 %1, double* %2) {
%4 = tail call double @CumSumSumSq(double* %0, i32 %1, double* %2)
ret double %4
}
unsigned LowestBit(unsigned x) { return x & ~(x - 1); }


x86 assembly (clang, -O0):
<LowestBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LowestBit>:
mov    %edi,%eax
neg    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @LowestBit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @LowestBit(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ XVisualInfo;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XVisualInfo(void *_p) {
  if (_p == NULL)
    abort();
  free((XVisualInfo *)_p);
}


x86 assembly (clang, -O0):
<free_XVisualInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XVisualInfo+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XVisualInfo>:
test   %rdi,%rdi
je     112a <free_XVisualInfo+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XVisualInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XVisualInfo(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c))
    return c | 0x20;
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x8(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = or i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char *str = "chenzongzhi";
  printf("%s %s\n", "str", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xed7(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"chenzongzhi\00"
@.str.1 = [7 x i8] c"%s %s\0A\00"
@.str.2 = [4 x i8] c"str\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long parent;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
void set_XCreateWindowEvent_parent(void *_p, unsigned long _v) {
  ((XCreateWindowEvent *)_p)->parent = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XCreateWindowEvent_parent(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_RenderingControl_SetHorizontalKeystone(
    struct UPnPService *Service, int ErrorCode, void *User) {
  printf("RND Invoke Response: "
         "RenderingControl/SetHorizontalKeystone[ErrorCode:%d]()\r\n",
         ErrorCode);
}


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

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: RenderingControl/SetHorizontalKeystone[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetHorizontalKeystone(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: RenderingControl/SetHorizontalKeystone[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetHorizontalKeystone(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void pr_year(char *year) { printf("The year is 19%s", year); }


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

x86 assembly (clang, -O2):
<pr_year>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"The year is 19%s\00"
define void @pr_year(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"The year is 19%s\00"
define void @pr_year(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float g(void *a, void *b, int e, int c, float d) { return d; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @g(i8* %0, i8* %1, i32 %2, i32 %3, float %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store float %4, float* %10
%11 = load float, float* %10
ret float %11
}

LLVM IR (-O2):
define float @g(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, float returned %4) {
ret float %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t _dh(uint8_t *data, uint8_t i) { return (*data >> (i << 1)); }


x86 assembly (clang, -O0):
<_dh>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dh>:
mov    (%rdi),%eax
lea    (%rsi,%rsi,1),%ecx
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @_dh(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* %5
%7 = load i32, i32* %4
%8 = shl i32 %7, 1
%9 = ashr i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @_dh(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = shl i32 %1, 1
%5 = ashr i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GenericFaultHandler(unsigned long *);
void MemManage_Handler(unsigned long *hardfault_args) {
  GenericFaultHandler(hardfault_args);
}


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

x86 assembly (clang, -O2):
<MemManage_Handler>:
jmp    1030 <GenericFaultHandler@plt>

LLVM IR (-O0):
define void @MemManage_Handler(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = call i32 @GenericFaultHandler(i64* %3)
ret void
}

LLVM IR (-O2):
define void @MemManage_Handler(i64* %0) {
%2 = tail call i32 @GenericFaultHandler(i64* %0)
ret void
}
void wait(void) {
  long i, j;
  for (i = 0; i < 2; ++i)
    for (j = 0; j < 2; ++j)
      ;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
cmpq   $0x2,-0x8(%rbp)
jge    1156 <wait+0x56>
movq   $0x0,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
jge    1140 <wait+0x40>
jmp    112f <wait+0x2f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111f <wait+0x1f>
jmp    1145 <wait+0x45>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <wait+0xc>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @wait() {
ret void
}
int Thanksgivingday(int monthStartDOW) {
  if ((monthStartDOW >= 0) && (monthStartDOW <= 4)) {
    return (26 - monthStartDOW);
  } else if (monthStartDOW == 5) {
    return 28;
  } else {
    return 27;
  }
}


x86 assembly (clang, -O0):
<Thanksgivingday>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112b <Thanksgivingday+0x2b>
cmpl   $0x4,-0x8(%rbp)
jg     112b <Thanksgivingday+0x2b>
mov    $0x1a,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <Thanksgivingday+0x48>
cmpl   $0x5,-0x8(%rbp)
jne    1141 <Thanksgivingday+0x41>
movl   $0x1c,-0x4(%rbp)
jmp    1148 <Thanksgivingday+0x48>
movl   $0x1b,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thanksgivingday>:
mov    $0x1a,%ecx
sub    %edi,%ecx
xor    %eax,%eax
cmp    $0x5,%edi
sete   %al
add    $0x1b,%eax
cmp    $0x5,%edi
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Thanksgivingday(i32 %0) {
%2 = icmp ult i32 %0, 5
%3 = sub nsw i32 26, %0
%4 = icmp eq i32 %0, 5
%5 = select i1 %4, i32 28, i32 27
%6 = select i1 %2, i32 %3, i32 %5
ret i32 %6
}
int fun1279() { return 1279; }


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

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

LLVM IR (-O0):
define i32 @fun1279() {
ret i32 1279
}

LLVM IR (-O2):
define i32 @fun1279() {
ret i32 1279
}
/* Type definitions */
struct clad_test {
  int dummy;
};

/* Variables and functions */
struct clad_test *clad_test_assert(struct clad_test *, int, char *, int,
                                   char const *);
struct clad_test *clad_test_false(struct clad_test *test, int boole,
                                  const char *explain) {
  return clad_test_assert(test, (!boole), "Boolean should be FALSE: %d; %s ",
                          boole, explain);
}


x86 assembly (clang, -O0):
<clad_test_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xebd(%rip),%rdx
call   1030 <clad_test_assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_test_false>:
mov    %rdx,%r8
mov    %esi,%ecx
xor    %esi,%esi
test   %ecx,%ecx
sete   %sil
lea    0xedc(%rip),%rdx
jmp    1030 <clad_test_assert@plt>

LLVM IR (-O0):
%struct.clad_test = type { i32 }
@.str = [33 x i8] c"Boolean should be FALSE: %d; %s \00"
define %struct.clad_test* @clad_test_false(%struct.clad_test* %0, i32 %1, i8* %2) {
%4 = alloca %struct.clad_test*
%5 = alloca i32
%6 = alloca i8*
store %struct.clad_test* %0, %struct.clad_test** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.clad_test*, %struct.clad_test** %4
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = call %struct.clad_test* @clad_test_assert(%struct.clad_test* %7, i32 %11, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13)
ret %struct.clad_test* %14
}

LLVM IR (-O2):
%struct.clad_test = type { i32 }
@.str = [33 x i8] c"Boolean should be FALSE: %d; %s \00"
define %struct.clad_test* @clad_test_false(%struct.clad_test* %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 0
%5 = zext i1 %4 to i32
%6 = tail call %struct.clad_test* @clad_test_assert(%struct.clad_test* %0, i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
ret %struct.clad_test* %6
}
int I_NoAppServicesLobbyJoinRequested(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @I_NoAppServicesLobbyJoinRequested() {
ret i32 0
}
int d_bun_mr2(double *a1, double a2) {
  return !(__builtin_isunordered(*a1, a2));
}


x86 assembly (clang, -O0):
<d_bun_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x10(%rbp),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bun_mr2>:
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @d_bun_mr2(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp uno double %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_bun_mr2(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ord double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
void pramcache_save_bdev_cache(struct super_block *sb) {}


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

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

LLVM IR (-O0):
%struct.super_block = type opaque
define void @pramcache_save_bdev_cache(%struct.super_block* %0) {
%2 = alloca %struct.super_block*
store %struct.super_block* %0, %struct.super_block** %2
ret void
}

LLVM IR (-O2):
%struct.super_block = type opaque
define void @pramcache_save_bdev_cache(%struct.super_block* nocapture %0) {
ret void
}
void swap(int *i, int *j) {
  int t;
  t = *i;
  *i = *j;
  *j = t;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int *initArr(int);
int /*<<< orphan*/ printArr(int *, int);
int main(void) {
  int *arr2 = initArr(10);
  printArr(arr2, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <initArr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <printArr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <initArr@plt>
mov    %rax,%rdi
mov    $0xa,%esi
call   1030 <printArr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @initArr(i32 10)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @printArr(i32* %4, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @initArr(i32 10)
%2 = tail call i32 @printArr(i32* %1, i32 10)
ret i32 0
}
void adjust_temp(int temp) {}


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

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

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

LLVM IR (-O2):
define void @adjust_temp(i32 %0) {
ret void
}
/* Variables and functions */
bool nrf51_errata_24(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_24() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_convert(int N, int M) {
  printf("\n\t- number of individuals detected:\t%d\n", N);
  printf("\t- number of loci detected:\t\t%d\n\n", M);
}


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

x86 assembly (clang, -O2):
<print_convert>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\0A\09- number of individuals detected:\09%d\0A\00"
@.str.1 = [34 x i8] c"\09- number of loci detected:\09\09%d\0A\0A\00"
define void @print_convert(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"\0A\09- number of individuals detected:\09%d\0A\00"
@.str.1 = [34 x i8] c"\09- number of loci detected:\09\09%d\0A\0A\00"
define void @print_convert(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int findinserts(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
void main() {
  char a[] = "geekabcdef kpeeg";
  int len = strlen(a);
  int res = findinserts(a, 0, len - 1);
  printf(" Min insertions required %d ", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebc(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1050 <findinserts@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <findinserts@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [17 x i8] c"geekabcdef kpeeg\00"
@.str = [29 x i8] c" Min insertions required %d \00"
define void @main() {
%1 = alloca [17 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [17 x i8]* %1 to i8*
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %2
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = call i32 @findinserts(i8* %7, i32 0, i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@__const.main.a = [17 x i8] c"geekabcdef kpeeg\00"
@.str = [29 x i8] c" Min insertions required %d \00"
define void @main() {
%1 = alloca [17 x i8]
%2 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = add nsw i32 %3, -1
%5 = call i32 @findinserts(i8* %2, i32 0, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
__attribute__((no, noclone)) int foo(int x) {
  if (x == -216 || x == -211 || x == -218 || x == -205 || x == -223)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffff28,-0x8(%rbp)
je     1148 <foo+0x48>
cmpl   $0xffffff2d,-0x8(%rbp)
je     1148 <foo+0x48>
cmpl   $0xffffff26,-0x8(%rbp)
je     1148 <foo+0x48>
cmpl   $0xffffff33,-0x8(%rbp)
je     1148 <foo+0x48>
cmpl   $0xffffff21,-0x8(%rbp)
jne    1154 <foo+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <foo+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    $0xdf,%edi
cmp    $0x12,%edi
ja     111b <foo+0x1b>
mov    $0x1,%eax
mov    $0x410a1,%ecx
bt     %edi,%ecx
jae    111b <foo+0x1b>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
switch i32 %0, label %2 [
i32 -205, label %3
i32 -211, label %3
i32 -216, label %3
i32 -218, label %3
i32 -223, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int GetFileLen(char *filename) {
  struct stat file;
  if (stat(filename, &file) == 0) {
    return ((int)file.st_size);
  }
  return 0;
}


x86 assembly (clang, -O0):
<GetFileLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    113f <GetFileLen+0x2f>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1146 <GetFileLen+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFileLen>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1126 <GetFileLen+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @GetFileLen(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @GetFileLen(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = select i1 %5, i32 %8, i32 0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ mbc_reset();
void mbc_init(void) { mbc_reset(); }


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

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

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

LLVM IR (-O2):
define void @mbc_init() {
%1 = tail call i32 (...) @mbc_reset()
ret void
}
/* Variables and functions */
int INT_MAX;
int INT_MIN;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", INT_MIN - 1);
  printf("%d\n", INT_MAX + 1);
  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)
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
sub    $0x1,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
add    $0x1,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
add    $0xffffffff,%esi
lea    0xedc(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@INT_MIN = global i32 0
@INT_MAX = global i32 0
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 = load i32, i32* @INT_MIN
%7 = sub nsw i32 %6, 1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @INT_MAX
%10 = add nsw i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@INT_MIN = global i32 0
@INT_MAX = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @INT_MIN
%4 = add nsw i32 %3, -1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @INT_MAX
%7 = add nsw i32 %6, 1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void xxx(void) {
  int iter, jter;
  for (iter = 0, jter = 2; iter < 100; iter++, jter++) {
    foo(iter);
    foo(jter);
  }
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1157 <xxx+0x47>
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <xxx+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxx>:
push   %rbx
mov    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%edi
call   1030 <foo@plt>
mov    %ebx,%edi
call   1030 <foo@plt>
add    $0x1,%ebx
cmp    $0x66,%ebx
jne    1120 <xxx+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @xxx() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @foo(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @foo(i32 %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @xxx() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 2, %0 ], [ %7, %1 ]
%3 = phi i32 [ 0, %0 ], [ %6, %1 ]
%4 = tail call i32 @foo(i32 %3)
%5 = tail call i32 @foo(i32 %2)
%6 = add nuw nsw i32 %3, 1
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %6, 100
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
unsigned char threegpplte_rsc(unsigned char input, unsigned char *state) {
  unsigned char output;
  output = (input ^ (*state >> 2) ^ (*state >> 1)) & 1;
  *state = (((input << 2) ^ (*state >> 1)) ^ ((*state >> 1) << 2) ^
            ((*state) << 2)) &
           7;
  return (output);
}


x86 assembly (clang, -O0):
<threegpplte_rsc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sar    $0x2,%ecx
xor    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
and    $0x1,%eax
mov    %al,-0x11(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x2,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sar    $0x1,%ecx
shl    $0x2,%ecx
xor    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x2,%ecx
xor    %ecx,%eax
and    $0x7,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<threegpplte_rsc>:
movzbl (%rsi),%ecx
mov    %ecx,%eax
shr    $0x2,%eax
xor    %edi,%eax
mov    %ecx,%edx
shr    %edx
xor    %edx,%eax
and    $0x1,%al
shl    $0x2,%edi
xor    %edx,%edi
shl    $0x2,%edx
shl    $0x2,%ecx
xor    %edi,%ecx
xor    %edx,%ecx
and    $0x7,%cl
mov    %cl,(%rsi)
ret

LLVM IR (-O0):
define zeroext i8 @threegpplte_rsc(i8 zeroext %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
%7 = zext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = ashr i32 %10, 2
%12 = xor i32 %7, %11
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = ashr i32 %15, 1
%17 = xor i32 %12, %16
%18 = and i32 %17, 1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %5
%20 = load i8, i8* %3
%21 = zext i8 %20 to i32
%22 = shl i32 %21, 2
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = ashr i32 %25, 1
%27 = xor i32 %22, %26
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = ashr i32 %30, 1
%32 = shl i32 %31, 2
%33 = xor i32 %27, %32
%34 = load i8*, i8** %4
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = shl i32 %36, 2
%38 = xor i32 %33, %37
%39 = and i32 %38, 7
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %4
store i8 %40, i8* %41
%42 = load i8, i8* %5
ret i8 %42
}

LLVM IR (-O2):
define zeroext i8 @threegpplte_rsc(i8 zeroext %0, i8* nocapture %1) {
%3 = zext i8 %0 to i32
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = lshr i32 %5, 2
%7 = xor i32 %6, %3
%8 = lshr i32 %5, 1
%9 = xor i32 %7, %8
%10 = trunc i32 %9 to i8
%11 = and i8 %10, 1
%12 = shl nuw nsw i32 %3, 2
%13 = xor i32 %8, %12
%14 = shl nuw nsw i32 %8, 2
%15 = shl nuw nsw i32 %5, 2
%16 = xor i32 %13, %15
%17 = xor i32 %16, %14
%18 = trunc i32 %17 to i8
%19 = and i8 %18, 7
store i8 %19, i8* %1
ret i8 %11
}