xunge/DecIR huggingface dataset:
/* Variables and functions */
int LOG_CONS;
int LOG_NDELAY;
int LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
void startlog(char *name) {
  openlog(name, LOG_PID | LOG_CONS | LOG_NDELAY, LOG_USER);
}


x86 assembly (clang, -O0):
<startlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
mov    0x2e87(%rip),%rax
or     (%rax),%esi
mov    0x2ea6(%rip),%rax
mov    (%rax),%edx
call   1030 <openlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startlog>:
mov    0x2ec1(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e97(%rip),%rax
or     (%rax),%esi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_NDELAY = global i32 0
@LOG_USER = global i32 0
define void @startlog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @LOG_PID
%5 = load i32, i32* @LOG_CONS
%6 = or i32 %4, %5
%7 = load i32, i32* @LOG_NDELAY
%8 = or i32 %6, %7
%9 = load i32, i32* @LOG_USER
%10 = call i32 @openlog(i8* %3, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_NDELAY = global i32 0
@LOG_USER = global i32 0
define void @startlog(i8* %0) {
%2 = load i32, i32* @LOG_PID
%3 = load i32, i32* @LOG_CONS
%4 = or i32 %3, %2
%5 = load i32, i32* @LOG_NDELAY
%6 = or i32 %4, %5
%7 = load i32, i32* @LOG_USER
%8 = tail call i32 @openlog(i8* %0, i32 %6, i32 %7)
ret void
}
/* Variables and functions */
size_t backtrace(void **, unsigned int);
int /*<<< orphan*/ printf(char *, void *);
void trace_print(void) {
  void *array[(4U) + 1];
  size_t size;
  size = backtrace(array, (4U) + 1);
  for (size_t i = 1; i < size; i++) {
    printf("%p\n", array[i]);
  }
}


x86 assembly (clang, -O0):
<trace_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1030 <backtrace@plt>
mov    %rax,-0x38(%rbp)
movq   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x38(%rbp),%rax
jae    1176 <trace_print+0x56>
mov    -0x40(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rsi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1142 <trace_print+0x22>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_print>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <backtrace@plt>
cmp    $0x2,%rax
jb     1165 <trace_print+0x45>
mov    %rax,%r15
mov    $0x1,%ebx
lea    0xeb5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%rsp,%rbx,8),%rsi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1150 <trace_print+0x30>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define void @trace_print() {
%1 = alloca [5 x i8*]
%2 = bitcast [5 x i8*]* %1 to i8*
%3 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
%4 = call i64 @backtrace(i8** %3, i32 5)
%5 = icmp ugt i64 %4, 1
br i1 %5, label %7, label %6
6: ; preds = %7, %0
ret void
7: ; preds = %0, %7
%8 = phi i64 [ %12, %7 ], [ 1, %0 ]
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 %8
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw i64 %8, 1
%13 = icmp eq i64 %12, %4
br i1 %13, label %6, label %7
}
/* Variables and functions */
unsigned int rand_interval(int, unsigned int);
void randomSample(unsigned int *samples, unsigned int sample_count,
                  unsigned int max) {
  int i;
  for (i = 0; i < sample_count; i++)
    samples[i] = rand_interval(1, max);
}


x86 assembly (clang, -O0):
<randomSample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    115d <randomSample+0x4d>
mov    -0x10(%rbp),%esi
mov    $0x1,%edi
call   1030 <rand_interval@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <randomSample+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomSample>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     114a <randomSample+0x3a>
mov    %edx,%r14d
mov    %rdi,%r15
mov    %esi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edi
mov    %r14d,%esi
call   1030 <rand_interval@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <randomSample+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @randomSample(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = tail call i32 @rand_interval(i32 1, i32 %2)
%10 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %9, i32* %10
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %3
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int stringComparator(void *x, void *y) {
  if (strcmp((char *)x, (char *)y) > 0)
    return 1;
  else if (strcmp((char *)x, (char *)y) < 0)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<stringComparator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jle    1143 <stringComparator+0x33>
movl   $0x1,-0x4(%rbp)
jmp    116d <stringComparator+0x5d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jge    1166 <stringComparator+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <stringComparator+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringComparator>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jg     113b <stringComparator+0x2b>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
sar    $0x3f,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @stringComparator(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %0, i8* %1)
%7 = ashr i64 %6, 63
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
double linearinv(double lp) { return lp; }


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

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

LLVM IR (-O0):
define double @linearinv(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @linearinv(double returned %0) {
ret double %0
}
int palin(char s[], int t, int n) {
  if (n == 0)
    return 1;
  else if (s[t] != s[n - 1])
    return 0;
  else
    return palin(s, t + 1, n - 1);
}


x86 assembly (clang, -O0):
<palin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1138 <palin+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1181 <palin+0x71>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1169 <palin+0x59>
movl   $0x0,-0x4(%rbp)
jmp    1181 <palin+0x71>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
call   1030 <palin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<palin>:
mov    $0x1,%eax
test   %edx,%edx
je     1135 <palin+0x35>
movslq %edx,%r8
movslq %esi,%rcx
add    %rdi,%rcx
mov    %edx,%r9d
lea    (%r8,%rdi,1),%rsi
add    $0xffffffffffffffff,%rsi
xor    %edi,%edi
nop
movzbl (%rcx,%rdi,1),%edx
cmp    (%rsi),%dl
jne    1136 <palin+0x36>
add    $0x1,%rdi
add    $0xffffffffffffffff,%rsi
cmp    %edi,%r9d
jne    1120 <palin+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @palin(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 1, i32* %4
br label %34
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i8*, i8** %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %17, %24
br i1 %25, label %26, label %27
26: ; preds = %11
store i32 0, i32* %4
br label %34
27: ; preds = %11
%28 = load i8*, i8** %5
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
%31 = load i32, i32* %7
%32 = sub nsw i32 %31, 1
%33 = call i32 @palin(i8* %28, i32 %30, i32 %32)
store i32 %33, i32* %4
br label %34
34: ; preds = %27, %26, %10
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @palin(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %21, label %5
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = sext i32 %1 to i64
br label %12
8: ; preds = %12
%9 = add nsw i64 %13, 1
%10 = trunc i64 %17 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %21, label %12
12: ; preds = %5, %8
%13 = phi i64 [ %7, %5 ], [ %9, %8 ]
%14 = phi i64 [ %6, %5 ], [ %17, %8 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %13
%16 = load i8, i8* %15
%17 = add nsw i64 %14, -1
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = load i8, i8* %18
%20 = icmp eq i8 %16, %19
br i1 %20, label %8, label %21
21: ; preds = %8, %12, %3
%22 = phi i32 [ 1, %3 ], [ 0, %12 ], [ 1, %8 ]
ret i32 %22
}
float u2f(unsigned u) {
  float *fp = (float *)&u;
  return *fp;
}


x86 assembly (clang, -O0):
<u2f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<u2f>:
movd   %edi,%xmm0
ret

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

LLVM IR (-O2):
define float @u2f(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
int color_offset_f2(int x, int y) {
  return ((y << 10) - (((x << 10) * 164) / 157) - (8 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0xa4,%eax,%eax
mov    $0x9d,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
sub    $0x2000,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f2>:
shl    $0xa,%esi
imul   $0x29000,%edi,%eax
cltq
imul   $0xffffffffcbd2580d,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
add    %esi,%eax
add    $0xffffe000,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 164
%10 = sdiv i32 %9, 157
%11 = sub nsw i32 %6, %10
%12 = sub nsw i32 %11, 8192
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f2(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 167936
%5 = sdiv i32 %4, -157
%6 = add i32 %3, -8192
%7 = add i32 %6, %5
%8 = ashr i32 %7, 10
ret i32 %8
}
void a2i_ASN1_STRING(void) {}


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

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

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

LLVM IR (-O2):
define void @a2i_ASN1_STRING() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  typedef int meuInteiro;
  typedef char String[20];
  meuInteiro numero = 1;
  String nome;
  scanf("%[^\n]s", nome);
  printf("A variavel do tipo 'meuInteiro' eh um int e vale %d\n", numero);
  printf("Ja a variavel 'nome' eh uma String e armazena \"%s\"\n", nome);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec9(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [53 x i8] c"A variavel do tipo 'meuInteiro' eh um int e vale %d\0A\00"
@.str.2 = [52 x i8] c"Ja a variavel 'nome' eh uma String e armazena \22%s\22\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i8]
store i32 0, i32* %1
store i32 1, i32* %2
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [53 x i8] c"A variavel do tipo 'meuInteiro' eh um int e vale %d\0A\00"
@.str.2 = [52 x i8] c"Ja a variavel 'nome' eh uma String e armazena \22%s\22\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
struct ln_rst_time {
  int dummy;
};
struct ln_lnlat_posn {
  int dummy;
};

/* Variables and functions */
int ln_get_solar_rst_horizon(double, struct ln_lnlat_posn *, double,
                             struct ln_rst_time *);
int ln_get_solar_rst(double JD, struct ln_lnlat_posn *observer,
                     struct ln_rst_time *rst) {
  return ln_get_solar_rst_horizon(JD, observer, -0.8333, rst);
}


x86 assembly (clang, -O0):
<ln_get_solar_rst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movsd  0xec6(%rip),%xmm1
call   1030 <ln_get_solar_rst_horizon@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_solar_rst>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <ln_get_solar_rst_horizon@plt>

LLVM IR (-O0):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_solar_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_rst_time* %2) {
%4 = alloca double
%5 = alloca %struct.ln_lnlat_posn*
%6 = alloca %struct.ln_rst_time*
store double %0, double* %4
store %struct.ln_lnlat_posn* %1, %struct.ln_lnlat_posn** %5
store %struct.ln_rst_time* %2, %struct.ln_rst_time** %6
%7 = load double, double* %4
%8 = load %struct.ln_lnlat_posn*, %struct.ln_lnlat_posn** %5
%9 = load %struct.ln_rst_time*, %struct.ln_rst_time** %6
%10 = call i32 @ln_get_solar_rst_horizon(double %7, %struct.ln_lnlat_posn* %8, double -8.333000e-01, %struct.ln_rst_time* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_solar_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_rst_time* %2) {
%4 = tail call i32 @ln_get_solar_rst_horizon(double %0, %struct.ln_lnlat_posn* %1, double -8.333000e-01, %struct.ln_rst_time* %2)
ret i32 %4
}
/* Variables and functions */
double sqrt(double);
double qSqrt(double value) { return sqrt(value); }


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

x86 assembly (clang, -O2):
<qSqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <qSqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @qSqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ __OPEN_NEEDS_MODE(int);
int /*<<< orphan*/ __fortify_fail(char *);
int __open(char const *, int);
int __open_2(const char *file, int oflag) {
  if (__OPEN_NEEDS_MODE(oflag))
    __fortify_fail("invalid open call: O_CREAT or O_TMPFILE without mode");
  return __open(file, oflag);
}


x86 assembly (clang, -O0):
<__open_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <__OPEN_NEEDS_MODE@plt>
cmp    $0x0,%rax
je     115d <__open_2+0x2d>
lea    0xea8(%rip),%rdi
call   1050 <__fortify_fail@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <__open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__open_2>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <__OPEN_NEEDS_MODE@plt>
test   %rax,%rax
je     1151 <__open_2+0x21>
lea    0xeb4(%rip),%rdi
call   1050 <__fortify_fail@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__open@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"invalid open call: O_CREAT or O_TMPFILE without mode\00"
define i32 @__open_2(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 i64 @__OPEN_NEEDS_MODE(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @__fortify_fail(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @__open(i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [53 x i8] c"invalid open call: O_CREAT or O_TMPFILE without mode\00"
define i32 @__open_2(i8* %0, i32 %1) {
%3 = tail call i64 @__OPEN_NEEDS_MODE(i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @__fortify_fail(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @__open(i8* %0, i32 %1)
ret i32 %8
}
int ft_isdigit(int c) {
  if (c < 58 && c > 47)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3a,-0x8(%rbp)
jge    1127 <ft_isdigit+0x27>
cmpl   $0x2f,-0x8(%rbp)
jle    1127 <ft_isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int helper(struct TreeNode *, int *);
int kthSmallest0(struct TreeNode *root, int k) { return helper(root, &k); }


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

x86 assembly (clang, -O2):
<kthSmallest0>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <helper@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @kthSmallest0(%struct.TreeNode* %0, i32 %1) {
%3 = alloca %struct.TreeNode*
%4 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %3
store i32 %1, i32* %4
%5 = load %struct.TreeNode*, %struct.TreeNode** %3
%6 = call i32 @helper(%struct.TreeNode* %5, i32* %4)
ret i32 %6
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @kthSmallest0(%struct.TreeNode* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @helper(%struct.TreeNode* %0, i32* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dd_draw_circle(char, char, int, int /*<<< orphan*/);
int /*<<< orphan*/ dd_set_printpos(char, char, int);
int /*<<< orphan*/ dd_setcolor(char);
void draw_degrees(char x, char y, char color) {
  dd_set_printpos(x, y, 1);
  dd_setcolor(color);
  dd_draw_circle(x, y, 2, 0);
}


x86 assembly (clang, -O0):
<draw_degrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
mov    $0x1,%edx
movsbl %al,%edi
movsbl -0x2(%rbp),%esi
call   1050 <dd_set_printpos@plt>
movsbl -0x3(%rbp),%edi
call   1040 <dd_setcolor@plt>
mov    -0x1(%rbp),%al
mov    $0x2,%edx
xor    %ecx,%ecx
movsbl %al,%edi
movsbl -0x2(%rbp),%esi
call   1030 <dd_draw_circle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_degrees>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x1,%edx
call   1050 <dd_set_printpos@plt>
mov    %r14d,%edi
call   1040 <dd_setcolor@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <dd_draw_circle@plt>

LLVM IR (-O0):
define void @draw_degrees(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = load i8, i8* %5
%9 = call i32 @dd_set_printpos(i8 signext %7, i8 signext %8, i32 1)
%10 = load i8, i8* %6
%11 = call i32 @dd_setcolor(i8 signext %10)
%12 = load i8, i8* %4
%13 = load i8, i8* %5
%14 = call i32 @dd_draw_circle(i8 signext %12, i8 signext %13, i32 2, i32 0)
ret void
}

LLVM IR (-O2):
define void @draw_degrees(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @dd_set_printpos(i8 signext %0, i8 signext %1, i32 1)
%5 = tail call i32 @dd_setcolor(i8 signext %2)
%6 = tail call i32 @dd_draw_circle(i8 signext %0, i8 signext %1, i32 2, i32 0)
ret void
}
void answer_bk(void) {}


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

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

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

LLVM IR (-O2):
define void @answer_bk() {
ret void
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stub_print_memory_stats(struct activity *, int, int,
                                           unsigned long long,
                                           int /*<<< orphan*/);
void print_memory_stats(struct activity *a, int prev, int curr,
                        unsigned long long itv) {
  stub_print_memory_stats(a, prev, curr, itv, 0);
}


x86 assembly (clang, -O0):
<print_memory_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <stub_print_memory_stats@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_memory_stats>:
xor    %r8d,%r8d
jmp    1030 <stub_print_memory_stats@plt>

LLVM IR (-O0):
%struct.activity = type { i32 }
define void @print_memory_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca %struct.activity*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store %struct.activity* %0, %struct.activity** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load %struct.activity*, %struct.activity** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i64, i64* %8
%13 = call i32 @stub_print_memory_stats(%struct.activity* %9, i32 %10, i32 %11, i64 %12, i32 0)
ret void
}

LLVM IR (-O2):
%struct.activity = type { i32 }
define void @print_memory_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i32 @stub_print_memory_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3, i32 0)
ret void
}
void FlushDcache(unsigned long addr, unsigned long len) {
  unsigned long end;
  return;
  addr &= (~((1 << 5) - 1));
  len >>= 5;
  end = addr + len * (1 << 5);
  while (addr != end) {
    asm("mcr p15, 0, %0, c7, c10, 1" ::"r"(addr));
    addr += (1 << 5);
  }
  return;
}


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

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

LLVM IR (-O0):
define void @FlushDcache(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @FlushDcache(i64 %0, i64 %1) {
ret void
}
const char *r2t_version(void) {
  return ("r2t : V1.01 Peter Boesecke 2012-06-04");
}


x86 assembly (clang, -O0):
<r2t_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r2t_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [38 x i8] c"r2t : V1.01 Peter Boesecke 2012-06-04\00"
define i8* @r2t_version() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [38 x i8] c"r2t : V1.01 Peter Boesecke 2012-06-04\00"
define i8* @r2t_version() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int UINT64_C(int);
int is_vdi_obj(uint64_t oid) { return !!(oid & (UINT64_C(1) << 63)); }


x86 assembly (clang, -O0):
<is_vdi_obj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%eax
mov    $0x3f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_vdi_obj(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @UINT64_C(i32 1)
%5 = shl i32 %4, 63
%6 = and i32 %3, %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_vdi_obj(i32 %0) {
%2 = tail call i32 @UINT64_C(i32 1)
ret i32 poison
}
/* Variables and functions */
int mysnprintf(char *, size_t, char *, unsigned int);
int unsigned2str(unsigned value, char *buf, size_t len) {
  return mysnprintf(buf, len, "%u", value);
}


x86 assembly (clang, -O0):
<unsigned2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%ecx
lea    0xecb(%rip),%rdx
call   1030 <mysnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned2str>:
mov    %edi,%ecx
lea    0xee7(%rip),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <mysnprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i32 @unsigned2str(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 i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32, i32* %4
%10 = call i32 @mysnprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @unsigned2str(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @mysnprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %4
}
int test_imm_12uint8_mem(unsigned char *val) {
  return ((*val) & (0x12 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_12uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x12,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
uint8_t rtp3640_get_aac_hbr_au_index(const uint8_t *header) {
  return (header[1] & 0x7);
}


x86 assembly (clang, -O0):
<rtp3640_get_aac_hbr_au_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp3640_get_aac_hbr_au_index>:
mov    0x4(%rdi),%eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @rtp3640_get_aac_hbr_au_index(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = and i32 %3, 7
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *name) { printf("usage: %s [-f file] [-h]\n", name); }


x86 assembly (clang, -O0):
<print_usage>:
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):
<print_usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"usage: %s [-f file] [-h]\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"usage: %s [-f file] [-h]\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
yyPrint_INT(i) long i;
{ printf("%ld", i); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @yyPrint_INT(i64 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 undef
}
void b(int *i, int *j) {}


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

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

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

LLVM IR (-O2):
define void @b(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPI_Configuration();
void spi_peripheral_init() { SPI_Configuration(); }


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

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

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

LLVM IR (-O2):
define void @spi_peripheral_init() {
%1 = tail call i32 (...) @SPI_Configuration()
ret void
}
void rop3_136_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D & S;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_136_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_136_1_0>:
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_136_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
store i8 %5, i8* %0
ret void
}
int rocker_tlv_total_size(int payload) {
  return (((rocker_tlv_size(payload)) + 8U - 1) & ~(8U - 1));
}


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

x86 assembly (clang, -O2):
<rocker_tlv_total_size>:
push   %rax
xor    %eax,%eax
call   1030 <rocker_tlv_size@plt>
add    $0x7,%eax
and    $0xfffffff8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rocker_tlv_total_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @rocker_tlv_size to i32 (i32, ...)*)(i32 %3)
%5 = add i32 %4, 8
%6 = sub i32 %5, 1
%7 = and i32 %6, -8
ret i32 %7
}

LLVM IR (-O2):
define i32 @rocker_tlv_total_size(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @rocker_tlv_size to i32 (i32, ...)*)(i32 %0)
%3 = add i32 %2, 7
%4 = and i32 %3, -8
ret i32 %4
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long long current_time_m() {
  struct timeval t_start;
  gettimeofday(&t_start, 0);
  long long t = ((long long)t_start.tv_sec);
  return t;
}


x86 assembly (clang, -O0):
<current_time_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_time_m>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i64 @current_time_m() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i64, i64* %4
store i64 %5, i64* %2
%6 = load i64, i64* %2
ret i64 %6
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i64 @current_time_m() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_ICMP;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ printf(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int createRawSocket() {
  int fd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
  if (fd < 0) {
    printf("Error: createRawSocket()");
  }
  return fd;
}


x86 assembly (clang, -O0):
<createRawSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
call   1040 <socket@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1161 <createRawSocket+0x41>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createRawSocket>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
call   1040 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1153 <createRawSocket+0x33>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_ICMP = global i32 0
@.str = [25 x i8] c"Error: createRawSocket()\00"
define i32 @createRawSocket() {
%1 = alloca i32
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_RAW
%4 = load i32, i32* @IPPROTO_ICMP
%5 = call i32 @socket(i32 %2, i32 %3, i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_ICMP = global i32 0
@.str = [25 x i8] c"Error: createRawSocket()\00"
define i32 @createRawSocket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_RAW
%3 = load i32, i32* @IPPROTO_ICMP
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret i32 %4
}
void gtk_text_view_get_overwrite() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_get_overwrite() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by_ptr_mm(int /*<<< orphan*/);
int /*<<< orphan*/ shr();
void shr_by_ptr_mm(uint32_t x) {
  by_ptr_mm(x);
  shr();
}


x86 assembly (clang, -O0):
<shr_by_ptr_mm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <by_ptr_mm@plt>
mov    $0x0,%al
call   1030 <shr@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @shr_by_ptr_mm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_ptr_mm(i32 %3)
%5 = call i32 (...) @shr()
ret void
}

LLVM IR (-O2):
define void @shr_by_ptr_mm(i32 %0) {
%2 = tail call i32 @by_ptr_mm(i32 %0)
%3 = tail call i32 (...) @shr()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateTamperIODisable(uint32_t ui32Input) {
  ;
  (*((volatile uint32_t *)(0x400FC360))) = 0xA3359554;
  _HibernateWriteComplete();
  (*((volatile uint32_t *)(0x400FC410))) &= ((~0x00000001) << (ui32Input << 3));
  _HibernateWriteComplete();
  (*((volatile uint32_t *)(0x400FC360))) = 0;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateTamperIODisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x400fc360,%eax
movl   $0xa3359554,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
mov    $0xfffffffe,%eax
shl    %cl,%eax
mov    $0x400fc410,%ecx
mov    (%rcx),%ecx
and    %eax,%ecx
mov    $0x400fc410,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc360,%eax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateTamperIODisable>:
push   %rbx
mov    %edi,%ebx
movl   $0xa3359554,0x400fc360
54 95 35 a3
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
shl    $0x3,%ebx
mov    $0xfffffffe,%eax
mov    %ebx,%ecx
shl    %cl,%eax
and    %eax,0x400fc410
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
movl   $0x0,0x400fc360
xor    %eax,%eax
pop    %rbx
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateTamperIODisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i32 -1556769452, i32* inttoptr (i64 1074774880 to i32*)
%3 = call i32 (...) @_HibernateWriteComplete()
%4 = load i32, i32* %2
%5 = shl i32 %4, 3
%6 = shl i32 -2, %5
%7 = load volatile i32, i32* inttoptr (i64 1074775056 to i32*)
%8 = and i32 %7, %6
store volatile i32 %8, i32* inttoptr (i64 1074775056 to i32*)
%9 = call i32 (...) @_HibernateWriteComplete()
store volatile i32 0, i32* inttoptr (i64 1074774880 to i32*)
%10 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateTamperIODisable(i32 %0) {
store volatile i32 -1556769452, i32* inttoptr (i64 1074774880 to i32*)
%2 = tail call i32 (...) @_HibernateWriteComplete()
%3 = shl i32 %0, 3
%4 = shl i32 -2, %3
%5 = load volatile i32, i32* inttoptr (i64 1074775056 to i32*)
%6 = and i32 %5, %4
store volatile i32 %6, i32* inttoptr (i64 1074775056 to i32*)
%7 = tail call i32 (...) @_HibernateWriteComplete()
store volatile i32 0, i32* inttoptr (i64 1074774880 to i32*)
%8 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *fun2() {
  int *p = (int *)malloc(sizeof(int));
  return p;
}


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

x86 assembly (clang, -O2):
<fun2>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @fun2() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
ret i32* %4
}

LLVM IR (-O2):
define i32* @fun2() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}