xunge/DecIR huggingface dataset:
int my_power_rec(int nb, int power) {
  if (power > 1)
    nb *= my_power_rec(nb, power - 1);
  else
    return (0);
  return (nb);
}


x86 assembly (clang, -O0):
<my_power_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1142 <my_power_rec+0x32>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <my_power_rec@plt>
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114e <my_power_rec+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1154 <my_power_rec+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @my_power_rec(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 sgt i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = sub nsw i32 %10, 1
%12 = call i32 @my_power_rec(i32 %9, i32 %11)
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, %12
store i32 %14, i32* %4
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %18
16: ; preds = %8
%17 = load i32, i32* %4
store i32 %17, i32* %3
br label %18
18: ; preds = %16, %15
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @my_power_rec(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
char *get_scheme_list();
int /*<<< orphan*/ printf(char *, char *);
int main(void) { printf("%s\n", get_scheme_list()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_scheme_list@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = call i8* (...) @get_scheme_list()
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @get_scheme_list()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
int password_cache_clear(const char *keygrip) {
  (void)keygrip;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @password_cache_clear(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ special(int *);
void update(int a, int *b, int *c) {
  a += 2;
  *b += 2;
  special(c);
  printf("a = %d, *b = %d, *c = %d.\n", a, *b, *c);
}


x86 assembly (clang, -O0):
<update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
call   1040 <special@plt>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0x2(%rdi),%ebp
addl   $0x2,(%rsi)
mov    %rdx,%rdi
call   1040 <special@plt>
mov    (%rbx),%edx
mov    (%r14),%ecx
lea    0xebc(%rip),%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"a = %d, *b = %d, *c = %d.\0A\00"
define void @update(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 = add nsw i32 %7, 2
store i32 %8, i32* %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 2
store i32 %11, i32* %9
%12 = load i32*, i32** %6
%13 = call i32 @special(i32* %12)
%14 = load i32, i32* %4
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %16, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"a = %d, *b = %d, *c = %d.\0A\00"
define void @update(i32 %0, i32* nocapture %1, i32* %2) {
%4 = add nsw i32 %0, 2
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 2
store i32 %6, i32* %1
%7 = tail call i32 @special(i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %8, i32 %9)
ret void
}
null_u2f(i, vf, cb, sht, flt, dub, intype, inmult, tbuf) int i, inmult, *vf;
char *cb, intype, *tbuf;
short *sht;
float *flt;
double *dub;
{}


x86 assembly (clang, -O0):
<null_u2f>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    %al,-0x31(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @null_u2f(i32 %0, i32* %1, i8* %2, i16* %3, float* %4, double* %5, i32 %6, i32 %7, i8* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i16*
%15 = alloca float*
%16 = alloca double*
%17 = alloca i8
%18 = alloca i32
%19 = alloca i8*
%20 = trunc i32 %6 to i8
store i32 %0, i32* %11
store i32* %1, i32** %12
store i8* %2, i8** %13
store i16* %3, i16** %14
store float* %4, float** %15
store double* %5, double** %16
store i8 %20, i8* %17
store i32 %7, i32* %18
store i8* %8, i8** %19
%21 = load i32, i32* %10
ret i32 %21
}

LLVM IR (-O2):
define i32 @null_u2f(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2, i16* nocapture readnone %3, float* nocapture readnone %4, double* nocapture readnone %5, i32 %6, i32 %7, i8* nocapture readnone %8) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ft_memset(void *, int /*<<< orphan*/, size_t);
scalar_t__ malloc(size_t);
void *ft_memalloc(size_t size) {
  void *ptr;
  ptr = NULL;
  ptr = (void *)malloc(size);
  if (ptr == NULL)
    return (NULL);
  ft_memset(ptr, 0, size);
  return (ptr);
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1159 <ft_memalloc+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1170 <ft_memalloc+0x50>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <ft_memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
test   %rax,%rax
je     1143 <ft_memalloc+0x23>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <ft_memset@plt>
jmp    1145 <ft_memalloc+0x25>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_memalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* null, i8** %4
%5 = load i64, i64* %3
%6 = call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %16
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = load i64, i64* %3
%14 = call i32 @ft_memset(i8* %12, i32 0, i64 %13)
%15 = load i8*, i8** %4
store i8* %15, i8** %2
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @ft_memalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @ft_memset(i8* %3, i32 0, i64 %0)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %3, %5 ], [ null, %1 ]
ret i8* %8
}
int Operand_soffsetx4_rtoa(unsigned int *valp, unsigned int pc) {
  *valp += (pc & ~0x3);
  return 0;
}


x86 assembly (clang, -O0):
<Operand_soffsetx4_rtoa>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xfffffffc,%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_soffsetx4_rtoa>:
and    $0xfffffffc,%esi
add    %esi,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_soffsetx4_rtoa(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, -4
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = add i32 %8, %6
store i32 %9, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_soffsetx4_rtoa(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, -4
%4 = load i32, i32* %0
%5 = add i32 %4, %3
store i32 %5, i32* %0
ret i32 0
}
int max(a, b)
int a, b;
{ return ((a > b) ? a : b); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void add_usage() {
  printf("Usage: add { target | interface | access-list } \n");
}


x86 assembly (clang, -O0):
<add_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [50 x i8] c"Usage: add { target | interface | access-list } \0A\00"
define void @add_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"Usage: add { target | interface | access-list } \00"
define void @add_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret void
}
int a1(int a) { return a == 1; }


x86 assembly (clang, -O0):
<a1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a1>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @a1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @a1(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ function(int, int **);
int /*<<< orphan*/ function1(int, int ***);
void test1() {
  int bork[4][13][15];
  function1(1, bork);
  function(1, bork[2]);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc30,%rsp
lea    -0xc30(%rbp),%rsi
mov    $0x1,%edi
call   1030 <function1@plt>
lea    -0xc30(%rbp),%rsi
add    $0x618,%rsi
mov    $0x1,%edi
call   1040 <function@plt>
add    $0xc30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
sub    $0xc38,%rsp
mov    %rsp,%rsi
mov    $0x1,%edi
call   1030 <function1@plt>
lea    0x618(%rsp),%rsi
mov    $0x1,%edi
call   1040 <function@plt>
add    $0xc38,%rsp
ret

LLVM IR (-O0):
define void @test1() {
%1 = alloca [4 x [13 x [15 x i32]]]
%2 = getelementptr inbounds [4 x [13 x [15 x i32]]], [4 x [13 x [15 x i32]]]* %1, i64 0, i64 0
%3 = bitcast [13 x [15 x i32]]* %2 to i32***
%4 = call i32 @function1(i32 1, i32*** %3)
%5 = getelementptr inbounds [4 x [13 x [15 x i32]]], [4 x [13 x [15 x i32]]]* %1, i64 0, i64 2
%6 = getelementptr inbounds [13 x [15 x i32]], [13 x [15 x i32]]* %5, i64 0, i64 0
%7 = bitcast [15 x i32]* %6 to i32**
%8 = call i32 @function(i32 1, i32** %7)
ret void
}

LLVM IR (-O2):
define void @test1() {
%1 = alloca [4 x [13 x [15 x i32]]]
%2 = bitcast [4 x [13 x [15 x i32]]]* %1 to i8*
%3 = bitcast [4 x [13 x [15 x i32]]]* %1 to i32***
%4 = call i32 @function1(i32 1, i32*** %3)
%5 = getelementptr inbounds [4 x [13 x [15 x i32]]], [4 x [13 x [15 x i32]]]* %1, i64 0, i64 2, i64 0
%6 = bitcast [15 x i32]* %5 to i32**
%7 = call i32 @function(i32 1, i32** %6)
ret void
}
/* Variables and functions */
int __semihost(int, int *);
int semihost_close(int fh) { return __semihost((0x2), &fh); }


x86 assembly (clang, -O0):
<semihost_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
lea    -0x4(%rbp),%rsi
call   1030 <__semihost@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semihost_close>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2,%edi
call   1030 <__semihost@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @semihost_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__semihost(i32 2, i32* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @semihost_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__semihost(i32 2, i32* %2)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char c;
  printf("enter a character: ");
  c = getchar();
  printf("you entered: %c\n", c);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"enter a character: \00"
@.str.1 = [17 x i8] c"you entered: %c\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [20 x i8] c"enter a character: \00"
@.str.1 = [17 x i8] c"you entered: %c\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
int securestore_key_write(char *keyname, char *keybuf, unsigned int keylen) {
  return -1;
}


x86 assembly (clang, -O0):
<securestore_key_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @securestore_key_write(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @securestore_key_write(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
int get_line_length(char const *str) {
  char const *p = str;
  while (*p && *p != '\n')
    p++;
  return p - str;
}


x86 assembly (clang, -O0):
<get_line_length>:
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 <get_line_length+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1145 <get_line_length+0x45>
jmp    1156 <get_line_length+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <get_line_length+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_line_length>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <get_line_length+0x23>
cmp    $0xa,%cl
je     1123 <get_line_length+0x23>
add    $0x1,%rax
jmp    1110 <get_line_length+0x10>
ret

LLVM IR (-O0):
define i32 @get_line_length(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, 10
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** %2
%23 = ptrtoint i8* %21 to i64
%24 = ptrtoint i8* %22 to i64
%25 = sub i64 %23, %24
%26 = trunc i64 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_line_length(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 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
void _Jv_RegisterClasses(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_RegisterClasses() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *erealloc(void *ptr, size_t amount) {
  void *v = realloc(ptr, amount);
  if (!v) {
    fprintf(stderr, "realloc failed\n");
    exit(EXIT_FAILURE);
  }
  return v;
}


x86 assembly (clang, -O0):
<erealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <erealloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <erealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"realloc failed\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @erealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int abs(int);
void abs_negative() {
  Assert_real((abs(-30000) == 30000),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/abs.c",
              12, ("Should be == 30000"));
}


x86 assembly (clang, -O0):
<abs_negative>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffff8ad0,%edi
call   1030 <abs@plt>
cmp    $0x7530,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebe(%rip),%rsi
mov    $0xc,%edx
lea    0xf52(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_negative>:
lea    0xee9(%rip),%rsi
lea    0xf82(%rip),%rcx
mov    $0x1,%edi
mov    $0xc,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/abs.c\00"
@.str.1 = [19 x i8] c"Should be == 30000\00"
define void @abs_negative() {
%1 = call i32 @abs(i32 -30000)
%2 = icmp eq i32 %1, 30000
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/abs.c\00"
@.str.1 = [19 x i8] c"Should be == 30000\00"
define void @abs_negative() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
scalar_t__ O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int const);
void make_nonblocking(int fd) {
  const int old = fcntl(fd, F_GETFL, 0);
  fcntl(fd, F_SETFL, old | (int)O_NONBLOCK);
}


x86 assembly (clang, -O0):
<make_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
mov    (%rax),%rax
or     %eax,%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_nonblocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i64 0
define void @make_nonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i64, i64* @O_NONBLOCK
%11 = trunc i64 %10 to i32
%12 = or i32 %9, %11
%13 = call i32 @fcntl(i32 %7, i32 %8, i32 %12)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i64 0
define void @make_nonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i64, i64* @O_NONBLOCK
%6 = trunc i64 %5 to i32
%7 = or i32 %3, %6
%8 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void greeting() {
  printf("\033[2J");
  printf("Welcome to WPABF %s, the Wi-Fi Protected Access Bruteforce recovery "
         "tool.\n\t\t\tCopyright (c) 2013 Thomas Hand <th6045@gmail.com>\n",
         "1.1");
}


x86 assembly (clang, -O0):
<greeting>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0xf55(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<greeting>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0xf58(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [128 x i8] c"Welcome to WPABF %s, the Wi-Fi Protected Access Bruteforce recovery tool.\0A\09\09\09Copyright (c) 2013 Thomas Hand <th6045@gmail.com>\0A\00"
@.str.2 = [4 x i8] c"1.1\00"
define void @greeting() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [128 x i8] c"Welcome to WPABF %s, the Wi-Fi Protected Access Bruteforce recovery tool.\0A\09\09\09Copyright (c) 2013 Thomas Hand <th6045@gmail.com>\0A\00"
@.str.2 = [4 x i8] c"1.1\00"
define void @greeting() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bb_del();
int /*<<< orphan*/ loop_del();
void bb_delete(void) {
  bb_del();
  loop_del();
}


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

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

LLVM IR (-O0):
define void @bb_delete() {
%1 = call i32 (...) @bb_del()
%2 = call i32 (...) @loop_del()
ret void
}

LLVM IR (-O2):
define void @bb_delete() {
%1 = tail call i32 (...) @bb_del()
%2 = tail call i32 (...) @loop_del()
ret void
}
void msm_routing_ahc_set_copp_idx(int copp_idx) {}


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

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

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

LLVM IR (-O2):
define void @msm_routing_ahc_set_copp_idx(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isxdigit(int);
void t_isxdigit_0x63() {
  Assert_real((isxdigit(99)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              500, ("isxdigit should be 1 for c"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x63>:
push   %rbp
mov    %rsp,%rbp
mov    $0x63,%edi
call   1030 <isxdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1f4,%edx
lea    0xf66(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x63>:
push   %rax
mov    $0x63,%edi
call   1030 <isxdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0x1f4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for c\00"
define void @t_isxdigit_0x63() {
%1 = call i32 @isxdigit(i32 99)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 500, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for c\00"
define void @t_isxdigit_0x63() {
%1 = tail call i32 @isxdigit(i32 99)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 500, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void *test_anti_range_53(unsigned short n) {
  extern void *alloc_anti_range_53(unsigned short)
      __attribute__((alloc_size(1)));
  if ((0x7fff * 2 + 1) - 1 <= n && n <= (0x7fff * 2 + 1) - 1)
    n = (0x7fff * 2 + 1) - 1 - 1;
  return alloc_anti_range_53(n);
}


x86 assembly (clang, -O0):
<test_anti_range_53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
mov    $0xfffe,%eax
cmp    %ecx,%eax
jg     1145 <test_anti_range_53+0x35>
movzwl -0x2(%rbp),%eax
cmp    $0xfffe,%eax
jg     1145 <test_anti_range_53+0x35>
movw   $0xfffd,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_53@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_53>:
cmp    $0xfffe,%di
mov    $0xfffd,%eax
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_53@plt>

LLVM IR (-O0):
define i8* @test_anti_range_53(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp sle i32 65534, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = icmp sle i32 %8, 65534
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -3, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_53(i16 zeroext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_53(i16 zeroext %0) {
%2 = icmp eq i16 %0, -2
%3 = select i1 %2, i16 -3, i16 %0
%4 = tail call i8* @alloc_anti_range_53(i16 zeroext %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *reverseString(char *);
int main(void) {
  char str[] = "Hello ABCDEF";
  char *newstr = reverseString(str);
  printf("%s ", newstr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rdi
call   1040 <reverseString@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x46454443424120,%rax
mov    %rax,0xd(%rsp)
movabs $0x4241206f6c6c6548,%rax
20 41 42
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <reverseString@plt>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [13 x i8] c"Hello ABCDEF\00"
@.str = [4 x i8] c"%s \00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = alloca i8*
%3 = bitcast [13 x i8]* %1 to i8*
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%5 = call i8* @reverseString(i8* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [13 x i8] c"Hello ABCDEF\00"
@.str = [4 x i8] c"%s \00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i8* @reverseString(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() { assert(1 == 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
int cpuIdGetFlashSize() { return *((short *)(0x1FFFF7E0)); }


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

x86 assembly (clang, -O2):
<cpuIdGetFlashSize>:
movswl 0x1ffff7e0,%eax
1f
ret

LLVM IR (-O0):
define i32 @cpuIdGetFlashSize() {
%1 = load i16, i16* inttoptr (i64 536868832 to i16*)
%2 = sext i16 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @cpuIdGetFlashSize() {
%1 = load i16, i16* inttoptr (i64 536868832 to i16*)
%2 = sext i16 %1 to i32
ret i32 %2
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char **printmsg_1_svc(void *argp, struct svc_req *rqstp) {
  static char *result;
  static char msg[10];
  strcpy(msg, "HELLO!");
  result = msg;
  return &result;
}


x86 assembly (clang, -O0):
<printmsg_1_svc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0x2f11(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2efe(%rip),%rax
mov    %rax,0x2eef(%rip)
lea    0x2ee8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmsg_1_svc>:
push   %rbx
lea    0x2f20(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,0x2f02(%rip)
lea    0x2efb(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.svc_req = type { i32 }
@printmsg_1_svc.result = internal global i8* null
@printmsg_1_svc.msg = internal global [10 x i8] zeroinitializer
@.str = [7 x i8] c"HELLO!\00"
define i8** @printmsg_1_svc(i8* %0, %struct.svc_req* %1) {
%3 = alloca i8*
%4 = alloca %struct.svc_req*
store i8* %0, i8** %3
store %struct.svc_req* %1, %struct.svc_req** %4
%5 = call i32 @strcpy(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @printmsg_1_svc.msg, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @printmsg_1_svc.msg, i64 0, i64 0), i8** @printmsg_1_svc.result
ret i8** @printmsg_1_svc.result
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
@printmsg_1_svc.result = internal global i8* null
@printmsg_1_svc.msg = internal global [10 x i8] zeroinitializer
@.str = [7 x i8] c"HELLO!\00"
define i8** @printmsg_1_svc(i8* nocapture readnone %0, %struct.svc_req* nocapture readnone %1) {
%3 = tail call i32 @strcpy(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @printmsg_1_svc.msg, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @printmsg_1_svc.msg, i64 0, i64 0), i8** @printmsg_1_svc.result
ret i8** @printmsg_1_svc.result
}
void vscale(double *v, double scale) {
  v[0] *= scale;
  v[1] *= scale;
  v[2] *= scale;
}


x86 assembly (clang, -O0):
<vscale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscale>:
movupd (%rdi),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,(%rdi)
mulsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @vscale(double* nocapture %0, double %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fmul <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fmul double %10, %1
store double %11, double* %9
ret void
}
int addOK(int x, int y) { return 2; }


x86 assembly (clang, -O0):
<addOK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @addOK(i32 %0, i32 %1) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ tmpl(char *);
void main() {
  int offset, length, nlen;
  int i, j;
  tmpl("(le(i,j,nlen),le(i,j,nlen))");
  for (i = 0; i < nlen; i++) {
    for (j = 0; j < 8; j++) {
      assert(0 <= nlen - 1 - i);
      assert(nlen - 1 - i < nlen);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <tmpl@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ac <main+0x8c>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1199 <main+0x79>
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
sub    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
sub    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <main+0x2e>
jmp    119e <main+0x7e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113b <main+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"(le(i,j,nlen),le(i,j,nlen))\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @tmpl(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %7
7: ; preds = %35, %0
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %38
11: ; preds = %7
store i32 0, i32* %5
br label %12
12: ; preds = %31, %11
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 8
br i1 %14, label %15, label %34
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 1
%18 = load i32, i32* %4
%19 = sub nsw i32 %17, %18
%20 = icmp sle i32 0, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i32, i32* %3
%24 = sub nsw i32 %23, 1
%25 = load i32, i32* %4
%26 = sub nsw i32 %24, %25
%27 = load i32, i32* %3
%28 = icmp slt i32 %26, %27
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
br label %31
31: ; preds = %15
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %12
34: ; preds = %12
br label %35
35: ; preds = %34
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %7
38: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"(le(i,j,nlen),le(i,j,nlen))\00"
define void @main() {
%1 = tail call i32 @tmpl(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f0(char *);
void f6(unsigned stuff) {
  int n = 7000;
  do {
    char a[n];
    f0(a);
  } while (stuff--);
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1b58,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1030 <f0@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jne    1122 <f6+0x12>
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %edi,%ebx
add    $0x1,%ebx
nopl   0x0(%rax)
mov    %rsp,%r14
lea    -0x1b60(%rsp),%rdi
ff
mov    %rdi,%rsp
call   1030 <f0@plt>
mov    %r14,%rsp
add    $0xffffffff,%ebx
jne    1120 <f6+0x10>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @f6(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 %0, i32* %2
store i32 7000, i32* %3
br label %6
6: ; preds = %13, %1
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %4
%10 = alloca i8, i64 %8
store i64 %8, i64* %5
%11 = call i32 @f0(i8* %10)
%12 = load i8*, i8** %4
br label %13
13: ; preds = %6
%14 = load i32, i32* %2
%15 = add i32 %14, -1
store i32 %15, i32* %2
%16 = icmp ne i32 %14, 0
br i1 %16, label %6, label %17
17: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @f6(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %8, %2 ]
%4 = call i8* @llvm.stacksave()
%5 = alloca [7000 x i8]
%6 = getelementptr inbounds [7000 x i8], [7000 x i8]* %5, i64 0, i64 0
%7 = call i32 @f0(i8* %6)
%8 = add i32 %3, -1
%9 = icmp eq i32 %3, 0
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
char *Char2Ints(char *des, char c) {
  des[0] = c / 10 + '0';
  des[1] = c % 10 + '0';
  return des;
}


x86 assembly (clang, -O0):
<Char2Ints>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movsbl -0x9(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Char2Ints>:
mov    %rdi,%rax
imul   $0x67,%esi,%ecx
movzwl %cx,%edx
shr    $0xa,%ecx
shr    $0xf,%edx
add    %cl,%dl
lea    0x30(%rdx),%ecx
mov    %cl,(%rdi)
movzbl %dl,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%sil
add    $0x30,%sil
mov    %sil,0x1(%rdi)
ret

LLVM IR (-O0):
define i8* @Char2Ints(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sdiv i32 %6, 10
%8 = add nsw i32 %7, 48
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = srem i32 %13, 10
%15 = add nsw i32 %14, 48
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @Char2Ints(i8* returned writeonly %0, i8 signext %1) {
%3 = sdiv i8 %1, 10
%4 = add nsw i8 %3, 48
store i8 %4, i8* %0
%5 = srem i8 %1, 10
%6 = add nsw i8 %5, 48
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
ret i8* %0
}
int test_imm_92int8_mem(signed char *val) {
  return ((*val) & (0x92 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_92int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -110
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ mem_free(char *);
char *str_destroy(char *str) {
  mem_free(str);
  return (NULL);
}


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

x86 assembly (clang, -O2):
<str_destroy>:
push   %rax
call   1030 <mem_free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @str_destroy(i8* %0) {
%2 = tail call i32 @mem_free(i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ SystemInit();
void lowlevel_clock_init(void) { SystemInit(); }


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

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

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

LLVM IR (-O2):
define void @lowlevel_clock_init() {
%1 = tail call i32 (...) @SystemInit()
ret void
}