xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strchr(char *, char);
int CountPlayers(char *p) {
  int n = 0;
  while (p = strchr(p, '\n'))
    p++, n++;
  return n;
}


x86 assembly (clang, -O0):
<CountPlayers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1159 <CountPlayers+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <CountPlayers+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountPlayers>:
push   %rbx
mov    $0xa,%esi
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1149 <CountPlayers+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rax
add    $0x1,%ebx
mov    %rax,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <CountPlayers+0x20>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @CountPlayers(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = tail call i8* @strchr(i8* dereferenceable(1) %7, i8 signext 10)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
void __attribute__((__always___, __nodebug__))
_mm_store_ps(float *p, __m128 a) {
  *(__m128 *)p = a;
}


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

x86 assembly (clang, -O2):
<_mm_store_ps>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @_mm_store_ps(float* nocapture writeonly %0, i32 %1) {
%3 = bitcast float* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_start_serverside() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_start_serverside() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_start_serverside() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void radio_df_ant_switch_spacing_set_2us(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ Insert(struct List *, struct Node *, void *);
void AddHead(struct List *ThisList, struct Node *AddNode) {
  Insert(ThisList, AddNode, (void *)0L);
}


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

x86 assembly (clang, -O2):
<AddHead>:
xor    %edx,%edx
jmp    1030 <Insert@plt>

LLVM IR (-O0):
%struct.List = type { i32 }
%struct.Node = type { i32 }
define void @AddHead(%struct.List* %0, %struct.Node* %1) {
%3 = alloca %struct.List*
%4 = alloca %struct.Node*
store %struct.List* %0, %struct.List** %3
store %struct.Node* %1, %struct.Node** %4
%5 = load %struct.List*, %struct.List** %3
%6 = load %struct.Node*, %struct.Node** %4
%7 = call i32 @Insert(%struct.List* %5, %struct.Node* %6, i8* null)
ret void
}

LLVM IR (-O2):
%struct.List = type { i32 }
%struct.Node = type { i32 }
define void @AddHead(%struct.List* %0, %struct.Node* %1) {
%3 = tail call i32 @Insert(%struct.List* %0, %struct.Node* %1, i8* null)
ret void
}
__attribute__((always_)) void mpol_free_shared_policy(struct shared_policy *p) {
}


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

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

LLVM IR (-O0):
%struct.shared_policy = type opaque
define void @mpol_free_shared_policy(%struct.shared_policy* %0) {
%2 = alloca %struct.shared_policy*
store %struct.shared_policy* %0, %struct.shared_policy** %2
ret void
}

LLVM IR (-O2):
%struct.shared_policy = type opaque
define void @mpol_free_shared_policy(%struct.shared_policy* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TIOCMGET;
int TIOCM_CTS;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
int fn_get_int(int fd) {
  int i;
  ioctl(fd, TIOCMGET, &i);
  return i & TIOCM_CTS;
}


x86 assembly (clang, -O0):
<fn_get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
mov    0x2e9e(%rip),%rcx
and    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_get_int>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
and    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCMGET = global i32 0
@TIOCM_CTS = global i32 0
define i32 @fn_get_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @TIOCMGET
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
%7 = load i32, i32* %3
%8 = load i32, i32* @TIOCM_CTS
%9 = and i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
@TIOCMGET = global i32 0
@TIOCM_CTS = global i32 0
define i32 @fn_get_int(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @TIOCMGET
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* @TIOCM_CTS
%8 = and i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *identifier_destructor(const char *name) {
  char *id = xmalloc(strlen(name) + 2);
  strcpy(id, "~");
  strcat(id, name);
  return id;
}


x86 assembly (clang, -O0):
<identifier_destructor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x2,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<identifier_destructor>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x2(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
lea    0xea1(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"~\00"
define i8* @identifier_destructor(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 2
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @strcat(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"~\00"
define i8* @identifier_destructor(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 2
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, char *);
void *alt_tbl_malloc(size_t sz) {
  printf("%s\n", "alt_tbl_malloc");
  return malloc(sz);
}


x86 assembly (clang, -O0):
<alt_tbl_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alt_tbl_malloc>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [15 x i8] c"alt_tbl_malloc\00"
define noalias i8* @alt_tbl_malloc(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @malloc(i64 %0)
ret i8* %3
}
int siTieneConflictoEnCuadradoEsEnLaMismaColumna(
    int posicionConflictoEnCuadrado[], int jj) {
  if (posicionConflictoEnCuadrado[0] != 10 ||
      posicionConflictoEnCuadrado[1] != 10) {
    if (posicionConflictoEnCuadrado[1] == jj) {
      return 1;
    }
  } else {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<siTieneConflictoEnCuadradoEsEnLaMismaColumna>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xa,(%rax)
jne    1126 <siTieneConflictoEnCuadradoEsEnLaMismaColumna+0x26>
mov    -0x10(%rbp),%rax
cmpl   $0xa,0x4(%rax)
je     1147 <siTieneConflictoEnCuadradoEsEnLaMismaColumna+0x47>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1142 <siTieneConflictoEnCuadradoEsEnLaMismaColumna+0x42>
movl   $0x1,-0x4(%rbp)
jmp    115a <siTieneConflictoEnCuadradoEsEnLaMismaColumna+0x5a>
jmp    1153 <siTieneConflictoEnCuadradoEsEnLaMismaColumna+0x53>
movl   $0x1,-0x4(%rbp)
jmp    115a <siTieneConflictoEnCuadradoEsEnLaMismaColumna+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<siTieneConflictoEnCuadradoEsEnLaMismaColumna>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
xor    $0xa,%eax
mov    %ecx,%edx
xor    $0xa,%edx
or     %eax,%edx
sete   %al
cmp    %esi,%ecx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @siTieneConflictoEnCuadradoEsEnLaMismaColumna(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** %4
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 10
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %23
15: ; preds = %10, %2
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = load i32, i32* %5
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 1, i32* %3
br label %25
22: ; preds = %15
br label %24
23: ; preds = %10
store i32 1, i32* %3
br label %25
24: ; preds = %22
store i32 0, i32* %3
br label %25
25: ; preds = %24, %23, %21
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @siTieneConflictoEnCuadradoEsEnLaMismaColumna(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 10
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 10
%8 = select i1 %4, i1 %7, i1 false
%9 = icmp eq i32 %6, %1
%10 = select i1 %8, i1 true, i1 %9
%11 = zext i1 %10 to i32
ret i32 %11
}
float dobrar(float x) { return 2.0f * x; }


x86 assembly (clang, -O0):
<dobrar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobrar>:
addss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @dobrar(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 2.000000e+00, %3
ret float %4
}

LLVM IR (-O2):
define float @dobrar(float %0) {
%2 = fmul float %0, 2.000000e+00
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char const);
void ft_putstr(char const *s) {
  if (!s || !(*s))
    return;
  ft_putchar(*s);
  ft_putstr(s + 1);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <ft_putstr+0x24>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1149 <ft_putstr+0x29>
jmp    1162 <ft_putstr+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ft_putchar@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <ft_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
test   %rdi,%rdi
je     1143 <ft_putstr+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <ft_putstr+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %5, %1
br label %16
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = call i32 @ft_putchar(i8 signext %12)
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
br label %16
16: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
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 @ft_putchar(i8 signext %7)
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
void fun(int *ptr) { *ptr++; }


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

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

LLVM IR (-O0):
define void @fun(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i32 1
store i32* %4, i32** %2
%5 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @fun(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t read_input(void) {
  uint32_t opcode = 0;
  uint32_t new_opcode = 0;
  bool was_high = false;
  do {
    opcode = new_opcode;
    new_opcode = *(volatile uint32_t *)0x20000000;
    was_high |= new_opcode != 0;
  } while (!(was_high && new_opcode == 0));
  return opcode;
}


x86 assembly (clang, -O0):
<read_input>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x20000000,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
je     115c <read_input+0x5c>
cmpq   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    111b <read_input+0x1b>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_input>:
xor    %ecx,%ecx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rcx,%rax
mov    0x20000000,%rcx
20
xor    %esi,%esi
test   %rcx,%rcx
setne  %sil
or     %esi,%edx
je     1110 <read_input+0x10>
test   %rcx,%rcx
jne    1110 <read_input+0x10>
ret

LLVM IR (-O0):
define i64 @read_input() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i32
store i64 0, i64* %1
store i64 0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %0
%5 = load i64, i64* %2
store i64 %5, i64* %1
%6 = load volatile i64, i64* inttoptr (i64 536870912 to i64*)
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
br label %12
12: ; preds = %4
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i64, i64* %2
%17 = icmp eq i64 %16, 0
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
%20 = xor i1 %19, true
br i1 %20, label %4, label %21
21: ; preds = %18
%22 = load i64, i64* %1
ret i64 %22
}

LLVM IR (-O2):
define i64 @read_input() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %4, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = load volatile i64, i64* inttoptr (i64 536870912 to i64*)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
%7 = or i32 %3, %6
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i1 true, i1 %5
br i1 %9, label %1, label %10
10: ; preds = %1
ret i64 %2
}
/* Variables and functions */
scalar_t__ str_startswith(char *, char const *);
int dcc_count_leading_dotdots(const char *path) {
  int count = 0;
  while (str_startswith("../", path)) {
    path += 3;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<dcc_count_leading_dotdots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <str_startswith@plt>
cmp    $0x0,%rax
je     1157 <dcc_count_leading_dotdots+0x47>
mov    -0x8(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <dcc_count_leading_dotdots+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcc_count_leading_dotdots>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xee2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <str_startswith@plt>
test   %rax,%rax
je     1159 <dcc_count_leading_dotdots+0x49>
add    $0x3,%rbx
xor    %ebp,%ebp
lea    0xec8(%rip),%r14
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <str_startswith@plt>
add    $0x3,%rbx
test   %rax,%rax
jne    1140 <dcc_count_leading_dotdots+0x30>
jmp    115b <dcc_count_leading_dotdots+0x4b>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"../\00"
define i32 @dcc_count_leading_dotdots(i8* %0) {
%2 = tail call i64 @str_startswith(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = add nuw nsw i32 %5, 1
%9 = tail call i64 @str_startswith(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgmul(void) { gen("imull\t%ecx,%eax"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"imull\09%ecx,%eax\00"
define void @cgmul() {
%1 = call i32 @gen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"imull\09%ecx,%eax\00"
define void @cgmul() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ExtSelect(char *, char *, int /*<<< orphan*/);
void ExttAuthorizeSelect(void) {
  ExtSelect("tAuthorize",
            "tAuthorize.uAuthorize,tAuthorize.cLabel,tAuthorize.cIpMask,"
            "tAuthorize.uPerm,tAuthorize.uCertClient,tAuthorize.cPasswd,"
            "tAuthorize.cClrPasswd,tAuthorize.uOwner,tAuthorize.uCreatedBy,"
            "tAuthorize.uCreatedDate,tAuthorize.uModBy,tAuthorize.uModDate",
            0);
}


x86 assembly (clang, -O0):
<ExttAuthorizeSelect>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
call   1030 <ExtSelect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExttAuthorizeSelect>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ExtSelect@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"tAuthorize\00"
@.str.1 = [242 x i8] c"tAuthorize.uAuthorize,tAuthorize.cLabel,tAuthorize.cIpMask,tAuthorize.uPerm,tAuthorize.uCertClient,tAuthorize.cPasswd,tAuthorize.cClrPasswd,tAuthorize.uOwner,tAuthorize.uCreatedBy,tAuthorize.uCreatedDate,tAuthorize.uModBy,tAuthorize.uModDate\00"
define void @ExttAuthorizeSelect() {
%1 = call i32 @ExtSelect(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([242 x i8], [242 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"tAuthorize\00"
@.str.1 = [242 x i8] c"tAuthorize.uAuthorize,tAuthorize.cLabel,tAuthorize.cIpMask,tAuthorize.uPerm,tAuthorize.uCertClient,tAuthorize.cPasswd,tAuthorize.cClrPasswd,tAuthorize.uOwner,tAuthorize.uCreatedBy,tAuthorize.uCreatedDate,tAuthorize.uModBy,tAuthorize.uModDate\00"
define void @ExttAuthorizeSelect() {
%1 = tail call i32 @ExtSelect(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([242 x i8], [242 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int pupload(char const *, int /*<<< orphan*/ const *, int, int);
int ploadbuf(const char *file, const uint8_t *dlbuf, int count, int type) {
  return pupload(file, dlbuf, count, type);
}


x86 assembly (clang, -O0):
<ploadbuf>:
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    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <pupload@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ploadbuf>:
jmp    1030 <pupload@plt>

LLVM IR (-O0):
define i32 @ploadbuf(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @pupload(i8* %9, i32* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @ploadbuf(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @pupload(i8* %0, i32* %1, i32 %2, i32 %3)
ret i32 %5
}
void tegra20_init_speedo_data(struct tegra_sku_info *sku_info) {}


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

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

LLVM IR (-O0):
%struct.tegra_sku_info = type opaque
define void @tegra20_init_speedo_data(%struct.tegra_sku_info* %0) {
%2 = alloca %struct.tegra_sku_info*
store %struct.tegra_sku_info* %0, %struct.tegra_sku_info** %2
ret void
}

LLVM IR (-O2):
%struct.tegra_sku_info = type opaque
define void @tegra20_init_speedo_data(%struct.tegra_sku_info* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
char *reverse(char *);
int main() {
  printf("\nInput: %s", "Faxian");
  printf("\nOutput: %s", reverse("Faxian"));
  printf("\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xecc(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"\0AInput: %s\00"
@.str.1 = [7 x i8] c"Faxian\00"
@.str.2 = [12 x i8] c"\0AOutput: %s\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i8* @reverse(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%4 = tail call i32 @putchar(i32 10)
ret i32 0
}
void __sys_exit(int exitcode) {
  long __res, dummy;
  __asm__ __volatile__("int $0x80"
                       : "=a"(__res), "=&b"(dummy)
                       : "0"(1), "1"((long)(exitcode)));
  return (void)__res;
}


x86 assembly (clang, -O0):
<__sys_exit>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rbx
mov    $0x1,%eax
int    $0x80
mov    %rax,-0x18(%rbp)
mov    %rbx,-0x20(%rbp)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sys_exit>:
push   %rbx
movslq %edi,%rbx
mov    $0x1,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define void @__sys_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,~{dirflag},~{fpsr},~{flags}"(i64 1, i64 %6)
%8 = extractvalue { i64, i64 } %7, 0
%9 = extractvalue { i64, i64 } %7, 1
store i64 %8, i64* %3
store i64 %9, i64* %4
%10 = load i64, i64* %3
ret void
}

LLVM IR (-O2):
define void @__sys_exit(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,~{dirflag},~{fpsr},~{flags}"(i64 1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bench();
int main() { bench(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bench()
ret i32 0
}
int __attribute__((__gnu___, __always___, target("popcnt"))) foo() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRBB_set(void) { return U_WMRCORENONE_set("U_WMRBB"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRBB\00"
define i8* @U_WMRBB_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRBB\00"
define i8* @U_WMRBB_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ NODE_ENTRY(int /*<<< orphan*/);
void wsmain(int argc, char **argv) {
  while (1) {
    NODE_ENTRY(0);
  }
}


x86 assembly (clang, -O0):
<wsmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <NODE_ENTRY@plt>
jmp    111f <wsmain+0xf>

x86 assembly (clang, -O2):
<wsmain>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <NODE_ENTRY@plt>
jmp    1120 <wsmain+0x10>

LLVM IR (-O0):
define void @wsmain(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %5
5: ; preds = %2, %5
%6 = call i32 @NODE_ENTRY(i32 0)
br label %5
}

LLVM IR (-O2):
define void @wsmain(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @NODE_ENTRY(i32 0)
br label %3
}
int silk_min_int(int a, int b) { return (((a) < (b)) ? (a) : (b)); }


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

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

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

LLVM IR (-O2):
define i32 @silk_min_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int sprintf(char *, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int poffset(char *rbuffer, off_t o1, off_t o2) {
  return sprintf(rbuffer, "%022ld %022ld\n", o1, o2);
}


x86 assembly (clang, -O0):
<poffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xecd(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poffset>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%022ld %022ld\0A\00"
define i32 @poffset(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 @sprintf(i8* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [15 x i8] c"%022ld %022ld\0A\00"
define i32 @poffset(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ echo(int /*<<< orphan*/);
int /*<<< orphan*/ sum(int);
main() { echo(sum(100)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1040 <sum@plt>
mov    %eax,%edi
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1040 <sum@plt>
mov    %eax,%edi
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @sum(i32 100)
%2 = call i32 @echo(i32 %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 100)
%2 = tail call i32 @echo(i32 %1)
ret i32 0
}
char *sys_cmplt(i)
unsigned long i;
{
  if ((i >> 5) & 1)
    return ",M";
  else
    return "";
}


x86 assembly (clang, -O0):
<sys_cmplt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x5,%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     112e <sys_cmplt+0x2e>
lea    0xedb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1139 <sys_cmplt+0x39>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_cmplt>:
test   $0x20,%dil
lea    0xef7(%rip),%rcx
lea    0xeee(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c",M\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @sys_cmplt(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = lshr i64 %4, 5
%6 = and i64 %5, 1
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
9: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %9, %8
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c",M\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @sys_cmplt(i64 %0) {
%2 = and i64 %0, 32
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void socket_close(int s) { close(s); }


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

x86 assembly (clang, -O2):
<socket_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @socket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool uDMAChannelIsEnabled(uint32_t ui32ChannelNum) {
  ;
  return (
      ((*((volatile uint32_t *)(0x400FF028))) & (1 << (ui32ChannelNum & 0x1f)))
          ? true
          : false);
}


x86 assembly (clang, -O0):
<uDMAChannelIsEnabled>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x400ff028,%eax
mov    (%rax),%edx
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelIsEnabled>:
mov    %edi,%ecx
mov    0x400ff028,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @uDMAChannelIsEnabled(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load volatile i32, i32* inttoptr (i64 1074786344 to i32*)
%4 = load i32, i32* %2
%5 = and i32 %4, 31
%6 = shl i32 1, %5
%7 = and i32 %3, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @uDMAChannelIsEnabled(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1074786344 to i32*)
%3 = and i32 %0, 31
%4 = lshr i32 %2, %3
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ctr128_inc(unsigned char *);
void ctr128_inc_aligned(unsigned char *counter) {
  size_t *data, c, d, n;
  const int ossl_is_little_endian = 1234 == 1234;
  if ((ossl_is_little_endian) || ((size_t)counter % sizeof(size_t)) != 0) {
    ctr128_inc(counter);
    return;
  }
  data = (size_t *)counter;
  c = 1;
  n = 16 / sizeof(size_t);
  do {
    --n;
    d = data[n] += c;
    c = ((d - c) & ~d) >> (sizeof(size_t) * 8 - 1);
  } while (n);
}


x86 assembly (clang, -O0):
<ctr128_inc_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ctr128_inc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctr128_inc_aligned>:
jmp    1030 <ctr128_inc@plt>

LLVM IR (-O0):
define void @ctr128_inc_aligned(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %7
%8 = load i8*, i8** %2
%9 = call i32 @ctr128_inc(i8* %8)
ret void
}

LLVM IR (-O2):
define void @ctr128_inc_aligned(i8* %0) {
%2 = tail call i32 @ctr128_inc(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dayOfYear(int, int, int);
int /*<<< orphan*/ monthDay(int, int, unsigned char *, unsigned char *);
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, int);
int main() {
  unsigned char month, day;
  dayOfYear(1995, 3, 1);
  monthDay(1995, 61, &month, &day);
  printf("%d/%d/%d\n", month, day, 1995);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7cb,%edi
mov    $0x3,%esi
mov    $0x1,%edx
call   1050 <dayOfYear@plt>
mov    $0x7cb,%edi
mov    $0x3d,%esi
lea    -0x5(%rbp),%rdx
lea    -0x6(%rbp),%rcx
call   1040 <monthDay@plt>
mov    -0x5(%rbp),%al
lea    0xe8c(%rip),%rdi
mov    $0x7cb,%ecx
movzbl %al,%esi
movzbl -0x6(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7cb,%edi
mov    $0x3,%esi
mov    $0x1,%edx
call   1050 <dayOfYear@plt>
lea    0x7(%rsp),%rdx
lea    0x6(%rsp),%rcx
mov    $0x7cb,%edi
mov    $0x3d,%esi
call   1040 <monthDay@plt>
movzbl 0x7(%rsp),%esi
movzbl 0x6(%rsp),%edx
lea    0xe91(%rip),%rdi
mov    $0x7cb,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d/%d/%d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = tail call i32 @dayOfYear(i32 1995, i32 3, i32 1)
%4 = call i32 @monthDay(i32 1995, i32 61, i8* %1, i8* %2)
%5 = load i8, i8* %1
%6 = load i8, i8* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 zeroext %5, i8 zeroext %6, i32 1995)
ret i32 0
}
int fun370() { return 370; }


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

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

LLVM IR (-O0):
define i32 @fun370() {
ret i32 370
}

LLVM IR (-O2):
define i32 @fun370() {
ret i32 370
}
void kasan_enable_current(void) {}


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

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

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

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

/* Variables and functions */
void build_heap(struct huffman_node *heap, size_t heap_size) {}


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

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

LLVM IR (-O0):
%struct.huffman_node = type { i32 }
define void @build_heap(%struct.huffman_node* %0, i64 %1) {
%3 = alloca %struct.huffman_node*
%4 = alloca i64
store %struct.huffman_node* %0, %struct.huffman_node** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
%struct.huffman_node = type { i32 }
define void @build_heap(%struct.huffman_node* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t int64_hash1(int64_t key) {
  key = ~key + (key << 15);
  key = key ^ (key >> 12);
  key = key + (key << 2);
  key = key ^ (key >> 4);
  key = key * 2057;
  key = key ^ (key >> 16);
  return key;
}


x86 assembly (clang, -O0):
<int64_hash1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x4(%rbp),%ecx
shl    $0xf,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xc,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
imul   $0x809,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int64_hash1>:
mov    %edi,%eax
not    %eax
shl    $0xf,%edi
add    %eax,%edi
mov    %edi,%eax
sar    $0xc,%eax
xor    %edi,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,%ecx
sar    $0x4,%ecx
xor    %eax,%ecx
imul   $0x809,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @int64_hash1(i32 %0) {
%2 = xor i32 %0, -1
%3 = shl i32 %0, 15
%4 = add nsw i32 %3, %2
%5 = ashr i32 %4, 12
%6 = xor i32 %5, %4
%7 = mul i32 %6, 5
%8 = ashr i32 %7, 4
%9 = xor i32 %8, %7
%10 = mul nsw i32 %9, 2057
%11 = ashr i32 %10, 16
%12 = xor i32 %11, %10
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ asn1_ps_func;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_C_SET_SUFFIX;
int asn1_bio_set_ex(int /*<<< orphan*/ *, int /*<<< orphan*/,
                    int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
                        asn1_ps_func *suffix_free) {
  return asn1_bio_set_ex(b, BIO_C_SET_SUFFIX, suffix, suffix_free);
}


x86 assembly (clang, -O0):
<BIO_asn1_set_suffix>:
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    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <asn1_bio_set_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_asn1_set_suffix>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
jmp    1030 <asn1_bio_set_ex@plt>

LLVM IR (-O0):
@BIO_C_SET_SUFFIX = global i32 0
define i32 @BIO_asn1_set_suffix(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* @BIO_C_SET_SUFFIX
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = call i32 @asn1_bio_set_ex(i32* %7, i32 %8, i32* %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
@BIO_C_SET_SUFFIX = global i32 0
define i32 @BIO_asn1_set_suffix(i32* %0, i32* %1, i32* %2) {
%4 = load i32, i32* @BIO_C_SET_SUFFIX
%5 = tail call i32 @asn1_bio_set_ex(i32* %0, i32 %4, i32* %1, i32* %2)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;

/* Variables and functions */
int local_sleep(u_long seconds, u_long microseconds) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @local_sleep(i32 %0, i32 %1) {
ret i32 0
}