xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _hmt_count_cover(char *, int);
float logf(float);
float HMM_LogF(float Float) {
  { _hmt_count_cover("HMM_LogF", 492); };
  float Result = logf(Float);
  return (Result);
}


x86 assembly (clang, -O0):
<HMM_LogF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x1ec,%esi
call   1030 <_hmt_count_cover@plt>
movss  -0x4(%rbp),%xmm0
call   1040 <logf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMM_LogF>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0xed2(%rip),%rdi
mov    $0x1ec,%esi
call   1030 <_hmt_count_cover@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <logf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"HMM_LogF\00"
define float @HMM_LogF(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = call i32 @_hmt_count_cover(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 492)
%5 = load float, float* %2
%6 = call float @logf(float %5)
store float %6, float* %3
%7 = load float, float* %3
ret float %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"HMM_LogF\00"
define float @HMM_LogF(float %0) {
%2 = tail call i32 @_hmt_count_cover(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 492)
%3 = tail call float @logf(float %0)
ret float %3
}
void gtk_selection_data_set_pixbuf() {}


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

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

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

LLVM IR (-O2):
define void @gtk_selection_data_set_pixbuf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int a = 0x45678912;
  int *p;
  p = &a;
  if (*(char *)p == *((char *)&a))
    printf(" little endian");
  else
    printf(" big endian");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x45678912,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jne    1152 <main+0x42>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    115e <main+0x4e>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c" little endian\00"
@.str.1 = [12 x i8] c" big endian\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 1164413202, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = bitcast i32* %4 to i8*
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = bitcast i32* %2 to i8*
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c" little endian\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void func6(float fp) {
#pragma acc data deviceptr(fp)
  ;
}


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

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

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

LLVM IR (-O2):
define void @func6(float %0) {
ret void
}
/* Type definitions */
struct drm_framebuffer {
  int dummy;
};

/* Variables and functions */
void *ERR_PTR(int /*<<< orphan*/);
void *exynos_drm_dmabuf_sync_work(struct drm_framebuffer *fb) {
  return ERR_PTR(0);
}


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

x86 assembly (clang, -O2):
<exynos_drm_dmabuf_sync_work>:
xor    %edi,%edi
jmp    1030 <ERR_PTR@plt>

LLVM IR (-O0):
%struct.drm_framebuffer = type { i32 }
define i8* @exynos_drm_dmabuf_sync_work(%struct.drm_framebuffer* %0) {
%2 = alloca %struct.drm_framebuffer*
store %struct.drm_framebuffer* %0, %struct.drm_framebuffer** %2
%3 = call i8* @ERR_PTR(i32 0)
ret i8* %3
}

LLVM IR (-O2):
%struct.drm_framebuffer = type { i32 }
define i8* @exynos_drm_dmabuf_sync_work(%struct.drm_framebuffer* nocapture readnone %0) {
%2 = tail call i8* @ERR_PTR(i32 0)
ret i8* %2
}
void config_gpu(void) {}


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

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

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

LLVM IR (-O2):
define void @config_gpu() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mikado(int);
int /*<<< orphan*/ printf(char *, int, int *);
int main(void) {
  int pooh = 2, bah = 5;
  printf("In main(), pooh = %d and &pooh = %p\n", pooh, &pooh);
  printf("In main(), bath = %d and &bah = %p\n", bah, &bah);
  mikado(pooh);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rdx
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xecb(%rip),%rdi
lea    -0xc(%rbp),%rdx
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <mikado@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2,(%rsp)
movl   $0x5,0x4(%rsp)
lea    0xec9(%rip),%rdi
mov    %rsp,%rdx
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rdx
mov    $0x5,%esi
call   1030 <printf@plt>
mov    (%rsp),%edi
call   1040 <mikado@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"In main(), pooh = %d and &pooh = %p\0A\00"
@.str.1 = [36 x i8] c"In main(), bath = %d and &bah = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %4, i32* %2)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32* %3)
%8 = load i32, i32* %2
%9 = call i32 @mikado(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"In main(), pooh = %d and &pooh = %p\0A\00"
@.str.1 = [36 x i8] c"In main(), bath = %d and &bah = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 5, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 2, i32* %1)
%6 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 5, i32* %2)
%7 = load i32, i32* %1
%8 = call i32 @mikado(i32 %7)
ret i32 0
}
unsigned int set_hash(unsigned int h, unsigned char c) {
  h += (h << 5);
  return h ^ c;
}


x86 assembly (clang, -O0):
<set_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl -0x5(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_hash>:
mov    %edi,%eax
shl    $0x5,%eax
add    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @set_hash(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = shl i32 %5, 5
%7 = load i32, i32* %3
%8 = add i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = xor i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @set_hash(i32 %0, i8 zeroext %1) {
%3 = mul i32 %0, 33
%4 = zext i8 %1 to i32
%5 = xor i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int src_layer;
typedef int dest_layer;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void CopyLayer(unsigned char src_layer, unsigned char dest_layer) {
  SendChar((0XEE) & 0xFF);
  SendChar((0xA4) & 0xFF);
  SendChar((src_layer)&0xFF);
  SendChar((dest_layer)&0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<CopyLayer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xa4,%edi
call   1030 <SendChar@plt>
movzbl -0x1(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movzbl -0x2(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyLayer>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xa4,%edi
call   1030 <SendChar@plt>
mov    %ebp,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @CopyLayer(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 @SendChar(i32 238)
%6 = call i32 @SendChar(i32 164)
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = and i32 %8, 255
%10 = call i32 @SendChar(i32 %9)
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = and i32 %12, 255
%14 = call i32 @SendChar(i32 %13)
%15 = call i32 @SendChar(i32 255)
%16 = call i32 @SendChar(i32 252)
%17 = call i32 @SendChar(i32 255)
%18 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @CopyLayer(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @SendChar(i32 238)
%4 = tail call i32 @SendChar(i32 164)
%5 = zext i8 %0 to i32
%6 = tail call i32 @SendChar(i32 %5)
%7 = zext i8 %1 to i32
%8 = tail call i32 @SendChar(i32 %7)
%9 = tail call i32 @SendChar(i32 255)
%10 = tail call i32 @SendChar(i32 252)
%11 = tail call i32 @SendChar(i32 255)
%12 = tail call i32 @SendChar(i32 255)
ret void
}
long tolong(double l) {
  unsigned char *bit_representation = (unsigned char *)&l;
  long *result = (long *)bit_representation;
  return *result;
}


x86 assembly (clang, -O0):
<tolong>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolong>:
movq   %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @tolong(double %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca i64*
store double %0, double* %2
%5 = bitcast double* %2 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %4
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @tolong(double %0) {
%2 = bitcast double %0 to i64
ret i64 %2
}
/* Variables and functions */
char *alloca(int);
int goo(int *);
int foo9() {
  char *p = alloca(100);
  return goo((int *)(p + 50));
}


x86 assembly (clang, -O0):
<foo9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1030 <alloca@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x32,%rdi
call   1040 <goo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo9>:
push   %rax
mov    $0x64,%edi
call   1030 <alloca@plt>
lea    0x32(%rax),%rdi
pop    %rax
jmp    1040 <goo@plt>

LLVM IR (-O0):
define i32 @foo9() {
%1 = alloca i8*
%2 = call i8* @alloca(i32 100)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 50
%5 = bitcast i8* %4 to i32*
%6 = call i32 @goo(i32* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo9() {
%1 = tail call i8* @alloca(i32 100)
%2 = getelementptr inbounds i8, i8* %1, i64 50
%3 = bitcast i8* %2 to i32*
%4 = tail call i32 @goo(i32* %3)
ret i32 %4
}
unsigned ulog2(unsigned n) {
  unsigned i = 0;
  while (1) {
    if ((1 << i) >= n)
      return i;
    ++i;
  }
}


x86 assembly (clang, -O0):
<ulog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x4(%rbp),%eax
jb     1126 <ulog2+0x26>
mov    -0x8(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ulog2+0xe>

x86 assembly (clang, -O2):
<ulog2>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    %edi,%eax
jb     1110 <ulog2+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ulog2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = shl nuw i32 1, %3
%5 = icmp ult i32 %4, %0
%6 = add i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int b;
  int *ptr = &b;
  *ptr = 1;
  printf("%d %d\n", b, *ptr);
  int xs[2];
  xs[0] = 1;
  xs[1] = 2;
  ptr = xs;
  printf("%d %d\n", ptr[0], ptr[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
movl   $0x2,-0x14(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
ret i32 0
}
int main() {
  int i, j;
  int c;
  c = 0;
  i = 0;
  while (i < 10) {
    j = 3;
    while (j < 12) {
      j = j - 1;
      c = c + 1;
      j = j + 2;
    }
    i = i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1162 <main+0x62>
movl   $0x3,-0xc(%rbp)
cmpl   $0xc,-0xc(%rbp)
jge    1154 <main+0x54>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
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
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %2
br label %5
5: ; preds = %19, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %22
8: ; preds = %5
store i32 3, i32* %3
br label %9
9: ; preds = %12, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 12
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 2
store i32 %18, i32* %3
br label %9
19: ; preds = %9
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %5
22: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
double pow(double, double);
int32_t calcKernelBandWidth(int32_t n, int32_t iqr) {
  return (n > 0) ? (int32_t)(0.9 * pow((double)n, -0.2) * ((double)iqr) / 1.34)
                 : 0;
}


x86 assembly (clang, -O0):
<calcKernelBandWidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1171 <calcKernelBandWidth+0x61>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xebf(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x18(%rbp)
jmp    117c <calcKernelBandWidth+0x6c>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    117c <calcKernelBandWidth+0x6c>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcKernelBandWidth>:
test   %rdi,%rdi
jle    114e <calcKernelBandWidth+0x3e>
push   %rbx
mov    %rsi,%rbx
cvtsi2sd %rdi,%xmm0
movsd  0xeda(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xed5(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %rbx,%xmm1
mulsd  %xmm0,%xmm1
divsd  0xec9(%rip),%xmm1
cvttsd2si %xmm1,%rax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @calcKernelBandWidth(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = load i64, i64* %3
%9 = sitofp i64 %8 to double
%10 = call double @pow(double %9, double -2.000000e-01)
%11 = fmul double 9.000000e-01, %10
%12 = load i64, i64* %4
%13 = sitofp i64 %12 to double
%14 = fmul double %11, %13
%15 = fdiv double %14, 1.340000e+00
%16 = fptosi double %15 to i64
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %7
%19 = phi i64 [ %16, %7 ], [ 0, %17 ]
ret i64 %19
}

LLVM IR (-O2):
define i64 @calcKernelBandWidth(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = sitofp i64 %0 to double
%6 = tail call double @pow(double %5, double -2.000000e-01)
%7 = fmul double %6, 9.000000e-01
%8 = sitofp i64 %1 to double
%9 = fmul double %7, %8
%10 = fdiv double %9, 1.340000e+00
%11 = fptosi double %10 to i64
br label %12
12: ; preds = %2, %4
%13 = phi i64 [ %11, %4 ], [ 0, %2 ]
ret i64 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void volatile_store_u16(uint16_t *dest, uint16_t val) {
  *((volatile uint16_t *)dest) = val;
}


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

x86 assembly (clang, -O2):
<volatile_store_u16>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @volatile_store_u16(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
/* Type definitions */
struct Kernel {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Kernel *);
int kernel_fin(struct Kernel *q) {
  free(q);
  return 0;
}


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

x86 assembly (clang, -O2):
<kernel_fin>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Kernel = type { i32 }
define i32 @kernel_fin(%struct.Kernel* %0) {
%2 = alloca %struct.Kernel*
store %struct.Kernel* %0, %struct.Kernel** %2
%3 = load %struct.Kernel*, %struct.Kernel** %2
%4 = call i32 @free(%struct.Kernel* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.Kernel = type { i32 }
define i32 @kernel_fin(%struct.Kernel* nocapture %0) {
%2 = tail call i32 @free(%struct.Kernel* %0)
ret i32 0
}
/* Variables and functions */
int log10(float);
float db_pos(float power) { return 10 * log10(power); }


x86 assembly (clang, -O0):
<db_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log10@plt>
imul   $0xa,%eax,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_pos>:
push   %rax
call   1030 <log10@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @db_pos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @log10(float %3)
%5 = mul nsw i32 10, %4
%6 = sitofp i32 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @db_pos(float %0) {
%2 = tail call i32 @log10(float %0)
%3 = mul nsw i32 %2, 10
%4 = sitofp i32 %3 to float
ret float %4
}
second(t) double *t;
{ second_(t); }


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

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

LLVM IR (-O0):
define i32 @second(double* %0) {
%2 = alloca i32
%3 = alloca double*
store double* %0, double** %3
%4 = load double*, double** %3
%5 = call i32 (double*, ...) bitcast (i32 (...)* @second_ to i32 (double*, ...)*)(double* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @second(double* %0) {
%2 = tail call i32 (double*, ...) bitcast (i32 (...)* @second_ to i32 (double*, ...)*)(double* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/
__softboundcets_propagate_metadata_shadow_stack_from(int, int /*<<< orphan*/);
char *strncat(char *, char const *, size_t);
__attribute__((__weak__, __always___)) char *
softboundcets_strncat(char *dest, const char *src, size_t n) {
  char *ret_ptr = strncat(dest, src, n);
  __softboundcets_propagate_metadata_shadow_stack_from(1, 0);
  return ret_ptr;
}


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

x86 assembly (clang, -O2):
<softboundcets_strncat>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strncat@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <__softboundcets_propagate_metadata_shadow_stack_from@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i8* @softboundcets_strncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @strncat(i8* %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = call i32 @__softboundcets_propagate_metadata_shadow_stack_from(i32 1, i32 0)
%13 = load i8*, i8** %7
ret i8* %13
}

LLVM IR (-O2):
define weak i8* @softboundcets_strncat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @strncat(i8* dereferenceable(1) %0, i8* %1, i64 %2)
%5 = tail call i32 @__softboundcets_propagate_metadata_shadow_stack_from(i32 1, i32 0)
ret i8* %0
}
int main() {
  int a[1] = {42};
  int *p = a;
  return ((&p)[0])[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeef(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [1 x i32] [i32 42]
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32* %5, i32** %3
%6 = getelementptr inbounds i32*, i32** %3, i64 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ input();
int /*<<< orphan*/ prem();
int /*<<< orphan*/ printf(char *);
main() {
  printf("\nCPU SCHEDULLING\n");
  printf("METODE SJF - PREEMPTIVE\n\n");
  input();
  prem();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <input@plt>
mov    $0x0,%al
call   1050 <prem@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0xecd(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <input@plt>
xor    %eax,%eax
call   1050 <prem@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0ACPU SCHEDULLING\0A\00"
@.str.1 = [26 x i8] c"METODE SJF - PREEMPTIVE\0A\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @input()
%4 = call i32 (...) @prem()
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"\0ACPU SCHEDULLING\00"
@str.2 = [25 x i8] c"METODE SJF - PREEMPTIVE\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @input()
%4 = tail call i32 (...) @prem()
ret i32 0
}
int f2(int t) {
  int a = 7U - t;
  return 7 - a;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x7,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x7,%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f2(i32 returned %0) {
ret i32 %0
}
int test_imm_EEint64_lowword_reg(long long val) {
  return ((val) & (0xEE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EEint64_lowword_reg>:
test   $0xee,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EEint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 238
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char tolower(unsigned char);
void downcase(char *str) {
  while (*str) {
    *str = tolower((unsigned char)*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<downcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <downcase+0x3e>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <downcase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downcase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <downcase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <downcase+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @downcase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call signext i8 @tolower(i8 zeroext %9)
%11 = load i8*, i8** %2
store i8 %10, i8* %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @downcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 zeroext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int retzero(const unsigned char *_x, void *_ign) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @retzero(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int bitn(int, unsigned int);
int fc(unsigned int i) { return bitn(0x7907287B, i); }


x86 assembly (clang, -O0):
<fc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x7907287b,%edi
call   1030 <bitn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc>:
mov    %edi,%esi
mov    $0x7907287b,%edi
jmp    1030 <bitn@plt>

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

LLVM IR (-O2):
define i32 @fc(i32 %0) {
%2 = tail call i32 @bitn(i32 2030512251, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo();
int main() {
  if (foo() <= 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x0,%rax
jg     1147 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
test   %rax,%rax
jle    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp sle i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp slt i64 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(int /*<<< orphan*/ *, int, unsigned int, int /*<<< orphan*/ *);
unsigned RangeCoderReadStdio(__attribute__((unused)) void *user, uint8_t **data,
                             unsigned *size) {
  size_t n;
  n = fread(*data, 1, *size, (FILE *)user);
  return n;
}


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

x86 assembly (clang, -O2):
<RangeCoderReadStdio>:
mov    %rdi,%rcx
mov    (%rsi),%rdi
mov    (%rdx),%edx
mov    $0x1,%esi
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i32 @RangeCoderReadStdio(i8* %0, i32** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32**
%6 = alloca i32*
%7 = alloca i64
store i8* %0, i8** %4
store i32** %1, i32*** %5
store i32* %2, i32** %6
%8 = load i32**, i32*** %5
%9 = load i32*, i32** %8
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i32*
%14 = call i64 @fread(i32* %9, i32 1, i32 %11, i32* %13)
store i64 %14, i64* %7
%15 = load i64, i64* %7
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @RangeCoderReadStdio(i8* nocapture %0, i32** nocapture %1, i32* nocapture %2) {
%4 = load i32*, i32** %1
%5 = load i32, i32* %2
%6 = bitcast i8* %0 to i32*
%7 = tail call i64 @fread(i32* %4, i32 1, i32 %5, i32* %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}
void buf_write_callback(struct bufferevent *bev, void *arg) {}


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

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

LLVM IR (-O0):
%struct.bufferevent = type opaque
define void @buf_write_callback(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type opaque
define void @buf_write_callback(%struct.bufferevent* nocapture %0, i8* nocapture %1) {
ret void
}
void v2d3(pos, rra, rdec, r) double pos[3];
double *rra;
double *rdec;
double *r;
{
  v2s3(pos, rra, rdec, r);
  *rra = raddeg(*rra);
  *rdec = raddeg(*rdec);
  return;
}


x86 assembly (clang, -O0):
<v2d3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1040 <v2s3@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
call   1030 <raddeg@plt>
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
call   1030 <raddeg@plt>
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2d3>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
xor    %eax,%eax
call   1040 <v2s3@plt>
movsd  (%rbx),%xmm0
mov    $0x1,%al
call   1030 <raddeg@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rbx)
movsd  (%r14),%xmm0
mov    $0x1,%al
call   1030 <raddeg@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @v2d3(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double*, double** %5
%10 = load double*, double** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
%13 = call i32 (double*, double*, double*, double*, ...) bitcast (i32 (...)* @v2s3 to i32 (double*, double*, double*, double*, ...)*)(double* %9, double* %10, double* %11, double* %12)
%14 = load double*, double** %6
%15 = load double, double* %14
%16 = call i32 (double, ...) bitcast (i32 (...)* @raddeg to i32 (double, ...)*)(double %15)
%17 = sitofp i32 %16 to double
%18 = load double*, double** %6
store double %17, double* %18
%19 = load double*, double** %7
%20 = load double, double* %19
%21 = call i32 (double, ...) bitcast (i32 (...)* @raddeg to i32 (double, ...)*)(double %20)
%22 = sitofp i32 %21 to double
%23 = load double*, double** %7
store double %22, double* %23
ret void
}

LLVM IR (-O2):
define void @v2d3(double* %0, double* %1, double* %2, double* %3) {
%5 = tail call i32 (double*, double*, double*, double*, ...) bitcast (i32 (...)* @v2s3 to i32 (double*, double*, double*, double*, ...)*)(double* %0, double* %1, double* %2, double* %3)
%6 = load double, double* %1
%7 = tail call i32 (double, ...) bitcast (i32 (...)* @raddeg to i32 (double, ...)*)(double %6)
%8 = sitofp i32 %7 to double
store double %8, double* %1
%9 = load double, double* %2
%10 = tail call i32 (double, ...) bitcast (i32 (...)* @raddeg to i32 (double, ...)*)(double %9)
%11 = sitofp i32 %10 to double
store double %11, double* %2
ret void
}
int tolower(int c) {
  if (c >= 'A' && c <= 'Z') {
    c += ('A' - 'a');
  }
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <tolower+0x24>
mov    -0x4(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void event_base_stop_iocp(struct event_base *base) {}


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

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

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

LLVM IR (-O2):
%struct.event_base = type opaque
define void @event_base_stop_iocp(%struct.event_base* nocapture %0) {
ret void
}
/* Variables and functions */
double log10(double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double LogB10(double a) {
  printf("Enter a number:");
  scanf("%lf", &a);
  return (log10(a));
}


x86 assembly (clang, -O0):
<LogB10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1050 <log10@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LogB10>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <log10@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a number:\00"
@.str.1 = [4 x i8] c"%lf\00"
define double @LogB10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @log10(double %5)
ret double %6
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter a number:\00"
@.str.1 = [4 x i8] c"%lf\00"
define double @LogB10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @log10(double %5)
ret double %6
}
/* Type definitions */
struct Persona2 {
  int dummy;
};

/* Variables and functions */
struct Persona2 *creaPersona();
int /*<<< orphan*/ stampaPersona(struct Persona2 *);
int main(void) {
  struct Persona2 *p = NULL;
  p = creaPersona();
  stampaPersona(p);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <creaPersona@plt>
mov    %rax,%rdi
call   1030 <stampaPersona@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Persona2 = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.Persona2*
store i32 0, i32* %1
store %struct.Persona2* null, %struct.Persona2** %2
%3 = call %struct.Persona2* (...) @creaPersona()
store %struct.Persona2* %3, %struct.Persona2** %2
%4 = load %struct.Persona2*, %struct.Persona2** %2
%5 = call i32 @stampaPersona(%struct.Persona2* %4)
ret i32 0
}

LLVM IR (-O2):
%struct.Persona2 = type { i32 }
define i32 @main() {
%1 = tail call %struct.Persona2* (...) @creaPersona()
%2 = tail call i32 @stampaPersona(%struct.Persona2* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void csv_pstate_table_header(__attribute__((unused)) void *report_data) {
  printf("P-State Table\n");
  printf(",,,P-state (kHz),min (us),max (us),avg (us),total (us),hits\n");
}


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

x86 assembly (clang, -O2):
<csv_pstate_table_header>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"P-State Table\0A\00"
@.str.1 = [61 x i8] c",,,P-state (kHz),min (us),max (us),avg (us),total (us),hits\0A\00"
define void @csv_pstate_table_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"P-State Table\00"
@str.2 = [60 x i8] c",,,P-state (kHz),min (us),max (us),avg (us),total (us),hits\00"
define void @csv_pstate_table_header(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
double atof(char const *);
double newtan(double);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, const char *argv[]) {
  if (argc == 2) {
    double x = atof(argv[1]);
    double result = newtan(x);
    printf("%f\n", result);
    return 0;
  } else {
    return 1;
  }
}


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)
cmpl   $0x2,-0x8(%rbp)
jne    118e <main+0x5e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <newtan@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1195 <main+0x65>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jne    115b <main+0x2b>
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atof@plt>
call   1030 <newtan@plt>
lea    0xeb0(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call double @atof(i8* %13)
store double %14, double* %6
%15 = load double, double* %6
%16 = call double @newtan(double %15)
store double %16, double* %7
%17 = load double, double* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %17)
store i32 0, i32* %3
br label %20
19: ; preds = %2
store i32 1, i32* %3
br label %20
20: ; preds = %19, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call double @atof(i8* %6)
%8 = tail call double @newtan(double %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %8)
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %11
}
void rtems_provides_crt0(void) {}


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

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

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

LLVM IR (-O2):
define void @rtems_provides_crt0() {
ret void
}