xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ajout_info_liste(int);
int creation_fichier_liste(char *);
int /*<<< orphan*/ ecriture_s(int);
int lecture(char *);
void liste_referentiel(int ta_socket) {
  int liste_ref = creation_fichier_liste("liste_ref");
  ajout_info_liste(liste_ref);
  while (lecture("liste_ref") == 1)
    ecriture_s(ta_socket);
}


x86 assembly (clang, -O0):
<liste_referentiel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1060 <creation_fichier_liste@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <ajout_info_liste@plt>
lea    0xe97(%rip),%rdi
call   1040 <lecture@plt>
cmp    $0x1,%eax
jne    1184 <liste_referentiel+0x44>
mov    -0x4(%rbp),%edi
call   1030 <ecriture_s@plt>
jmp    1162 <liste_referentiel+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liste_referentiel>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xeb3(%rip),%r14
mov    %r14,%rdi
call   1060 <creation_fichier_liste@plt>
mov    %eax,%edi
call   1050 <ajout_info_liste@plt>
mov    %r14,%rdi
call   1040 <lecture@plt>
cmp    $0x1,%eax
jne    1184 <liste_referentiel+0x44>
lea    0xe90(%rip),%r14
mov    %ebx,%edi
call   1030 <ecriture_s@plt>
mov    %r14,%rdi
call   1040 <lecture@plt>
cmp    $0x1,%eax
je     1170 <liste_referentiel+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"liste_ref\00"
define void @liste_referentiel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @creation_fichier_liste(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @ajout_info_liste(i32 %5)
br label %7
7: ; preds = %10, %1
%8 = call i32 @lecture(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = call i32 @ecriture_s(i32 %11)
br label %7
13: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"liste_ref\00"
define void @liste_referentiel(i32 %0) {
%2 = tail call i32 @creation_fichier_liste(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ajout_info_liste(i32 %2)
%4 = tail call i32 @lecture(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1, %6
%7 = tail call i32 @ecriture_s(i32 %0)
%8 = tail call i32 @lecture(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 1
br i1 %9, label %6, label %10
10: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *, int *);
void checkIntInput(int *a, int *b) {
  if ((scanf("%d %d", a, b)) != 2) {
    printf("Not digit!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkIntInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1177 <checkIntInput+0x47>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkIntInput>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    114a <checkIntInput+0x1a>
pop    %rax
ret
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @checkIntInput(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 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @checkIntInput(i32* %0, i32* %1) {
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1)
%4 = icmp eq i32 %3, 2
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b1outp(unsigned int, int, int);
int /*<<< orphan*/ mdelay(int);
void b1_reset(unsigned int base) {
  b1outp(base, 0x10, 0);
  mdelay(55 * 2);
  b1outp(base, 0x10, 1);
  mdelay(55 * 2);
  b1outp(base, 0x10, 0);
  mdelay(55 * 2);
}


x86 assembly (clang, -O0):
<b1_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <b1outp@plt>
mov    $0x6e,%edi
call   1030 <mdelay@plt>
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
mov    $0x1,%edx
call   1040 <b1outp@plt>
mov    $0x6e,%edi
call   1030 <mdelay@plt>
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <b1outp@plt>
mov    $0x6e,%edi
call   1030 <mdelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b1_reset>:
push   %rbx
mov    %edi,%ebx
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <b1outp@plt>
mov    $0x6e,%edi
call   1030 <mdelay@plt>
mov    %ebx,%edi
mov    $0x10,%esi
mov    $0x1,%edx
call   1040 <b1outp@plt>
mov    $0x6e,%edi
call   1030 <mdelay@plt>
mov    %ebx,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <b1outp@plt>
mov    $0x6e,%edi
pop    %rbx
jmp    1030 <mdelay@plt>

LLVM IR (-O0):
define void @b1_reset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @b1outp(i32 %3, i32 16, i32 0)
%5 = call i32 @mdelay(i32 110)
%6 = load i32, i32* %2
%7 = call i32 @b1outp(i32 %6, i32 16, i32 1)
%8 = call i32 @mdelay(i32 110)
%9 = load i32, i32* %2
%10 = call i32 @b1outp(i32 %9, i32 16, i32 0)
%11 = call i32 @mdelay(i32 110)
ret void
}

LLVM IR (-O2):
define void @b1_reset(i32 %0) {
%2 = tail call i32 @b1outp(i32 %0, i32 16, i32 0)
%3 = tail call i32 @mdelay(i32 110)
%4 = tail call i32 @b1outp(i32 %0, i32 16, i32 1)
%5 = tail call i32 @mdelay(i32 110)
%6 = tail call i32 @b1outp(i32 %0, i32 16, i32 0)
%7 = tail call i32 @mdelay(i32 110)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int s(int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int n, i;
  scanf("%d", &n);
  for (i = 1; s(i) <= n; i++) {
  }
  printf("%d\n", i - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <s@plt>
cmp    -0x14(%rbp),%eax
jg     1181 <main+0x51>
jmp    1173 <main+0x43>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <main+0x2d>
mov    -0x18(%rbp),%esi
sub    $0x1,%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    $0xffffffff,%ebx
nopl   0x0(%rax,%rax,1)
lea    0x2(%rbx),%edi
call   1040 <s@plt>
add    $0x1,%ebx
cmp    0xc(%rsp),%eax
jle    1150 <main+0x20>
lea    0xe9b(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ 1, %2 ], [ %11, %6 ]
%8 = call i32 @s(i32 %7)
%9 = load i32, i32* %3
%10 = icmp sgt i32 %8, %9
%11 = add nuw nsw i32 %7, 1
br i1 %10, label %12, label %6
12: ; preds = %6
%13 = add nsw i32 %7, -1
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *cam_library_create() {
  fprintf(stderr, "This library should not be used\n");
  abort();
  return NULL;
}


x86 assembly (clang, -O0):
<cam_library_create>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<cam_library_create>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"This library should not be used\0A\00"
define i8* @cam_library_create() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"This library should not be used\0A\00"
define noalias i8* @cam_library_create() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int stack_pop(int *stack) {
  if (stack[0] == 0)
    return 0;
  stack[0]--;
  return 1;
}


x86 assembly (clang, -O0):
<stack_pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1121 <stack_pop+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1133 <stack_pop+0x33>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_pop>:
mov    (%rdi),%eax
test   %eax,%eax
je     1111 <stack_pop+0x11>
add    $0xffffffff,%eax
mov    %eax,(%rdi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @stack_pop(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add nsw i32 %2, -1
store i32 %5, i32* %0
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void swap(int *p1, int *p2) {
  int temp = *p1;
  *p1 = *p2;
  *p2 = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
__attribute__((always_)) int rcu_blocking_is_gp(void) { return 1U == 1; }


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

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

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

LLVM IR (-O2):
define i32 @rcu_blocking_is_gp() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int BN_nnmod(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
             int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_sub(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int /*<<< orphan*/ const *);
int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
               BN_CTX *ctx) {
  if (!BN_sub(r, a, b))
    return 0;
  return BN_nnmod(r, r, m, ctx);
}


x86 assembly (clang, -O0):
<BN_mod_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <BN_sub@plt>
cmp    $0x0,%eax
jne    1162 <BN_mod_sub+0x42>
movl   $0x0,-0x4(%rbp)
jmp    117a <BN_mod_sub+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1040 <BN_nnmod@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_mod_sub>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdi,%rbx
call   1030 <BN_sub@plt>
test   %eax,%eax
je     114d <BN_mod_sub+0x2d>
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <BN_nnmod@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @BN_mod_sub(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @BN_sub(i32* %0, i32* %1, i32* %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @BN_nnmod(i32* %0, i32* %0, i32* %3, i32* %4)
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ %9, %8 ], [ 0, %5 ]
ret i32 %11
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int printlock_w39_common(struct flashctx *, int);
int printlock_w39v080a(struct flashctx *flash) {
  return printlock_w39_common(flash, 0xffff2);
}


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

x86 assembly (clang, -O2):
<printlock_w39v080a>:
mov    $0xffff2,%esi
jmp    1030 <printlock_w39_common@plt>

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v080a(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
store %struct.flashctx* %0, %struct.flashctx** %2
%3 = load %struct.flashctx*, %struct.flashctx** %2
%4 = call i32 @printlock_w39_common(%struct.flashctx* %3, i32 1048562)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v080a(%struct.flashctx* %0) {
%2 = tail call i32 @printlock_w39_common(%struct.flashctx* %0, i32 1048562)
ret i32 %2
}
int test_imm_D6uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xd6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D6uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14024704
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int LCM(int a, int b, int gcd) { return (a * b) / gcd; }


x86 assembly (clang, -O0):
<LCM>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCM>:
mov    %edx,%ecx
mov    %edi,%eax
imul   %esi,%eax
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @LCM(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 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = sdiv i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @LCM(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = sdiv i32 %4, %2
ret i32 %5
}
int main(void) {
  int counter;
  for (counter = 0; counter < 5; counter++) {
    int a;
    for (a = 0; a < 5; a++) {
      int b;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1153 <main+0x53>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1140 <main+0x40>
jmp    1132 <main+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
jmp    1145 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
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
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %20
8: ; preds = %5
store i32 0, i32* %3
br label %9
9: ; preds = %13, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 5
br i1 %11, label %12, label %16
12: ; preds = %9
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %9
16: ; preds = %9
br label %17
17: ; preds = %16
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %5
20: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void storeCallback(void *addr) {
  int (*func)(void *) = (int (*)(void *))0x08000541;
  func(addr);
}


x86 assembly (clang, -O0):
<storeCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8000541,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<storeCallback>:
mov    $0x8000541,%eax
jmp    *%rax

LLVM IR (-O0):
define void @storeCallback(i8* %0) {
%2 = alloca i8*
%3 = alloca i32 (i8*)*
store i8* %0, i8** %2
store i32 (i8*)* inttoptr (i64 134219073 to i32 (i8*)*), i32 (i8*)** %3
%4 = load i32 (i8*)*, i32 (i8*)** %3
%5 = load i8*, i8** %2
%6 = call i32 %4(i8* %5)
ret void
}

LLVM IR (-O2):
define void @storeCallback(i8* %0) {
%2 = tail call i32 inttoptr (i64 134219073 to i32 (i8*)*)(i8* %0)
ret void
}
int _gcd(int a, int b) {
  if (!b)
    return (a);
  return (_gcd(b, a % b));
}


x86 assembly (clang, -O0):
<_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <_gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <_gcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <_gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <_gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <_gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_gcd(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 %10, label %8
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @_gcd(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @_gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned long,
                           unsigned int, char const *);
void perf_map_write_entry(FILE *method_file, const void *code_addr,
                          unsigned int code_size, const char *entry) {
  if (method_file) {
    fprintf(method_file, "%lx %x %s\n", (unsigned long)code_addr, code_size,
            entry);
  }
}


x86 assembly (clang, -O0):
<perf_map_write_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114d <perf_map_write_entry+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_map_write_entry>:
test   %rdi,%rdi
je     1129 <perf_map_write_entry+0x19>
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xedc(%rip),%rsi
jmp    1030 <fprintf@plt>
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%lx %x %s\0A\00"
define void @perf_map_write_entry(i32* %0, i8* %1, i32 %2, i8* %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = ptrtoint i8* %1 to i64
%8 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %7, i32 %2, i8* %3)
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
int *malloc(int);
int *int_arr_init(int size) {
  int *array;
  array = malloc(sizeof(int) * size);
  int i;
  for (i = 0; i < size; i++) {
    array[i] = 0;
  }
  return array;
}


x86 assembly (clang, -O0):
<int_arr_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115e <int_arr_init+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <int_arr_init+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_arr_init>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <int_arr_init+0x29>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i32* @int_arr_init(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = bitcast i32* %3 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 2
br label %9
9: ; preds = %5, %1
ret i32* %3
}
int main(void) {
  char temp[11];
  char *p;
  printf("test %d.\n", sum(2, 3));
  memset(temp, 0, sizeof(temp));
  p = setdec(&temp[10], 4294967295);
  printf("ss%s\n", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x0,%al
call   1060 <sum@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xf(%rbp),%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1040 <memset@plt>
lea    -0xf(%rbp),%rdi
add    $0xa,%rdi
mov    $0xffffffff,%esi
mov    $0x0,%al
call   1050 <setdec@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    $0x2,%edi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <sum@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movq   $0x0,0x8(%rsp)
movl   $0x0,0xf(%rsp)
lea    0x12(%rsp),%rdi
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1040 <setdec@plt>
movslq %eax,%rsi
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"test %d.\0A\00"
@.str.1 = [6 x i8] c"ss%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @sum to i32 (i32, i32, ...)*)(i32 2, i32 3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 10
%8 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @setdec to i32 (i8*, i64, ...)*)(i8* %7, i64 4294967295)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"test %d.\0A\00"
@.str.1 = [6 x i8] c"ss%s\0A\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @sum to i32 (i32, i32, ...)*)(i32 2, i32 3)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 10
%6 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @setdec to i32 (i8*, i64, ...)*)(i8* %5, i64 4294967295)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}
void genmtc1() {}


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

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

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

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


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

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

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

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

/* Variables and functions */
uint8_t pad_16(uint32_t num) {
  uint8_t residual_16 = num & 0X0F;
  return (residual_16 == 0) ? 0 : (~residual_16 & 0X0F) + 1;
}


x86 assembly (clang, -O0):
<pad_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <pad_16+0x24>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <pad_16+0x33>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    $0xf,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad_16>:
and    $0xf,%edi
mov    $0x10,%eax
sub    %edi,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @pad_16(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp eq i32 %2, 0
%4 = sub nuw nsw i32 16, %2
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
int clampi(const int in_VALUE, const int in_MIN, const int in_MAX) {
  int result = (in_VALUE < in_MIN) ? in_MIN : in_VALUE;
  return (result > in_MAX) ? in_MAX : result;
}


x86 assembly (clang, -O0):
<clampi>:
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 <clampi+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <clampi+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1147 <clampi+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114d <clampi+0x4d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @clampi(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 = icmp slt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %5
br label %15
13: ; preds = %3
%14 = load i32, i32* %4
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i32, i32* %6
br label %24
22: ; preds = %15
%23 = load i32, i32* %7
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ %23, %22 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @clampi(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
char *getenv(char *);
const char *path_rsync() {
  char *rsync_path;
  rsync_path = getenv("RSYNC_PATH");
  if (rsync_path == NULL)
    rsync_path = "rsync";
  return rsync_path;
}


x86 assembly (clang, -O0):
<path_rsync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <path_rsync+0x2e>
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_rsync>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee4(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"RSYNC_PATH\00"
@.str.1 = [6 x i8] c"rsync\00"
define i8* @path_rsync() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %0
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"RSYNC_PATH\00"
@.str.1 = [6 x i8] c"rsync\00"
define i8* @path_rsync() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
void wait_loop() {
  for (int i = 0; i < sizeof(int); i++) {
    __asm__("PAUSE");
  }
}


x86 assembly (clang, -O0):
<wait_loop>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0x4,%rax
jae    1129 <wait_loop+0x29>
pause
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <wait_loop+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @wait_loop() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = icmp ult i64 %4, 4
br i1 %5, label %6, label %10
6: ; preds = %2
br label %7
7: ; preds = %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @wait_loop() {
tail call void asm sideeffect "PAUSE", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "PAUSE", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "PAUSE", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "PAUSE", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_TYPE_PROG_ARRAY;
int bpf_create_map(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int /*<<< orphan*/);
int create_prog_array(void) {
  int map_fd;
  map_fd = bpf_create_map(BPF_MAP_TYPE_PROG_ARRAY, sizeof(int), sizeof(int), 4);
  if (map_fd < 0)
    printf("failed to create prog_array '%s'\n", strerror(errno));
  return map_fd;
}


x86 assembly (clang, -O0):
<create_prog_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    $0x4,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1040 <bpf_create_map@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1179 <create_prog_array+0x49>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_prog_array>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    $0x4,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
call   1040 <bpf_create_map@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1171 <create_prog_array+0x41>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe97(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@BPF_MAP_TYPE_PROG_ARRAY = global i32 0
@.str = [34 x i8] c"failed to create prog_array '%s'\0A\00"
@errno = global i32 0
define i32 @create_prog_array() {
%1 = alloca i32
%2 = load i32, i32* @BPF_MAP_TYPE_PROG_ARRAY
%3 = call i32 @bpf_create_map(i32 %2, i32 4, i32 4, i32 4)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* @errno
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@BPF_MAP_TYPE_PROG_ARRAY = global i32 0
@.str = [34 x i8] c"failed to create prog_array '%s'\0A\00"
@errno = global i32 0
define i32 @create_prog_array() {
%1 = load i32, i32* @BPF_MAP_TYPE_PROG_ARRAY
%2 = tail call i32 @bpf_create_map(i32 %1, i32 4, i32 4, i32 4)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %4, %0
ret i32 %2
}
void ARGB1555ToARGBRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGB1555ToARGBRow_NEON() {
ret void
}
/* Variables and functions */
char *calloc(int, int);
void callocNoFree() {
  char *buf = calloc(2, 2);
  return;
}


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

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

LLVM IR (-O0):
define void @callocNoFree() {
%1 = alloca i8*
%2 = call i8* @calloc(i32 2, i32 2)
store i8* %2, i8** %1
ret void
}

LLVM IR (-O2):
define void @callocNoFree() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void pr_exit(char *err) {
  perror(err);
  exit(0);
}


x86 assembly (clang, -O0):
<pr_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pr_exit>:
push   %rax
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @pr_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @pr_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_43int32_reg(int val) { return ((val) & (0x43 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_43int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x43,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_43int32_reg>:
test   $0x43,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_43int32_reg(i32 %0) {
%2 = and i32 %0, 67
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *mpgedit_index_build_filename_2(char *, int /*<<< orphan*/ *);
char *mpgedit_index_build_filename(char *path) {
  return mpgedit_index_build_filename_2(path, NULL);
}


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

x86 assembly (clang, -O2):
<mpgedit_index_build_filename>:
xor    %esi,%esi
jmp    1030 <mpgedit_index_build_filename_2@plt>

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

LLVM IR (-O2):
define i8* @mpgedit_index_build_filename(i8* %0) {
%2 = tail call i8* @mpgedit_index_build_filename_2(i8* %0, i32* null)
ret i8* %2
}
/* Variables and functions */
int musbgm_fade(int, int, int);
int mus_bgm_fade(int no, int time, int vol) {
  return musbgm_fade(no, time, vol);
}


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

x86 assembly (clang, -O2):
<mus_bgm_fade>:
jmp    1030 <musbgm_fade@plt>

LLVM IR (-O0):
define i32 @mus_bgm_fade(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 = load i32, i32* %6
%10 = call i32 @musbgm_fade(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @mus_bgm_fade(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @musbgm_fade(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
void default_signals() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_banlist_callback(uint8_t *ip_data, uint32_t ip_data_size,
                             uint32_t mask, char *name, char *hash,
                             char *reason, char *start, int32_t duration,
                             void *user_data) {
  printf("banlist_callback\n");
}


x86 assembly (clang, -O0):
<mumble_banlist_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"banlist_callback\0A\00"
define void @mumble_banlist_callback(i32* %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5, i8* %6, i32 %7, i8* %8) {
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i8*
store i32* %0, i32** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i8* %3, i8** %13
store i8* %4, i8** %14
store i8* %5, i8** %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i8* %8, i8** %18
%19 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"banlist_callback\00"
define void @mumble_banlist_callback(i32* nocapture readnone %0, i32 %1, i32 %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8* nocapture readnone %6, i32 %7, i8* nocapture readnone %8) {
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_ldr(int /*<<< orphan*/);
int /*<<< orphan*/ arm_memio_reg_op();
void arm_ldr_reg() { arm_memio_ldr(arm_memio_reg_op()); }


x86 assembly (clang, -O0):
<arm_ldr_reg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_memio_reg_op@plt>
mov    %eax,%edi
call   1040 <arm_memio_ldr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_ldr_reg>:
push   %rax
xor    %eax,%eax
call   1030 <arm_memio_reg_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_memio_ldr@plt>

LLVM IR (-O0):
define void @arm_ldr_reg() {
%1 = call i32 (...) @arm_memio_reg_op()
%2 = call i32 @arm_memio_ldr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_ldr_reg() {
%1 = tail call i32 (...) @arm_memio_reg_op()
%2 = tail call i32 @arm_memio_ldr(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ bar();
int /*<<< orphan*/ baz(int);
void foo(char c) {
  int i;
  if (bar())
    i = c;
  else
    i = c;
  baz(i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <bar@plt>
cmp    $0x0,%rax
je     114b <foo+0x2b>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <foo+0x32>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <baz@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <bar@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <baz@plt>

LLVM IR (-O0):
define void @foo(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = call i64 (...) @bar()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
store i32 %8, i32* %3
br label %12
9: ; preds = %1
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
store i32 %11, i32* %3
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %3
%14 = call i32 @baz(i32 %13)
ret void
}

LLVM IR (-O2):
define void @foo(i8 signext %0) {
%2 = tail call i64 (...) @bar()
%3 = sext i8 %0 to i32
%4 = tail call i32 @baz(i32 %3)
ret void
}