xunge/DecIR huggingface dataset:
void swap(int *t, int i, int j) {
  int aux;
  aux = t[i];
  t[i] = t[j];
  t[j] = aux;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
unsigned short checkButtons();
int /*<<< orphan*/ usleep(int);
unsigned short getButtons() {
  unsigned short state1, state2;
  do {
    state1 = checkButtons();
    usleep(10 * 1000);
    state2 = checkButtons();
  } while (state1 != state2);
  return state1;
}


x86 assembly (clang, -O0):
<getButtons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <checkButtons@plt>
mov    %ax,-0x2(%rbp)
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    $0x0,%al
call   1030 <checkButtons@plt>
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jne    1128 <getButtons+0x8>
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getButtons>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <checkButtons@plt>
mov    %eax,%ebx
mov    $0x2710,%edi
call   1040 <usleep@plt>
xor    %eax,%eax
call   1030 <checkButtons@plt>
cmp    %ax,%bx
jne    1130 <getButtons+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @getButtons() {
%1 = alloca i16
%2 = alloca i16
br label %3
3: ; preds = %7, %0
%4 = call zeroext i16 (...) @checkButtons()
store i16 %4, i16* %1
%5 = call i32 @usleep(i32 10000)
%6 = call zeroext i16 (...) @checkButtons()
store i16 %6, i16* %2
br label %7
7: ; preds = %3
%8 = load i16, i16* %1
%9 = zext i16 %8 to i32
%10 = load i16, i16* %2
%11 = zext i16 %10 to i32
%12 = icmp ne i32 %9, %11
br i1 %12, label %3, label %13
13: ; preds = %7
%14 = load i16, i16* %1
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @getButtons() {
br label %1
1: ; preds = %1, %0
%2 = tail call zeroext i16 (...) @checkButtons()
%3 = tail call i32 @usleep(i32 10000)
%4 = tail call zeroext i16 (...) @checkButtons()
%5 = icmp eq i16 %2, %4
br i1 %5, label %6, label %1
6: ; preds = %1
ret i16 %2
}
int main(void) {
  int x;
  x;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLshort;

/* Variables and functions */
int /*<<< orphan*/ glVertex2s(int /*<<< orphan*/, int /*<<< orphan*/);
void Vertex2s(GLshort x, GLshort y) { glVertex2s(x, y); }


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

x86 assembly (clang, -O2):
<Vertex2s>:
jmp    1030 <glVertex2s@plt>

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

LLVM IR (-O2):
define void @Vertex2s(i32 %0, i32 %1) {
%3 = tail call i32 @glVertex2s(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void pausarExibicao() {
  printf("\nPressione qualquer tecla para continuar");
  getchar();
  getchar();
}


x86 assembly (clang, -O0):
<pausarExibicao>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [41 x i8] c"\0APressione qualquer tecla para continuar\00"
define void @pausarExibicao() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
%3 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"\0APressione qualquer tecla para continuar\00"
define void @pausarExibicao() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 (...) @getchar()
ret void
}
void genmultu() {}


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

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

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

LLVM IR (-O2):
define void @genmultu() {
ret void
}
int config_MODULE_GBOX(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @config_MODULE_GBOX() {
ret i32 1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ set_matrix_limits(int /*<<< orphan*/, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
int set_default_matrix_limits(void) {
  set_matrix_limits(0, 0, 0);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<set_default_matrix_limits>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <set_matrix_limits@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_default_matrix_limits>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <set_matrix_limits@plt>
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @set_default_matrix_limits() {
%1 = call i32 @set_matrix_limits(i32 0, i32 0, i32 0)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @set_default_matrix_limits() {
%1 = tail call i32 @set_matrix_limits(i32 0, i32 0, i32 0)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
unsigned short ZExt(unsigned short targ) { return targ; }


x86 assembly (clang, -O0):
<ZExt>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i16 @ZExt(i16 returned zeroext %0) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void free_yuv_buffers(unsigned char *yuv[3]) {
  free(yuv[0]);
  free(yuv[1]);
  free(yuv[2]);
  yuv[0] = yuv[1] = yuv[2] = NULL;
}


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

x86 assembly (clang, -O2):
<free_yuv_buffers>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    0x8(%rbx),%rdi
call   1030 <free@plt>
mov    0x10(%rbx),%rdi
call   1030 <free@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%rbx)
movq   $0x0,0x10(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @free_yuv_buffers(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
%7 = load i8**, i8*** %2
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @free(i8* %9)
%11 = load i8**, i8*** %2
%12 = getelementptr inbounds i8*, i8** %11, i64 2
%13 = load i8*, i8** %12
%14 = call i32 @free(i8* %13)
%15 = load i8**, i8*** %2
%16 = getelementptr inbounds i8*, i8** %15, i64 2
store i8* null, i8** %16
%17 = load i8**, i8*** %2
%18 = getelementptr inbounds i8*, i8** %17, i64 1
store i8* null, i8** %18
%19 = load i8**, i8*** %2
%20 = getelementptr inbounds i8*, i8** %19, i64 0
store i8* null, i8** %20
ret void
}

LLVM IR (-O2):
define void @free_yuv_buffers(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
%4 = getelementptr inbounds i8*, i8** %0, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @free(i8* %5)
%7 = getelementptr inbounds i8*, i8** %0, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @free(i8* %8)
%10 = bitcast i8** %0 to i8*
ret void
}
/* Variables and functions */
int leernumero();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num = 0;
  num = leernumero();
  printf("El numero que has escrito es: %d", num);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"El numero que has escrito es: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @leernumero()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"El numero que has escrito es: %d\00"
define i32 @main() {
%1 = tail call i32 (...) @leernumero()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned int mini_strlen(const char *s) {
  unsigned int len = 0;
  while (s[len++])
    ;
  return len;
}


x86 assembly (clang, -O0):
<mini_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    %ecx,%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <mini_strlen+0x2f>
jmp    110f <mini_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mini_strlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rcx,1)
jne    1110 <mini_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @mini_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %4, %2 ]
%4 = add i32 %3, 1
%5 = zext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t si470x_tuneup() {}


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

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

LLVM IR (-O0):
define i32 @si470x_tuneup() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @si470x_tuneup() {
ret i32 undef
}
char getPair(char c) {
  switch (c) {
  case '(':
    return ')';
  case '{':
    return '}';
  case '[':
    return ']';
  default:
    return 'X';
  }
}


x86 assembly (clang, -O0):
<getPair>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x28,%eax
je     1141 <getPair+0x41>
jmp    111f <getPair+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x5b,%eax
je     1153 <getPair+0x53>
jmp    1130 <getPair+0x30>
mov    -0x8(%rbp),%eax
sub    $0x7b,%eax
je     114a <getPair+0x4a>
jmp    115c <getPair+0x5c>
movb   $0x29,-0x1(%rbp)
jmp    1160 <getPair+0x60>
movb   $0x7d,-0x1(%rbp)
jmp    1160 <getPair+0x60>
movb   $0x5d,-0x1(%rbp)
jmp    1160 <getPair+0x60>
movb   $0x58,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPair>:
cmp    $0x28,%edi
je     1112 <getPair+0x12>
cmp    $0x5b,%edi
je     1115 <getPair+0x15>
cmp    $0x7b,%edi
jne    1118 <getPair+0x18>
mov    $0x7d,%al
ret
mov    $0x29,%al
ret
mov    $0x5d,%al
ret
mov    $0x58,%al
ret

LLVM IR (-O0):
define signext i8 @getPair(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 40, label %6
i32 123, label %7
i32 91, label %8
]
6: ; preds = %1
store i8 41, i8* %2
br label %10
7: ; preds = %1
store i8 125, i8* %2
br label %10
8: ; preds = %1
store i8 93, i8* %2
br label %10
9: ; preds = %1
store i8 88, i8* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @getPair(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 40, label %6
i32 123, label %3
i32 91, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i8 [ 88, %5 ], [ 93, %4 ], [ 125, %3 ], [ 41, %1 ]
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int unaddr_test1(int *val_p) {
  int x = 1;
  printf("testing access after free\n");
  return (*val_p & x) ? 1 : 0;
}


x86 assembly (clang, -O0):
<unaddr_test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaddr_test1>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%eax
and    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"testing access after free\0A\00"
define i32 @unaddr_test1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = load i32, i32* %3
%8 = and i32 %6, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
@str = [26 x i8] c"testing access after free\00"
define i32 @unaddr_test1(i32* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* %0
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int, int);
int /*<<< orphan*/ stderr;
void print_block(uint32_t (*block)[4]) {
  fprintf(stderr, "Block: %08x %08x %08x %08x\n", (*block)[0], (*block)[1],
          (*block)[2], (*block)[3]);
}


x86 assembly (clang, -O0):
<print_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r9d
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_block>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%edx
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%r8d
mov    0xc(%rdi),%r9d
lea    0xed3(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Block: %08x %08x %08x %08x\0A\00"
define void @print_block([4 x i32]* %0) {
%2 = alloca [4 x i32]*
store [4 x i32]* %0, [4 x i32]** %2
%3 = load i32, i32* @stderr
%4 = load [4 x i32]*, [4 x i32]** %2
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = load [4 x i32]*, [4 x i32]** %2
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 1
%9 = load i32, i32* %8
%10 = load [4 x i32]*, [4 x i32]** %2
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 2
%12 = load i32, i32* %11
%13 = load [4 x i32]*, [4 x i32]** %2
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 3
%15 = load i32, i32* %14
%16 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9, i32 %12, i32 %15)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Block: %08x %08x %08x %08x\0A\00"
define void @print_block([4 x i32]* nocapture %0) {
%2 = load i32, i32* @stderr
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 2
%8 = load i32, i32* %7
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 3
%10 = load i32, i32* %9
%11 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8, i32 %10)
ret void
}
/* Variables and functions */
void memrev16(void *p) {
  unsigned char *x = p, t;
  t = x[0];
  x[0] = x[1];
  x[1] = t;
}


x86 assembly (clang, -O0):
<memrev16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<memrev16>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @memrev16(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i8, i8* %4
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @memrev16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
ret void
}
char JsonParser_prev_char(const char *p, int pos) {
  char ch;
  while ((ch = *(p + --pos)) != '\0') {
    if (ch != ' ' && ch != '\r' && ch != '\n' && ch != '\t')
      break;
  }
  return ch;
}


x86 assembly (clang, -O0):
<JsonParser_prev_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     116b <JsonParser_prev_char+0x6b>
movsbl -0xd(%rbp),%eax
cmp    $0x20,%eax
je     1166 <JsonParser_prev_char+0x66>
movsbl -0xd(%rbp),%eax
cmp    $0xd,%eax
je     1166 <JsonParser_prev_char+0x66>
movsbl -0xd(%rbp),%eax
cmp    $0xa,%eax
je     1166 <JsonParser_prev_char+0x66>
movsbl -0xd(%rbp),%eax
cmp    $0x9,%eax
je     1166 <JsonParser_prev_char+0x66>
jmp    116b <JsonParser_prev_char+0x6b>
jmp    110b <JsonParser_prev_char+0xb>
movsbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<JsonParser_prev_char>:
movslq %esi,%rax
lea    (%rax,%rdi,1),%rcx
add    $0xffffffffffffffff,%rcx
movabs $0x100002600,%rdx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rcx),%eax
cmp    $0x20,%rax
ja     1135 <JsonParser_prev_char+0x35>
bt     %rax,%rdx
jae    1135 <JsonParser_prev_char+0x35>
add    $0xffffffffffffffff,%rcx
jmp    1120 <JsonParser_prev_char+0x20>
ret

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

LLVM IR (-O2):
define signext i8 @JsonParser_prev_char(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %9, %2
%5 = phi i64 [ %3, %2 ], [ %6, %9 ]
%6 = add nsw i64 %5, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
switch i8 %8, label %10 [
i8 9, label %9
i8 32, label %9
i8 13, label %9
i8 10, label %9
]
9: ; preds = %4, %4, %4, %4
br label %4
10: ; preds = %4
ret i8 %8
}
void gendaddi() {}


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

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

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

LLVM IR (-O2):
define void @gendaddi() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_raw_clib_object(void *, void **);
void *get_value_c_map(void *pObject) {
  void *elem;
  get_raw_clib_object(pObject, &elem);
  return elem;
}


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

x86 assembly (clang, -O2):
<get_value_c_map>:
push   %rax
mov    %rsp,%rsi
call   1030 <get_raw_clib_object@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @get_value_c_map(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @get_raw_clib_object(i8* %0, i8** %2)
%5 = load i8*, i8** %2
ret i8* %5
}
/* Variables and functions */
double floor(double const);
double duration_round(const double duration) {
  return floor((duration * 100.0) + 0.5) / 100.0;
}


x86 assembly (clang, -O0):
<duration_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  0xeb9(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<duration_round>:
push   %rax
mulsd  0xee7(%rip),%xmm0
addsd  0xee7(%rip),%xmm0
call   1030 <floor@plt>
divsd  0xed2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @duration_round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double %3, double 1.000000e+02, double 5.000000e-01)
%5 = call double @llvm.floor.f64(double %4)
%6 = fdiv double %5, 1.000000e+02
ret double %6
}

LLVM IR (-O2):
define double @duration_round(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.000000e+02, double 5.000000e-01)
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fdiv double %3, 1.000000e+02
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void good() {
  printf("You Win - Key would be here on server.");
  fflush(stdout);
  exit(666);
}


x86 assembly (clang, -O0):
<good>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x29a,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<good>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x29a,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"You Win - Key would be here on server.\00"
@stdout = global i32 0
define void @good() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call i32 @exit(i32 666)
unreachable
}

LLVM IR (-O2):
@.str = [39 x i8] c"You Win - Key would be here on server.\00"
@stdout = global i32 0
define void @good() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 @exit(i32 666)
unreachable
}
char *trunc_mname(char *mname) {
  char *p = mname;
  while (*p && *p != '_')
    p++;
  return *p ? p + 1 : mname;
}


x86 assembly (clang, -O0):
<trunc_mname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1135 <trunc_mname+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1145 <trunc_mname+0x45>
jmp    1156 <trunc_mname+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <trunc_mname+0x10>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1177 <trunc_mname+0x77>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    117f <trunc_mname+0x7f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunc_mname>:
lea    0x1(%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl -0x1(%rax),%ecx
test   %cl,%cl
je     1123 <trunc_mname+0x23>
cmp    $0x5f,%cl
je     1123 <trunc_mname+0x23>
add    $0x1,%rax
jmp    1110 <trunc_mname+0x10>
test   %cl,%cl
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @trunc_mname(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 = %17, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 95
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ false, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
br label %5
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 1
br label %30
28: ; preds = %20
%29 = load i8*, i8** %2
br label %30
30: ; preds = %28, %25
%31 = phi i8* [ %27, %25 ], [ %29, %28 ]
ret i8* %31
}

LLVM IR (-O2):
define i8* @trunc_mname(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 95, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
%8 = icmp eq i8 %4, 0
%9 = getelementptr inbounds i8, i8* %3, i64 1
%10 = select i1 %8, i8* %0, i8* %9
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int, int, int);
main() { foo(1, 2, 3, 4); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo(i32 1, i32 2, i32 3, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 2, i32 3, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int setConfigIntValue(char *, int);
int setDbVersion(int version) {
  if (version < 2) {
    assert(0);
  } else {
    return setConfigIntValue("db.version", version);
  }
}


x86 assembly (clang, -O0):
<setDbVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1141 <setDbVersion+0x21>
xor    %edi,%edi
call   1030 <assert@plt>
jmp    1153 <setDbVersion+0x33>
mov    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1040 <setConfigIntValue@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDbVersion>:
cmp    $0x1,%edi
jg     112c <setDbVersion+0xc>
xor    %edi,%edi
jmp    1030 <assert@plt>
mov    %edi,%esi
lea    0xecb(%rip),%rdi
jmp    1040 <setConfigIntValue@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"db.version\00"
define i32 @setDbVersion(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @assert(i32 0)
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @setConfigIntValue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"db.version\00"
define i32 @setDbVersion(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @assert(i32 0)
br label %7
5: ; preds = %1
%6 = tail call i32 @setConfigIntValue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ undef, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popreal32array(void *x, int n) {
  popNarray((char *)x, (unsigned int)(n * 32));
}


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

x86 assembly (clang, -O2):
<popreal32array>:
shl    $0x5,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popreal32array(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 = mul nsw i32 %6, 32
%8 = call i32 @popNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @popreal32array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 5
%4 = tail call i32 @popNarray(i8* %0, i32 %3)
ret void
}
void DBGFR3MemScan(void) {}


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

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

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

LLVM IR (-O2):
define void @DBGFR3MemScan() {
ret void
}
/* Variables and functions */
char *get_extension(char const *);
int strfind(char const *, char const *);
int match_extension(const char *filename, const char *extlist) {
  const char *r;
  r = get_extension(filename);
  if (*r == '.') {
    return strfind(extlist, r + 1);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<match_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_extension@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1166 <match_extension+0x46>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
call   1040 <strfind@plt>
mov    %eax,-0x4(%rbp)
jmp    116d <match_extension+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_extension>:
push   %rbx
mov    %rsi,%rbx
call   1030 <get_extension@plt>
cmpb   $0x2e,(%rax)
jne    113e <match_extension+0x1e>
add    $0x1,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <strfind@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @match_extension(i8* %0, i8* %1) {
%3 = tail call i8* @get_extension(i8* %0)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 46
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = tail call i32 @strfind(i8* %1, i8* %7)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_get_unique_name(void *bus, const char **unique) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_get_unique_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_get_unique_name>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_get_unique_name(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ vff_init(float, int, int);
void vff_realign(float z_meas) { vff_init(z_meas, 0., 0.); }


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

x86 assembly (clang, -O2):
<vff_realign>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <vff_init@plt>

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

LLVM IR (-O2):
define void @vff_realign(float %0) {
%2 = tail call i32 @vff_init(float %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  int i;
  for (i = 5; i > 0; i--) {
    printf("%5d", '*');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114f <main+0x3f>
lea    0xec9(%rip),%rdi
mov    $0x2a,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%5d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 42)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%5d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 42)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 42)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 42)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 42)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 42)
ret i32 0
}
unsigned int my_rand(unsigned int state) {
  return state * 1664525L + 1013904223L;
}


x86 assembly (clang, -O0):
<my_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x19660d,%rax,%rax
add    $0x3c6ef35f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand>:
imul   $0x19660d,%edi,%eax
add    $0x3c6ef35f,%eax
ret

LLVM IR (-O0):
define i32 @my_rand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = mul nsw i64 %4, 1664525
%6 = add nsw i64 %5, 1013904223
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @my_rand(i32 %0) {
%2 = mul i32 %0, 1664525
%3 = add i32 %2, 1013904223
ret i32 %3
}
/* Variables and functions */
int PTHREAD_MUTEX_NORMAL;
void test_PTHREAD_MUTEX_NORMAL(void) {
  int dummy = PTHREAD_MUTEX_NORMAL;
  (void)dummy;
}


x86 assembly (clang, -O0):
<test_PTHREAD_MUTEX_NORMAL>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
@PTHREAD_MUTEX_NORMAL = global i32 0
define void @test_PTHREAD_MUTEX_NORMAL() {
ret void
}
/* Type definitions */
struct B {
  int dummy;
};

/* Variables and functions */
int B_write_delimited_to(struct B *, void *, int);
int write_raw_varint32(int, void *, int);
int B_write_with_tag(struct B *_B, void *_buffer, int offset, int tag) {
  offset = write_raw_varint32((tag << 3) + 2, _buffer, offset);
  offset = B_write_delimited_to(_B, _buffer, offset);
  return offset;
}


x86 assembly (clang, -O0):
<B_write_with_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
shl    $0x3,%edi
add    $0x2,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <write_raw_varint32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <B_write_delimited_to@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<B_write_with_tag>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x2(,%rcx,8),%edi
call   1040 <write_raw_varint32@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <B_write_delimited_to@plt>

LLVM IR (-O0):
%struct.B = type { i32 }
define i32 @B_write_with_tag(%struct.B* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.B*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store %struct.B* %0, %struct.B** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = shl i32 %9, 3
%11 = add nsw i32 %10, 2
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 @write_raw_varint32(i32 %11, i8* %12, i32 %13)
store i32 %14, i32* %7
%15 = load %struct.B*, %struct.B** %5
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = call i32 @B_write_delimited_to(%struct.B* %15, i8* %16, i32 %17)
store i32 %18, i32* %7
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
%struct.B = type { i32 }
define i32 @B_write_with_tag(%struct.B* %0, i8* %1, i32 %2, i32 %3) {
%5 = shl i32 %3, 3
%6 = or i32 %5, 2
%7 = tail call i32 @write_raw_varint32(i32 %6, i8* %1, i32 %2)
%8 = tail call i32 @B_write_delimited_to(%struct.B* %0, i8* %1, i32 %7)
ret i32 %8
}
int HelpItem164(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem164() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vcode_dump_with_mark(int);
void vcode_dump(void) { vcode_dump_with_mark(-1); }


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

x86 assembly (clang, -O2):
<vcode_dump>:
mov    $0xffffffff,%edi
jmp    1030 <vcode_dump_with_mark@plt>

LLVM IR (-O0):
define void @vcode_dump() {
%1 = call i32 @vcode_dump_with_mark(i32 -1)
ret void
}

LLVM IR (-O2):
define void @vcode_dump() {
%1 = tail call i32 @vcode_dump_with_mark(i32 -1)
ret void
}
/* Type definitions */
typedef scalar_t__ GLushort;
typedef double GLdouble;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void shoveUshort(GLdouble value, int index, void *data) {
  assert(0.0 <= value && value < 65536.0);
  ((GLushort *)data)[index] = (GLushort)value;
}


x86 assembly (clang, -O0):
<shoveUshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     114e <shoveUshort+0x3e>
movsd  0xebd(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cvttsd2si -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shoveUshort>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
movsd  %xmm0,(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
movsd  0xed0(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
cvttsd2si (%rsp),%rax
movslq %ebp,%rcx
mov    %rax,(%rbx,%rcx,8)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @shoveUshort(double %0, i32 %1, i8* %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i8*
store double %0, double* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load double, double* %4
%8 = fcmp ole double 0.000000e+00, %7
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load double, double* %4
%11 = fcmp olt double %10, 6.553600e+04
br label %12
12: ; preds = %9, %3
%13 = phi i1 [ false, %3 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load double, double* %4
%17 = fptosi double %16 to i64
%18 = load i8*, i8** %6
%19 = bitcast i8* %18 to i64*
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i64, i64* %19, i64 %21
store i64 %17, i64* %22
ret void
}

LLVM IR (-O2):
define void @shoveUshort(double %0, i32 %1, i8* nocapture writeonly %2) {
%4 = fcmp oge double %0, 0.000000e+00
%5 = fcmp olt double %0, 6.553600e+04
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = fptosi double %0 to i64
%10 = bitcast i8* %2 to i64*
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds i64, i64* %10, i64 %11
store i64 %9, i64* %12
ret void
}
/* Variables and functions */
int p(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
void runTest(int l, int n) { printf("p(%d, %d) = %d\n", l, n, p(l, n)); }


x86 assembly (clang, -O0):
<runTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <p@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runTest>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <p@plt>
lea    0xecd(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"p(%d, %d) = %d\0A\00"
define void @runTest(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @p(i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"p(%d, %d) = %d\0A\00"
define void @runTest(i32 %0, i32 %1) {
%3 = tail call i32 @p(i32 %0, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}