xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *util_strdup(char *string) {
  int len = strlen(string);
  char *dup = (char *)malloc(len + 1);
  if (dup == NULL) {
    perror("malloc");
    return NULL;
  }
  strcpy(dup, string);
  return dup;
}


x86 assembly (clang, -O0):
<util_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    118b <util_strdup+0x4b>
lea    0xe87(%rip),%rdi
call   1060 <perror@plt>
movq   $0x0,-0x8(%rbp)
jmp    11a0 <util_strdup+0x60>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1172 <util_strdup+0x32>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe87(%rip),%rdi
call   1060 <perror@plt>
xor    %ebx,%ebx
jmp    1167 <util_strdup+0x27>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @util_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %2
br label %21
16: ; preds = %1
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = load i8*, i8** %5
store i8* %20, i8** %2
br label %21
21: ; preds = %16, %14
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define i8* @util_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %11
11: ; preds = %9, %7
%12 = phi i8* [ null, %7 ], [ %5, %9 ]
ret i8* %12
}
int test_imm_0Cuint16_mem(unsigned short *val) {
  return ((*val) & (0x0C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 12
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *fgets(char *, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *receive(char *buf, size_t buf_size, void *state) {
  return fgets(buf, buf_size, stdin);
}


x86 assembly (clang, -O0):
<receive>:
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),%rsi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
call   1030 <fgets@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fgets@plt>

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

LLVM IR (-O2):
@stdin = global i32 0
define i8* @receive(i8* %0, i64 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @stdin
%5 = tail call i8* @fgets(i8* %0, i64 %1, i32 %4)
ret i8* %5
}
void insert_userblock(char *filename, char *inifilename) {}


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

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

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

LLVM IR (-O2):
define void @insert_userblock(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void os_trace_api_u32x2(unsigned id, uint32_t p0, uint32_t p1) {}


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

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

LLVM IR (-O0):
define void @os_trace_api_u32x2(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
ret void
}

LLVM IR (-O2):
define void @os_trace_api_u32x2(i32 %0, i32 %1, i32 %2) {
ret void
}
__typeof__(snprintf(1, 1, 1)) test_snprintf_254(void) {
  return snprintf(1, 1, 1);
}


x86 assembly (clang, -O0):
<test_snprintf_254>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <snprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_snprintf_254>:
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
define i32 @test_snprintf_254() {
%1 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* inttoptr (i64 1 to i8*), i64 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_snprintf_254() {
%1 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* inttoptr (i64 1 to i8*), i64 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}
/* Variables and functions */
int num_divisors(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n = 0, i = 1;
  while (num_divisors(n) < 500)
    n += (i++);
  printf("%d\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <num_divisors@plt>
cmp    $0x1f4,%eax
jge    1166 <main+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <num_divisors@plt>
cmp    $0x1f3,%eax
jg     1153 <main+0x33>
xor    %ebx,%ebx
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
add    %ebp,%ebx
add    $0x1,%ebp
mov    %ebx,%edi
call   1040 <num_divisors@plt>
cmp    $0x1f4,%eax
jl     1140 <main+0x20>
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @num_divisors(i32 0)
%2 = icmp slt i32 %1, 500
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 1, %0 ]
%5 = phi i32 [ %7, %3 ], [ 0, %0 ]
%6 = add nuw nsw i32 %4, 1
%7 = add nuw nsw i32 %4, %5
%8 = tail call i32 @num_divisors(i32 %7)
%9 = icmp slt i32 %8, 500
br i1 %9, label %3, label %10
10: ; preds = %3, %0
%11 = phi i32 [ 0, %0 ], [ %7, %3 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
int rename(char const *, char const *);
void stub1(char const *, char const *);
int do_rename(const char *on, const char *nn, void *void_arg) {
  void (*void_func)(const char *, const char *) =
      (void (*)(const char *, const char *))void_arg;
  if (void_func)
    (*void_func)(on, nn);
  return (rename(on, nn));
}


x86 assembly (clang, -O0):
<do_rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1145 <do_rename+0x35>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rename@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rename>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdx,%rdx
je     1127 <do_rename+0x17>
mov    %rbx,%rdi
mov    %r14,%rsi
call   *%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <rename@plt>

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

LLVM IR (-O2):
define i32 @do_rename(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = bitcast i8* %2 to void (i8*, i8*)*
tail call void %6(i8* %0, i8* %1)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
void console_ESC_C(char *esc_param) {
  int p[1];
  sscanf(esc_param, "%d", &p[0]);
}


x86 assembly (clang, -O0):
<console_ESC_C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rdx
lea    0xed5(%rip),%rsi
call   1030 <sscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_ESC_C>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @console_ESC_C(i8* nocapture %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
ret void
}
int foo(void) {
  while (1) {
    return 1;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <foo+0x9>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
br label %1
1: ; preds = %0
ret i32 1
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
char *pdu_get_tpscts(char *body, char *tpscts) {
  char *pBegin, *pEnd;
  int len = 14;
  pBegin = body;
  pEnd = pBegin + len;
  strncpy(tpscts, pBegin, len);
  tpscts[len] = '\0';
  return pEnd;
}


x86 assembly (clang, -O0):
<pdu_get_tpscts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xe,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_get_tpscts>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xe(%rdi),%r14
mov    %rbx,%rdi
mov    $0xe,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xe(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @pdu_get_tpscts(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 14, i32* %7
%8 = load i8*, i8** %3
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i32, i32* %7
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8* %12, i8** %6
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = call i32 @strncpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %4
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 0, i8* %20
%21 = load i8*, i8** %6
ret i8* %21
}

LLVM IR (-O2):
define i8* @pdu_get_tpscts(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 14
%4 = tail call i32 @strncpy(i8* %1, i8* %0, i32 14)
%5 = getelementptr inbounds i8, i8* %1, i64 14
store i8 0, i8* %5
ret i8* %3
}
int security_unix_stream_connect(struct socket *sock, struct socket *other) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.socket = type opaque
define i32 @security_unix_stream_connect(%struct.socket* %0, %struct.socket* %1) {
%3 = alloca %struct.socket*
%4 = alloca %struct.socket*
store %struct.socket* %0, %struct.socket** %3
store %struct.socket* %1, %struct.socket** %4
ret i32 0
}

LLVM IR (-O2):
%struct.socket = type opaque
define i32 @security_unix_stream_connect(%struct.socket* nocapture readnone %0, %struct.socket* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
main() { printf("%le\n", 1.0 / 720.0); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%le\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x3F56C16C16C16C17)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ application_init();
int /*<<< orphan*/ board_init();
int /*<<< orphan*/ rt_hw_interrupt_disable();
int /*<<< orphan*/ rt_show_version();
int /*<<< orphan*/ rt_system_scheduler_init();
int /*<<< orphan*/ rt_system_scheduler_start();
int /*<<< orphan*/ rt_system_timer_init();
int /*<<< orphan*/ rt_thread_idle_init();
int main() {
  rt_hw_interrupt_disable();
  board_init();
  rt_show_version();
  rt_system_timer_init();
  rt_system_scheduler_init();
  application_init();
  rt_thread_idle_init();
  rt_system_scheduler_start();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rt_hw_interrupt_disable@plt>
mov    $0x0,%al
call   1070 <board_init@plt>
mov    $0x0,%al
call   1090 <rt_show_version@plt>
mov    $0x0,%al
call   1060 <rt_system_timer_init@plt>
mov    $0x0,%al
call   1080 <rt_system_scheduler_init@plt>
mov    $0x0,%al
call   1050 <application_init@plt>
mov    $0x0,%al
call   10a0 <rt_thread_idle_init@plt>
mov    $0x0,%al
call   1030 <rt_system_scheduler_start@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rt_hw_interrupt_disable@plt>
xor    %eax,%eax
call   1070 <board_init@plt>
xor    %eax,%eax
call   1090 <rt_show_version@plt>
xor    %eax,%eax
call   1060 <rt_system_timer_init@plt>
xor    %eax,%eax
call   1080 <rt_system_scheduler_init@plt>
xor    %eax,%eax
call   1050 <application_init@plt>
xor    %eax,%eax
call   10a0 <rt_thread_idle_init@plt>
xor    %eax,%eax
call   1030 <rt_system_scheduler_start@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @rt_hw_interrupt_disable()
%3 = call i32 (...) @board_init()
%4 = call i32 (...) @rt_show_version()
%5 = call i32 (...) @rt_system_timer_init()
%6 = call i32 (...) @rt_system_scheduler_init()
%7 = call i32 (...) @application_init()
%8 = call i32 (...) @rt_thread_idle_init()
%9 = call i32 (...) @rt_system_scheduler_start()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @rt_hw_interrupt_disable()
%2 = tail call i32 (...) @board_init()
%3 = tail call i32 (...) @rt_show_version()
%4 = tail call i32 (...) @rt_system_timer_init()
%5 = tail call i32 (...) @rt_system_scheduler_init()
%6 = tail call i32 (...) @application_init()
%7 = tail call i32 (...) @rt_thread_idle_init()
%8 = tail call i32 (...) @rt_system_scheduler_start()
ret i32 0
}
/* Variables and functions */
double pgamma(double, double);
double qgamma(double x, double a) {
  double oup;
  oup = pgamma(x, a);
  return 1.0 - oup;
}


x86 assembly (clang, -O0):
<qgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pgamma@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xec2(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qgamma>:
push   %rax
call   1030 <pgamma@plt>
movsd  0xee2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @qgamma(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double @pgamma(double %6, double %7)
store double %8, double* %5
%9 = load double, double* %5
%10 = fsub double 1.000000e+00, %9
ret double %10
}

LLVM IR (-O2):
define double @qgamma(double %0, double %1) {
%3 = tail call double @pgamma(double %0, double %1)
%4 = fsub double 1.000000e+00, %3
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ EncryptionPrinceCore(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *);
int /*<<< orphan*/ Whitening(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void Encrypt(uint8_t *block, uint8_t *roundKeys) {
  Whitening(block, roundKeys);
  EncryptionPrinceCore(block, &roundKeys[16]);
  Whitening(block, &roundKeys[8]);
}


x86 assembly (clang, -O0):
<Encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Whitening@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x40,%rsi
call   1040 <EncryptionPrinceCore@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
call   1030 <Whitening@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Encrypt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <Whitening@plt>
lea    0x40(%rbx),%rsi
mov    %r14,%rdi
call   1040 <EncryptionPrinceCore@plt>
add    $0x20,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <Whitening@plt>

LLVM IR (-O0):
define void @Encrypt(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @Whitening(i32* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 16
%11 = call i32 @EncryptionPrinceCore(i32* %8, i32* %10)
%12 = load i32*, i32** %3
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 8
%15 = call i32 @Whitening(i32* %12, i32* %14)
ret void
}

LLVM IR (-O2):
define void @Encrypt(i32* %0, i32* %1) {
%3 = tail call i32 @Whitening(i32* %0, i32* %1)
%4 = getelementptr inbounds i32, i32* %1, i64 16
%5 = tail call i32 @EncryptionPrinceCore(i32* %0, i32* %4)
%6 = getelementptr inbounds i32, i32* %1, i64 8
%7 = tail call i32 @Whitening(i32* %0, i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  register unsigned i, j = 0;
  for (i = 0; i < (150000 * 25); i++)
    j += i;
  printf("Done (%d)\n", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x393870,-0x8(%rbp)
jae    1151 <main+0x41>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Done (%d)\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 386661448)
ret i32 0
}
void ar9003_mci_init_cal_done(struct ath_hw *ah) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.ath_hw = type opaque
define void @ar9003_mci_init_cal_done(%struct.ath_hw* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ INT_MIN;
unsigned int test7u(unsigned int x) {
  unsigned int y = (unsigned int)INT_MIN;
  unsigned int z = 0x1234;
  return (x ^ y) ^ z;
}


x86 assembly (clang, -O0):
<test7u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0x8(%rbp)
movl   $0x1234,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7u>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
xor    (%rcx),%eax
xor    $0x1234,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @test7u(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i64, i64* @INT_MIN
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
store i32 4660, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = xor i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @test7u(i32 %0) {
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = xor i32 %3, %0
%5 = xor i32 %4, 4660
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ iwrites(char *);
int slength(char *);
void echo(char *str) {
  int len = slength(str);
  if (len <= 0) {
    iwrites("Error: No string was provided");
  } else {
    iwrites(str);
  }
  iwrites("\n");
}


x86 assembly (clang, -O0):
<echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <slength@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1153 <echo+0x33>
lea    0xeb7(%rip),%rdi
call   1030 <iwrites@plt>
jmp    115c <echo+0x3c>
mov    -0x8(%rbp),%rdi
call   1030 <iwrites@plt>
lea    0xebb(%rip),%rdi
call   1030 <iwrites@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo>:
push   %rbx
mov    %rdi,%rbx
call   1040 <slength@plt>
test   %eax,%eax
lea    0xece(%rip),%rdi
cmovg  %rbx,%rdi
call   1030 <iwrites@plt>
lea    0xedc(%rip),%rdi
pop    %rbx
jmp    1030 <iwrites@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Error: No string was provided\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @echo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @slength(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @iwrites(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @iwrites(i8* %11)
br label %13
13: ; preds = %10, %8
%14 = call i32 @iwrites(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Error: No string was provided\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @echo(i8* %0) {
%2 = tail call i32 @slength(i8* %0)
%3 = icmp slt i32 %2, 1
%4 = select i1 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0
%5 = tail call i32 @iwrites(i8* %4)
%6 = tail call i32 @iwrites(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int getsockopt(int, int /*<<< orphan*/, int, char *, int *);
int get_tcp_windowsize(int sock, int dir) {
  int bufsize = 0;
  int rc;
  socklen_t len;
  len = sizeof bufsize;
  rc = getsockopt(sock, SOL_SOCKET, dir, (char *)&bufsize, &len);
  if (rc < 0)
    return rc;
  return bufsize;
}


x86 assembly (clang, -O0):
<get_tcp_windowsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x4,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1160 <get_tcp_windowsize+0x50>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <get_tcp_windowsize+0x56>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tcp_windowsize>:
push   %rax
mov    %esi,%edx
movl   $0x0,(%rsp)
movl   $0x4,0x4(%rsp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rcx
lea    0x4(%rsp),%r8
call   1030 <getsockopt@plt>
test   %eax,%eax
js     113f <get_tcp_windowsize+0x2f>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
define i32 @get_tcp_windowsize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 4, i32* %4
%7 = load i32, i32* @SOL_SOCKET
%8 = call i32 @getsockopt(i32 %0, i32 %7, i32 %1, i8* %5, i32* %4)
%9 = icmp slt i32 %8, 0
%10 = load i32, i32* %3
%11 = select i1 %9, i32 %8, i32 %10
ret i32 %11
}
int test_imm_A3uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xA3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A3uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10682368
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *copyin(src, space)
char src[];
char **space;
{
  register char *cp, *top;
  register int s;
  s = strlen(src);
  cp = *space;
  top = cp;
  strcpy(cp, src);
  cp += s + 1;
  *space = cp;
  return (top);
}


x86 assembly (clang, -O0):
<copyin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyin>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    (%r14),%r12
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0x1,%ebx
movslq %ebx,%rax
add    %r12,%rax
mov    %rax,(%r14)
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @copyin(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %7
%11 = load i8**, i8*** %4
%12 = load i8*, i8** %11
store i8* %12, i8** %5
%13 = load i8*, i8** %5
store i8* %13, i8** %6
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = call i8* @strcpy(i8* %14, i8* %15)
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
%19 = load i8*, i8** %5
%20 = sext i32 %18 to i64
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8* %21, i8** %5
%22 = load i8*, i8** %5
%23 = load i8**, i8*** %4
store i8* %22, i8** %23
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
define i8* @copyin(i8* nocapture %0, i8** nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = load i8*, i8** %1
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
%6 = shl i64 %3, 32
%7 = add i64 %6, 4294967296
%8 = ashr exact i64 %7, 32
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8* %9, i8** %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int mocksuspend_enter(void) {
  printf("mocksuspend enter\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"mocksuspend enter\0A\00"
define i32 @mocksuspend_enter() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"mocksuspend enter\00"
define i32 @mocksuspend_enter() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double luaL_check_number(int);
scalar_t__ lua_lua2C(int);
double luaL_opt_number(int numArg, double def) {
  return (lua_lua2C(numArg) == 0) ? def : luaL_check_number(numArg);
}


x86 assembly (clang, -O0):
<luaL_opt_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <lua_lua2C@plt>
cmp    $0x0,%rax
jne    1151 <luaL_opt_number+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    115e <luaL_opt_number+0x3e>
mov    -0x4(%rbp),%edi
call   1030 <luaL_check_number@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaL_opt_number>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %edi,%ebx
call   1040 <lua_lua2C@plt>
test   %rax,%rax
je     1143 <luaL_opt_number+0x23>
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <luaL_check_number@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define double @luaL_opt_number(i32 %0, double %1) {
%3 = tail call i64 @lua_lua2C(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call double @luaL_check_number(i32 %0)
br label %7
7: ; preds = %2, %5
%8 = phi double [ %6, %5 ], [ %1, %2 ]
ret double %8
}
int prefix(const char *str1, const char *str2) {
  int i = 0;
  while (str1[i]) {
    if (str1[i] == str2[i]) {
      i++;
    } else {
      return 0;
    }
  }
  return i;
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1164 <prefix+0x64>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1153 <prefix+0x53>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115f <prefix+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    116a <prefix+0x6a>
jmp    1113 <prefix+0x13>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1124 <prefix+0x24>
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmp    (%rsi,%rdx,1),%cl
jne    1124 <prefix+0x24>
movzbl 0x1(%rdi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <prefix+0x10>
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @prefix(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %32, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %33
14: ; preds = %7
%15 = load i8*, i8** %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i8*, i8** %5
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %20, %26
br i1 %27, label %28, label %31
28: ; preds = %14
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %32
31: ; preds = %14
store i32 0, i32* %3
br label %35
32: ; preds = %28
br label %7
33: ; preds = %7
%34 = load i32, i32* %6
store i32 %34, i32* %3
br label %35
35: ; preds = %33, %31
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @prefix(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %11
%6 = phi i64 [ %12, %11 ], [ 0, %2 ]
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %6
%9 = load i8, i8* %8
%10 = icmp eq i8 %7, %9
br i1 %10, label %11, label %18
11: ; preds = %5
%12 = add nuw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %11
%17 = trunc i64 %12 to i32
br label %18
18: ; preds = %5, %16, %2
%19 = phi i32 [ 0, %2 ], [ %17, %16 ], [ 0, %5 ]
ret i32 %19
}
/* Variables and functions */
bool alphabetic(const char c) {
  if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<alphabetic>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1124 <alphabetic+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    113e <alphabetic+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     114a <alphabetic+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     114a <alphabetic+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <alphabetic+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphabetic>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @alphabetic(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %19, label %20
19: ; preds = %15, %7
store i32 1, i32* %2
br label %21
20: ; preds = %15, %11
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @alphabetic(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
long syscall3(long num, long arg1, long arg2, long arg3) {
  long result;
  asm volatile("syscall"
               : "=a"(result)
               : "a"(num), "D"(arg1), "S"(arg2), "d"(arg3)
               : "rcx", "r11");
  return result;
}


x86 assembly (clang, -O0):
<syscall3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
syscall
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall3>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
syscall
ret

LLVM IR (-O0):
define i64 @syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %10, i64 %11, i64 %12, i64 %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ b();
int /*<<< orphan*/ c();
int /*<<< orphan*/ d();
int /*<<< orphan*/ e();
int /*<<< orphan*/ f();
int main(void) {
  a();
  b();
  c();
  d();
  e();
  f();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <a@plt>
mov    $0x0,%al
call   1040 <b@plt>
mov    $0x0,%al
call   1070 <c@plt>
mov    $0x0,%al
call   1030 <d@plt>
mov    $0x0,%al
call   1060 <e@plt>
mov    $0x0,%al
call   1050 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <a@plt>
xor    %eax,%eax
call   1040 <b@plt>
xor    %eax,%eax
call   1070 <c@plt>
xor    %eax,%eax
call   1030 <d@plt>
xor    %eax,%eax
call   1060 <e@plt>
xor    %eax,%eax
call   1050 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @a()
%3 = call i32 (...) @b()
%4 = call i32 (...) @c()
%5 = call i32 (...) @d()
%6 = call i32 (...) @e()
%7 = call i32 (...) @f()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @b()
%3 = tail call i32 (...) @c()
%4 = tail call i32 (...) @d()
%5 = tail call i32 (...) @e()
%6 = tail call i32 (...) @f()
ret i32 0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int sys__gettid();
int sys_getpid();
pid_t sys_gettid(void) {
  pid_t tid = sys__gettid();
  if (tid != -1) {
    return tid;
  }
  return sys_getpid();
}


x86 assembly (clang, -O0):
<sys_gettid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <sys__gettid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1147 <sys_gettid+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <sys_gettid+0x31>
mov    $0x0,%al
call   1030 <sys_getpid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_gettid>:
push   %rax
xor    %eax,%eax
call   1040 <sys__gettid@plt>
cmp    $0xffffffff,%eax
je     112f <sys_gettid+0xf>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <sys_getpid@plt>

LLVM IR (-O0):
define i32 @sys_gettid() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @sys__gettid()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %10
8: ; preds = %0
%9 = call i32 (...) @sys_getpid()
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @sys_gettid() {
%1 = tail call i32 (...) @sys__gettid()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @sys_getpid()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
unsigned int instr_util_swaph(unsigned int val) {
  return ((val << 16) & 0xffff0000) | ((val >> 16) & 0xffff);
}


x86 assembly (clang, -O0):
<instr_util_swaph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
and    $0xffff0000,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instr_util_swaph>:
mov    %edi,%eax
rol    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @instr_util_swaph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 16
%5 = and i32 %4, -65536
%6 = load i32, i32* %2
%7 = lshr i32 %6, 16
%8 = and i32 %7, 65535
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @instr_util_swaph(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 16)
ret i32 %2
}
int sync(void) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(36));
  do {
    return (int)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<sync>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync>:
mov    $0x24,%eax
int    $0x80
ret

LLVM IR (-O0):
define i32 @sync() {
%1 = alloca i64
%2 = call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 36)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @sync() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 36)
%2 = trunc i64 %1 to i32
ret i32 %2
}
hello(int x) {
  x *= 2;
  return x + 45;
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2d,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
lea    (%rdi,%rdi,1),%eax
add    $0x2d,%eax
ret

LLVM IR (-O0):
define i32 @hello(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 45
ret i32 %6
}

LLVM IR (-O2):
define i32 @hello(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 45
ret i32 %3
}