xunge/DecIR huggingface dataset:
int main(int argc, char *argv[]) {
  if (1)
#pragma omp task
  {
    int i;
    i = 3;
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ suspend_curses();
void endwin() { suspend_curses(); }


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

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

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

LLVM IR (-O2):
define void @endwin() {
%1 = tail call i32 (...) @suspend_curses()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void vis_jsondoc_preamble(void) {
  printf("{\n");
  printf("  \"source_version\" : \"%s\",\n", "2015.2");
  printf("  \"algorithm\" : 4,\n");
  printf("  \"vis\" : [\n");
}


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

x86 assembly (clang, -O2):
<vis_jsondoc_preamble>:
push   %rax
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0xee1(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [28 x i8] c" \22source_version\22 : \22%s\22,\0A\00"
@.str.2 = [7 x i8] c"2015.2\00"
@.str.3 = [20 x i8] c" \22algorithm\22 : 4,\0A\00"
@.str.4 = [13 x i8] c" \22vis\22 : [\0A\00"
define void @vis_jsondoc_preamble() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c" \22source_version\22 : \22%s\22,\0A\00"
@.str.2 = [7 x i8] c"2015.2\00"
@str = [2 x i8] c"{\00"
@str.5 = [19 x i8] c" \22algorithm\22 : 4,\00"
@str.6 = [12 x i8] c" \22vis\22 : [\00"
define void @vis_jsondoc_preamble() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.6, i64 0, i64 0))
ret void
}
int tegra_cpu_edp_count_therm_floors(struct platform_device *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @tegra_cpu_edp_count_therm_floors(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *lang_callFunction_string(char *);
char *lang_eval_doCallPreliminary(int /*<<< orphan*/ *);
char *lang_eval_doCall_string(FILE *lang_in) {
  char *ret;
  char *name;
  name = lang_eval_doCallPreliminary(lang_in);
  ret = lang_callFunction_string(name);
  return ret;
}


x86 assembly (clang, -O0):
<lang_eval_doCall_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lang_eval_doCallPreliminary@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <lang_callFunction_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lang_eval_doCall_string>:
push   %rax
call   1030 <lang_eval_doCallPreliminary@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <lang_callFunction_string@plt>

LLVM IR (-O0):
define i8* @lang_eval_doCall_string(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i8*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i8* @lang_eval_doCallPreliminary(i32* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i8* @lang_callFunction_string(i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @lang_eval_doCall_string(i32* %0) {
%2 = tail call i8* @lang_eval_doCallPreliminary(i32* %0)
%3 = tail call i8* @lang_callFunction_string(i8* %2)
ret i8* %3
}
void foo124(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo124(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t write(int, void const *, size_t);
int WriteFile(int fd, const void *address, size_t length) {
  assert(fd != -1);
  if (write(fd, address, length) != length)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<WriteFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
cmp    -0x18(%rbp),%rax
je     116a <WriteFile+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <WriteFile+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteFile>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0xffffffff,%ebp
setne  %dil
call   1040 <assert@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @WriteFile(i32 %0, i8* nocapture %1, i64 %2) {
%4 = icmp ne i32 %0, -1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i64 @write(i32 %0, i8* %1, i64 %2)
%8 = icmp ne i64 %7, %2
%9 = sext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
struct WdStack {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wdPeek(struct WdStack *);
int /*<<< orphan*/ wdPush(int /*<<< orphan*/, struct WdStack *);
int32_t wdDup(struct WdStack *s) { wdPush(wdPeek(s), s); }


x86 assembly (clang, -O0):
<wdDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <wdPeek@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <wdPush@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wdDup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <wdPeek@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <wdPush@plt>

LLVM IR (-O0):
%struct.WdStack = type { i32 }
define i32 @wdDup(%struct.WdStack* %0) {
%2 = alloca i32
%3 = alloca %struct.WdStack*
store %struct.WdStack* %0, %struct.WdStack** %3
%4 = load %struct.WdStack*, %struct.WdStack** %3
%5 = call i32 @wdPeek(%struct.WdStack* %4)
%6 = load %struct.WdStack*, %struct.WdStack** %3
%7 = call i32 @wdPush(i32 %5, %struct.WdStack* %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
%struct.WdStack = type { i32 }
define i32 @wdDup(%struct.WdStack* %0) {
%2 = tail call i32 @wdPeek(%struct.WdStack* %0)
%3 = tail call i32 @wdPush(i32 %2, %struct.WdStack* %0)
ret i32 undef
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t table_hash(int *table) {
  int64_t idx;
  int i;
  for (i = 0; i < 16; i++)
    idx |= i << (table[i] * 4);
  return idx;
}


x86 assembly (clang, -O0):
<table_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    1140 <table_hash+0x40>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
shl    $0x2,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    110f <table_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @table_hash(i32* nocapture %0) {
ret i32 -1
}
/* Type definitions */
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int log_message(const struct mg_connection *conn, const char *message) {
  (void)conn;
  printf("%s\n", message);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define i32 @log_message(%struct.mg_connection* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
int subtract(int a, int b) { return a - b; }


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

x86 assembly (clang, -O2):
<subtract>:
mov    %edi,%eax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @subtract(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
void avs_disable(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @avs_disable(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void adjustedGE(unsigned a) {
  char *b = ((void *)0);
  if (a - 1 >= -1U - 1)
    b = malloc(1);
  if (a == -1U)
    free(b);
  return;
}


x86 assembly (clang, -O0):
<adjustedGE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cmp    $0xfffffffe,%eax
jb     1150 <adjustedGE+0x30>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1163 <adjustedGE+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjustedGE>:
push   %rbx
mov    %edi,%ebx
lea    0x1(%rbx),%eax
cmp    $0x1,%eax
ja     113a <adjustedGE+0x1a>
mov    $0x1,%edi
call   1040 <malloc@plt>
cmp    $0xffffffff,%ebx
je     113c <adjustedGE+0x1c>
pop    %rbx
ret
mov    %rax,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @adjustedGE(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = icmp uge i32 %5, -2
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i8* @malloc(i32 1)
store i8* %8, i8** %3
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @adjustedGE(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 2
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%6 = icmp eq i32 %0, -1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @free(i8* %5)
br label %9
9: ; preds = %1, %7, %4
ret void
}
/* Variables and functions */
int getchar();
int read_s(char a[]) {
  int i = 0;
  int c = getchar();
  while (c != '\n' && c != '\0') {
    a[i] = c;
    c = getchar();
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<read_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1146 <read_s+0x36>
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1156 <read_s+0x46>
jmp    117e <read_s+0x6e>
mov    -0x10(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <read_s+0x1d>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_s>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     1148 <read_s+0x38>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0xa,%eax
je     1148 <read_s+0x38>
mov    %al,(%r14,%rbx,1)
xor    %eax,%eax
call   1030 <getchar@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    1130 <read_s+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @read_s(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = call i32 (...) @getchar()
store i32 %5, i32* %4
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br i1 %13, label %14, label %24
14: ; preds = %12
%15 = load i32, i32* %4
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %2
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
%21 = call i32 (...) @getchar()
store i32 %21, i32* %4
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %6
24: ; preds = %12
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @read_s(i8* nocapture writeonly %0) {
%2 = tail call i32 (...) @getchar()
br label %3
3: ; preds = %6, %1
%4 = phi i64 [ %10, %6 ], [ 0, %1 ]
%5 = phi i32 [ %9, %6 ], [ %2, %1 ]
switch i32 %5, label %6 [
i32 10, label %11
i32 0, label %11
]
6: ; preds = %3
%7 = trunc i32 %5 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %7, i8* %8
%9 = tail call i32 (...) @getchar()
%10 = add nuw i64 %4, 1
br label %3
11: ; preds = %3, %3
%12 = trunc i64 %4 to i32
ret i32 %12
}
void APPS_ADC_IRQ_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @APPS_ADC_IRQ_Interrupt() {
ret void
}
extern void pinio_nvram_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @pinio_nvram_lock() {
ret void
}
unsigned long SysCtlFlashSizeGet(void) {
  return ((((*((volatile unsigned long *)(0x400FE008))) & 0x0000FFFF) << 11) +
          0x800);
}


x86 assembly (clang, -O0):
<SysCtlFlashSizeGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe008,%eax
mov    (%rax),%rax
and    $0xffff,%rax
shl    $0xb,%rax
add    $0x800,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlFlashSizeGet>:
mov    0x400fe008,%rax
40
movzwl %ax,%eax
shl    $0xb,%rax
add    $0x800,%rax
ret

LLVM IR (-O0):
define i64 @SysCtlFlashSizeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782216 to i64*)
%2 = and i64 %1, 65535
%3 = shl i64 %2, 11
%4 = add i64 %3, 2048
ret i64 %4
}

LLVM IR (-O2):
define i64 @SysCtlFlashSizeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782216 to i64*)
%2 = shl i64 %1, 11
%3 = and i64 %2, 134215680
%4 = add nuw nsw i64 %3, 2048
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
ansi_attr(int attr) { printf("\033[%dm", attr); }


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

x86 assembly (clang, -O2):
<ansi_attr>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dm\00"
define i32 @ansi_attr(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
int main() {
  unsigned int m;
  register int idx;
  m = 10;
  idx = fn_test(m);
  printf("idx=%d\n", idx);
  printf("address of m=%x", &m);
  printf("\nPress any key to end...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1050 <fn_test@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
mov    $0xa,%edi
xor    %eax,%eax
call   1050 <fn_test@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"idx=%d\0A\00"
@.str.1 = [16 x i8] c"address of m=%x\00"
@.str.2 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
%3 = load i32, i32* %1
%4 = call i32 (i32, ...) bitcast (i32 (...)* @fn_test to i32 (i32, ...)*)(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"idx=%d\0A\00"
@.str.1 = [16 x i8] c"address of m=%x\00"
@.str.2 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @fn_test to i32 (i32, ...)*)(i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookreal32array(void *x, int n) {
  lookNarray((char *)x, (unsigned int)(n * 32));
}


x86 assembly (clang, -O0):
<lookreal32array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x5,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookreal32array>:
shl    $0x5,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookreal32array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 32
%8 = call i32 @lookNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @lookreal32array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 5
%4 = tail call i32 @lookNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
char *broadcast_command(char *, char *);
int /*<<< orphan*/ free(char *);
char *strdup(char *);
char *check_if_running() {
  char *r = NULL;
  char *dest = NULL;
  dest = strdup("127.0.0.1");
  char *cmd = NULL;
  cmd = strdup("ping");
  r = broadcast_command(dest, cmd);
  free(dest);
  free(cmd);
  return r;
}


x86 assembly (clang, -O0):
<check_if_running>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xeb1(%rip),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xea3(%rip),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <broadcast_command@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if_running>:
push   %r15
push   %r14
push   %rbx
lea    0xec4(%rip),%rdi
call   1050 <strdup@plt>
mov    %rax,%r14
lea    0xebf(%rip),%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <broadcast_command@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [5 x i8] c"ping\00"
define i8* @check_if_running() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
store i8* null, i8** %1
store i8* null, i8** %2
%4 = call i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %2
store i8* null, i8** %3
%5 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i8* @broadcast_command(i8* %6, i8* %7)
store i8* %8, i8** %1
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [5 x i8] c"ping\00"
define i8* @check_if_running() {
%1 = tail call dereferenceable_or_null(10) i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @broadcast_command(i8* %1, i8* %2)
%4 = tail call i32 @free(i8* %1)
%5 = tail call i32 @free(i8* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ TEST(char *, int /*<<< orphan*/);
int XParseGeometry(char *parsestring, int *x_return, int *y_return,
                   unsigned int *width_return, unsigned int *height_return) {
  TEST("XParseGeometry", 0);
  return 0;
}


x86 assembly (clang, -O0):
<XParseGeometry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xecd(%rip),%rdi
xor    %esi,%esi
call   1030 <TEST@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"XParseGeometry\00"
define i32 @XParseGeometry(i8* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = call i32 @TEST(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"XParseGeometry\00"
define i32 @XParseGeometry(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3, i32* nocapture readnone %4) {
%6 = tail call i32 @TEST(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void c_fputs_(char *str, FILE **fp, int len) { fputs(str, *fp); }


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

x86 assembly (clang, -O2):
<c_fputs_>:
mov    (%rsi),%rsi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
define void @c_fputs_(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** %8
%10 = call i32 @fputs(i8* %7, i32* %9)
ret void
}

LLVM IR (-O2):
define void @c_fputs_(i8* nocapture %0, i32** nocapture %1, i32 %2) {
%4 = load i32*, i32** %1
%5 = tail call i32 @fputs(i8* %0, i32* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char getc(int /*<<< orphan*/ *);
scalar_t__ isspace(char);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
void skip_spaces(FILE *inf) {
  char c;
  while (isspace(c = getc(inf)))
    ;
  ungetc(c, inf);
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     115f <skip_spaces+0x2f>
jmp    113c <skip_spaces+0xc>
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <getc@plt>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1140 <skip_spaces+0x10>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ungetc@plt>

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

LLVM IR (-O2):
define void @skip_spaces(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 @getc(i32* %0)
%4 = tail call i64 @isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 @ungetc(i8 signext %3, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int);
void kill_process_group(int sig) {
  static int received_termination = 0;
  if (received_termination) {
    return;
  }
  received_termination = 1;
  kill(0, sig);
  exit(0);
}


x86 assembly (clang, -O0):
<kill_process_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,0x2f02(%rip)
je     113e <kill_process_group+0x1e>
add    $0x10,%rsp
pop    %rbp
ret
movl   $0x1,0x2eec(%rip)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1030 <kill@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<kill_process_group>:
push   %rax
cmpb   $0x1,0x2f0c(%rip)
jne    112c <kill_process_group+0xc>
pop    %rax
ret
mov    %edi,%esi
movb   $0x1,0x2eff(%rip)
xor    %edi,%edi
call   1030 <kill@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@kill_process_group.received_termination = internal global i32 0
define void @kill_process_group(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @kill_process_group.received_termination
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
ret void
6: ; preds = %1
store i32 1, i32* @kill_process_group.received_termination
%7 = load i32, i32* %2
%8 = call i32 @kill(i32 0, i32 %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@kill_process_group.received_termination = internal unnamed_addr global i1 false
define void @kill_process_group(i32 %0) {
%2 = load i1, i1* @kill_process_group.received_termination
br i1 %2, label %3, label %4
3: ; preds = %1
ret void
4: ; preds = %1
store i1 true, i1* @kill_process_group.received_termination
%5 = tail call i32 @kill(i32 0, i32 %0)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ copy_file(char const *, char const *, char const *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
void fork_copy_file(const char *src_dir, const char *dst_dir,
                    const char *file_name) {
  pid_t pid = fork();
  if (pid == 0) {
    copy_file(src_dir, dst_dir, file_name);
    exit(0);
  }
}


x86 assembly (clang, -O0):
<fork_copy_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1172 <fork_copy_file+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <copy_file@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_copy_file>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
je     1150 <fork_copy_file+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <copy_file@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fork_copy_file(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i64 (...) @fork()
store i64 %8, i64* %7
%9 = load i64, i64* %7
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @copy_file(i8* %12, i8* %13, i8* %14)
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @fork_copy_file(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 (...) @fork()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @copy_file(i8* %0, i8* %1, i8* %2)
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %3
ret void
}
void test_114(unsigned short *x, unsigned int *y) { y[0] = x[1] >> 15; }


x86 assembly (clang, -O0):
<test_114>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%ecx
sar    $0xf,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_114>:
movzwl 0x2(%rdi),%eax
shr    $0xf,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @test_114(i16* %0, i32* %1) {
%3 = alloca i16*
%4 = alloca i32*
store i16* %0, i16** %3
store i32* %1, i32** %4
%5 = load i16*, i16** %3
%6 = getelementptr inbounds i16, i16* %5, i64 1
%7 = load i16, i16* %6
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 15
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @test_114(i16* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %3
%5 = lshr i16 %4, 15
%6 = zext i16 %5 to i32
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
char *ptsname(int /*<<< orphan*/);
int main(void) {
  char *name = ptsname(0);
  (void)name;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <ptsname@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @ptsname(i32 0)
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRA6_set(void) { return U_WMRCORENONE_set("U_WMRA6"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA6\00"
define i8* @U_WMRA6_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_WMRA6\00"
define i8* @U_WMRA6_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
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int fscanf(int /*<<< orphan*/ *, char *, char *);
uint32_t pofsic_get_config_data(FILE *fp, uint32_t *ret_p) {
  char str[(100)];
  if (fscanf(fp, "%s", str) != 1) {
    *ret_p = 1;
    return 1;
  } else {
    return atoi(str);
  }
}


x86 assembly (clang, -O0):
<pofsic_get_config_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    0xebe(%rip),%rsi
call   1030 <fscanf@plt>
cmp    $0x1,%eax
je     1166 <pofsic_get_config_data+0x46>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1172 <pofsic_get_config_data+0x52>
lea    -0x80(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pofsic_get_config_data>:
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%rbx
lea    0xed1(%rip),%rsi
mov    %rsp,%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
jne    1146 <pofsic_get_config_data+0x26>
mov    %rsp,%rdi
call   1040 <atoi@plt>
jmp    1151 <pofsic_get_config_data+0x31>
movl   $0x1,(%rbx)
mov    $0x1,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @pofsic_get_config_data(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %8, label %7
7: ; preds = %2
store i32 1, i32* %1
br label %10
8: ; preds = %2
%9 = call i32 @atoi(i8* %4)
br label %10
10: ; preds = %8, %7
%11 = phi i32 [ 1, %7 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void unpackWithShift(unsigned int val) {
  printf("Unpacking bits by shifting\n");
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Unpacking bits by shifting\0A\00"
define void @unpackWithShift(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Unpacking bits by shifting\00"
define void @unpackWithShift(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
double sqr(x)
double x;
{ return (x * x); }


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

x86 assembly (clang, -O2):
<sqr>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @sqr(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void setNEqual() {
  emitln("setne\t%%al");
  emitln("neg\t%%al\t#change 1 to -1");
  emitln("movsx\t%%al,%%eax\t#extend al to eax");
}


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

x86 assembly (clang, -O2):
<setNEqual>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <emitln@plt>
lea    0xee7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xef4(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"setne\09%%al\00"
@.str.1 = [25 x i8] c"neg\09%%al\09#change 1 to -1\00"
@.str.2 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @setNEqual() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitln(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"setne\09%%al\00"
@.str.1 = [25 x i8] c"neg\09%%al\09#change 1 to -1\00"
@.str.2 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @setNEqual() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ _stub(int /*<<< orphan*/);
ssize_t _read(int fd, void *ptr, size_t len) { return _stub(EBADF); }


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <_stub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_stub@plt>

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

LLVM IR (-O2):
@EBADF = global i32 0
define i32 @_read(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @EBADF
%5 = tail call i32 @_stub(i32 %4)
ret i32 %5
}
void foo800(int p) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @foo800(i32 %0) {
ret void
}
void init_log(char *name, int level) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ max32u(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t max3x32u(uint32_t a, uint32_t b, uint32_t c) {
  return max32u(max32u(a, b), c);
}


x86 assembly (clang, -O0):
<max3x32u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <max32u@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <max32u@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3x32u>:
push   %rbx
mov    %edx,%ebx
call   1030 <max32u@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <max32u@plt>

LLVM IR (-O0):
define i32 @max3x32u(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* %5
%9 = call i32 @max32u(i32 %7, i32 %8)
%10 = load i32, i32* %6
%11 = call i32 @max32u(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @max3x32u(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @max32u(i32 %0, i32 %1)
%5 = tail call i32 @max32u(i32 %4, i32 %2)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t knot_wire_read_u16(const uint8_t *pos) {
  return ntohs(*(uint16_t *)pos);
}


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

x86 assembly (clang, -O2):
<knot_wire_read_u16>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

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

LLVM IR (-O2):
define i32 @knot_wire_read_u16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ntohs(i32 %2)
ret i32 %3
}
int main() {
  int c, x, y, z;
  (void)(c ? x / y : z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
jmp    1124 <main+0x24>
mov    -0x14(%rbp),%eax
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}