xunge/DecIR huggingface dataset:
/* Variables and functions */
int findMinNumberInRotatedArray_improved(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int array[] = {1, 1, 1, 0, 1};
  int position = findMinNumberInRotatedArray_improved(array, 5);
  printf("%d\n", position);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1040 <findMinNumberInRotatedArray_improved@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <findMinNumberInRotatedArray_improved@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [5 x i32] [i32 1, i32 1, i32 1, i32 0, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [5 x i32]* %6 to i8*
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%10 = call i32 @findMinNumberInRotatedArray_improved(i32* %9, i32 5)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [5 x i32] [i32 1, i32 1, i32 1, i32 0, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %3 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%6 = call i32 @findMinNumberInRotatedArray_improved(i32* %5, i32 5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
int f() {
  int i = 0;
  if (i > 0) {
    int j = 1;
    return j;
  } else {
    char j = '2';
    return j;
  }
  return i;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1127 <f+0x27>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <f+0x32>
movb   $0x32,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
store i32 1, i32* %3
%8 = load i32, i32* %3
store i32 %8, i32* %1
br label %12
9: ; preds = %0
store i8 50, i8* %4
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
store i32 %11, i32* %1
br label %12
12: ; preds = %9, %7
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @f() {
ret i32 50
}
void rte_mbuf_set_as_core_local(struct rte_mbuf *m) {}


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

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

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

LLVM IR (-O2):
%struct.rte_mbuf = type opaque
define void @rte_mbuf_set_as_core_local(%struct.rte_mbuf* nocapture %0) {
ret void
}
/* Variables and functions */
int sprintf(char *, char *);
int connectionSet(char *buf) {
  return sprintf(buf, "Connection: keep-alive\n");
}


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

x86 assembly (clang, -O2):
<connectionSet>:
movups 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movabs $0xa6576696c612d,%rax
mov    %rax,0x10(%rdi)
mov    $0x17,%eax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Connection: keep-alive\0A\00"
define i32 @connectionSet(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [24 x i8] c"Connection: keep-alive\0A\00"
define i32 @connectionSet(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(24) %0, i8* align 1 dereferenceable(24) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 24, i1 false)
ret i32 23
}
/* Variables and functions */
int rand();
int RandBetween(int Lower, int Upper) {
  return rand() % (Upper - Lower + 1) + Lower;
}


x86 assembly (clang, -O0):
<RandBetween>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandBetween>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @RandBetween(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @RandBetween(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ pickup_forks(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
int /*<<< orphan*/ return_forks(int);
void *eating(int philosopherNumber) {
  printf("The philosopher %d wishes to eat dinner!\n", philosopherNumber);
  pickup_forks(philosopherNumber);
  return_forks(philosopherNumber);
  pthread_exit(0);
}


x86 assembly (clang, -O0):
<eating>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <pickup_forks@plt>
mov    -0xc(%rbp),%edi
call   1050 <return_forks@plt>
xor    %edi,%edi
call   1060 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eating>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1030 <pickup_forks@plt>
mov    %ebx,%edi
call   1050 <return_forks@plt>
xor    %edi,%edi
pop    %rbx
jmp    1060 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"The philosopher %d wishes to eat dinner!\0A\00"
define i8* @eating(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @pickup_forks(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @return_forks(i32 %8)
%10 = call i32 @pthread_exit(i32 0)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [42 x i8] c"The philosopher %d wishes to eat dinner!\0A\00"
define noalias i8* @eating(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @pickup_forks(i32 %0)
%4 = tail call i32 @return_forks(i32 %0)
%5 = tail call i32 @pthread_exit(i32 0)
ret i8* undef
}
/* Variables and functions */
scalar_t__ write(int, void const *, int);
int hal_write(int fd, const void *buf, int nbytes) {
  return (int)write(1, buf, nbytes);
}


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

x86 assembly (clang, -O2):
<hal_write>:
mov    $0x1,%edi
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @hal_write(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 = call i64 @write(i32 1, i8* %7, i32 %8)
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @hal_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @write(i32 1, i8* %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void logg(const char *str) { fprintf(stderr, "%s\n", str); }


x86 assembly (clang, -O0):
<logg>:
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):
<logg>:
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 = [4 x i8] c"%s\0A\00"
define void @logg(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @logg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int u8isupperlatini(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char const *);
int u8isupperlatincc(const char *c) { return u8isupperlatini(u8tointcc(c)); }


x86 assembly (clang, -O0):
<u8isupperlatincc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointcc@plt>
mov    %eax,%edi
call   1040 <u8isupperlatini@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isupperlatincc>:
push   %rax
call   1030 <u8tointcc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isupperlatini@plt>

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

LLVM IR (-O2):
define i32 @u8isupperlatincc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8isupperlatini(i32 %2)
ret i32 %3
}
/* Variables and functions */
float calc(int, int, int);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  float r;
  int h, m, code;
  scanf("%d %d %d", &h, &m, &code);
  if ((r = calc(h, m, code)) >= 0) {
    printf("Spent %f", r);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <calc@plt>
movss  %xmm0,-0x8(%rbp)
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1187 <main+0x57>
movss  -0x8(%rbp),%xmm0
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1040 <calc@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1174 <main+0x44>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [9 x i8] c"Spent %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call float @calc(i32 %7, i32 %8, i32 %9)
store float %10, float* %2
%11 = fcmp oge float %10, 0.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %0
%13 = load float, float* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float %13)
br label %15
15: ; preds = %12, %0
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [9 x i8] c"Spent %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call float @calc(i32 %8, i32 %9, i32 %10)
%12 = fcmp ult float %11, 0.000000e+00
br i1 %12, label %15, label %13
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float %11)
br label %15
15: ; preds = %13, %0
ret i32 0
}
/* Variables and functions */
float cos(float);
float sin(float);
void MatrixRotate4x4(float *matrix, float angle) {
  *(matrix + 0) = cos(angle);
  *(matrix + 1) = sin(angle);
  *(matrix + 4) = -sin(angle);
  *(matrix + 5) = cos(angle);
}


x86 assembly (clang, -O0):
<MatrixRotate4x4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
call   1030 <sin@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
movss  -0xc(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x14(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatrixRotate4x4>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
call   1040 <cos@plt>
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <sin@plt>
movss  %xmm0,0x4(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <sin@plt>
xorps  0xea7(%rip),%xmm0
movss  %xmm0,0x10(%rbx)
movss  0xc(%rsp),%xmm0
call   1040 <cos@plt>
movss  %xmm0,0x14(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @MatrixRotate4x4(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = call float @cos(float %5)
%7 = load float*, float** %3
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float, float* %4
%10 = call float @sin(float %9)
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
store float %10, float* %12
%13 = load float, float* %4
%14 = call float @sin(float %13)
%15 = fneg float %14
%16 = load float*, float** %3
%17 = getelementptr inbounds float, float* %16, i64 4
store float %15, float* %17
%18 = load float, float* %4
%19 = call float @cos(float %18)
%20 = load float*, float** %3
%21 = getelementptr inbounds float, float* %20, i64 5
store float %19, float* %21
ret void
}

LLVM IR (-O2):
define void @MatrixRotate4x4(float* nocapture writeonly %0, float %1) {
%3 = tail call float @cos(float %1)
store float %3, float* %0
%4 = tail call float @sin(float %1)
%5 = getelementptr inbounds float, float* %0, i64 1
store float %4, float* %5
%6 = tail call float @sin(float %1)
%7 = fneg float %6
%8 = getelementptr inbounds float, float* %0, i64 4
store float %7, float* %8
%9 = tail call float @cos(float %1)
%10 = getelementptr inbounds float, float* %0, i64 5
store float %9, float* %10
ret void
}
int avx512f_os_support(void) {
  unsigned int eax, edx;
  unsigned int ecx = 0x0;
  unsigned int mask = 0x2 | 0x4 | 0x20 | 0x40 | 0x80;
  __asm__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(ecx));
  return ((eax & mask) == mask);
}


x86 assembly (clang, -O0):
<avx512f_os_support>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
movl   $0xe6,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
xgetbv
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<avx512f_os_support>:
xor    %ecx,%ecx
xgetbv
not    %eax
xor    %ecx,%ecx
test   $0xe6,%al
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @avx512f_os_support() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %3
store i32 230, i32* %4
%5 = load i32, i32* %3
%6 = call { i32, i32 } asm "xgetbv", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %1
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = load i32, i32* %4
%11 = and i32 %9, %10
%12 = load i32, i32* %4
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @avx512f_os_support() {
%1 = tail call { i32, i32 } asm "xgetbv", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0)
%2 = extractvalue { i32, i32 } %1, 0
%3 = and i32 %2, 230
%4 = icmp eq i32 %3, 230
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ qs(int *, int /*<<< orphan*/, int, int *);
void quicksort(int lista[], int n, int *iteracion) {
  qs(lista, 0, n - 1, iteracion);
}


x86 assembly (clang, -O0):
<quicksort>:
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),%edx
sub    $0x1,%edx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <qs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
mov    %rdx,%rcx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <qs@plt>

LLVM IR (-O0):
define void @quicksort(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 = sub nsw i32 %8, 1
%10 = load i32*, i32** %6
%11 = call i32 @qs(i32* %7, i32 0, i32 %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32* %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @qs(i32* %0, i32 0, i32 %4, i32* %2)
ret void
}
void bug(char *x) { *x = *x + 1; }


x86 assembly (clang, -O0):
<bug>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x1,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bug>:
addb   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @bug(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 1
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %2
store i8 %7, i8* %8
ret void
}

LLVM IR (-O2):
define void @bug(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, 1
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ INT_MIN;
unsigned int test10u(unsigned int x) {
  unsigned int y = 0x1234;
  unsigned int z = (unsigned int)INT_MIN;
  return (x ^ y) + z;
}


x86 assembly (clang, -O0):
<test10u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1234,-0x8(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10u>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
xor    $0x1234,%eax
add    (%rcx),%eax
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @test10u(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 4660, i32* %3
%5 = load i64, i64* @INT_MIN
%6 = trunc i64 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = xor i32 %7, %8
%10 = load i32, i32* %4
%11 = add i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @test10u(i32 %0) {
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = xor i32 %0, 4660
%5 = add i32 %4, %3
ret i32 %5
}
void asm_beep() {
  asm volatile("movw $0x0E07, %%ax;"
               "xor  %%bh,%%bh;"
               "int $0x10"
               :
               :
               : "eax", "ebx");
}


x86 assembly (clang, -O0):
<asm_beep>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0xe07,%ax
xor    %bh,%bh
int    $0x10
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<asm_beep>:
push   %rbx
mov    $0xe07,%ax
xor    %bh,%bh
int    $0x10
pop    %rbx
ret

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

LLVM IR (-O2):
define void @asm_beep() {
tail call void asm sideeffect "movw $$0x0E07, %ax;xor %bh,%bh;int $$0x10", "~{eax},~{ebx},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void n_free(void *ptr, const char *file, int line) {
  int i = 0;
  if (ptr == NULL) {
    i = i;
    return;
  }
  free(ptr);
}


x86 assembly (clang, -O0):
<n_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <n_free+0x30>
mov    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1149 <n_free+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @n_free(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %3, %5
ret void
}
/* Variables and functions */
int EINPROGRESS;
int EINTR;
int __syscall_cp(int, int);
int __syscall_ret(int);
int close(int fd) {
  int r = __syscall_cp(6, fd);
  if (r == -EINTR)
    r = -EINPROGRESS;
  return __syscall_ret(r);
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x6,%edi
call   1030 <__syscall_cp@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
mov    0x2e91(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
jne    115f <close+0x3f>
xor    %eax,%eax
mov    0x2e8e(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <__syscall_ret@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rax
mov    %edi,%esi
mov    $0x6,%edi
call   1030 <__syscall_cp@plt>
mov    0x2ea4(%rip),%rcx
mov    0x2ead(%rip),%rdx
xor    %edi,%edi
sub    (%rdx),%edi
mov    (%rcx),%ecx
add    %eax,%ecx
cmovne %eax,%edi
pop    %rax
jmp    1040 <__syscall_ret@plt>

LLVM IR (-O0):
@EINTR = global i32 0
@EINPROGRESS = global i32 0
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @__syscall_cp(i32 6, i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @EINTR
%8 = sub nsw i32 0, %7
%9 = icmp eq i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* @EINPROGRESS
%12 = sub nsw i32 0, %11
store i32 %12, i32* %3
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %3
%15 = call i32 @__syscall_ret(i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@EINTR = global i32 0
@EINPROGRESS = global i32 0
define i32 @close(i32 %0) {
%2 = tail call i32 @__syscall_cp(i32 6, i32 %0)
%3 = load i32, i32* @EINTR
%4 = sub nsw i32 0, %3
%5 = icmp eq i32 %2, %4
%6 = load i32, i32* @EINPROGRESS
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %2
%9 = tail call i32 @__syscall_ret(i32 %8)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t rfcomm_event_channel_closed_get_rfcomm_cid(const uint8_t *event) {
  return little_endian_read_16(event, 2);
}


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

x86 assembly (clang, -O2):
<rfcomm_event_channel_closed_get_rfcomm_cid>:
mov    $0x2,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @rfcomm_event_channel_closed_get_rfcomm_cid(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 2)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _scanf_getll(char *, long long *, int, int,
                                int /*<<< orphan*/);
int /*<<< orphan*/ safe_gets(char *, int);
unsigned long long getlhex() {
  char buf[80];
  safe_gets(buf, 80);
  unsigned long long x = 0;
  _scanf_getll(buf, (long long *)&x, 16, 80, 0);
  return x;
}


x86 assembly (clang, -O0):
<getlhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
mov    $0x50,%esi
call   1030 <safe_gets@plt>
movq   $0x0,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x58(%rbp),%rsi
mov    $0x10,%edx
mov    $0x50,%ecx
xor    %r8d,%r8d
call   1040 <_scanf_getll@plt>
mov    -0x58(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlhex>:
push   %rbx
sub    $0x60,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1030 <safe_gets@plt>
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x10,%edx
mov    $0x50,%ecx
xor    %r8d,%r8d
call   1040 <_scanf_getll@plt>
mov    0x8(%rsp),%rax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @getlhex() {
%1 = alloca [80 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i32 @safe_gets(i8* %3, i32 80)
store i64 0, i64* %2
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%6 = call i32 @_scanf_getll(i8* %5, i64* %2, i32 16, i32 80, i32 0)
%7 = load i64, i64* %2
ret i64 %7
}

LLVM IR (-O2):
define i64 @getlhex() {
%1 = alloca [80 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i32 @safe_gets(i8* %3, i32 80)
%5 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%6 = call i32 @_scanf_getll(i8* %3, i64* %2, i32 16, i32 80, i32 0)
%7 = load i64, i64* %2
ret i64 %7
}
void blankVFSMinit(void *info, int numstates) { return; }


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

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

LLVM IR (-O0):
define void @blankVFSMinit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @blankVFSMinit(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "Usage: %s [OPTIONS] key [src [dst]]\n"
          "Encrypt a file with the Caesar or the Vigenère cipher\n"
          "\n"
          "  key     integer for the Caesar shift value\n"
          "          string for the Vigenère key\n"
          "  src     the source file (default: stdin)\n"
          "  dst     the destination file (default: stdout)\n"
          "\n"
          "OPTIONS:\n"
          "  --reverse, -r  uses the key to decrypt\n"
          "  --version, -v  prints information about this program\n"
          "  --help,    -h  prints this page of help\n",
          name);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [417 x i8] c"Usage: %s [OPTIONS] key [src [dst]]\0AEncrypt a file with the Caesar or the Vigen\C3\A8re cipher\0A\0A key integer for the Caesar shift value\0A string for the Vigen\C3\A8re key\0A src the source file (default: stdin)\0A dst the destination file (default: stdout)\0A\0AOPTIONS:\0A --reverse, -r uses the key to decrypt\0A --version, -v prints information about this program\0A --help, -h prints this page of help\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 ([417 x i8], [417 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [417 x i8] c"Usage: %s [OPTIONS] key [src [dst]]\0AEncrypt a file with the Caesar or the Vigen\C3\A8re cipher\0A\0A key integer for the Caesar shift value\0A string for the Vigen\C3\A8re key\0A src the source file (default: stdin)\0A dst the destination file (default: stdout)\0A\0AOPTIONS:\0A --reverse, -r uses the key to decrypt\0A --version, -v prints information about this program\0A --help, -h prints this page of help\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([417 x i8], [417 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ HSEFailureDetection_Callback();
int /*<<< orphan*/ LL_RCC_ClearFlag_HSECSS();
scalar_t__ LL_RCC_IsActiveFlag_HSECSS();
void NMI_Handler(void) {
  if (LL_RCC_IsActiveFlag_HSECSS() != 0) {
    LL_RCC_ClearFlag_HSECSS();
    HSEFailureDetection_Callback();
  }
}


x86 assembly (clang, -O0):
<NMI_Handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LL_RCC_IsActiveFlag_HSECSS@plt>
cmp    $0x0,%rax
je     1153 <NMI_Handler+0x23>
mov    $0x0,%al
call   1040 <LL_RCC_ClearFlag_HSECSS@plt>
mov    $0x0,%al
call   1050 <HSEFailureDetection_Callback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NMI_Handler>:
push   %rax
xor    %eax,%eax
call   1030 <LL_RCC_IsActiveFlag_HSECSS@plt>
test   %rax,%rax
je     114c <NMI_Handler+0x1c>
xor    %eax,%eax
call   1040 <LL_RCC_ClearFlag_HSECSS@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <HSEFailureDetection_Callback@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @NMI_Handler() {
%1 = call i64 (...) @LL_RCC_IsActiveFlag_HSECSS()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @LL_RCC_ClearFlag_HSECSS()
%5 = call i32 (...) @HSEFailureDetection_Callback()
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @NMI_Handler() {
%1 = tail call i64 (...) @LL_RCC_IsActiveFlag_HSECSS()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @LL_RCC_ClearFlag_HSECSS()
%5 = tail call i32 (...) @HSEFailureDetection_Callback()
br label %6
6: ; preds = %3, %0
ret void
}
/* Variables and functions */
int __syscall(int, char const *, char const *);
int link(const char *from, const char *new) { return __syscall(86, from, new); }


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x56,%edi
call   1030 <__syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x56,%edi
jmp    1030 <__syscall@plt>

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

LLVM IR (-O2):
define i32 @link(i8* %0, i8* %1) {
%3 = tail call i32 @__syscall(i32 86, i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void arg_sp(void) { printf("sp\n"); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @BlinkNoTimerTaskC__Leds__led2Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led2Toggle()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char);
int Topics_hasWildcards(char *topic) {
  return (strchr(topic, '+') != NULL) || (strchr(topic, '#') != NULL);
}


x86 assembly (clang, -O0):
<Topics_hasWildcards>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2b,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1154 <Topics_hasWildcards+0x44>
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Topics_hasWildcards>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2b,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     112d <Topics_hasWildcards+0x1d>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Topics_hasWildcards(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @strchr(i8* %3, i8 signext 43)
%5 = icmp ne i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32* @strchr(i8* %7, i8 signext 35)
%9 = icmp ne i32* %8, null
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @Topics_hasWildcards(i8* %0) {
%2 = tail call i32* @strchr(i8* %0, i8 signext 43)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32* @strchr(i8* %0, i8 signext 35)
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int add2is(int *last, int nod, int *iord, int *riord) {
  (*last)++;
  iord[nod] = *last;
  riord[*last] = nod;
  return 0;
}


x86 assembly (clang, -O0):
<add2is>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2is>:
mov    (%rdi),%eax
add    $0x1,%eax
mov    %eax,(%rdi)
movslq %esi,%rsi
mov    %eax,(%rdx,%rsi,4)
movslq (%rdi),%rax
mov    %esi,(%rcx,%rax,4)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @add2is(i32* nocapture %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = add nsw i32 %5, 1
store i32 %6, i32* %0
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %2, i64 %7
store i32 %6, i32* %8
%9 = load i32, i32* %0
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %3, i64 %10
store i32 %1, i32* %11
ret i32 0
}
void emergency_stack_init(void) {}


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

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

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

LLVM IR (-O2):
define void @emergency_stack_init() {
ret void
}
/* Variables and functions */
int getsysctl(char *);
int getdeferred(void) { return (getsysctl("net.local.deferred")); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"net.local.deferred\00"
define i32 @getdeferred() {
%1 = call i32 @getsysctl(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [19 x i8] c"net.local.deferred\00"
define i32 @getdeferred() {
%1 = tail call i32 @getsysctl(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int main() {
  int a = 0b101010, b = 0b010101;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
movl   $0x15,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
store i32 21, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
void *dlopen(char *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
void *awosSelf(const char *name) {
  char buf[256];
  snprintf(buf, sizeof buf - 1, "lib%s.so", name);
  return dlopen(buf, 0);
}


x86 assembly (clang, -O0):
<awosSelf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0xff,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
call   1040 <dlopen@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<awosSelf>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <dlopen@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"lib%s.so\00"
define i8* @awosSelf(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 255, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i8* @dlopen(i8* %7, i32 0)
ret i8* %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"lib%s.so\00"
define i8* @awosSelf(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 255, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i8* @dlopen(i8* %3, i32 0)
ret i8* %5
}
int test_imm_FCuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xFC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FCuint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xfc,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_FCuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 16515072
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef unsigned int __u32;

/* Variables and functions */
unsigned int INT_MAX;
int ethtool_validate_speed(__u32 speed) {
  return speed <= INT_MAX || speed == -1U;
}


x86 assembly (clang, -O0):
<ethtool_validate_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2ed5(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
jbe    1128 <ethtool_validate_speed+0x28>
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ethtool_validate_speed>:
mov    0x2ee1(%rip),%rax
cmp    %edi,(%rax)
setae  %al
cmp    $0xffffffff,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @ethtool_validate_speed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @INT_MAX
%5 = icmp ule i32 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, -1
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @ethtool_validate_speed(i32 %0) {
%2 = load i32, i32* @INT_MAX
%3 = icmp uge i32 %2, %0
%4 = icmp eq i32 %0, -1
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void __writeb(unsigned char val, void *addr) {
  *(volatile unsigned char *)addr = val;
}


x86 assembly (clang, -O0):
<__writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__writeb>:
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @__writeb(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = load i8*, i8** %4
store volatile i8 %5, i8* %6
ret void
}

LLVM IR (-O2):
define void @__writeb(i8 zeroext %0, i8* %1) {
store volatile i8 %0, i8* %1
ret void
}
/* Variables and functions */
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int htxd_send_ack_command_length(int new_fd) {
  int result;
  char ack_string[] = ":length received:";
  result = send(new_fd, ack_string, strlen(ack_string), 0);
  if (result == -1) {
    return result;
  }
  return result;
}


x86 assembly (clang, -O0):
<htxd_send_ack_command_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec8(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    118b <htxd_send_ack_command_length+0x6b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1191 <htxd_send_ack_command_length+0x71>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htxd_send_ack_command_length>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
movaps 0xed0(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x3a,0x10(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.htxd_send_ack_command_length.ack_string = [18 x i8] c":length received:\00"
define i32 @htxd_send_ack_command_length(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [18 x i8]
store i32 %0, i32* %3
%6 = bitcast [18 x i8]* %5 to i8*
%7 = load i32, i32* %3
%8 = getelementptr inbounds [18 x i8], [18 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [18 x i8], [18 x i8]* %5, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @send(i32 %7, i8* %8, i32 %10, i32 0)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %18
16: ; preds = %1
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@__const.htxd_send_ack_command_length.ack_string = [18 x i8] c":length received:\00"
define i32 @htxd_send_ack_command_length(i32 %0) {
%2 = alloca [18 x i8]
%3 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%4 = call i32 @strlen(i8* %3)
%5 = call i32 @send(i32 %0, i8* %3, i32 %4, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ctest_test_assert_add(int /*<<< orphan*/, char *);
int ctest_assert_pass(char *message) {
  ctest_test_assert_add(0, message);
  return -1;
}


x86 assembly (clang, -O0):
<ctest_assert_pass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <ctest_test_assert_add@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctest_assert_pass>:
push   %rax
mov    %rdi,%rsi
xor    %edi,%edi
call   1030 <ctest_test_assert_add@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ctest_assert_pass(i8* %0) {
%2 = tail call i32 @ctest_test_assert_add(i32 0, i8* %0)
ret i32 -1
}