xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, int);
unsigned char RdStatus(int);
void OisEna(void) {
  unsigned char UcStRd = 1;
  RamWrite32A(0xF012, 0x00000001);
  while (UcStRd) {
    UcStRd = RdStatus(1);
  }
}


x86 assembly (clang, -O0):
<OisEna>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
mov    $0xf012,%edi
mov    $0x1,%esi
call   1030 <RamWrite32A@plt>
cmpb   $0x0,-0x1(%rbp)
je     1157 <OisEna+0x37>
mov    $0x1,%edi
call   1040 <RdStatus@plt>
mov    %al,-0x1(%rbp)
jmp    113b <OisEna+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OisEna>:
push   %rax
mov    $0xf012,%edi
mov    $0x1,%esi
call   1030 <RamWrite32A@plt>
mov    $0x1,%edi
call   1040 <RdStatus@plt>
test   %al,%al
jne    1130 <OisEna+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @OisEna() {
%1 = alloca i8
store i8 1, i8* %1
%2 = call i32 @RamWrite32A(i32 61458, i32 1)
br label %3
3: ; preds = %6, %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call zeroext i8 @RdStatus(i32 1)
store i8 %7, i8* %1
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @OisEna() {
%1 = tail call i32 @RamWrite32A(i32 61458, i32 1)
br label %2
2: ; preds = %0, %2
%3 = tail call zeroext i8 @RdStatus(i32 1)
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
int main() { return 0UL >= 0UL; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, long, long, long);
void send_obp(struct ship *ship, long a, long b, long c, long d) {
  Write(14, ship, a, b, c, d);
}


x86 assembly (clang, -O0):
<send_obp>:
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    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    $0xe,%edi
call   1030 <Write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_obp>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xe,%edi
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_obp(%struct.ship* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca %struct.ship*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store %struct.ship* %0, %struct.ship** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load %struct.ship*, %struct.ship** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i32 @Write(i32 14, %struct.ship* %11, i64 %12, i64 %13, i64 %14, i64 %15)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_obp(%struct.ship* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i32 @Write(i32 14, %struct.ship* %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int _split(int *, int, int);
void _quick_sort(int *v, int left, int right) {
  if (right > left) {
    int mid = _split(v, left, right);
    _quick_sort(v, left, mid);
    _quick_sort(v, mid + 1, right);
  }
}


x86 assembly (clang, -O0):
<_quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1171 <_quick_sort+0x51>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <_split@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <_quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <_quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edx
jle    1165 <_quick_sort+0x45>
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <_split@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <_quick_sort@plt>
add    $0x1,%ebp
mov    %ebp,%ebx
cmp    %r14d,%ebp
jl     1140 <_quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @_quick_sort(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
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @_split(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
br label %23
23: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @_quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %1, %3 ]
%7 = tail call i32 @_split(i32* %0, i32 %6, i32 %2)
tail call void @_quick_sort(i32* %0, i32 %6, i32 %7)
%8 = add nsw i32 %7, 1
%9 = icmp slt i32 %8, %2
br i1 %9, label %5, label %10
10: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
void ignore_spaces_print(const char *str) {
  const char *c = str;
  while (*c) {
    if (*c != ' ') {
      printf("%c", *c);
    }
    c++;
  }
}


x86 assembly (clang, -O0):
<ignore_spaces_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1165 <ignore_spaces_print+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1154 <ignore_spaces_print+0x44>
mov    -0x10(%rbp),%rax
lea    0xeb4(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <ignore_spaces_print+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_spaces_print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
jmp    1124 <ignore_spaces_print+0x14>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x20,%al
je     1120 <ignore_spaces_print+0x10>
test   %al,%al
je     113c <ignore_spaces_print+0x2c>
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1120 <ignore_spaces_print+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @ignore_spaces_print(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %18, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %21
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 %18
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %16)
br label %18
18: ; preds = %14, %9
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %5
21: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @ignore_spaces_print(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %8, %7 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %9
i8 32, label %7
]
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
br label %7
7: ; preds = %2, %5
%8 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
9: ; preds = %2
ret void
}
unsigned getl32(const unsigned char *buf) {
  unsigned long v;
  v = (unsigned long)buf[0];
  v |= (unsigned long)buf[1] << 8;
  v |= (unsigned long)buf[2] << 16;
  v |= (unsigned long)buf[3] << 24;
  return v;
}


x86 assembly (clang, -O0):
<getl32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x10,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getl32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ glRasterPos2f(float, float);
int /*<<< orphan*/ glutBitmapCharacter(void *, char);
void drawText(float x, float y, void *font, char *text) {
  char *p;
  glRasterPos2f(x, y);
  for (p = text; *p; ++p) {
    glutBitmapCharacter(font, *p);
  }
}


x86 assembly (clang, -O0):
<drawText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <glRasterPos2f@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     117f <drawText+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
movsbl (%rax),%esi
call   1030 <glutBitmapCharacter@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1151 <drawText+0x31>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawText>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <glRasterPos2f@plt>
mov    (%rbx),%al
test   %al,%al
je     1156 <drawText+0x36>
add    $0x1,%rbx
nopl   0x0(%rax)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <glutBitmapCharacter@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <drawText+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @drawText(float %0, float %1, i8* %2, i8* nocapture %3) {
%5 = tail call i32 @glRasterPos2f(float %0, float %1)
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %4, %8
%9 = phi i8 [ %13, %8 ], [ %6, %4 ]
%10 = phi i8* [ %12, %8 ], [ %3, %4 ]
%11 = tail call i32 @glutBitmapCharacter(i8* %2, i8 signext %9)
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %8
15: ; preds = %8, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int set_reuseaddr(int socket) {
  int val = 1;
  return setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(int));
}


x86 assembly (clang, -O0):
<set_reuseaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_reuseaddr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @set_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @set_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcomplex32array_(char *x, unsigned int *n) { lookNarray(x, (*n * 32)); }


x86 assembly (clang, -O0):
<lookcomplex32array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x5,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookcomplex32array_>:
mov    (%rsi),%esi
shl    $0x5,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookcomplex32array_(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 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 32
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookcomplex32array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 5
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int uint16_t;
struct p4_field_match_header {
  int dummy;
};

/* Variables and functions */
struct p4_field_match_header *unpack_p4_field_match_header(char *buffer,
                                                           uint16_t offset) {
  return (struct p4_field_match_header *)(buffer + offset);
}


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

x86 assembly (clang, -O2):
<unpack_p4_field_match_header>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
%struct.p4_field_match_header = type { i32 }
define %struct.p4_field_match_header* @unpack_p4_field_match_header(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 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to %struct.p4_field_match_header*
ret %struct.p4_field_match_header* %9
}

LLVM IR (-O2):
%struct.p4_field_match_header = type { i32 }
define %struct.p4_field_match_header* @unpack_p4_field_match_header(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to %struct.p4_field_match_header*
ret %struct.p4_field_match_header* %5
}
/* Variables and functions */
int RAND_MAX;
int /*<<< orphan*/ initiate_randomness();
int rand();
int generate_limited_random_number(int limit) {
  int divisor = RAND_MAX / (limit + 1);
  int number = 0;
  initiate_randomness();
  do {
    number = rand() / divisor;
  } while (number > limit);
  return number;
}


x86 assembly (clang, -O0):
<generate_limited_random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <initiate_randomness@plt>
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114e <generate_limited_random_number+0x2e>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_limited_random_number>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
lea    0x1(%rbx),%ecx
cltd
idiv   %ecx
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <initiate_randomness@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <rand@plt>
cltd
idiv   %ebp
cmp    %ebx,%eax
jg     1140 <generate_limited_random_number+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @generate_limited_random_number(i32 %0) {
%2 = load i32, i32* @RAND_MAX
%3 = add nsw i32 %0, 1
%4 = sdiv i32 %2, %3
%5 = tail call i32 (...) @initiate_randomness()
br label %6
6: ; preds = %6, %1
%7 = tail call i32 (...) @rand()
%8 = sdiv i32 %7, %4
%9 = icmp sgt i32 %8, %0
br i1 %9, label %6, label %10
10: ; preds = %6
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int putchar(int c) {
  while (!((*((volatile uint32_t *)(0x20000004))) & (0x00000001)))
    ;
  *((volatile uint32_t *)(0x20000000)) = (uint32_t)c;
  return c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x20000004,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1126 <putchar+0x26>
jmp    112b <putchar+0x2b>
jmp    1107 <putchar+0x7>
mov    -0x4(%rbp),%ecx
mov    $0x20000000,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
testl  $0x1,0x20000004
je     1110 <putchar+0x10>
mov    %eax,0x20000000
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i32, i32* inttoptr (i64 536870916 to i32*)
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
store volatile i32 %10, i32* inttoptr (i64 536870912 to i32*)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 536870916 to i32*)
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i32 %0, i32* inttoptr (i64 536870912 to i32*)
ret i32 %0
}
int casasDecimais(int num) {
  int aux, casas = 1;
  aux = num / 10;
  while (aux != 0) {
    casas++;
    aux = aux / 10;
  }
  return casas;
}


x86 assembly (clang, -O0):
<casasDecimais>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1142 <casasDecimais+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    111c <casasDecimais+0x1c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<casasDecimais>:
lea    0x9(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x13,%ecx
jb     1145 <casasDecimais+0x45>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    $0x1,%eax
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1120 <casasDecimais+0x20>
ret

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

LLVM IR (-O2):
define i32 @casasDecimais(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = sdiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = add nsw i32 %7, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
void foo() {
  int n = 0;
  while (1) {
    int i[n % 1];
    n++;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
jmp    110f <foo+0xf>

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 0, i32* %1
br label %4
4: ; preds = %0, %4
%5 = load i32, i32* %1
%6 = srem i32 %5, 1
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %2
%9 = alloca i32, i64 %7
store i64 %7, i64* %3
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
%12 = load i8*, i8** %2
br label %4
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %1, %0
br label %1
}
unsigned long rho_ruby_create_byte_array(unsigned char *buf, int length) {
  return 0;
}


x86 assembly (clang, -O0):
<rho_ruby_create_byte_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @rho_ruby_create_byte_array(i8* nocapture readnone %0, i32 %1) {
ret i64 0
}
exit(n) int n;
{
  cleenup();
  _exit(n);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <cleenup@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <cleenup@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleenup()
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define i32 @exit(i32 %0) {
%2 = tail call i32 (...) @cleenup()
tail call void @_exit(i32 %0)
unreachable
}
void NEOMOTE_1_DELAY_COUNTER_SaveConfig(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_window_iconify() {
ret void
}
unsigned int fibo(unsigned int x) {
  if (x <= 2)
    return 1;
  else
    return fibo(x - 1) + fibo(x - 2);
}


x86 assembly (clang, -O0):
<fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
ja     1131 <fibo+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fibo+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jb     1145 <fibo+0x35>
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
call   1030 <fibo@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x2,%ebx
ja     1130 <fibo+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibo(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add i32 %4, -1
%7 = tail call i32 @fibo(i32 %6)
%8 = add i32 %4, -2
%9 = add i32 %7, %5
%10 = icmp ult i32 %8, 3
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void matrix_print_topline(FILE *stream, unsigned innerWidth) {
  fputc('+', stream);
  for (; innerWidth > 0; innerWidth--)
    fputc('-', stream);
  fputc('+', stream);
  fputc('\n', stream);
}


x86 assembly (clang, -O0):
<matrix_print_topline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x2b,%edi
call   1030 <fputc@plt>
cmpl   $0x0,-0xc(%rbp)
jbe    1153 <matrix_print_topline+0x43>
mov    -0x8(%rbp),%rsi
mov    $0x2d,%edi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <matrix_print_topline+0x1d>
mov    -0x8(%rbp),%rsi
mov    $0x2b,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_print_topline>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x2b,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
test   %ebp,%ebp
je     1142 <matrix_print_topline+0x32>
nopl   0x0(%rax)
mov    $0x2d,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1130 <matrix_print_topline+0x20>
mov    $0x2b,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @matrix_print_topline(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @fputc(i8 signext 43, i32* %5)
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %4
%9 = icmp ugt i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = call i32 @fputc(i8 signext 45, i32* %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %4
%15 = add i32 %14, -1
store i32 %15, i32* %4
br label %7
16: ; preds = %7
%17 = load i32*, i32** %3
%18 = call i32 @fputc(i8 signext 43, i32* %17)
%19 = load i32*, i32** %3
%20 = call i32 @fputc(i8 signext 10, i32* %19)
ret void
}

LLVM IR (-O2):
define void @matrix_print_topline(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fputc(i8 signext 43, i32* %0)
%4 = icmp eq i32 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %1, %2 ]
%7 = tail call i32 @fputc(i8 signext 45, i32* %0)
%8 = add i32 %6, -1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = tail call i32 @fputc(i8 signext 43, i32* %0)
%12 = tail call i32 @fputc(i8 signext 10, i32* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void LCDIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000005C))) = ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<LCDIntClear>:
mov    %rsi,0x5c(%rdi)
ret

LLVM IR (-O0):
define void @LCDIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 92
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @LCDIntClear(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 92
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RAND_pseudo_bytes(unsigned char *, int const);
void cryptoRand(unsigned char *buf, const int buf_size) {
  RAND_pseudo_bytes(buf, buf_size);
}


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

x86 assembly (clang, -O2):
<cryptoRand>:
jmp    1030 <RAND_pseudo_bytes@plt>

LLVM IR (-O0):
define void @cryptoRand(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 = load i32, i32* %4
%7 = call i32 @RAND_pseudo_bytes(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @cryptoRand(i8* %0, i32 %1) {
%3 = tail call i32 @RAND_pseudo_bytes(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rand_r(unsigned int *);
void randomGenerator(unsigned int *seedp) { rand_r(seedp); }


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

x86 assembly (clang, -O2):
<randomGenerator>:
jmp    1030 <rand_r@plt>

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

LLVM IR (-O2):
define void @randomGenerator(i32* %0) {
%2 = tail call i32 @rand_r(i32* %0)
ret void
}
/* Variables and functions */
double randum_();
double randum() { return randum_(); }


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

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

LLVM IR (-O0):
define double @randum() {
%1 = call double (...) @randum_()
ret double %1
}

LLVM IR (-O2):
define double @randum() {
%1 = tail call double (...) @randum_()
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sub(int, int);
int main() {
  int n, a;
  scanf("%d", &n);
  a = n;
  sub(n, a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
mov    %edi,%esi
call   1040 <sub@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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


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

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

LLVM IR (-O0):
define i32 @is_simd_cpu() {
ret i32 1
}

LLVM IR (-O2):
define i32 @is_simd_cpu() {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t unicode_reverse_codepoint_utf32(uint32_t code_point, bool reverse) {
  if (reverse)
    return ((code_point << 24) & 0xFF000000) |
           ((code_point << 8) & 0x00FF0000) | ((code_point >> 8) & 0x0000FF00) |
           ((code_point >> 24) & 0x000000FF);
  else
    return code_point;
}


x86 assembly (clang, -O0):
<unicode_reverse_codepoint_utf32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1151 <unicode_reverse_codepoint_utf32+0x51>
mov    -0x8(%rbp),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <unicode_reverse_codepoint_utf32+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_reverse_codepoint_utf32>:
test   %esi,%esi
mov    %edi,%eax
bswap  %eax
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @unicode_reverse_codepoint_utf32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %24
8: ; preds = %2
%9 = load i32, i32* %4
%10 = shl i32 %9, 24
%11 = and i32 %10, -16777216
%12 = load i32, i32* %4
%13 = shl i32 %12, 8
%14 = and i32 %13, 16711680
%15 = or i32 %11, %14
%16 = load i32, i32* %4
%17 = ashr i32 %16, 8
%18 = and i32 %17, 65280
%19 = or i32 %15, %18
%20 = load i32, i32* %4
%21 = ashr i32 %20, 24
%22 = and i32 %21, 255
%23 = or i32 %19, %22
store i32 %23, i32* %3
br label %26
24: ; preds = %2
%25 = load i32, i32* %4
store i32 %25, i32* %3
br label %26
26: ; preds = %24, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @unicode_reverse_codepoint_utf32(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = tail call i32 @llvm.bswap.i32(i32 %0)
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *twkb2esriJSON_fromFile(char *, int);
char *test_esrijson_filereading() {
  char *file_name = "testdata/kommuner.twkb";
  char *txt = twkb2esriJSON_fromFile(file_name, 32633);
  printf("%s\n", txt);
  free(txt);
  return 0;
}


x86 assembly (clang, -O0):
<test_esrijson_filereading>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x7f79,%esi
call   1050 <twkb2esriJSON_fromFile@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_esrijson_filereading>:
push   %rbx
lea    0xec8(%rip),%rdi
mov    $0x7f79,%esi
call   1050 <twkb2esriJSON_fromFile@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"testdata/kommuner.twkb\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i8* @test_esrijson_filereading() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i8* @twkb2esriJSON_fromFile(i8* %3, i32 32633)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
ret i8* null
}

LLVM IR (-O2):
@.str = [23 x i8] c"testdata/kommuner.twkb\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define noalias i8* @test_esrijson_filereading() {
%1 = tail call i8* @twkb2esriJSON_fromFile(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 32633)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i8* null
}
int get_mnemonic_type(int m, int *o) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @get_mnemonic_type(i32 %0, i32* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void _test_end(const char *func) { fprintf(stderr, "SUCCESS: '%s'\n", func); }


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"SUCCESS: '%s'\0A\00"
define void @_test_end(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
const char *_EXEEXT() { return 0; }


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

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

LLVM IR (-O0):
define i8* @_EXEEXT() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_EXEEXT() {
ret i8* null
}
int clamp(int value, int min, int max) {
  return (value < min) ? min : (value > max) ? max : value;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <clamp+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ GMP_RNDU;
int /*<<< orphan*/ mpfr_set_default_rounding_mode(int /*<<< orphan*/);
double add_hi(double x, double y) {
  mpfr_set_default_rounding_mode(GMP_RNDU);
  ;
  return (x + y);
}


x86 assembly (clang, -O0):
<add_hi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_hi>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@GMP_RNDU = global i32 0
define double @add_hi(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load i32, i32* @GMP_RNDU
%6 = call i32 @mpfr_set_default_rounding_mode(i32 %5)
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fadd double %7, %8
ret double %9
}

LLVM IR (-O2):
@GMP_RNDU = global i32 0
define double @add_hi(double %0, double %1) {
%3 = load i32, i32* @GMP_RNDU
%4 = tail call i32 @mpfr_set_default_rounding_mode(i32 %3)
%5 = fadd double %0, %1
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int mystrlen(const char *string) {
  int length = 0;
  while (*string++)
    length++;
  printf("This should not be called.\n");
  return length;
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1149 <mystrlen+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <mystrlen+0x13>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
push   %rbx
cmpb   $0x0,(%rdi)
je     112d <mystrlen+0x1d>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1120 <mystrlen+0x10>
jmp    112f <mystrlen+0x1f>
xor    %ebx,%ebx
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"This should not be called.\0A\00"
define i32 @mystrlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %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 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@str = [27 x i8] c"This should not be called.\00"
define i32 @mystrlen(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 i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %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 i32 [ 0, %1 ], [ %8, %4 ]
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 %12
}
int do_139() { return 139; }


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

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

LLVM IR (-O0):
define i32 @do_139() {
ret i32 139
}

LLVM IR (-O2):
define i32 @do_139() {
ret i32 139
}
void XESetWireToError() {}


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

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

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

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