xunge/DecIR huggingface dataset:
int calcn(int n) { return (2 * n) + 1; }


x86 assembly (clang, -O0):
<calcn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcn>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @calcn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @calcn(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int *foo() {
  int i;
  static int array[5];
  printf("%p\n", array);
  for (i = 0; i < 5; i++) {
    array[i] = 17;
  }
  return array;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0x2f1a(%rip),%rsi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    115c <foo+0x4c>
movslq -0x4(%rbp),%rcx
lea    0x2ef9(%rip),%rax
movl   $0x11,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <foo+0x22>
lea    0x2edd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
lea    0xef8(%rip),%rdi
lea    0x2f21(%rip),%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x2f0b(%rip)
movl   $0x11,0x2f11(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@foo.array = internal global [5 x i32] zeroinitializer
@.str = [4 x i8] c"%p\0A\00"
define i32* @foo() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* getelementptr inbounds ([5 x i32], [5 x i32]* @foo.array, i64 0, i64 0))
store i32 0, i32* %1
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [5 x i32], [5 x i32]* @foo.array, i64 0, i64 %8
store i32 17, i32* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %3
13: ; preds = %3
ret i32* getelementptr inbounds ([5 x i32], [5 x i32]* @foo.array, i64 0, i64 0)
}

LLVM IR (-O2):
@foo.array = internal global [5 x i32] zeroinitializer
@.str = [4 x i8] c"%p\0A\00"
define i32* @foo() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* getelementptr inbounds ([5 x i32], [5 x i32]* @foo.array, i64 0, i64 0))
store <4 x i32> <i32 17, i32 17, i32 17, i32 17>, <4 x i32>* bitcast ([5 x i32]* @foo.array to <4 x i32>*)
store i32 17, i32* getelementptr inbounds ([5 x i32], [5 x i32]* @foo.array, i64 0, i64 4)
ret i32* getelementptr inbounds ([5 x i32], [5 x i32]* @foo.array, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void writelines(char *linep[], int nlines) {
  int i;
  for (i = 0; i < nlines; i++)
    printf("%s\n", linep[i]);
}


x86 assembly (clang, -O0):
<writelines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <writelines+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <writelines+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writelines>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <writelines+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <writelines+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writelines(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int rollDie(int, int);
int statRoll(int max) { return rollDie(6, max); }


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

x86 assembly (clang, -O2):
<statRoll>:
mov    %edi,%esi
mov    $0x6,%edi
jmp    1030 <rollDie@plt>

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

LLVM IR (-O2):
define i32 @statRoll(i32 %0) {
%2 = tail call i32 @rollDie(i32 6, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ m4x4_translate(int /*<<< orphan*/, float, float, float);
int /*<<< orphan*/ matrixstack_head();
void matrixstack_translate(float x, float y, float z) {
  m4x4_translate(matrixstack_head(), x, y, z);
}


x86 assembly (clang, -O0):
<matrixstack_translate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    $0x0,%al
call   1030 <matrixstack_head@plt>
mov    %eax,%edi
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1040 <m4x4_translate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrixstack_translate>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1030 <matrixstack_head@plt>
mov    %eax,%edi
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
add    $0x18,%rsp
jmp    1040 <m4x4_translate@plt>

LLVM IR (-O0):
define void @matrixstack_translate(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = call i32 (...) @matrixstack_head()
%8 = load float, float* %4
%9 = load float, float* %5
%10 = load float, float* %6
%11 = call i32 @m4x4_translate(i32 %7, float %8, float %9, float %10)
ret void
}

LLVM IR (-O2):
define void @matrixstack_translate(float %0, float %1, float %2) {
%4 = tail call i32 (...) @matrixstack_head()
%5 = tail call i32 @m4x4_translate(i32 %4, float %0, float %1, float %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
void set_XButtonEvent_send_event(void *_p, int _v) {
  ((XButtonEvent *)_p)->send_event = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonEvent_send_event(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int log(float);
float convertFloattoDB(float value) { return 20 * log(value); }


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

x86 assembly (clang, -O2):
<convertFloattoDB>:
push   %rax
call   1030 <log@plt>
shl    $0x2,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @convertFloattoDB(float %0) {
%2 = tail call i32 @log(float %0)
%3 = mul nsw i32 %2, 20
%4 = sitofp i32 %3 to float
ret float %4
}
void foo401() {}


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

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

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

LLVM IR (-O2):
define void @foo401() {
ret void
}
void unsigned_prune_zero2_Good(unsigned int y) {
  unsigned int x = y;
  for (; x; --x) {
  }
}


x86 assembly (clang, -O0):
<unsigned_prune_zero2_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <unsigned_prune_zero2_Good+0x2a>
jmp    111c <unsigned_prune_zero2_Good+0x1c>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110d <unsigned_prune_zero2_Good+0xd>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @unsigned_prune_zero2_Good(i32 %0) {
ret void
}
/* Variables and functions */
int strcoll(char const *, char const *);
int c_strcoll(const char *arg0, const char *arg1) {
  return strcoll(arg0, arg1);
}


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

x86 assembly (clang, -O2):
<c_strcoll>:
jmp    1030 <strcoll@plt>

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

LLVM IR (-O2):
define i32 @c_strcoll(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcoll(i8* %0, i8* %1)
ret i32 %3
}
struct base_proto *get_base(void *p4) {
  return (struct base_proto *)p4;
}


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

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

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

LLVM IR (-O2):
%struct.base_proto = type opaque
define %struct.base_proto* @get_base(i8* readnone %0) {
%2 = bitcast i8* %0 to %struct.base_proto*
ret %struct.base_proto* %2
}
/* Variables and functions */
int /*<<< orphan*/ srand48(int /*<<< orphan*/);
int /*<<< orphan*/ test(int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand48(time(NULL));
  test(1024);
  test(13);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,%edi
call   1040 <srand48@plt>
mov    $0x400,%edi
call   1050 <test@plt>
mov    $0xd,%edi
call   1050 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%edi
call   1040 <srand48@plt>
mov    $0x400,%edi
call   1050 <test@plt>
mov    $0xd,%edi
call   1050 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand48(i32 %2)
%4 = call i32 @test(i32 1024)
%5 = call i32 @test(i32 13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand48(i32 %1)
%3 = tail call i32 @test(i32 1024)
%4 = tail call i32 @test(i32 13)
ret i32 0
}
int connectivityNumber(int connectivity) {
  int con;
  switch (connectivity) {
  case 1:
    con = 1;
    break;
  case 2:
    con = 2;
    break;
  case 3:
    con = 1;
    break;
  case 4:
    con = 3;
    break;
  default:
    con = 1;
    break;
  }
  return con;
}


x86 assembly (clang, -O0):
<connectivityNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1160 <connectivityNumber+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    1167 <connectivityNumber+0x67>
movl   $0x2,-0x8(%rbp)
jmp    1167 <connectivityNumber+0x67>
movl   $0x1,-0x8(%rbp)
jmp    1167 <connectivityNumber+0x67>
movl   $0x3,-0x8(%rbp)
jmp    1167 <connectivityNumber+0x67>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<connectivityNumber>:
xor    %ecx,%ecx
cmp    $0x2,%edi
sete   %cl
add    $0x1,%ecx
cmp    $0x4,%edi
mov    $0x3,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @connectivityNumber(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
]
5: ; preds = %1
store i32 1, i32* %3
br label %10
6: ; preds = %1
store i32 2, i32* %3
br label %10
7: ; preds = %1
store i32 1, i32* %3
br label %10
8: ; preds = %1
store i32 3, i32* %3
br label %10
9: ; preds = %1
store i32 1, i32* %3
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @connectivityNumber(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i32 2, i32 1
%4 = icmp eq i32 %0, 4
%5 = select i1 %4, i32 3, i32 %3
ret i32 %5
}
int IsNumeric(char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<IsNumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <IsNumeric+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsNumeric>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsNumeric(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsNumeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
int main(void) {
  foo(2, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x5,%esi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x5,%esi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 2, i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 2, i32 5)
ret i32 0
}
void gtk_tree_view_column_get_max_width() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_max_width() {
ret void
}
/* Variables and functions */
unsigned short copy_from_pascal_two(char *, char *, unsigned short);
unsigned short utf8_to_string(char *dest, char *buf, unsigned short maxlen) {
  return copy_from_pascal_two(dest, buf + 4, maxlen);
}


x86 assembly (clang, -O0):
<utf8_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
movzwl -0x12(%rbp),%edx
call   1030 <copy_from_pascal_two@plt>
movzwl %ax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_to_string>:
add    $0x4,%rsi
jmp    1030 <copy_from_pascal_two@plt>

LLVM IR (-O0):
define zeroext i16 @utf8_to_string(i8* %0, i8* %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16
store i8* %0, i8** %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 4
%10 = load i16, i16* %6
%11 = call zeroext i16 @copy_from_pascal_two(i8* %7, i8* %9, i16 zeroext %10)
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @utf8_to_string(i8* %0, i8* %1, i16 zeroext %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 4
%5 = tail call zeroext i16 @copy_from_pascal_two(i8* %0, i8* %4, i16 zeroext %2)
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ r_cons_printf(char *, char const *, char const *);
int sdbforcb(void *p, const char *k, const char *v) {
  r_cons_printf("%s=%s\n", k, v);
  return 1;
}


x86 assembly (clang, -O0):
<sdbforcb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xecd(%rip),%rdi
call   1030 <r_cons_printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbforcb>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <r_cons_printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s=%s\0A\00"
define i32 @sdbforcb(i8* %0, i8* %1, i8* %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** %5
%8 = load i8*, i8** %6
%9 = call i32 @r_cons_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s=%s\0A\00"
define i32 @sdbforcb(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call i32 @r_cons_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *x) {
  fprintf(stderr, "Usage: %s -o|-n <file>\n", x);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s -o|-n <file>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s -o|-n <file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, unsigned int);
void _ses_str_cpy(uint8_t *src, unsigned src_len, char *s, unsigned slen) {
  if (slen > src_len)
    slen = src_len;
  else
    slen--;
  memcpy(s, src, slen);
  s[slen] = 0;
}


x86 assembly (clang, -O0):
<_ses_str_cpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    113d <_ses_str_cpy+0x2d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1146 <_ses_str_cpy+0x36>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ses_str_cpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rax
lea    -0x1(%rcx),%ebx
cmp    %esi,%ecx
cmova  %esi,%ebx
mov    %rdx,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @_ses_str_cpy(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp ugt i32 %3, %1
%6 = add i32 %3, -1
%7 = select i1 %5, i32 %1, i32 %6
%8 = tail call i32 @memcpy(i8* %2, i32* %0, i32 %7)
%9 = zext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %2, i64 %9
store i8 0, i8* %10
ret void
}
/* Variables and functions */
bool nrf52_errata_81(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf52_errata_81() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_81() {
ret i32 0
}
__attribute__((always_)) char *___ignore_blank(char *ps, char *str_end) {
  while (ps < str_end) {
    if ((*ps != ' ') && (*ps != '\t') && (*ps != '\r') && (*ps != '\n')) {
      break;
    }
    ps++;
  }
  return ps;
}


x86 assembly (clang, -O0):
<___ignore_blank>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1170 <___ignore_blank+0x70>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     115f <___ignore_blank+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     115f <___ignore_blank+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     115f <___ignore_blank+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     115f <___ignore_blank+0x5f>
jmp    1170 <___ignore_blank+0x70>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <___ignore_blank+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<___ignore_blank>:
mov    %rdi,%rax
cmp    %rsi,%rdi
jae    113c <___ignore_blank+0x3c>
mov    %rsi,%rcx
sub    %rax,%rcx
movabs $0x100002600,%rdx
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%edi
cmp    $0x20,%rdi
ja     113c <___ignore_blank+0x3c>
bt     %rdi,%rdx
jae    113c <___ignore_blank+0x3c>
add    $0x1,%rax
add    $0xffffffffffffffff,%rcx
jne    1120 <___ignore_blank+0x20>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @___ignore_blank(i8* %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = getelementptr i8, i8* %0, i64 %7
br label %9
9: ; preds = %4, %12
%10 = phi i8* [ %13, %12 ], [ %0, %4 ]
%11 = load i8, i8* %10
switch i8 %11, label %15 [
i8 32, label %12
i8 9, label %12
i8 13, label %12
i8 10, label %12
]
12: ; preds = %9, %9, %9, %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = icmp eq i8* %13, %8
br i1 %14, label %15, label %9
15: ; preds = %12, %9, %2
%16 = phi i8* [ %0, %2 ], [ %10, %9 ], [ %8, %12 ]
ret i8* %16
}
int fun1074() { return 1074; }


x86 assembly (clang, -O0):
<fun1074>:
push   %rbp
mov    %rsp,%rbp
mov    $0x432,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun1074() {
ret i32 1074
}

LLVM IR (-O2):
define i32 @fun1074() {
ret i32 1074
}
/* Variables and functions */
int /*<<< orphan*/ init_shell(char **);
int /*<<< orphan*/ parse_options(char **);
int /*<<< orphan*/ read_cmd_loop();
int main(int ac, char **av, char **env) {
  init_shell(env);
  if (ac >= 1) {
    parse_options(av);
  }
  read_cmd_loop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <init_shell@plt>
cmpl   $0x1,-0x8(%rbp)
jl     1166 <main+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <parse_options@plt>
mov    $0x0,%al
call   1050 <read_cmd_loop@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rdx,%rdi
call   1040 <init_shell@plt>
test   %ebp,%ebp
jle    114c <main+0x1c>
mov    %rbx,%rdi
call   1030 <parse_options@plt>
xor    %eax,%eax
call   1050 <read_cmd_loop@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i8**, i8*** %7
%9 = call i32 @init_shell(i8** %8)
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i8**, i8*** %6
%14 = call i32 @parse_options(i8** %13)
br label %15
15: ; preds = %12, %3
%16 = call i32 (...) @read_cmd_loop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @init_shell(i8** %2)
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @parse_options(i8** %1)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 (...) @read_cmd_loop()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(int argn, char *argv[]) {
  while (1) {
    printf("openFPGArduino\n");
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [16 x i8] c"openFPGArduino\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2, %6
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @sleep(i32 1)
br label %6
}

LLVM IR (-O2):
@str = [15 x i8] c"openFPGArduino\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 1)
br label %3
}
/* Variables and functions */
char *xml_find_start(char *, char *);
char *wordin_findstartwrapper(char *buf, int *ntype) {
  return xml_find_start(buf, "b:Source");
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"b:Source\00"
define i8* @wordin_findstartwrapper(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = call i8* @xml_find_start(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %6
}

LLVM IR (-O2):
@.str = [9 x i8] c"b:Source\00"
define i8* @wordin_findstartwrapper(i8* %0, i32* nocapture readnone %1) {
%3 = tail call i8* @xml_find_start(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t AONRTCSecGet(void) {
  return ((*((volatile unsigned long *)(0x40092000 + 0x00000008))));
}


x86 assembly (clang, -O0):
<AONRTCSecGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40092008,%eax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONRTCSecGet>:
mov    0x40092008,%rax
40
ret

LLVM IR (-O0):
define i64 @AONRTCSecGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074339848 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @AONRTCSecGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074339848 to i64*)
ret i64 %1
}
isdot(p) register char *p;
{
  if (p && *p++ == '.' && *p++ == '\0')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<isdot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <isdot+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1155 <isdot+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1155 <isdot+0x55>
movl   $0x1,-0x4(%rbp)
jmp    115c <isdot+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdot>:
test   %rdi,%rdi
je     1110 <isdot+0x10>
cmpb   $0x2e,(%rdi)
jne    1110 <isdot+0x10>
cmpb   $0x0,0x1(%rdi)
je     1113 <isdot+0x13>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isdot(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %19
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 46
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 1, i32* %2
br label %20
19: ; preds = %12, %6, %1
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @isdot(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 46
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %6, %3, %1
br label %11
11: ; preds = %6, %10
%12 = phi i32 [ 0, %10 ], [ 1, %6 ]
ret i32 %12
}
int test_imm_13int32_mem(int *val) {
  return ((*val) & (0x13 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_13int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 19
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void setfblank_(void *value) {
  long *ivalue = (long *)value;
  *ivalue = 0x7fffffff;
}


x86 assembly (clang, -O0):
<setfblank_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x7fffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setfblank_>:
movq   $0x7fffffff,(%rdi)
ret

LLVM IR (-O0):
define void @setfblank_(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
store i64 2147483647, i64* %6
ret void
}

LLVM IR (-O2):
define void @setfblank_(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i64*
store i64 2147483647, i64* %2
ret void
}
void ata_sff_flush_pio_task(struct ata_port *ap) {}


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

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

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

LLVM IR (-O2):
%struct.ata_port = type opaque
define void @ata_sff_flush_pio_task(%struct.ata_port* nocapture %0) {
ret void
}
void ScaleRowDown4_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown4_SSSE3() {
ret void
}
/* Variables and functions */
int pathconN_nm6_f0(double const **, double **, int *, double *, int);
int pathconN_nm6(const double **arg, double **res, int *iw, double *w,
                 int mem) {
  return pathconN_nm6_f0(arg, res, iw, w, mem);
}


x86 assembly (clang, -O0):
<pathconN_nm6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <pathconN_nm6_f0@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm6>:
jmp    1030 <pathconN_nm6_f0@plt>

LLVM IR (-O0):
define i32 @pathconN_nm6(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load double**, double*** %7
%13 = load i32*, i32** %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call i32 @pathconN_nm6_f0(double** %11, double** %12, i32* %13, double* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @pathconN_nm6(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @pathconN_nm6_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t rdz_32(uint32_t addr) { return *((uint32_t *)addr); }


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

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

LLVM IR (-O0):
define i64 @rdz_32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @rdz_32(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ button_delete(void *);
void button_delete_cb(void *self) { button_delete(self); }


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

x86 assembly (clang, -O2):
<button_delete_cb>:
jmp    1030 <button_delete@plt>

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

LLVM IR (-O2):
define void @button_delete_cb(i8* %0) {
%2 = tail call i32 @button_delete(i8* %0)
ret void
}
void WF_SpiEnableChipSelect() {
  if (0)
    *(volatile unsigned *)(0xBF800000 + (0x60328)) = 1 << 4;
  else
    *(volatile unsigned *)(0xBF800000 + (0x60324)) = 1 << 4;
}


x86 assembly (clang, -O0):
<WF_SpiEnableChipSelect>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbf860324,%eax
movl   $0x10,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WF_SpiEnableChipSelect>:
mov    $0xbf860324,%eax
movl   $0x10,(%rax)
ret

LLVM IR (-O0):
define void @WF_SpiEnableChipSelect() {
store volatile i32 16, i32* inttoptr (i64 3213230884 to i32*)
ret void
}

LLVM IR (-O2):
define void @WF_SpiEnableChipSelect() {
store volatile i32 16, i32* inttoptr (i64 3213230884 to i32*)
ret void
}
/* Variables and functions */
size_t str_len(char *s) {
  size_t l;
  for (l = 0; *s++ != '\0'; l++)
    ;
  return l;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <str_len+0x41>
jmp    1130 <str_len+0x30>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <str_len+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
cmpb   $0x0,(%rdi)
je     111f <str_len+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <str_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @str_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ logPrint(char *);
void ping(int i0, short i1, void *i2) { logPrint("PING :localhost\r\n"); }


x86 assembly (clang, -O0):
<ping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <logPrint@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"PING :localhost\0D\0A\00"
define void @ping(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = call i32 @logPrint(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"PING :localhost\0D\0A\00"
define void @ping(i32 %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = tail call i32 @logPrint(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
long long __fixunsxfdi(long double);
long long __fixxfdi(long double a1) {
  long long ret;
  int s;
  ret = __fixunsxfdi((s = a1 >= 0) ? a1 : -a1);
  return s ? ret : -ret;
}


x86 assembly (clang, -O0):
<__fixxfdi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x1c(%rbp)
test   $0x1,%al
jne    1134 <__fixxfdi+0x34>
jmp    113f <__fixxfdi+0x3f>
fldt   -0x10(%rbp)
fstpt  -0x28(%rbp)
jmp    1147 <__fixxfdi+0x47>
fldt   -0x10(%rbp)
fchs
fstpt  -0x28(%rbp)
fldt   -0x28(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1190 <__fixunsxfdi>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     116f <__fixxfdi+0x6f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1179 <__fixxfdi+0x79>
xor    %eax,%eax
sub    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)

x86 assembly (clang, -O2):
<__fixxfdi>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fldz
fld    %st(0)
fstpt  0x1c(%rsp)
fxch   %st(1)
fucomi %st(1),%st
fstp   %st(1)
fld    %st(0)
fchs
fcmovnb %st(1),%st
fstp   %st(1)
fstpt  (%rsp)
call   1150 <__fixunsxfdi>
mov    %rax,%rcx
neg    %rcx
fldt   0x1c(%rsp)
fldt   0x10(%rsp)
fucomip %st(1),%st
fstp   %st(0)
cmovb  %rcx,%rax
add    $0x28,%rsp
ret
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
define i64 @__fixxfdi(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i64
%4 = alloca i32
store x86_fp80 %0, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = fcmp oge x86_fp80 %5, 0xK00000000000000000000
%7 = zext i1 %6 to i32
store i32 %7, i32* %4
br i1 %6, label %8, label %10
8: ; preds = %1
%9 = load x86_fp80, x86_fp80* %2
br label %13
10: ; preds = %1
%11 = load x86_fp80, x86_fp80* %2
%12 = fneg x86_fp80 %11
br label %13
13: ; preds = %10, %8
%14 = phi x86_fp80 [ %9, %8 ], [ %12, %10 ]
%15 = call i64 @__fixunsxfdi(x86_fp80 %14)
store i64 %15, i64* %3
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = load i64, i64* %3
br label %23
20: ; preds = %13
%21 = load i64, i64* %3
%22 = sub nsw i64 0, %21
br label %23
23: ; preds = %20, %18
%24 = phi i64 [ %19, %18 ], [ %22, %20 ]
ret i64 %24
}

LLVM IR (-O2):
define i64 @__fixxfdi(x86_fp80 %0) {
%2 = fcmp oge x86_fp80 %0, 0xK00000000000000000000
%3 = fneg x86_fp80 %0
%4 = select i1 %2, x86_fp80 %0, x86_fp80 %3
%5 = tail call i64 @__fixunsxfdi(x86_fp80 %4)
%6 = sub nsw i64 0, %5
%7 = select i1 %2, i64 %5, i64 %6
ret i64 %7
}
/* Type definitions */
typedef int int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
scalar_t__ sature(int);
int16_t mult_r(int16_t var1, int16_t var2) {
  int16_t var_out;
  int32_t L_produit_arr;
  L_produit_arr = (int32_t)var1 * (int32_t)var2;
  L_produit_arr += (int32_t)0x00004000;
  L_produit_arr &= (int32_t)0xffff8000L;
  L_produit_arr >>= 15;
  if (L_produit_arr & (int32_t)0x00010000L) {
    L_produit_arr |= (int32_t)0xffff0000L;
  }
  var_out = sature(L_produit_arr);
  return (var_out);
}


x86 assembly (clang, -O0):
<mult_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x4000,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
and    $0xffff8000,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sar    $0xf,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     1169 <mult_r+0x59>
mov    -0x1c(%rbp),%eax
or     $0xffff0000,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <sature@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult_r>:
imul   %esi,%edi
add    $0x4000,%edi
sar    $0xf,%edi
mov    %edi,%eax
or     $0xffff0000,%eax
test   $0x10000,%edi
cmovne %eax,%edi
jmp    1030 <sature@plt>

LLVM IR (-O0):
define i64 @mult_r(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %8, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 16384
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = and i32 %14, -32768
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = ashr i32 %16, 15
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = and i32 %18, 65536
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %2
%22 = load i32, i32* %6
%23 = or i32 %22, -65536
store i32 %23, i32* %6
br label %24
24: ; preds = %21, %2
%25 = load i32, i32* %6
%26 = call i64 @sature(i32 %25)
store i64 %26, i64* %5
%27 = load i64, i64* %5
ret i64 %27
}

LLVM IR (-O2):
define i64 @mult_r(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = mul nsw i32 %4, %3
%6 = add nsw i32 %5, 16384
%7 = ashr i32 %6, 15
%8 = and i32 %7, 65536
%9 = icmp eq i32 %8, 0
%10 = or i32 %7, -65536
%11 = select i1 %9, i32 %7, i32 %10
%12 = tail call i64 @sature(i32 %11)
ret i64 %12
}