xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char literal1[] = "This is misssspelled literal";
  char *literal2 = "This is another misssspelled literal";
  char *literal3 = "This is spelled perfectly!";
  printf("This is a crapppily spelled string literal\n");
  printf("%s\n", "hello");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x14(%rbp)
lea    0xec4(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
lea    0xf09(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.literal1 = [29 x i8] c"This is misssspelled literal\00"
@.str = [37 x i8] c"This is another misssspelled literal\00"
@.str.1 = [27 x i8] c"This is spelled perfectly!\00"
@.str.2 = [44 x i8] c"This is a crapppily spelled string literal\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [29 x i8]
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [29 x i8]* %2 to i8*
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [6 x i8] c"hello\00"
@str = [43 x i8] c"This is a crapppily spelled string literal\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xfd() {
  Assert_real((isalnum(253) == 0),
              "/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_isalnum.c",
              1270, ("isalnum should be 0 for 0xfd"));
}


x86 assembly (clang, -O0):
<t_isalnum_0xfd>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfd,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4f6,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0xfd>:
push   %rax
mov    $0xfd,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4f6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xfd\00"
define void @t_isalnum_0xfd() {
%1 = call i64 @isalnum(i32 253)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1270, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xfd\00"
define void @t_isalnum_0xfd() {
%1 = tail call i64 @isalnum(i32 253)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1270, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double dummy(double x) { return x * 56.7; }


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @dummy(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 5.670000e+01
ret double %4
}

LLVM IR (-O2):
define double @dummy(double %0) {
%2 = fmul double %0, 5.670000e+01
ret double %2
}
char *g1(a, b)
int a;
int *b;
{}


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @g1(i32 %0, i32* nocapture readnone %1) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_shm_free() {
  printf("NOT IMPLEMENTED:"
         "pa_shm_free"
         "\n");
}


x86 assembly (clang, -O0):
<pa_shm_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"NOT IMPLEMENTED:pa_shm_free\0A\00"
define i32 @pa_shm_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [28 x i8] c"NOT IMPLEMENTED:pa_shm_free\00"
define i32 @pa_shm_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ touchmanager_detach_all();
void view_battleship_wait_detach() { touchmanager_detach_all(); }


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

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

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

LLVM IR (-O2):
define void @view_battleship_wait_detach() {
%1 = tail call i32 (...) @touchmanager_detach_all()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __delete_vec(const char *const *v) {
  const char *const *p;
  if (!v)
    return;
  for (p = v; *p; ++p)
    free((void *)(*p));
  free((void *)(v));
}


x86 assembly (clang, -O0):
<__delete_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <__delete_vec+0x1c>
jmp    1168 <__delete_vec+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115f <__delete_vec+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <__delete_vec+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__delete_vec>:
test   %rdi,%rdi
je     1150 <__delete_vec+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <__delete_vec+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <__delete_vec+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @__delete_vec(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %11, %6 ], [ %4, %3 ]
%8 = phi i8** [ %10, %6 ], [ %0, %3 ]
%9 = tail call i32 @free(i8* %7)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
%15 = tail call i32 @free(i8* %14)
br label %16
16: ; preds = %1, %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AS1_RecvChar(unsigned char *);
int /*<<< orphan*/ AS1_SendChar(unsigned char);
void AS1_OnRxChar(void) {
  unsigned char t;
  AS1_RecvChar(&t);
  AS1_SendChar(t);
}


x86 assembly (clang, -O0):
<AS1_OnRxChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
call   1040 <AS1_RecvChar@plt>
movzbl -0x1(%rbp),%edi
call   1030 <AS1_SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AS1_OnRxChar>:
push   %rax
lea    0x7(%rsp),%rdi
call   1040 <AS1_RecvChar@plt>
movzbl 0x7(%rsp),%edi
call   1030 <AS1_SendChar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @AS1_OnRxChar() {
%1 = alloca i8
%2 = call i32 @AS1_RecvChar(i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @AS1_SendChar(i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @AS1_OnRxChar() {
%1 = alloca i8
%2 = call i32 @AS1_RecvChar(i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @AS1_SendChar(i8 zeroext %3)
ret void
}
/* Variables and functions */
int checker_read_int(int, char const *, int, int *);
int checker_read_out_int(const char *name, int eof_error_flag, int *p_val) {
  return checker_read_int(1, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_out_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
call   1030 <checker_read_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_out_int>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <checker_read_int@plt>

LLVM IR (-O0):
define i32 @checker_read_out_int(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @checker_read_int(i32 1, i8* %7, i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @checker_read_out_int(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @checker_read_int(i32 1, i8* %0, i32 %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void strcat_fn(char *x) { strcat(x, (char *)&strcat_fn); }


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

x86 assembly (clang, -O2):
<strcat_fn>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
define void @strcat_fn(i8* %0) {
%2 = tail call i32 @strcat(i8* %0, i8* bitcast (void (i8*)* @strcat_fn to i8*))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void syntax_multiline_block(void) {
  printf("<div class=\"syntax-multiline-block\">");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"<div class=\22syntax-multiline-block\22>\00"
define void @syntax_multiline_block() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"<div class=\22syntax-multiline-block\22>\00"
define void @syntax_multiline_block() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  char *p = (char *)s;
  while (*p)
    p++;
  return (size_t)(p - s);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i64 @strlen(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 = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %5
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
main() { echo("MoOooOooOO!!"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"MoOooOooOO!!\00"
define i32 @main() {
%1 = call i32 @echo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"MoOooOooOO!!\00"
define i32 @main() {
%1 = tail call i32 @echo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
char *coltoa(int col) {
  static char rname[3];
  register char *p = rname;
  if (col > 25) {
    *p++ = col / 26 + 'A' - 1;
    col %= 26;
  }
  *p++ = col + 'A';
  *p = 0;
  return (rname);
}


x86 assembly (clang, -O0):
<coltoa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0x2f13(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x19,-0x4(%rbp)
jle    114e <coltoa+0x4e>
mov    -0x4(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%eax
sub    $0x1,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x41,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
lea    0x2eac(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<coltoa>:
cmp    $0x1a,%edi
jl     112e <coltoa+0x2e>
mov    %edi,%eax
imul   $0x4ec4ec4f,%rax,%rax
shr    $0x23,%rax
lea    0x40(%rax),%ecx
mov    %cl,0x2f06(%rip)
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%edi
lea    0x2ef6(%rip),%rax
jmp    1135 <coltoa+0x35>
lea    0x2eec(%rip),%rax
add    $0x41,%dil
mov    %dil,(%rax)
movb   $0x0,0x1(%rax)
lea    0x2eda(%rip),%rax
ret

LLVM IR (-O0):
@coltoa.rname = internal global [3 x i8] zeroinitializer
define i8* @coltoa(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @coltoa.rname, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 25
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 26
%9 = add nsw i32 %8, 65
%10 = sub nsw i32 %9, 1
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
store i8 %11, i8* %12
%14 = load i32, i32* %2
%15 = srem i32 %14, 26
store i32 %15, i32* %2
br label %16
16: ; preds = %6, %1
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 65
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
store i8 %19, i8* %20
%22 = load i8*, i8** %3
store i8 0, i8* %22
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @coltoa.rname, i64 0, i64 0)
}

LLVM IR (-O2):
@coltoa.rname = internal global [3 x i8] zeroinitializer
define i8* @coltoa(i32 %0) {
%2 = icmp sgt i32 %0, 25
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = udiv i32 %0, 26
%5 = trunc i32 %4 to i8
%6 = add i8 %5, 64
store i8 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @coltoa.rname, i64 0, i64 0)
%7 = urem i32 %0, 26
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ %7, %3 ], [ %0, %1 ]
%10 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @coltoa.rname, i64 0, i64 1), %3 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @coltoa.rname, i64 0, i64 0), %1 ]
%11 = trunc i32 %9 to i8
%12 = add i8 %11, 65
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
store i8 0, i8* %13
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @coltoa.rname, i64 0, i64 0)
}
/* Variables and functions */
int abs(int);
int highest(int a, int b) { return (a + b + abs(a - b)) / 2; }


x86 assembly (clang, -O0):
<highest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<highest>:
lea    (%rsi,%rdi,1),%eax
sub    %esi,%edi
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @highest(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 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
%11 = call i32 @abs(i32 %10)
%12 = add nsw i32 %7, %11
%13 = sdiv i32 %12, 2
ret i32 %13
}

LLVM IR (-O2):
define i32 @highest(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sub nsw i32 %0, %1
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = add nsw i32 %3, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 1;
  int b = 2;
  int c = 0;
  c = a + b;
  printf("%d + %d = %d\n", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}
/* Type definitions */
typedef long int32_t;

/* Variables and functions */
int /*<<< orphan*/ CAS(long, int /*<<< orphan*/, long volatile *);
long ZERO_ATOMIC(volatile int32_t *val) {
  int32_t actual;
  do {
    actual = *val;
  } while (!CAS(actual, 0, val));
  return actual;
}


x86 assembly (clang, -O0):
<ZERO_ATOMIC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <CAS@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    111c <ZERO_ATOMIC+0xc>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZERO_ATOMIC>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    (%r14),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <CAS@plt>
test   %eax,%eax
je     1120 <ZERO_ATOMIC+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @ZERO_ATOMIC(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
br label %4
4: ; preds = %7, %1
%5 = load i64*, i64** %2
%6 = load volatile i64, i64* %5
store i64 %6, i64* %3
br label %7
7: ; preds = %4
%8 = load i64, i64* %3
%9 = load i64*, i64** %2
%10 = call i32 @CAS(i64 %8, i32 0, i64* %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %4, label %13
13: ; preds = %7
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @ZERO_ATOMIC(i64* %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* %0
%4 = tail call i32 @CAS(i64 %3, i32 0, i64* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ refresh();
void display_quit() {
  clear();
  refresh();
  endwin();
}


x86 assembly (clang, -O0):
<display_quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clear@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_quit>:
push   %rax
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <endwin@plt>

LLVM IR (-O0):
define void @display_quit() {
%1 = call i32 (...) @clear()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @display_quit() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @endwin()
ret void
}
void *fn(void *p) { return p; }


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

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

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

LLVM IR (-O2):
define i8* @fn(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ L1C_CleanInvalidateCache(int);
__attribute__((always_)) void L1C_CleanDCacheAll(void) {
  L1C_CleanInvalidateCache(1);
}


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

x86 assembly (clang, -O2):
<L1C_CleanDCacheAll>:
mov    $0x1,%edi
jmp    1030 <L1C_CleanInvalidateCache@plt>

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

LLVM IR (-O2):
define void @L1C_CleanDCacheAll() {
%1 = tail call i32 @L1C_CleanInvalidateCache(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sq2_iterator_impl(void (*)(int *));
void sq2_iterator(void (*fn)(int *x)) { sq2_iterator_impl(fn); }


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

x86 assembly (clang, -O2):
<sq2_iterator>:
jmp    1030 <sq2_iterator_impl@plt>

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

LLVM IR (-O2):
define void @sq2_iterator(void (i32*)* %0) {
%2 = tail call i32 @sq2_iterator_impl(void (i32*)* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ drawtextrange(int, int, int, char const *,
                                 int /*<<< orphan*/);
void drawtextwidth(int x, int width, int y, const char *str, uint16_t length) {
  drawtextrange(x, x + width, y, str, length);
}


x86 assembly (clang, -O0):
<drawtextwidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <drawtextrange@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawtextwidth>:
add    %edi,%esi
jmp    1030 <drawtextrange@plt>

LLVM IR (-O0):
define void @drawtextwidth(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %8
%16 = load i8*, i8** %9
%17 = load i32, i32* %10
%18 = call i32 @drawtextrange(i32 %11, i32 %14, i32 %15, i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @drawtextwidth(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = add nsw i32 %1, %0
%7 = tail call i32 @drawtextrange(i32 %0, i32 %6, i32 %2, i8* %3, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *sha512_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_sha512(unsigned char *out, FILE *fp) {
  return sha512_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_sha512>:
jmp    1030 <sha512_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_sha512(i8* %0, i32* %1) {
%3 = tail call i8* @sha512_file(i8* %0, i32* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ pm_off();
int cmd_off(char *arg) {
  (void)arg;
  pm_off();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @cmd_off(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pm_off()
ret i32 0
}
int check(int n, int *A) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @check(i32 %0, i32* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
double tan_82(double);
double poly_tan(double x) { return tan_82(x); }


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

x86 assembly (clang, -O2):
<poly_tan>:
jmp    1030 <tan_82@plt>

LLVM IR (-O0):
define double @poly_tan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @tan_82(double %3)
ret double %4
}

LLVM IR (-O2):
define double @poly_tan(double %0) {
%2 = tail call double @tan_82(double %0)
ret double %2
}
void zskip_svlv(char **entry) {
  char *cursor = *entry;
  cursor++;
  while (*cursor < 0)
    cursor++;
  cursor++;
  *entry = cursor;
}


x86 assembly (clang, -O0):
<zskip_svlv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jge    1140 <zskip_svlv+0x40>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111f <zskip_svlv+0x1f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<zskip_svlv>:
mov    (%rdi),%rax
add    $0x1,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
js     1110 <zskip_svlv+0x10>
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @zskip_svlv(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = icmp slt i8 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 2
store i8* %9, i8** %0
ret void
}
/* Variables and functions */
unsigned short bam_swap_endian_2(unsigned short);
void *bam_swap_endian_2p(void *x) {
  *(unsigned short *)x = bam_swap_endian_2(*(unsigned short *)x);
  return x;
}


x86 assembly (clang, -O0):
<bam_swap_endian_2p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edi
call   1030 <bam_swap_endian_2@plt>
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bam_swap_endian_2p>:
push   %rbx
mov    %rdi,%rbx
movzwl (%rdi),%edi
call   1030 <bam_swap_endian_2@plt>
mov    %ax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @bam_swap_endian_2p(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i16*
%5 = load i16, i16* %4
%6 = call zeroext i16 @bam_swap_endian_2(i16 zeroext %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i16*
store i16 %6, i16* %8
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @bam_swap_endian_2p(i8* returned %0) {
%2 = bitcast i8* %0 to i16*
%3 = load i16, i16* %2
%4 = tail call zeroext i16 @bam_swap_endian_2(i16 zeroext %3)
store i16 %4, i16* %2
ret i8* %0
}
int d_ne_mm2(double *a1, double *a2) { return !(((*a1) != (*a2))); }


x86 assembly (clang, -O0):
<d_ne_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ne_mm2>:
movsd  (%rsi),%xmm0
cmpeqsd (%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_ne_mm2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp une double %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @d_ne_mm2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp oeq double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int f1() {
  int a[2][3];
  return a[1];
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
lea    -0x20(%rbp),%rax
add    $0xc,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    -0x18(%rsp),%rax
or     $0xc,%eax
ret

LLVM IR (-O0):
define i32 @f1() {
%1 = alloca [2 x [3 x i32]]
%2 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 1
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%4 = ptrtoint i32* %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @f1() {
%1 = alloca [2 x [3 x i32]]
%2 = bitcast [2 x [3 x i32]]* %1 to i8*
%3 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 1, i64 0
%4 = ptrtoint i32* %3 to i64
%5 = trunc i64 %4 to i32
ret i32 %5
}
void FN_pointer_arith4_Bad(int *x) {
  int len = 5;
  char p[5];
  (p + *x)[10 - *x] = 0;
}


x86 assembly (clang, -O0):
<FN_pointer_arith4_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
lea    -0x11(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rdx
mov    $0xa,%ecx
sub    (%rdx),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @FN_pointer_arith4_Bad(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [5 x i8]
store i32* %0, i32** %2
store i32 5, i32* %3
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = sub nsw i32 10, %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %9, i64 %13
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @FN_pointer_arith4_Bad(i32* nocapture %0) {
ret void
}
int fnAddUnitTen(int iVal1, int iVal2) {
  int iS;
  iS = (iVal1 + iVal2);
  return iS;
}


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

x86 assembly (clang, -O2):
<fnAddUnitTen>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @fnAddUnitTen(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* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @fnAddUnitTen(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void ts_packet_set_pid(uint8_t *ts_packet, uint16_t new_pid) {
  ts_packet[1] = (ts_packet[1] & ~0x1f) | (new_pid >> 8);
  ts_packet[2] = new_pid & ~0xff00;
}


x86 assembly (clang, -O0):
<ts_packet_set_pid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
and    $0xffffffe0,%ecx
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
and    $0xffff00ff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_packet_set_pid>:
mov    0x4(%rdi),%eax
and    $0xffffffe0,%eax
mov    %esi,%ecx
sar    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,0x4(%rdi)
and    $0xffff00ff,%esi
mov    %esi,0x8(%rdi)
ret

LLVM IR (-O0):
define void @ts_packet_set_pid(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 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = and i32 %7, -32
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = or i32 %8, %10
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
%14 = load i32, i32* %4
%15 = and i32 %14, -65281
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 2
store i32 %15, i32* %17
ret void
}

LLVM IR (-O2):
define void @ts_packet_set_pid(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = and i32 %4, -32
%6 = ashr i32 %1, 8
%7 = or i32 %5, %6
store i32 %7, i32* %3
%8 = and i32 %1, -65281
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int);
void randomize(int num) { srand((int)num); }


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

x86 assembly (clang, -O2):
<randomize>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @randomize(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
void capturing2capturingNonreset_rv_endCapturing() {}


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

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

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

LLVM IR (-O2):
define void @capturing2capturingNonreset_rv_endCapturing() {
ret void
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cpu_set_r8(struct cpu *, int /*<<< orphan*/, unsigned char);
void cpu_and_flags(struct cpu *cpu, unsigned char a, unsigned char b,
                   unsigned char t) {
  unsigned char z = t ? 0 : ((unsigned char)(0x80));
  unsigned char n = 0;
  unsigned char h = ((unsigned char)(0x20));
  unsigned char c = 0;
  cpu_set_r8(cpu, (0), z | n | h | c);
}


x86 assembly (clang, -O0):
<cpu_and_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%edx
mov    $0x80,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
movb   $0x20,-0xe(%rbp)
movb   $0x0,-0xf(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
movzbl -0xf(%rbp),%ecx
or     %ecx,%eax
xor    %esi,%esi
movzbl %al,%edx
call   1030 <cpu_set_r8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_and_flags>:
xor    %edx,%edx
test   %ecx,%ecx
sete   %dl
shl    $0x7,%edx
or     $0x20,%edx
xor    %esi,%esi
jmp    1030 <cpu_set_r8@plt>

LLVM IR (-O0):
%struct.cpu = type { i32 }
define void @cpu_and_flags(%struct.cpu* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca %struct.cpu*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
store %struct.cpu* %0, %struct.cpu** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%13 = load i8, i8* %8
%14 = zext i8 %13 to i32
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 128
%18 = trunc i32 %17 to i8
store i8 %18, i8* %9
store i8 0, i8* %10
store i8 32, i8* %11
store i8 0, i8* %12
%19 = load %struct.cpu*, %struct.cpu** %5
%20 = load i8, i8* %9
%21 = zext i8 %20 to i32
%22 = load i8, i8* %10
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = load i8, i8* %11
%26 = zext i8 %25 to i32
%27 = or i32 %24, %26
%28 = load i8, i8* %12
%29 = zext i8 %28 to i32
%30 = or i32 %27, %29
%31 = trunc i32 %30 to i8
%32 = call i32 @cpu_set_r8(%struct.cpu* %19, i32 0, i8 zeroext %31)
ret void
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define void @cpu_and_flags(%struct.cpu* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = icmp eq i8 %3, 0
%6 = select i1 %5, i8 -96, i8 32
%7 = tail call i32 @cpu_set_r8(%struct.cpu* %0, i32 0, i8 zeroext %6)
ret void
}
int gcd(int i, int j) {
  if (j > i)
    return gcd(j, i);
  return !j ? i : gcd(j, i % j);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113d <gcd+0x2d>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    116c <gcd+0x5c>
cmpl   $0x0,-0xc(%rbp)
jne    1152 <gcd+0x42>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1166 <gcd+0x56>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
mov    %edi,%eax
mov    %ecx,%edi
cmp    %eax,%ecx
jg     1110 <gcd+0x10>
test   %ecx,%ecx
je     1127 <gcd+0x27>
cltd
idiv   %ecx
mov    %ecx,%edi
mov    %edx,%eax
jmp    1110 <gcd+0x10>
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 = load i32, i32* %4
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = call i32 @gcd(i32 %10, i32 %11)
store i32 %12, i32* %3
br label %26
13: ; preds = %2
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = load i32, i32* %4
br label %24
18: ; preds = %13
%19 = load i32, i32* %5
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = srem i32 %20, %21
%23 = call i32 @gcd(i32 %19, i32 %22)
br label %24
24: ; preds = %18, %16
%25 = phi i32 [ %17, %16 ], [ %23, %18 ]
store i32 %25, i32* %3
br label %26
26: ; preds = %24, %9
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %11, %2
%4 = phi i32 [ %0, %2 ], [ %5, %11 ]
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = icmp sgt i32 %5, %4
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = icmp eq i32 %5, 0
br i1 %8, label %13, label %9
9: ; preds = %7
%10 = srem i32 %4, %5
br label %11
11: ; preds = %9, %3
%12 = phi i32 [ %10, %9 ], [ %4, %3 ]
br label %3
13: ; preds = %7
ret i32 %4
}
void swap_rows(double **A, int i, int j, int n) {
  void *temp;
  temp = A[i];
  A[i] = A[j];
  A[j] = temp;
}


x86 assembly (clang, -O0):
<swap_rows>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_rows>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

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

LLVM IR (-O2):
define void @swap_rows(double** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds double*, double** %0, i64 %5
%7 = load double*, double** %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds double*, double** %0, i64 %8
%10 = load double*, double** %9
store double* %10, double** %6
store double* %7, double** %9
ret void
}