xunge/DecIR huggingface dataset:
/* Variables and functions */
int _unlink(char const *);
int unlink(const char *path) { return _unlink(path); }


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

x86 assembly (clang, -O2):
<unlink>:
jmp    1030 <_unlink@plt>

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

LLVM IR (-O2):
define i32 @unlink(i8* %0) {
%2 = tail call i32 @_unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sigreap(void) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<sigreap>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <sigreap+0x9>
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    113f <sigreap+0x2f>
jmp    1119 <sigreap+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigreap>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <sigreap+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sigreap() {
br label %1
1: ; preds = %5, %0
%2 = load i32, i32* @WNOHANG
%3 = call i64 @waitpid(i32 -1, i32* null, i32 %2)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sigreap() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @WNOHANG
%3 = tail call i64 @waitpid(i32 -1, i32* null, i32 %2)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
void trace_log(char *line, ...) {}


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

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

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

LLVM IR (-O2):
define void @trace_log(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetCCDTemperatureCalibrated(char byBoardNum, double dTemp) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetCCDTemperatureCalibrated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSetCCDTemperatureCalibrated(i8 signext %0, double %1) {
%3 = alloca i8
%4 = alloca double
store i8 %0, i8* %3
store double %1, double* %4
%5 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetCCDTemperatureCalibrated(i8 signext %0, double %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
const char *kchar(const struct iam_key *key) { return (void *)key; }


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

x86 assembly (clang, -O2):
<kchar>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.iam_key = type opaque
define i8* @kchar(%struct.iam_key* %0) {
%2 = alloca %struct.iam_key*
store %struct.iam_key* %0, %struct.iam_key** %2
%3 = load %struct.iam_key*, %struct.iam_key** %2
%4 = bitcast %struct.iam_key* %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
%struct.iam_key = type opaque
define i8* @kchar(%struct.iam_key* readnone %0) {
%2 = bitcast %struct.iam_key* %0 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() { printf("usage: ysmbot <inputFifo> <outputFifo>\n"); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"usage: ysmbot <inputFifo> <outputFifo>\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"usage: ysmbot <inputFifo> <outputFifo>\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
void RTStrValidateEncoding(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrValidateEncoding() {
ret void
}
void carregaDataBloco1(float data[], float newData[]) {
  int x;
  for (x = 0; x < 16 / 2; x++) {
    newData[x] = data[x];
  }
}


x86 assembly (clang, -O0):
<carregaDataBloco1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1145 <carregaDataBloco1+0x45>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <carregaDataBloco1+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<carregaDataBloco1>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
movss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
movss  0xc(%rdi),%xmm0
movss  %xmm0,0xc(%rsi)
movss  0x10(%rdi),%xmm0
movss  %xmm0,0x10(%rsi)
movss  0x14(%rdi),%xmm0
movss  %xmm0,0x14(%rsi)
movss  0x18(%rdi),%xmm0
movss  %xmm0,0x18(%rsi)
movss  0x1c(%rdi),%xmm0
movss  %xmm0,0x1c(%rsi)
ret

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

LLVM IR (-O2):
define void @carregaDataBloco1(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 2
store float %8, float* %9
%10 = getelementptr inbounds float, float* %0, i64 3
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %1, i64 3
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 4
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 4
store float %14, float* %15
%16 = getelementptr inbounds float, float* %0, i64 5
%17 = load float, float* %16
%18 = getelementptr inbounds float, float* %1, i64 5
store float %17, float* %18
%19 = getelementptr inbounds float, float* %0, i64 6
%20 = load float, float* %19
%21 = getelementptr inbounds float, float* %1, i64 6
store float %20, float* %21
%22 = getelementptr inbounds float, float* %0, i64 7
%23 = load float, float* %22
%24 = getelementptr inbounds float, float* %1, i64 7
store float %23, float* %24
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigint(int signal) { printf("got milk\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"got milk\0A\00"
define void @sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"got milk\00"
define void @sigint(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_entropy_words();
void init_std_data(void) { add_entropy_words(); }


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

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

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

LLVM IR (-O2):
define void @init_std_data() {
%1 = tail call i32 (...) @add_entropy_words()
ret void
}
void serial_init() {}


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

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

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

LLVM IR (-O2):
define void @serial_init() {
ret void
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int nsvg__isdigit(char c) { return strchr("0123456789", c) != 0; }


x86 assembly (clang, -O0):
<nsvg__isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__isdigit>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define i32 @nsvg__isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @strchr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define i32 @nsvg__isdigit(i8 signext %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int saisir_entier(void) {
  int entier;
  scanf("%d", &entier);
  return entier;
}


x86 assembly (clang, -O0):
<saisir_entier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saisir_entier>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @saisir_entier() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @saisir_entier() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
int nls_op_sub(int a, int b) { return a - b; }


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

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

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

LLVM IR (-O2):
define i32 @nls_op_sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int f3();
int f2() {
  int x;
  x = f3();
  return 2 + x;
}


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

x86 assembly (clang, -O2):
<f2>:
push   %rax
xor    %eax,%eax
call   1030 <f3@plt>
add    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f2() {
%1 = alloca i32
%2 = call i32 (...) @f3()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @f2() {
%1 = tail call i32 (...) @f3()
%2 = add nsw i32 %1, 2
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ BASIC_CONSTRAINTS;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ BASIC_CONSTRAINTS_it;
BASIC_CONSTRAINTS *d2i_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS **a,
                                         const unsigned char **in, long len) {
  return (BASIC_CONSTRAINTS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                            &BASIC_CONSTRAINTS_it);
}


x86 assembly (clang, -O0):
<d2i_BASIC_CONSTRAINTS>:
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
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_BASIC_CONSTRAINTS>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@BASIC_CONSTRAINTS_it = global i32 0
define i32* @d2i_BASIC_CONSTRAINTS(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @BASIC_CONSTRAINTS_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@BASIC_CONSTRAINTS_it = global i32 0
define i32* @d2i_BASIC_CONSTRAINTS(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @BASIC_CONSTRAINTS_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int memory_padded_size(int size, int pad_size) {
  int i = size / pad_size;
  if ((size % pad_size) != 0)
    i++;
  return i * pad_size;
}


x86 assembly (clang, -O0):
<memory_padded_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     112d <memory_padded_size+0x2d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_padded_size>:
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @memory_padded_size(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
%8 = mul nsw i32 %7, %1
ret i32 %8
}
void modify(int *c) { *c = 6; }


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

x86 assembly (clang, -O2):
<modify>:
movl   $0x6,(%rdi)
ret

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

LLVM IR (-O2):
define void @modify(i32* nocapture writeonly %0) {
store i32 6, i32* %0
ret void
}
void asm_cpuid() { asm volatile("cpuid" ::: "rax", "rbx", "rcx", "rdx"); }


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

x86 assembly (clang, -O2):
<asm_cpuid>:
push   %rbx
cpuid
pop    %rbx
ret

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

LLVM IR (-O2):
define void @asm_cpuid() {
tail call void asm sideeffect "cpuid", "~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned xrop3_179_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_179_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_179_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_179_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_179_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %4, -1
%7 = or i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int inputint(char *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n, c, x;
  x = inputint("numero di numeri", x);
  while (x != 0) {
    n = inputint("n", n);
    if (n % 10 == 0) {
      c++;
    }
    x--;
  }
  printf("Il numero di numeri inseriti e \' %d \n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <inputint@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1188 <main+0x68>
mov    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1040 <inputint@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117a <main+0x5a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1141 <main+0x21>
mov    -0xc(%rbp),%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"numero di numeri\00"
@.str.1 = [2 x i8] c"n\00"
@.str.2 = [38 x i8] c"Il numero di numeri inseriti e ' %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %4
%6 = call i32 @inputint(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %4
br label %7
7: ; preds = %19, %0
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i32, i32* %2
%12 = call i32 @inputint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %11)
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = srem i32 %13, 10
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %10
%20 = load i32, i32* %4
%21 = add nsw i32 %20, -1
store i32 %21, i32* %4
br label %7
22: ; preds = %7
%23 = load i32, i32* %3
%24 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@.str = [17 x i8] c"numero di numeri\00"
@.str.2 = [38 x i8] c"Il numero di numeri inseriti e ' %d \0A\00"
define i32 @main() {
%1 = tail call i32 @inputint(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = icmp eq i32 %1, 0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 undef)
ret i32 0
}
int withinSameBlock(int *ptr1, int *ptr2) {
  int mask = (1 << 31) >> 25;
  return (int)(((int)ptr1 & mask) == ((int)ptr2 & mask));
}


x86 assembly (clang, -O0):
<withinSameBlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffc0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
and    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
and    -0x14(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<withinSameBlock>:
xor    %edi,%esi
xor    %eax,%eax
test   $0xffffffc0,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @withinSameBlock(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 -64, i32* %5
%6 = load i32*, i32** %3
%7 = ptrtoint i32* %6 to i32
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %10 to i32
%12 = load i32, i32* %5
%13 = and i32 %11, %12
%14 = icmp eq i32 %9, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @withinSameBlock(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = xor i64 %4, %3
%6 = and i64 %5, 4294967232
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ __builtin_vsx_xstdivdp_fe(double, double);
int *test_div_df_2(double a, double b, int *p) {
  if (__builtin_vsx_xstdivdp_fe(a, b))
    *p++ = 1;
  return p;
}


x86 assembly (clang, -O0):
<test_div_df_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__builtin_vsx_xstdivdp_fe@plt>
cmp    $0x0,%rax
je     1154 <test_div_df_2+0x44>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_div_df_2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__builtin_vsx_xstdivdp_fe@plt>
test   %rax,%rax
je     1128 <test_div_df_2+0x18>
movl   $0x1,(%rbx)
add    $0x4,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @test_div_df_2(double %0, double %1, i32* writeonly %2) {
%4 = tail call i64 @__builtin_vsx_xstdivdp_fe(double %0, double %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = getelementptr inbounds i32, i32* %2, i64 1
store i32 1, i32* %2
br label %8
8: ; preds = %6, %3
%9 = phi i32* [ %7, %6 ], [ %2, %3 ]
ret i32* %9
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ date_time(struct tm *, struct tm *, int);
void date_tea(struct tm *tm, struct tm *now, int *num) {
  date_time(tm, now, 17);
}


x86 assembly (clang, -O0):
<date_tea>:
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    $0x11,%edx
call   1030 <date_time@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_tea>:
mov    $0x11,%edx
jmp    1030 <date_time@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @date_tea(%struct.tm* %0, %struct.tm* %1, i32* %2) {
%4 = alloca %struct.tm*
%5 = alloca %struct.tm*
%6 = alloca i32*
store %struct.tm* %0, %struct.tm** %4
store %struct.tm* %1, %struct.tm** %5
store i32* %2, i32** %6
%7 = load %struct.tm*, %struct.tm** %4
%8 = load %struct.tm*, %struct.tm** %5
%9 = call i32 @date_time(%struct.tm* %7, %struct.tm* %8, i32 17)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @date_tea(%struct.tm* %0, %struct.tm* %1, i32* nocapture readnone %2) {
%4 = tail call i32 @date_time(%struct.tm* %0, %struct.tm* %1, i32 17)
ret void
}
void keyb_handler() {}


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

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

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

LLVM IR (-O2):
define void @keyb_handler() {
ret void
}
int main() {
  int a;
  if (a != 5)
    if (a != 6)
      if ((a != 7) == 7) {
      ERROR:
        goto ERROR;
      }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     1148 <main+0x48>
cmpl   $0x6,-0x8(%rbp)
je     1143 <main+0x43>
cmpl   $0x7,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x7,%eax
jne    113e <main+0x3e>
jmp    1139 <main+0x39>
jmp    1139 <main+0x39>
jmp    1143 <main+0x43>
jmp    1148 <main+0x48>
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
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 5
br i1 %4, label %5, label %17
5: ; preds = %0
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 6
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 7
%11 = zext i1 %10 to i32
%12 = icmp eq i32 %11, 7
br i1 %12, label %13, label %15
13: ; preds = %8
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %8
br label %16
16: ; preds = %15, %5
br label %17
17: ; preds = %16, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
float cos(float);
float area(float n) { return cos(n); }


x86 assembly (clang, -O0):
<area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<area>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define float @area(float %0) {
%2 = tail call float @cos(float %0)
ret float %2
}
char *i86_get_cpu_vendor() {
  static char name[13] = {0};
  asm volatile("mov $0, %%eax \n"
               "cpuid \n"
               "mov %%ebx, %0 \n"
               "mov %%edx, %1 \n"
               "mov %%ecx, %2 \n"
               : "=m"(name), "=m"(*(name + 4)), "=m"(*(name + 8)));
  return name;
}


x86 assembly (clang, -O0):
<i86_get_cpu_vendor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%eax
cpuid
mov    %ebx,0x2f10(%rip)
mov    %edx,0x2f0e(%rip)
mov    %ecx,0x2f0c(%rip)
lea    0x2efd(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i86_get_cpu_vendor>:
mov    $0x0,%eax
cpuid
mov    %ebx,0x2f14(%rip)
mov    %edx,0x2f12(%rip)
mov    %ecx,0x2f10(%rip)
lea    0x2f01(%rip),%rax
ret

LLVM IR (-O0):
@i86_get_cpu_vendor.name = internal global [13 x i8] zeroinitializer
define i8* @i86_get_cpu_vendor() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @i86_get_cpu_vendor.name, i64 0, i64 0)
}

LLVM IR (-O2):
@i86_get_cpu_vendor.name = internal global [13 x i8] zeroinitializer
define i8* @i86_get_cpu_vendor() {
tail call void asm sideeffect "mov $$0, %eax \0Acpuid \0Amov %ebx, $0 \0Amov %edx, $1 \0Amov %ecx, $2 \0A", "=*m,=*m,=*m,~{dirflag},~{fpsr},~{flags}"([13 x i8]* elementtype([13 x i8]) @i86_get_cpu_vendor.name, i8* elementtype(i8) getelementptr inbounds ([13 x i8], [13 x i8]* @i86_get_cpu_vendor.name, i64 0, i64 4), i8* elementtype(i8) getelementptr inbounds ([13 x i8], [13 x i8]* @i86_get_cpu_vendor.name, i64 0, i64 8))
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @i86_get_cpu_vendor.name, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _iconv_error(char const *message, int ret) {
  fputs("iconv: ", stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_iconv_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_iconv_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"iconv: \00"
@stderr = global i32 0
define i32 @_iconv_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"iconv: \00"
@stderr = global i32 0
define i32 @_iconv_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ I2Cinit();
int /*<<< orphan*/ LCDcmd(int);
int /*<<< orphan*/ delay(int);
void LCDinit() {
  I2Cinit();
  delay(30000);
  LCDcmd(0x38);
  LCDcmd(0x39);
  LCDcmd(0x14);
  LCDcmd(0x70);
  LCDcmd(0x52);
  LCDcmd(0x6C);
  delay(30000);
  LCDcmd(0x38);
  LCDcmd(0x0c);
  LCDcmd(0x01);
  delay(30000);
}


x86 assembly (clang, -O0):
<LCDinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <I2Cinit@plt>
mov    $0x7530,%edi
call   1040 <delay@plt>
mov    $0x38,%edi
call   1030 <LCDcmd@plt>
mov    $0x39,%edi
call   1030 <LCDcmd@plt>
mov    $0x14,%edi
call   1030 <LCDcmd@plt>
mov    $0x70,%edi
call   1030 <LCDcmd@plt>
mov    $0x52,%edi
call   1030 <LCDcmd@plt>
mov    $0x6c,%edi
call   1030 <LCDcmd@plt>
mov    $0x7530,%edi
call   1040 <delay@plt>
mov    $0x38,%edi
call   1030 <LCDcmd@plt>
mov    $0xc,%edi
call   1030 <LCDcmd@plt>
mov    $0x1,%edi
call   1030 <LCDcmd@plt>
mov    $0x7530,%edi
call   1040 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDinit>:
push   %rax
xor    %eax,%eax
call   1050 <I2Cinit@plt>
mov    $0x7530,%edi
call   1040 <delay@plt>
mov    $0x38,%edi
call   1030 <LCDcmd@plt>
mov    $0x39,%edi
call   1030 <LCDcmd@plt>
mov    $0x14,%edi
call   1030 <LCDcmd@plt>
mov    $0x70,%edi
call   1030 <LCDcmd@plt>
mov    $0x52,%edi
call   1030 <LCDcmd@plt>
mov    $0x6c,%edi
call   1030 <LCDcmd@plt>
mov    $0x7530,%edi
call   1040 <delay@plt>
mov    $0x38,%edi
call   1030 <LCDcmd@plt>
mov    $0xc,%edi
call   1030 <LCDcmd@plt>
mov    $0x1,%edi
call   1030 <LCDcmd@plt>
mov    $0x7530,%edi
pop    %rax
jmp    1040 <delay@plt>

LLVM IR (-O0):
define void @LCDinit() {
%1 = call i32 (...) @I2Cinit()
%2 = call i32 @delay(i32 30000)
%3 = call i32 @LCDcmd(i32 56)
%4 = call i32 @LCDcmd(i32 57)
%5 = call i32 @LCDcmd(i32 20)
%6 = call i32 @LCDcmd(i32 112)
%7 = call i32 @LCDcmd(i32 82)
%8 = call i32 @LCDcmd(i32 108)
%9 = call i32 @delay(i32 30000)
%10 = call i32 @LCDcmd(i32 56)
%11 = call i32 @LCDcmd(i32 12)
%12 = call i32 @LCDcmd(i32 1)
%13 = call i32 @delay(i32 30000)
ret void
}

LLVM IR (-O2):
define void @LCDinit() {
%1 = tail call i32 (...) @I2Cinit()
%2 = tail call i32 @delay(i32 30000)
%3 = tail call i32 @LCDcmd(i32 56)
%4 = tail call i32 @LCDcmd(i32 57)
%5 = tail call i32 @LCDcmd(i32 20)
%6 = tail call i32 @LCDcmd(i32 112)
%7 = tail call i32 @LCDcmd(i32 82)
%8 = tail call i32 @LCDcmd(i32 108)
%9 = tail call i32 @delay(i32 30000)
%10 = tail call i32 @LCDcmd(i32 56)
%11 = tail call i32 @LCDcmd(i32 12)
%12 = tail call i32 @LCDcmd(i32 1)
%13 = tail call i32 @delay(i32 30000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run();
int main(int argc, char *argv[]) {
  run();
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <run@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <run@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @run()
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @run()
ret i32 1
}
/* Variables and functions */
char *malloc(unsigned int);
int /*<<< orphan*/ strcpy(char *, char const *);
unsigned int strlen(char const *);
char *concat(const char *s1, const char *s2) {
  unsigned l1 = strlen(s1);
  unsigned l2 = strlen(s2);
  char *r = malloc(l1 + l2 + 1);
  strcpy(r, s1);
  strcpy(r + l1, s2);
  return r;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
add    -0x18(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%eax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %eax,%r12d
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r12,%rax,1),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r12d,%edi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @concat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add i32 %12, %13
%15 = add i32 %14, 1
%16 = call i8* @malloc(i32 %15)
store i8* %16, i8** %7
%17 = load i8*, i8** %7
%18 = load i8*, i8** %3
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = load i8*, i8** %7
%21 = load i32, i32* %5
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8*, i8** %4
%25 = call i32 @strcpy(i8* %23, i8* %24)
%26 = load i8*, i8** %7
ret i8* %26
}

LLVM IR (-O2):
define i8* @concat(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = tail call i8* @malloc(i32 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = zext i32 %3 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = tail call i32 @strcpy(i8* %10, i8* %1)
ret i8* %7
}
unsigned short int f46(unsigned short int x, long int y) {
  return (x >> y) | (x << ((-y) & (8 * sizeof(unsigned short) - 1)));
}


x86 assembly (clang, -O0):
<f46>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xf,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f46>:
mov    %rsi,%rcx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
and    $0xf,%cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f46(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = ashr i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i64, i64* %4
%13 = sub nsw i64 0, %12
%14 = and i64 %13, 15
%15 = trunc i64 %14 to i32
%16 = shl i32 %11, %15
%17 = or i32 %9, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f46(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = lshr i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 15
%8 = shl nuw nsw i32 %3, %7
%9 = or i32 %8, %5
%10 = trunc i32 %9 to i16
ret i16 %10
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int sa_family;
};

/* Variables and functions */
#define AF_INET 129
#define AF_INET6 128
size_t SALEN(struct sockaddr *sa) {
  switch (sa->sa_family) {
  case AF_INET:
    return (sizeof(struct sockaddr_in));
  case AF_INET6:
    return (sizeof(struct sockaddr_in6));
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<SALEN>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x80,%eax
je     1141 <SALEN+0x41>
jmp    1121 <SALEN+0x21>
mov    -0x14(%rbp),%eax
sub    $0x81,%eax
jne    114e <SALEN+0x4e>
jmp    1134 <SALEN+0x34>
movq   $0x4,-0x8(%rbp)
jmp    1156 <SALEN+0x56>
movq   $0x4,-0x8(%rbp)
jmp    1156 <SALEN+0x56>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SALEN>:
mov    (%rdi),%ecx
and    $0xfffffffe,%ecx
xor    %eax,%eax
cmp    $0x80,%ecx
sete   %al
shl    $0x2,%rax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i64 @SALEN(%struct.sockaddr* %0) {
%2 = alloca i64
%3 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %3
%4 = load %struct.sockaddr*, %struct.sockaddr** %3
%5 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %4, i32 0, i32 0
%6 = load i32, i32* %5
switch i32 %6, label %9 [
i32 129, label %7
i32 128, label %8
]
7: ; preds = %1
store i64 4, i64* %2
br label %10
8: ; preds = %1
store i64 4, i64* %2
br label %10
9: ; preds = %1
store i64 0, i64* %2
br label %10
10: ; preds = %9, %8, %7
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i64 @SALEN(%struct.sockaddr* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = and i32 %3, -2
%5 = icmp eq i32 %4, 128
%6 = select i1 %5, i64 4, i64 0
ret i64 %6
}
void XDrawImageString16() {}


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

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

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

LLVM IR (-O2):
define void @XDrawImageString16() {
ret void
}
void *test_anti_range_50(short n) {
  extern void *alloc_anti_range_50(short) __attribute__((alloc_size(1)));
  if ((-0x7fff - 1) + 2 <= n && n <= 12)
    n = (-0x7fff - 1) + 2 - 1;
  return alloc_anti_range_50(n);
}


x86 assembly (clang, -O0):
<test_anti_range_50>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0xffff8002,%eax
cmp    %ecx,%eax
jg     1143 <test_anti_range_50+0x33>
movswl -0x2(%rbp),%eax
cmp    $0xc,%eax
jg     1143 <test_anti_range_50+0x33>
movw   $0x8001,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_50@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_50>:
lea    0x7ffe(%rdi),%eax
movzwl %ax,%eax
cmp    $0x800b,%eax
mov    $0x8001,%eax
cmovae %edi,%eax
movswl %ax,%edi
jmp    1030 <alloc_anti_range_50@plt>

LLVM IR (-O0):
define i8* @test_anti_range_50(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 -32766, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 12
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -32767, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_50(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_50(i16 signext %0) {
%2 = add i16 %0, 32766
%3 = icmp ult i16 %2, -32757
%4 = select i1 %3, i16 -32767, i16 %0
%5 = tail call i8* @alloc_anti_range_50(i16 signext %4)
ret i8* %5
}
void init_spi1(void) {
  unsigned char i, Dummy;
  (*(volatile unsigned long *)(0xE0068000 + 0x00)) = 0x040F;
  (*(volatile unsigned long *)(0xE0068000 + 0x10)) = 0x1B;
  for (i = 0; i < 8; i++) {
    Dummy = (*(volatile unsigned long *)(0xE0068000 + 0x08));
  }
  (*(volatile unsigned long *)(0xE0068000 + 0x14)) = 0;
  (*(volatile unsigned long *)(0xE0068000 + 0x04)) = 0x00;
  return;
}


x86 assembly (clang, -O0):
<init_spi1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0068000,%eax
movq   $0x40f,(%rax)
mov    $0xe0068010,%eax
movq   $0x1b,(%rax)
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x8,%eax
jge    1145 <init_spi1+0x45>
mov    $0xe0068008,%eax
mov    (%rax),%rax
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    1120 <init_spi1+0x20>
mov    $0xe0068014,%eax
movq   $0x0,(%rax)
mov    $0xe0068004,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_spi1>:
mov    $0xe0068008,%eax
movq   $0x40f,-0x8(%rax)
movq   $0x1b,0x8(%rax)
mov    (%rax),%rcx
mov    (%rax),%rcx
mov    (%rax),%rcx
mov    (%rax),%rcx
mov    (%rax),%rcx
mov    (%rax),%rcx
mov    (%rax),%rcx
mov    (%rax),%rcx
movq   $0x0,0xc(%rax)
movq   $0x0,-0x4(%rax)
ret

LLVM IR (-O0):
define void @init_spi1() {
%1 = alloca i8
%2 = alloca i8
store volatile i64 1039, i64* inttoptr (i64 3758522368 to i64*)
store volatile i64 27, i64* inttoptr (i64 3758522384 to i64*)
store i8 0, i8* %1
br label %3
3: ; preds = %10, %0
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load volatile i64, i64* inttoptr (i64 3758522376 to i64*)
%9 = trunc i64 %8 to i8
store i8 %9, i8* %2
br label %10
10: ; preds = %7
%11 = load i8, i8* %1
%12 = add i8 %11, 1
store i8 %12, i8* %1
br label %3
13: ; preds = %3
store volatile i64 0, i64* inttoptr (i64 3758522388 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758522372 to i64*)
ret void
}

LLVM IR (-O2):
define void @init_spi1() {
store volatile i64 1039, i64* inttoptr (i64 3758522368 to i64*)
store volatile i64 27, i64* inttoptr (i64 3758522384 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 3758522376 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 3758522376 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 3758522376 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 3758522376 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 3758522376 to i64*)
%6 = load volatile i64, i64* inttoptr (i64 3758522376 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 3758522376 to i64*)
%8 = load volatile i64, i64* inttoptr (i64 3758522376 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758522388 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758522372 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void init(int numthreads) { assert(numthreads > 0); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
define void @init(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
void nullTimer(int tick) {}


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

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

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

LLVM IR (-O2):
define void @nullTimer(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *message) { fprintf(stderr, "[!] Error: %s\n", message); }


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"[!] Error: %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}