xunge/DecIR huggingface dataset:
int hash(char *name) {
  int h = 0;
  while (*name != '\0') {
    h += *name++;
  }
  return h % 137;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <hash+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x89,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     1140 <hash+0x40>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
movslq %ecx,%rax
imul   $0x77975b9,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
imul   $0x89,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = add nsw i32 %6, %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = srem i32 %10, 137
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 0, %1 ], [ %14, %13 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int soma_primo(int);
int main() {
  int n;
  do {
    printf("digite um número maior que 0: ");
    scanf("%d", &n);
  } while (n <= 0);
  printf("%d\n", soma_primo(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    113f <main+0xf>
mov    -0x8(%rbp),%edi
call   1030 <soma_primo@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%r14
lea    0xed9(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
jle    1150 <main+0x20>
call   1030 <soma_primo@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [32 x i8] c"digite um n\C3\BAmero maior que 0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = call i32 @soma_primo(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [32 x i8] c"digite um n\C3\BAmero maior que 0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %3, label %8
8: ; preds = %3
%9 = call i32 @soma_primo(i32 %6)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
void yy_1_TableBody(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_TableBody(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strbuf_append_buf(struct strbuf *, char const *,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void strbuf_append_str(struct strbuf *buf, char const *s) {
  strbuf_append_buf(buf, s, strlen(s));
}


x86 assembly (clang, -O0):
<strbuf_append_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strbuf_append_buf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbuf_append_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strbuf_append_buf@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define void @strbuf_append_str(%struct.strbuf* %0, i8* %1) {
%3 = alloca %struct.strbuf*
%4 = alloca i8*
store %struct.strbuf* %0, %struct.strbuf** %3
store i8* %1, i8** %4
%5 = load %struct.strbuf*, %struct.strbuf** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strbuf_append_buf(%struct.strbuf* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define void @strbuf_append_str(%struct.strbuf* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strbuf_append_buf(%struct.strbuf* %0, i8* %1, i32 %3)
ret void
}
int __attribute__((no, noclone)) f2(float a, float b) {
  return __builtin_islessgreater(a, b);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setne  %al
ret

LLVM IR (-O0):
define i32 @f2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp one float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f2(float %0, float %1) {
%3 = fcmp one float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t len) {
  void *block = malloc(len);
  if (!block)
    do {
      perror("malloc");
      exit(EXIT_FAILURE);
    } while (0);
  return block;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xmalloc+0x43>
jmp    1159 <xmalloc+0x29>
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
void RTSemSpinMutexCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemSpinMutexCreate() {
ret void
}
float *search(float (*pointer)[4], int n) {
  float *pt;
  pt = *(pointer + n);
  return pt;
}


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

x86 assembly (clang, -O2):
<search>:
movslq %esi,%rax
shl    $0x4,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define float* @search([4 x float]* %0, i32 %1) {
%3 = alloca [4 x float]*
%4 = alloca i32
%5 = alloca float*
store [4 x float]* %0, [4 x float]** %3
store i32 %1, i32* %4
%6 = load [4 x float]*, [4 x float]** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [4 x float], [4 x float]* %6, i64 %8
%10 = getelementptr inbounds [4 x float], [4 x float]* %9, i64 0, i64 0
store float* %10, float** %5
%11 = load float*, float** %5
ret float* %11
}

LLVM IR (-O2):
define float* @search([4 x float]* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %3, i64 0
ret float* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ simple_command(struct chirp_client *, int /*<<< orphan*/,
                                  char *, char const *);
int64_t chirp_client_remote_debug(struct chirp_client *c, const char *flag,
                                  time_t stoptime) {
  if (flag == NULL)
    flag = "*";
  return simple_command(c, stoptime, "debug %s\n", flag);
}


x86 assembly (clang, -O0):
<chirp_client_remote_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <chirp_client_remote_debug+0x29>
lea    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rcx
lea    0xeb7(%rip),%rdx
call   1030 <simple_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_remote_debug>:
test   %rsi,%rsi
lea    0xee6(%rip),%rcx
cmovne %rsi,%rcx
lea    0xedd(%rip),%rax
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <simple_command@plt>

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
@.str = [2 x i8] c"*\00"
@.str.1 = [10 x i8] c"debug %s\0A\00"
define i32 @chirp_client_remote_debug(%struct.chirp_client* %0, i8* %1, i32 %2) {
%4 = alloca %struct.chirp_client*
%5 = alloca i8*
%6 = alloca i32
store %struct.chirp_client* %0, %struct.chirp_client** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %5
br label %10
10: ; preds = %9, %3
%11 = load %struct.chirp_client*, %struct.chirp_client** %4
%12 = load i32, i32* %6
%13 = load i8*, i8** %5
%14 = call i32 @simple_command(%struct.chirp_client* %11, i32 %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
@.str = [2 x i8] c"*\00"
@.str.1 = [10 x i8] c"debug %s\0A\00"
define i32 @chirp_client_remote_debug(%struct.chirp_client* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %1, null
%5 = select i1 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %1
%6 = tail call i32 @simple_command(%struct.chirp_client* %0, i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 %6
}
double rep_double(double a) { return a; }


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

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

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

LLVM IR (-O2):
define double @rep_double(double returned %0) {
ret double %0
}
void gtk_scale_get_layout() {}


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

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

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

LLVM IR (-O2):
define void @gtk_scale_get_layout() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char **argv) {
  printf("usage: %s nbi nbj\n  nbi/nbj Number of row/column partitions.\n",
         argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rdi),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"usage: %s nbi nbj\0A nbi/nbj Number of row/column partitions.\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [62 x i8] c"usage: %s nbi nbj\0A nbi/nbj Number of row/column partitions.\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int fn_glutGetWindow();
int glutGetWindow() { return fn_glutGetWindow(); }


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

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

LLVM IR (-O0):
define i32 @glutGetWindow() {
%1 = call i32 (...) @fn_glutGetWindow()
ret i32 %1
}

LLVM IR (-O2):
define i32 @glutGetWindow() {
%1 = tail call i32 (...) @fn_glutGetWindow()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) { fprintf(stderr, "test tests\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"test tests\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"test tests\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int numa_run_on_node(int node) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @numa_run_on_node(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PutLetter(int, int, unsigned char);
void PutStream(int x, int y, unsigned char *p) {
  while (*p != 0) {
    PutLetter(x, y, *p);
    p += 1;
    x += 8;
  }
}


x86 assembly (clang, -O0):
<PutStream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     115e <PutStream+0x4e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
movzbl (%rax),%edx
call   1030 <PutLetter@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <PutStream+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutStream>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdx),%al
test   %al,%al
je     114b <PutStream+0x3b>
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
movzbl %al,%edx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <PutLetter@plt>
add    $0x8,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <PutStream+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @PutStream(i32 %0, i32 %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %13, %6 ], [ %4, %3 ]
%8 = phi i8* [ %11, %6 ], [ %2, %3 ]
%9 = phi i32 [ %12, %6 ], [ %0, %3 ]
%10 = tail call i32 @PutLetter(i32 %9, i32 %1, i8 zeroext %7)
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add nsw i32 %9, 8
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_svector(short *v, long nl, long nh) { free((char *)(v + nl - 0)); }


x86 assembly (clang, -O0):
<free_svector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_svector>:
lea    (%rdi,%rsi,2),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_svector(i16* %0, i64 %1, i64 %2) {
%4 = alloca i16*
%5 = alloca i64
%6 = alloca i64
store i16* %0, i16** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i16*, i16** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i16, i16* %7, i64 %8
%10 = getelementptr inbounds i16, i16* %9, i64 0
%11 = bitcast i16* %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @free_svector(i16* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i16, i16* %0, i64 %1
%5 = bitcast i16* %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
void REMR3Init(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char *s;
  printf("s = [%c]\n", *s);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"s = [%c]\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext undef)
ret i32 0
}
int foo9(a, b)
int a, b;
{ return a + b; }


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

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

LLVM IR (-O0):
define i32 @foo9(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
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo9(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
unsigned xrop3_86_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk1 = D ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_86_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_86_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %7
%41 = and i32 %39, %40
%42 = or i32 %38, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_86_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
void radio_df_ant_configure(void) {}


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

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

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

LLVM IR (-O2):
define void @radio_df_ant_configure() {
ret void
}
void __attribute__((weak)) eth_isr() { debug_handler(__FUNCTION__); }


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

x86 assembly (clang, -O2):
<eth_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.eth_isr = [8 x i8] c"eth_isr\00"
define weak void @eth_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.eth_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.eth_isr = [8 x i8] c"eth_isr\00"
define weak void @eth_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.eth_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IOwrite_to_LM1972_CLOCK_L();
void IOwrite_to_LM1972_CLOCK_pwrsave() { IOwrite_to_LM1972_CLOCK_L(); }


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

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

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

LLVM IR (-O2):
define void @IOwrite_to_LM1972_CLOCK_pwrsave() {
%1 = tail call i32 (...) @IOwrite_to_LM1972_CLOCK_L()
ret void
}
/* Type definitions */
struct dbuf_s {
  int dummy;
};

/* Variables and functions */
int dbuf_prepend_str(struct dbuf_s *, char *);
int dbuf_prepend_char(struct dbuf_s *dbuf, char chr) {
  char buf[2];
  buf[0] = chr;
  buf[1] = '\0';
  return (dbuf_prepend_str(dbuf, buf));
}


x86 assembly (clang, -O0):
<dbuf_prepend_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xb(%rbp)
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1030 <dbuf_prepend_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbuf_prepend_char>:
push   %rax
mov    %sil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rsi
call   1030 <dbuf_prepend_str@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.dbuf_s = type { i32 }
define i32 @dbuf_prepend_char(%struct.dbuf_s* %0, i8 signext %1) {
%3 = alloca %struct.dbuf_s*
%4 = alloca i8
%5 = alloca [2 x i8]
store %struct.dbuf_s* %0, %struct.dbuf_s** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 0, i8* %8
%9 = load %struct.dbuf_s*, %struct.dbuf_s** %3
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%11 = call i32 @dbuf_prepend_str(%struct.dbuf_s* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.dbuf_s = type { i32 }
define i32 @dbuf_prepend_char(%struct.dbuf_s* %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %5
%6 = call i32 @dbuf_prepend_str(%struct.dbuf_s* %0, i8* %4)
ret i32 %6
}
void g_value_get_int64() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ath_hal_set_spur_immunity(struct ath_hal *, int);
void ath_hal_restore_default_spur_immunity(struct ath_hal *ah) {
  ath_hal_set_spur_immunity(ah, 2);
}


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

x86 assembly (clang, -O2):
<ath_hal_restore_default_spur_immunity>:
mov    $0x2,%esi
jmp    1030 <ath_hal_set_spur_immunity@plt>

LLVM IR (-O0):
%struct.ath_hal = type { i32 }
define void @ath_hal_restore_default_spur_immunity(%struct.ath_hal* %0) {
%2 = alloca %struct.ath_hal*
store %struct.ath_hal* %0, %struct.ath_hal** %2
%3 = load %struct.ath_hal*, %struct.ath_hal** %2
%4 = call i32 @ath_hal_set_spur_immunity(%struct.ath_hal* %3, i32 2)
ret void
}

LLVM IR (-O2):
%struct.ath_hal = type { i32 }
define void @ath_hal_restore_default_spur_immunity(%struct.ath_hal* %0) {
%2 = tail call i32 @ath_hal_set_spur_immunity(%struct.ath_hal* %0, i32 2)
ret void
}
int category_decode(int code, int size) {
  return code >= (1 << (size - 1)) ? code : code - (1 << size) + 1;
}


x86 assembly (clang, -O0):
<category_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jl     112f <category_decode+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <category_decode+0x46>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<category_decode>:
lea    -0x1(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    $0xffffffff,%edx
mov    %esi,%ecx
shl    %cl,%edx
cmp    %edi,%eax
lea    0x1(%rdi,%rdx,1),%eax
cmovle %edi,%eax
ret

LLVM IR (-O0):
define i32 @category_decode(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 = sub nsw i32 %6, 1
%8 = shl i32 1, %7
%9 = icmp sge i32 %5, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %18
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = shl i32 1, %14
%16 = sub nsw i32 %13, %15
%17 = add nsw i32 %16, 1
br label %18
18: ; preds = %12, %10
%19 = phi i32 [ %11, %10 ], [ %17, %12 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @category_decode(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = icmp sgt i32 %4, %0
%6 = shl nsw i32 -1, %1
%7 = add i32 %0, 1
%8 = add i32 %7, %6
%9 = select i1 %5, i32 %8, i32 %0
ret i32 %9
}
/* Type definitions */
struct mat3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat3_scale(float *, float *, float);
__attribute__((always_)) struct mat3 *psmat3_scale(struct mat3 *result,
                                                   struct mat3 *m, float s) {
  mat3_scale((float *)result, (float *)m, s);
  return result;
}


x86 assembly (clang, -O0):
<psmat3_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
call   1030 <mat3_scale@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat3_scale>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat3_scale@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_scale(%struct.mat3* %0, %struct.mat3* %1, float %2) {
%4 = alloca %struct.mat3*
%5 = alloca %struct.mat3*
%6 = alloca float
store %struct.mat3* %0, %struct.mat3** %4
store %struct.mat3* %1, %struct.mat3** %5
store float %2, float* %6
%7 = load %struct.mat3*, %struct.mat3** %4
%8 = bitcast %struct.mat3* %7 to float*
%9 = load %struct.mat3*, %struct.mat3** %5
%10 = bitcast %struct.mat3* %9 to float*
%11 = load float, float* %6
%12 = call i32 @mat3_scale(float* %8, float* %10, float %11)
%13 = load %struct.mat3*, %struct.mat3** %4
ret %struct.mat3* %13
}

LLVM IR (-O2):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_scale(%struct.mat3* returned %0, %struct.mat3* %1, float %2) {
%4 = bitcast %struct.mat3* %0 to float*
%5 = bitcast %struct.mat3* %1 to float*
%6 = tail call i32 @mat3_scale(float* %4, float* %5, float %2)
ret %struct.mat3* %0
}
int phase1_test_edge(int end1, int end2, double *node_piest) {
  return (node_piest[end1] + node_piest[end2] > 0.0);
}


x86 assembly (clang, -O0):
<phase1_test_edge>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<phase1_test_edge>:
movslq %edi,%rax
movsd  (%rdx,%rax,8),%xmm0
movslq %esi,%rax
addsd  (%rdx,%rax,8),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @phase1_test_edge(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%7 = load double*, double** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %7, i64 %9
%11 = load double, double* %10
%12 = load double*, double** %6
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = load double, double* %15
%17 = fadd double %11, %16
%18 = fcmp ogt double %17, 0.000000e+00
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @phase1_test_edge(i32 %0, i32 %1, double* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds double, double* %2, i64 %4
%6 = load double, double* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds double, double* %2, i64 %7
%9 = load double, double* %8
%10 = fadd double %6, %9
%11 = fcmp ogt double %10, 0.000000e+00
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int Cannonball(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) { printf("%d\n", Cannonball(3)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%edi
call   1030 <Cannonball@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @Cannonball(i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void pic_init() {
  outb(0x20, 0x11);
  outb(0xA0, 0x11);
  outb(0x21, 0x20);
  outb(0xA1, 0x28);
  outb(0x21, 0x04);
  outb(0xA1, 0x02);
  outb(0x21, 0x01);
  outb(0xA1, 0x01);
  outb(0x21, 0x0);
  outb(0xA1, 0x0);
}


x86 assembly (clang, -O0):
<pic_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_init>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @pic_init() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @outb(i32 160, i32 17)
%3 = call i32 @outb(i32 33, i32 32)
%4 = call i32 @outb(i32 161, i32 40)
%5 = call i32 @outb(i32 33, i32 4)
%6 = call i32 @outb(i32 161, i32 2)
%7 = call i32 @outb(i32 33, i32 1)
%8 = call i32 @outb(i32 161, i32 1)
%9 = call i32 @outb(i32 33, i32 0)
%10 = call i32 @outb(i32 161, i32 0)
ret void
}

LLVM IR (-O2):
define void @pic_init() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 160, i32 17)
%3 = tail call i32 @outb(i32 33, i32 32)
%4 = tail call i32 @outb(i32 161, i32 40)
%5 = tail call i32 @outb(i32 33, i32 4)
%6 = tail call i32 @outb(i32 161, i32 2)
%7 = tail call i32 @outb(i32 33, i32 1)
%8 = tail call i32 @outb(i32 161, i32 1)
%9 = tail call i32 @outb(i32 33, i32 0)
%10 = tail call i32 @outb(i32 161, i32 0)
ret void
}
/* Variables and functions */
void *malloc(long);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, long);
void *PaHost_AllocateFastMemory(long numBytes) {
  void *addr = malloc(numBytes);
  if (addr != NULL)
    memset(addr, 0, numBytes);
  return addr;
}


x86 assembly (clang, -O0):
<PaHost_AllocateFastMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <PaHost_AllocateFastMemory+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PaHost_AllocateFastMemory>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <PaHost_AllocateFastMemory+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @PaHost_AllocateFastMemory(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i64, i64* %2
%11 = call i32 @memset(i8* %9, i32 0, i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @PaHost_AllocateFastMemory(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
struct idrepro {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ InitRepro(struct idrepro *, int, int);
void InitReproPair(struct idrepro *rep1, struct idrepro *rep2, int max1,
                   int max2) {
  InitRepro(rep1, max1, max2);
  InitRepro(rep2, max2, max1);
}


x86 assembly (clang, -O0):
<InitReproPair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <InitRepro@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <InitRepro@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitReproPair>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %edx,%esi
mov    %ecx,%edx
call   1030 <InitRepro@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <InitRepro@plt>

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

LLVM IR (-O2):
%struct.idrepro = type { i32 }
define void @InitReproPair(%struct.idrepro* %0, %struct.idrepro* %1, i32 %2, i32 %3) {
%5 = tail call i32 @InitRepro(%struct.idrepro* %0, i32 %2, i32 %3)
%6 = tail call i32 @InitRepro(%struct.idrepro* %1, i32 %3, i32 %2)
ret void
}
int main(int argc, char *argv[]) {
  int foo[2];
  int bar[4][2][1];
  foo[0] = 1;
  bar[2][1][0] = 4;
  return foo[0] + bar[2][1][0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x4,-0x2c(%rbp)
mov    -0x18(%rbp),%eax
add    -0x2c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca [4 x [2 x [1 x i32]]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 1, i32* %8
%9 = getelementptr inbounds [4 x [2 x [1 x i32]]], [4 x [2 x [1 x i32]]]* %7, i64 0, i64 2
%10 = getelementptr inbounds [2 x [1 x i32]], [2 x [1 x i32]]* %9, i64 0, i64 1
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %10, i64 0, i64 0
store i32 4, i32* %11
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds [4 x [2 x [1 x i32]]], [4 x [2 x [1 x i32]]]* %7, i64 0, i64 2
%15 = getelementptr inbounds [2 x [1 x i32]], [2 x [1 x i32]]* %14, i64 0, i64 1
%16 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%17 = load i32, i32* %16
%18 = add nsw i32 %13, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t round_to_pow2(uint32_t x) {
  x--;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  x++;
  return x;
}


x86 assembly (clang, -O0):
<round_to_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_pow2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @round_to_pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @round_to_pow2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}