xunge/DecIR huggingface dataset:
int cmpd(const void *p, const void *q) {
  double z = *(double *)p - *(double *)q;
  return (z > 0) - (z < 0);
}


x86 assembly (clang, -O0):
<cmpd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpd>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fsub double %8, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = fcmp ogt double %13, 0.000000e+00
%15 = zext i1 %14 to i32
%16 = load double, double* %5
%17 = fcmp olt double %16, 0.000000e+00
%18 = zext i1 %17 to i32
%19 = sub nsw i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @cmpd(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = fcmp ogt double %7, 0.000000e+00
%9 = zext i1 %8 to i32
%10 = fcmp olt double %7, 0.000000e+00
%11 = sext i1 %10 to i32
%12 = add nsw i32 %11, %9
ret i32 %12
}
/* Variables and functions */
int strcmp(char *, char *);
int test(char *X) { return strcmp(X, "\037\213"); }


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

x86 assembly (clang, -O2):
<test>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1F\8B\00"
define i32 @test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1F\8B\00"
define i32 @test(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_RADIO_SFD_PIN() { set_io_bit(-1, 4); }


x86 assembly (clang, -O0):
<TOSH_SET_RADIO_SFD_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x4,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_RADIO_SFD_PIN>:
mov    $0xffffffff,%edi
mov    $0x4,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_RADIO_SFD_PIN() {
%1 = call i32 @set_io_bit(i32 -1, i32 4)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_RADIO_SFD_PIN() {
%1 = tail call i32 @set_io_bit(i32 -1, i32 4)
ret void
}
/* Variables and functions */
int syscall(int, char const *);
int chroot(const char *path) { return syscall(61, path); }


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

x86 assembly (clang, -O2):
<chroot>:
mov    %rdi,%rsi
mov    $0x3d,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @chroot(i8* %0) {
%2 = tail call i32 @syscall(i32 61, i8* %0)
ret i32 %2
}
void XkbFreeGeomDoodads() {}


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

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

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

LLVM IR (-O2):
define void @XkbFreeGeomDoodads() {
ret void
}
/* Variables and functions */
int getchar();
fgetchar() { return getchar(); }


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

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

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

LLVM IR (-O2):
define i32 @fgetchar() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
/* Variables and functions */
int error(char *, int);
int wrongArgs(int n) { return error("wrong argument count", n); }


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

x86 assembly (clang, -O2):
<wrongArgs>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"wrong argument count\00"
define i32 @wrongArgs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"wrong argument count\00"
define i32 @wrongArgs(i32 %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ override_redirect;
};
typedef TYPE_1__ XMapEvent;

/* Variables and functions */
int get_XMapEvent_override_redirect(void *_p) {
  return (int)((XMapEvent *)_p)->override_redirect;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XMapEvent_override_redirect(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ charIn(char *, int);
int countWord(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
void ex3() {
  char *str1 = malloc(100);
  printf("Digite uma frase terminada com ponto final: ");
  charIn(str1, 100);
  printf("A frase possui %d palavras.", countWord(str1));
}


x86 assembly (clang, -O0):
<ex3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x64,%esi
call   1030 <charIn@plt>
mov    -0x8(%rbp),%rdi
call   1050 <countWord@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex3>:
push   %rbx
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <charIn@plt>
mov    %rbx,%rdi
call   1050 <countWord@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Digite uma frase terminada com ponto final: \00"
@.str.1 = [28 x i8] c"A frase possui %d palavras.\00"
define void @ex3() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 100)
store i8* %2, i8** %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @charIn(i8* %4, i32 100)
%6 = load i8*, i8** %1
%7 = call i32 @countWord(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Digite uma frase terminada com ponto final: \00"
@.str.1 = [28 x i8] c"A frase possui %d palavras.\00"
define void @ex3() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @charIn(i8* %1, i32 100)
%4 = tail call i32 @countWord(i8* %1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}
void quatcopy(float *qout, const float *qin) {
  qout[0] = qin[0];
  qout[1] = qin[1];
  qout[2] = qin[2];
  qout[3] = qin[3];
}


x86 assembly (clang, -O0):
<quatcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<quatcopy>:
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
movss  %xmm0,0xc(%rdi)
ret

LLVM IR (-O0):
define void @quatcopy(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 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 3
%22 = load float, float* %21
%23 = load float*, float** %3
%24 = getelementptr inbounds float, float* %23, i64 3
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @quatcopy(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 2
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 3
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %0, i64 3
store float %11, float* %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void push(int8_t *const stack, uint8_t *sp, int8_t v) { stack[*sp++] = v; }


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsi
add    $0x4,%rsi
mov    %rsi,-0x10(%rbp)
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
movslq (%rsi),%rax
mov    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @push(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* %6
%8 = load i32*, i32** %4
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %5
%11 = load i32, i32* %9
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %8, i64 %12
store i32 %7, i32* %13
ret void
}

LLVM IR (-O2):
define void @push(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %2, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *memalign(int, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *x = NULL;
  printf("before memalign(): x = %p\n", x);
  x = memalign(2, 123 * sizeof(char));
  printf("after memalign(): x = %p\n", x);
  free(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0x7b,%esi
call   1050 <memalign@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %esi,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0x7b,%esi
call   1050 <memalign@plt>
mov    %rax,%rbx
lea    0xec3(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"before memalign(): x = %p\0A\00"
@.str.1 = [26 x i8] c"after memalign(): x = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i8* @memalign(i32 2, i32 123)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"before memalign(): x = %p\0A\00"
@.str.1 = [26 x i8] c"after memalign(): x = %p\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* null)
%2 = tail call align 2 dereferenceable_or_null(123) i8* @memalign(i32 2, i32 123)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i32 0
}
int esHoraValida(int hora, int minu, int seg) {
  if (hora >= 0 && hora < 23) {
    if (minu >= 0 && minu < 59) {
      if (seg >= 0 && seg < 59) {
        return 1;
      } else {
        return 0;
      }
    } else {
      return 0;
    }
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<esHoraValida>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     116d <esHoraValida+0x6d>
cmpl   $0x17,-0x8(%rbp)
jge    116d <esHoraValida+0x6d>
cmpl   $0x0,-0xc(%rbp)
jl     1161 <esHoraValida+0x61>
cmpl   $0x3b,-0xc(%rbp)
jge    1161 <esHoraValida+0x61>
cmpl   $0x0,-0x10(%rbp)
jl     1155 <esHoraValida+0x55>
cmpl   $0x3b,-0x10(%rbp)
jge    1155 <esHoraValida+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1174 <esHoraValida+0x74>
movl   $0x0,-0x4(%rbp)
jmp    1174 <esHoraValida+0x74>
movl   $0x0,-0x4(%rbp)
jmp    1174 <esHoraValida+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<esHoraValida>:
cmp    $0x17,%edi
setb   %al
cmp    $0x3b,%esi
setb   %cl
and    %al,%cl
cmp    $0x3b,%edx
setb   %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @esHoraValida(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %0, 23
%5 = icmp ult i32 %1, 59
%6 = and i1 %4, %5
%7 = icmp ult i32 %2, 59
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
char ERR;
char getch();
int /*<<< orphan*/ start_curses();
int /*<<< orphan*/ stop_curses();
int /*<<< orphan*/ timeout(int /*<<< orphan*/);
char key_pressed() {
  char ch;
  start_curses();
  timeout(0);
  ch = getch();
  stop_curses();
  if (ch != ERR)
    return ch;
  else
    return 'p';
}


x86 assembly (clang, -O0):
<key_pressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <start_curses@plt>
xor    %edi,%edi
call   1050 <timeout@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1040 <stop_curses@plt>
movsbl -0x2(%rbp),%eax
mov    0x2e76(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1188 <key_pressed+0x48>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    118c <key_pressed+0x4c>
movb   $0x70,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_pressed>:
push   %rbx
xor    %eax,%eax
call   1030 <start_curses@plt>
xor    %edi,%edi
call   1050 <timeout@plt>
xor    %eax,%eax
call   1060 <getch@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <stop_curses@plt>
mov    0x2e82(%rip),%rax
cmp    (%rax),%bl
movzbl %bl,%ecx
mov    $0x70,%eax
cmovne %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@ERR = global i8 0
define signext i8 @key_pressed() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 (...) @start_curses()
%4 = call i32 @timeout(i32 0)
%5 = call signext i8 (...) @getch()
store i8 %5, i8* %2
%6 = call i32 (...) @stop_curses()
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = load i8, i8* @ERR
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %8, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = load i8, i8* %2
store i8 %13, i8* %1
br label %15
14: ; preds = %0
store i8 112, i8* %1
br label %15
15: ; preds = %14, %12
%16 = load i8, i8* %1
ret i8 %16
}

LLVM IR (-O2):
@ERR = global i8 0
define signext i8 @key_pressed() {
%1 = tail call i32 (...) @start_curses()
%2 = tail call i32 @timeout(i32 0)
%3 = tail call signext i8 (...) @getch()
%4 = tail call i32 (...) @stop_curses()
%5 = load i8, i8* @ERR
%6 = icmp eq i8 %3, %5
%7 = select i1 %6, i8 112, i8 %3
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_display(const char *display_name) {
  if (!display_name)
    printf("default ");
  printf("display");
  if (display_name)
    printf("=%s", display_name);
}


x86 assembly (clang, -O0):
<print_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1135 <print_display+0x25>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1160 <print_display+0x50>
mov    -0x8(%rbp),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_display>:
push   %rbx
test   %rdi,%rdi
je     1139 <print_display+0x29>
mov    %rdi,%rbx
lea    0xee9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"default \00"
@.str.1 = [8 x i8] c"display\00"
@.str.2 = [4 x i8] c"=%s\00"
define void @print_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"default \00"
@.str.1 = [8 x i8] c"display\00"
@.str.2 = [4 x i8] c"=%s\00"
define void @print_display(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %9
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %3, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void std() { db(0xFD); }


x86 assembly (clang, -O0):
<std>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfd,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<std>:
mov    $0xfd,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @std() {
%1 = call i32 @db(i32 253)
ret void
}

LLVM IR (-O2):
define void @std() {
%1 = tail call i32 @db(i32 253)
ret void
}
long ADCSequenceUnderflow(unsigned long ulBase, unsigned long ulSequenceNum) {
  ;
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000018))) &
          (1 << ulSequenceNum));
}


x86 assembly (clang, -O0):
<ADCSequenceUnderflow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCSequenceUnderflow>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
and    0x18(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @ADCSequenceUnderflow(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 = add i64 %5, 24
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
%11 = shl i32 1, %10
%12 = sext i32 %11 to i64
%13 = and i64 %8, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @ADCSequenceUnderflow(i64 %0, i64 %1) {
%3 = add i64 %0, 24
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = trunc i64 %1 to i32
%7 = shl nuw i32 1, %6
%8 = sext i32 %7 to i64
%9 = and i64 %5, %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ test29_AvrPin_clear__E();
int /*<<< orphan*/ test29_AvrPin_makeOutput__E();
void test29_Led_targetInit__I() {
  test29_AvrPin_clear__E();
  test29_AvrPin_makeOutput__E();
}


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

x86 assembly (clang, -O2):
<test29_Led_targetInit__I>:
push   %rax
xor    %eax,%eax
call   1040 <test29_AvrPin_clear__E@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test29_AvrPin_makeOutput__E@plt>

LLVM IR (-O0):
define void @test29_Led_targetInit__I() {
%1 = call i32 (...) @test29_AvrPin_clear__E()
%2 = call i32 (...) @test29_AvrPin_makeOutput__E()
ret void
}

LLVM IR (-O2):
define void @test29_Led_targetInit__I() {
%1 = tail call i32 (...) @test29_AvrPin_clear__E()
%2 = tail call i32 (...) @test29_AvrPin_makeOutput__E()
ret void
}
/* Variables and functions */
foo(unsigned long z) {
  z = ({
    unsigned long tmp;
    tmp = 1;
    tmp;
  });
  foo(z);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

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

LLVM IR (-O2):
define i32 @foo(i64 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
char uart_getc() {
  char r;
  do {
    asm volatile("nop");
  } while (!(*((volatile unsigned int *)(0x3F000000 + 0x00215054)) & 0x01));
  r = (char)(*((volatile unsigned int *)(0x3F000000 + 0x00215040)));
  return r == '\r' ? '\n' : r;
}


x86 assembly (clang, -O0):
<uart_getc>:
push   %rbp
mov    %rsp,%rbp
nop
mov    $0x3f215054,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1104 <uart_getc+0x4>
mov    $0x3f215040,%eax
mov    (%rax),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
jne    1143 <uart_getc+0x43>
mov    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <uart_getc+0x4a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_getc>:
nop
testl  $0x1,0x3f215054
je     1100 <uart_getc>
mov    0x3f215040,%ecx
cmp    $0xd,%cl
mov    $0xa,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @uart_getc() {
%1 = alloca i8
br label %2
2: ; preds = %3, %0
br label %3
3: ; preds = %2
%4 = load volatile i32, i32* inttoptr (i64 1059147860 to i32*)
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %2, label %8
8: ; preds = %3
%9 = load volatile i32, i32* inttoptr (i64 1059147840 to i32*)
%10 = trunc i32 %9 to i8
store i8 %10, i8* %1
%11 = load i8, i8* %1
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br i1 %13, label %14, label %15
14: ; preds = %8
br label %18
15: ; preds = %8
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %14
%19 = phi i32 [ 10, %14 ], [ %17, %15 ]
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @uart_getc() {
br label %1
1: ; preds = %1, %0
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%2 = load volatile i32, i32* inttoptr (i64 1059147860 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 1059147840 to i32*)
%7 = and i32 %6, 255
%8 = icmp eq i32 %7, 13
%9 = trunc i32 %6 to i8
%10 = select i1 %8, i8 10, i8 %9
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a = 10, b = 20;
  printf("\40:The larger one is %d\n", (a > b) ? a : b);
  printf("\40:The larger one is %d\n", (a > b) ? a : b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113d <main+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <main+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1169 <main+0x59>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116f <main+0x5f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [24 x i8] c" :The larger one is %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 20)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int set_bit(int bit_array[], unsigned bit_number) {
  int ArraySize = 1000;
  if (bit_number > ArraySize - 1) {
    printf("the second parameter is too big! The set_bit function can not "
           "accept it!\n\n");
    return 0;
  }
  bit_array[bit_number] = 1;
  return 0;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x3e8,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jbe    114f <set_bit+0x3f>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1164 <set_bit+0x54>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movl   $0x1,(%rax,%rcx,4)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
push   %rax
cmp    $0x3e8,%esi
jb     1127 <set_bit+0x17>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
jmp    1130 <set_bit+0x20>
mov    %esi,%eax
movl   $0x1,(%rdi,%rax,4)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [75 x i8] c"the second parameter is too big! The set_bit function can not accept it!\0A\0A\00"
define i32 @set_bit(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 1000, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = sub nsw i32 %8, 1
%10 = icmp ugt i32 %7, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %18
13: ; preds = %2
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 1, i32* %17
store i32 0, i32* %3
br label %18
18: ; preds = %13, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [74 x i8] c"the second parameter is too big! The set_bit function can not accept it!\0A\00"
define i32 @set_bit(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp ugt i32 %1, 999
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
br label %9
6: ; preds = %2
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 1, i32* %8
br label %9
9: ; preds = %6, %4
ret i32 0
}
void abc(int *i, int *j) {
  *i = *i + *j;
  *j = *i - *j;
  *i = *i - *j;
  return;
}


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

x86 assembly (clang, -O2):
<abc>:
mov    (%rsi),%eax
add    (%rdi),%eax
mov    %eax,(%rdi)
sub    (%rsi),%eax
mov    %eax,(%rsi)
sub    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @abc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = sub nsw i32 %18, %20
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @abc(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = sub nsw i32 %5, %6
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = sub nsw i32 %8, %7
store i32 %9, i32* %0
ret void
}
__attribute__((weak, used)) void _fini(void) { return; }


x86 assembly (clang, -O0):
<_fini>:
endbr64
sub    $0x8,%rsp
add    $0x8,%rsp
ret


x86 assembly (clang, -O2):
<_fini>:
endbr64
sub    $0x8,%rsp
add    $0x8,%rsp
ret


LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @_fini to i8*)], section "llvm.metadata"
define weak void @_fini() {
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @_fini to i8*)], section "llvm.metadata"
define weak void @_fini() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ entropy;

/* Variables and functions */
int /*<<< orphan*/ getentropy(unsigned int *, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int rand_range(int /*<<< orphan*/, int);
int /*<<< orphan*/ srand(unsigned int);
void test_random() {
  unsigned entropy;
  getentropy(&entropy, sizeof(entropy));
  srand(entropy);
  int x = rand_range(0, 10);
  int y = rand_range(0, 10);
  printf("%d + %d = %d\n", x, y, x + y);
}


x86 assembly (clang, -O0):
<test_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <getentropy@plt>
mov    -0x4(%rbp),%edi
call   1050 <srand@plt>
xor    %edi,%edi
mov    $0xa,%esi
call   1060 <rand_range@plt>
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
mov    $0xa,%esi
call   1060 <rand_range@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_random>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
call   1030 <getentropy@plt>
mov    0xc(%rsp),%edi
call   1050 <srand@plt>
xor    %edi,%edi
mov    $0xa,%esi
call   1060 <rand_range@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    $0xa,%esi
call   1060 <rand_range@plt>
lea    (%rax,%rbx,1),%ecx
lea    0xe7f(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define void @test_random() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @getentropy(i32* %1, i32 4)
%4 = load i32, i32* %1
%5 = call i32 @srand(i32 %4)
%6 = call i32 @rand_range(i32 0, i32 10)
%7 = call i32 @rand_range(i32 0, i32 10)
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pinentry_init(char *);
scalar_t__ pinentry_loop();
int /*<<< orphan*/ pinentry_parse_opts(int, char **);
int main(int argc, char *argv[]) {
  pinentry_init("pinentry-curses");
  pinentry_parse_opts(argc, argv);
  if (pinentry_loop())
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <pinentry_init@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <pinentry_parse_opts@plt>
mov    $0x0,%al
call   1050 <pinentry_loop@plt>
cmp    $0x0,%rax
je     117b <main+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1182 <main+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1040 <pinentry_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <pinentry_parse_opts@plt>
xor    %eax,%eax
call   1050 <pinentry_loop@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"pinentry-curses\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @pinentry_init(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @pinentry_parse_opts(i32 %7, i8** %8)
%10 = call i64 (...) @pinentry_loop()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [16 x i8] c"pinentry-curses\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @pinentry_init(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @pinentry_parse_opts(i32 %0, i8** %1)
%5 = tail call i64 (...) @pinentry_loop()
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void RSWAP(double *a, double *b) {
  double t;
  t = *a;
  *a = *b;
  *b = t;
}


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

x86 assembly (clang, -O2):
<RSWAP>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

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

LLVM IR (-O2):
define void @RSWAP(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
store double %4, double* %0
store double %3, double* %1
ret void
}
void compute(char board[8][8], char me, char opponent, int *row, int *col) {
  if (me == 'W') {
    *row = 2;
    *col = 3;
  } else {
    *row = 4;
    *col = 2;
  }
  return;
}


x86 assembly (clang, -O0):
<compute>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x57,%eax
jne    1141 <compute+0x41>
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x3,(%rax)
jmp    1155 <compute+0x55>
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute>:
xor    %eax,%eax
xor    %edx,%edx
cmp    $0x57,%sil
sete   %al
setne  %dl
add    %edx,%edx
add    $0x2,%edx
or     $0x2,%eax
mov    %edx,(%rcx)
mov    %eax,(%r8)
ret

LLVM IR (-O0):
define void @compute([8 x i8]* %0, i8 signext %1, i8 signext %2, i32* %3, i32* %4) {
%6 = alloca [8 x i8]*
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32*
%10 = alloca i32*
store [8 x i8]* %0, [8 x i8]** %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i8, i8* %7
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 87
br i1 %13, label %14, label %17
14: ; preds = %5
%15 = load i32*, i32** %9
store i32 2, i32* %15
%16 = load i32*, i32** %10
store i32 3, i32* %16
br label %20
17: ; preds = %5
%18 = load i32*, i32** %9
store i32 4, i32* %18
%19 = load i32*, i32** %10
store i32 2, i32* %19
br label %20
20: ; preds = %17, %14
ret void
}

LLVM IR (-O2):
define void @compute([8 x i8]* nocapture readnone %0, i8 signext %1, i8 signext %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = icmp eq i8 %1, 87
%7 = select i1 %6, i32 2, i32 4
%8 = select i1 %6, i32 3, i32 2
store i32 %7, i32* %3
store i32 %8, i32* %4
ret void
}
/* Variables and functions */
unsigned int s5p_sdhci_init(unsigned int, int, int);
int samsung_get_base_mmc();
unsigned int s5p_mmc_init(int index, int bus_width) {
  unsigned int base = samsung_get_base_mmc() + (0x100000 * index);
  return s5p_sdhci_init(base, index, bus_width);
}


x86 assembly (clang, -O0):
<s5p_mmc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <samsung_get_base_mmc@plt>
mov    -0x4(%rbp),%ecx
shl    $0x14,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <s5p_sdhci_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s5p_mmc_init>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <samsung_get_base_mmc@plt>
mov    %ebp,%edi
shl    $0x14,%edi
add    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <s5p_sdhci_init@plt>

LLVM IR (-O0):
define i32 @s5p_mmc_init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @samsung_get_base_mmc()
%7 = load i32, i32* %3
%8 = mul nsw i32 1048576, %7
%9 = add nsw i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @s5p_sdhci_init(i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @s5p_mmc_init(i32 %0, i32 %1) {
%3 = tail call i32 (...) @samsung_get_base_mmc()
%4 = shl nsw i32 %0, 20
%5 = add nsw i32 %3, %4
%6 = tail call i32 @s5p_sdhci_init(i32 %5, i32 %0, i32 %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void helptext(char *p_name) {
  printf("Usage: %s -a <amount> -i <interest rate> -d <duration> [ -c number "
         "of times a year to capitalize] \n",
         p_name);
}


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

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

LLVM IR (-O0):
@.str = [100 x i8] c"Usage: %s -a <amount> -i <interest rate> -d <duration> [ -c number of times a year to capitalize] \0A\00"
define void @helptext(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [100 x i8] c"Usage: %s -a <amount> -i <interest rate> -d <duration> [ -c number of times a year to capitalize] \0A\00"
define void @helptext(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void STREAM_DEBUG_DATA(unsigned char *data, int sz) {
  printf(" [%i bytes] ", sz);
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c" [%i bytes] \00"
define void @STREAM_DEBUG_DATA(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c" [%i bytes] \00"
define void @STREAM_DEBUG_DATA(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ my_free(int *);
int *my_realloc(int *, int);
void test_config_options_1_ok() {
  int *p = (int *)malloc(sizeof(int));
  int *q = my_realloc(p, sizeof(int));
  my_free(q);
}


x86 assembly (clang, -O0):
<test_config_options_1_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <my_realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <my_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_config_options_1_ok>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rdi
mov    $0x4,%esi
call   1040 <my_realloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1050 <my_free@plt>

LLVM IR (-O0):
define void @test_config_options_1_ok() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = call i32* @my_realloc(i32* %5, i32 4)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = call i32 @my_free(i32* %7)
ret void
}

LLVM IR (-O2):
define void @test_config_options_1_ok() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32* @my_realloc(i32* %2, i32 4)
%4 = tail call i32 @my_free(i32* %3)
ret void
}