xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun(int a) {
  if (a) {
    printf("True branch 1\n");
    printf("True branch 2\n");
  } else
    printf("False branch\n");
  printf("Done\n");
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <fun+0x32>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <fun+0x3e>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rax
test   %edi,%edi
je     112a <fun+0x1a>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
jmp    1131 <fun+0x21>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [13 x i8] c"False branch\00"
@str.4 = [5 x i8] c"Done\00"
@str.5 = [14 x i8] c"True branch 1\00"
@str.6 = [14 x i8] c"True branch 2\00"
define void @fun(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0), %3 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0), %1 ]
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tree *);
void tree_free(struct tree *t) { free(t); }


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

x86 assembly (clang, -O2):
<tree_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.tree = type { i32 }
define void @tree_free(%struct.tree* nocapture %0) {
%2 = tail call i32 @free(%struct.tree* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *program_name) {
  printf("Usage: %s (on|off|toggle|get) [MOD]\n\n", program_name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: %s (on|off|toggle|get) [MOD]\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Usage: %s (on|off|toggle|get) [MOD]\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void interrupt_reserved_1(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<interrupt_reserved_1>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <interrupt_reserved_1+0x9>
jmp    1109 <interrupt_reserved_1+0x9>

x86 assembly (clang, -O2):
<interrupt_reserved_1>:
jmp    1100 <interrupt_reserved_1>

LLVM IR (-O0):
define void @interrupt_reserved_1() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @interrupt_reserved_1() {
br label %1
1: ; preds = %0, %1
br label %1
}
void dstacktrace(int skip_count) {}


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

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

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

LLVM IR (-O2):
define void @dstacktrace(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NMI_WAKEUP_DriverIRQHandler();
__attribute__((weak)) void NMI_WAKEUP_IRQHandler(void) {
  NMI_WAKEUP_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @NMI_WAKEUP_IRQHandler() {
%1 = call i32 (...) @NMI_WAKEUP_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @NMI_WAKEUP_IRQHandler() {
%1 = tail call i32 (...) @NMI_WAKEUP_DriverIRQHandler()
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *tokenParser(char *, char *, int, char *);
char *dbNoVersionParser(char *header) {
  char *id = tokenParser(header, "|", 3, "dbNoVersionParser");
  char *ChP;
  if ((ChP = strchr(id, '.')) != NULL) {
    *ChP = '\0';
  }
  return id;
}


x86 assembly (clang, -O0):
<dbNoVersionParser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x3,%edx
lea    0xebf(%rip),%rcx
call   1040 <tokenParser@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116f <dbNoVersionParser+0x4f>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbNoVersionParser>:
push   %rbx
lea    0xed8(%rip),%rsi
lea    0xed3(%rip),%rcx
mov    $0x3,%edx
call   1040 <tokenParser@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1151 <dbNoVersionParser+0x31>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"|\00"
@.str.1 = [18 x i8] c"dbNoVersionParser\00"
define i8* @dbNoVersionParser(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @tokenParser(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @strchr(i8* %7, i8 signext 46)
store i8* %8, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i8*, i8** %4
store i8 0, i8* %11
br label %12
12: ; preds = %10, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
@.str.1 = [18 x i8] c"dbNoVersionParser\00"
define i8* @dbNoVersionParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 0, i8* %3
br label %6
6: ; preds = %5, %1
ret i8* %2
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
char *NameMenu(void) {
  char *myString = malloc(100 * sizeof(char));
  scanf("%*c");
  printf("Enter Name of Movie: ");
  scanf("%99[0-9a-zA-Z ]s", myString);
  return myString;
}


x86 assembly (clang, -O0):
<NameMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NameMenu>:
push   %rbx
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [22 x i8] c"Enter Name of Movie: \00"
@.str.2 = [17 x i8] c"%99[0-9a-zA-Z ]s\00"
define i8* @NameMenu() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 100)
store i8* %2, i8** %1
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %1
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [22 x i8] c"Enter Name of Movie: \00"
@.str.2 = [17 x i8] c"%99[0-9a-zA-Z ]s\00"
define i8* @NameMenu() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %1)
ret i8* %1
}
long int faktoriyel_hesapla(int girilen_sayi) {
  if (girilen_sayi == 0 || girilen_sayi == 1) {
    return 1;
  } else {
    return faktoriyel_hesapla(girilen_sayi - 1) * girilen_sayi;
  }
}


x86 assembly (clang, -O0):
<faktoriyel_hesapla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112f <faktoriyel_hesapla+0x1f>
cmpl   $0x1,-0xc(%rbp)
jne    113c <faktoriyel_hesapla+0x2c>
movq   $0x1,-0x8(%rbp)
jmp    1153 <faktoriyel_hesapla+0x43>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <faktoriyel_hesapla@plt>
movslq -0xc(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<faktoriyel_hesapla>:
mov    $0x1,%eax
cmp    $0x2,%edi
jb     1130 <faktoriyel_hesapla+0x30>
movslq %edi,%rcx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
imul   %rcx,%rax
add    $0xffffffffffffffff,%rcx
test   $0xfffffffe,%ecx
jne    1120 <faktoriyel_hesapla+0x20>
ret

LLVM IR (-O0):
define i64 @faktoriyel_hesapla(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i64 1, i64* %2
br label %17
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = call i64 @faktoriyel_hesapla(i32 %12)
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = mul nsw i64 %13, %15
store i64 %16, i64* %2
br label %17
17: ; preds = %10, %9
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
define i64 @faktoriyel_hesapla(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = sext i32 %0 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %8, %5 ]
%7 = phi i64 [ 1, %3 ], [ %9, %5 ]
%8 = add nsw i64 %6, -1
%9 = mul nsw i64 %7, %6
%10 = and i64 %8, 4294967294
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i64 [ 1, %1 ], [ %9, %5 ]
ret i64 %13
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void SysCtlLDODeepSleepSet(uint32_t ui32Voltage) {

  ;
  (*((volatile unsigned long *)(0x400FE1BC))) = ui32Voltage;
}


x86 assembly (clang, -O0):
<SysCtlLDODeepSleepSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fe1bc,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlLDODeepSleepSet>:
mov    %rdi,0x400fe1bc
40
ret

LLVM IR (-O0):
define void @SysCtlLDODeepSleepSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074782652 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlLDODeepSleepSet(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074782652 to i64*)
ret void
}
void fini(int display) {}


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

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

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

LLVM IR (-O2):
define void @fini(i32 %0) {
ret void
}
int test_imm_55int8_reg(signed char val) {
  return ((val) & (0x55 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_55int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x55,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_55int8_reg>:
test   $0x55,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_55int8_reg(i8 signext %0) {
%2 = and i8 %0, 85
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           unsigned int, char const *);
int /*<<< orphan*/ stderr;
void vrfs_assert_failed(const char *expr, const char *file, unsigned int line) {
  fprintf(stderr, "ERROR: (%s:%u) Assertion failed: %s\n", file, line, expr);
  abort();
}


x86 assembly (clang, -O0):
<vrfs_assert_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<vrfs_assert_failed>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r8
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"ERROR: (%s:%u) Assertion failed: %s\0A\00"
define void @vrfs_assert_failed(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"ERROR: (%s:%u) Assertion failed: %s\0A\00"
define void @vrfs_assert_failed(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ RLIMIT_NOFILE;
int /*<<< orphan*/ cdecl_func__RLIMIT_NOFILE(int /*<<< orphan*/);
void cdecl_expr__RLIMIT_NOFILE() { cdecl_func__RLIMIT_NOFILE(RLIMIT_NOFILE); }


x86 assembly (clang, -O0):
<cdecl_expr__RLIMIT_NOFILE>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <cdecl_func__RLIMIT_NOFILE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdecl_expr__RLIMIT_NOFILE>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <cdecl_func__RLIMIT_NOFILE@plt>

LLVM IR (-O0):
@RLIMIT_NOFILE = global i32 0
define void @cdecl_expr__RLIMIT_NOFILE() {
%1 = load i32, i32* @RLIMIT_NOFILE
%2 = call i32 @cdecl_func__RLIMIT_NOFILE(i32 %1)
ret void
}

LLVM IR (-O2):
@RLIMIT_NOFILE = global i32 0
define void @cdecl_expr__RLIMIT_NOFILE() {
%1 = load i32, i32* @RLIMIT_NOFILE
%2 = tail call i32 @cdecl_func__RLIMIT_NOFILE(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ draw_ball();
int /*<<< orphan*/ draw_missile(int);
int /*<<< orphan*/ draw_playfield();
int /*<<< orphan*/ pl_draw(int);
void tv_rasterise(int line) {
  draw_playfield();
  draw_ball();
  draw_missile(1);
  pl_draw(1);
  draw_missile(0);
  pl_draw(0);
}


x86 assembly (clang, -O0):
<tv_rasterise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <draw_playfield@plt>
mov    $0x0,%al
call   1060 <draw_ball@plt>
mov    $0x1,%edi
call   1050 <draw_missile@plt>
mov    $0x1,%edi
call   1030 <pl_draw@plt>
xor    %edi,%edi
call   1050 <draw_missile@plt>
xor    %edi,%edi
call   1030 <pl_draw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tv_rasterise>:
push   %rax
xor    %eax,%eax
call   1040 <draw_playfield@plt>
xor    %eax,%eax
call   1060 <draw_ball@plt>
mov    $0x1,%edi
call   1050 <draw_missile@plt>
mov    $0x1,%edi
call   1030 <pl_draw@plt>
xor    %edi,%edi
call   1050 <draw_missile@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <pl_draw@plt>

LLVM IR (-O0):
define void @tv_rasterise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @draw_playfield()
%4 = call i32 (...) @draw_ball()
%5 = call i32 @draw_missile(i32 1)
%6 = call i32 @pl_draw(i32 1)
%7 = call i32 @draw_missile(i32 0)
%8 = call i32 @pl_draw(i32 0)
ret void
}

LLVM IR (-O2):
define void @tv_rasterise(i32 %0) {
%2 = tail call i32 (...) @draw_playfield()
%3 = tail call i32 (...) @draw_ball()
%4 = tail call i32 @draw_missile(i32 1)
%5 = tail call i32 @pl_draw(i32 1)
%6 = tail call i32 @draw_missile(i32 0)
%7 = tail call i32 @pl_draw(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void error_exit(const char *error_text) {
  printf("\nError exit because %s\n        -- errno: %s\n", error_text,
         strerror(errno));
  exit(-1);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"\0AError exit because %s\0A -- errno: %s\0A\00"
@errno = global i32 0
define void @error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5)
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [45 x i8] c"\0AError exit because %s\0A -- errno: %s\0A\00"
@errno = global i32 0
define void @error_exit(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t decode_special_branch_opcode(uint32_t instruction) {
  return (instruction & 0x1f0000) >> 16;
}


x86 assembly (clang, -O0):
<decode_special_branch_opcode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f0000,%eax
sar    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_special_branch_opcode>:
mov    %edi,%eax
shr    $0x10,%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @decode_special_branch_opcode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 2031616
%5 = ashr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @decode_special_branch_opcode(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 31
ret i32 %3
}
rdisplay(fmt, a1, a2, a3, a4, a5) char *fmt, *a1, *a2, *a3, *a4, *a5;
{
  static char buf[2000];
  sprintf(buf, fmt, a1, a2, a3, a4, a5);
  show_to_user(buf);
}


x86 assembly (clang, -O0):
<rdisplay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    -0x38(%rbp),%rax
lea    0x2ee1(%rip),%rdi
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    0x2ecf(%rip),%rdi
mov    $0x0,%al
call   1030 <show_to_user@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdisplay>:
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %r9,(%rsp)
lea    0x2f01(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%r9
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <show_to_user@plt>

LLVM IR (-O0):
@rdisplay.buf = internal global [2000 x i8] zeroinitializer
define i32 @rdisplay(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = load i8*, i8** %13
%20 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([2000 x i8], [2000 x i8]* @rdisplay.buf, i64 0, i64 0), i8* %14, i8* %15, i8* %16, i8* %17, i8* %18, i8* %19)
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @show_to_user to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2000 x i8], [2000 x i8]* @rdisplay.buf, i64 0, i64 0))
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
@rdisplay.buf = internal global [2000 x i8] zeroinitializer
define i32 @rdisplay(i8* nocapture %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([2000 x i8], [2000 x i8]* @rdisplay.buf, i64 0, i64 0), i8* dereferenceable(1) %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5)
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @show_to_user to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2000 x i8], [2000 x i8]* @rdisplay.buf, i64 0, i64 0))
ret i32 undef
}
int rafael(int x) { return x + 12; }


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

x86 assembly (clang, -O2):
<rafael>:
lea    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rafael(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 12
ret i32 %4
}

LLVM IR (-O2):
define i32 @rafael(i32 %0) {
%2 = add nsw i32 %0, 12
ret i32 %2
}
void waitBitTime(void) {}


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

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

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

LLVM IR (-O2):
define void @waitBitTime() {
ret void
}
/* Variables and functions */
void lng_reverse(long *array, size_t n) {
  long *end = array + n;
  long t;
  while (--end > array) {
    t = *end;
    *end = *array;
    *array++ = t;
  }
}


x86 assembly (clang, -O0):
<lng_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
cmp    -0x8(%rbp),%rax
jbe    1169 <lng_reverse+0x69>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x8(%rbp)
mov    %rcx,(%rax)
jmp    111f <lng_reverse+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lng_reverse>:
lea    (%rdi,%rsi,8),%rax
add    $0xfffffffffffffff8,%rax
cmp    %rdi,%rax
jbe    113e <lng_reverse+0x3e>
add    $0x8,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rax),%rcx
mov    -0x8(%rdi),%rdx
mov    %rdx,(%rax)
mov    %rcx,-0x8(%rdi)
add    $0xfffffffffffffff8,%rax
lea    0x8(%rdi),%rcx
cmp    %rdi,%rax
mov    %rcx,%rdi
ja     1120 <lng_reverse+0x20>
ret

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

LLVM IR (-O2):
define void @lng_reverse(i64* %0, i64 %1) {
%3 = getelementptr inbounds i64, i64* %0, i64 %1
%4 = getelementptr inbounds i64, i64* %3, i64 -1
%5 = icmp ugt i64* %4, %0
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i64* [ %12, %6 ], [ %4, %2 ]
%8 = phi i64* [ %11, %6 ], [ %0, %2 ]
%9 = load i64, i64* %7
%10 = load i64, i64* %8
store i64 %10, i64* %7
%11 = getelementptr inbounds i64, i64* %8, i64 1
store i64 %9, i64* %8
%12 = getelementptr inbounds i64, i64* %7, i64 -1
%13 = icmp ugt i64* %12, %11
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void cubeByValue(int n) {
  n = n * n * n;
  printf("input cubed is %d\n", n);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"input cubed is %d\0A\00"
define void @cubeByValue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"input cubed is %d\0A\00"
define void @cubeByValue(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, size_t, char *, int /*<<< orphan*/);
void mmp_time_1123_format(time_t t, char *datestr, size_t strsize) {
  if (datestr == NULL || strsize == 0)
    return;
  strftime(datestr, strsize, "%a, %d %b %Y %H:%M:%S GMT", gmtime(&t));
}


x86 assembly (clang, -O0):
<mmp_time_1123_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1149 <mmp_time_1123_format+0x29>
cmpq   $0x0,-0x18(%rbp)
jne    114e <mmp_time_1123_format+0x2e>
jmp    117d <mmp_time_1123_format+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <gmtime@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%ecx
lea    0xe88(%rip),%rdx
call   1030 <strftime@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmp_time_1123_format>:
push   %r14
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
test   %rsi,%rsi
je     1156 <mmp_time_1123_format+0x36>
mov    %rdx,%r14
test   %rdx,%rdx
je     1156 <mmp_time_1123_format+0x36>
mov    %rsi,%rbx
lea    0x4(%rsp),%rdi
call   1040 <gmtime@plt>
lea    0xeb7(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%ecx
call   1030 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"%a, %d %b %Y %H:%M:%S GMT\00"
define void @mmp_time_1123_format(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 i8*, i8** %5
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load i64, i64* %6
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9, %3
br label %18
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = call i32 @gmtime(i32* %4)
%17 = call i32 @strftime(i8* %14, i64 %15, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%a, %d %b %Y %H:%M:%S GMT\00"
define void @mmp_time_1123_format(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = icmp eq i8* %1, null
%6 = icmp eq i64 %2, 0
%7 = or i1 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = call i32 @gmtime(i32* %4)
%10 = call i32 @strftime(i8* %1, i64 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %3, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("oonf_api package compiled!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"oonf_api package compiled!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"oonf_api package compiled!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dumpByte(unsigned char const);
void dumpCode(unsigned short codeSize, const unsigned char *code) {
  int count;
  for (count = 0; count < codeSize; count++) {
    dumpByte(code[count]);
  }
}


x86 assembly (clang, -O0):
<dumpCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movzwl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    1158 <dumpCode+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <dumpByte@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <dumpCode+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpCode>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     1143 <dumpCode+0x33>
mov    %rsi,%r14
movzwl %di,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%edi
call   1030 <dumpByte@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <dumpCode+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @dumpCode(i16 zeroext %0, i8* nocapture %1) {
%3 = icmp eq i16 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i16 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @dumpByte(i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int errno;
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int os_gettimeofday(struct timeval *tv) {
  int retval;
  retval = gettimeofday(tv, NULL);
  if (retval == -1)
    retval = -errno;
  return retval;
}


x86 assembly (clang, -O0):
<os_gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1144 <os_gettimeofday+0x34>
xor    %eax,%eax
mov    0x2ea1(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_gettimeofday>:
push   %rbx
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x2ebf(%rip),%rcx
sub    (%rcx),%ebx
cmp    $0xffffffff,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@errno = global i32 0
define i32 @os_gettimeofday(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca i32
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = sub nsw i32 0, %9
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@errno = global i32 0
define i32 @os_gettimeofday(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
%3 = icmp eq i32 %2, -1
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 %5, i32 %2
ret i32 %6
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ shutdown(int, int);
int SocketClose(int fd) {
  shutdown(fd, 2);
  if (close(fd) == -1) {
    return (-1);
  }
  return (1);
}


x86 assembly (clang, -O0):
<SocketClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
cmp    $0xffffffff,%eax
jne    1155 <SocketClose+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <SocketClose+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SocketClose>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SocketClose(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @shutdown(i32 %4, i32 2)
%6 = load i32, i32* %3
%7 = call i32 @close(i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @SocketClose(i32 %0) {
%2 = tail call i32 @shutdown(i32 %0, i32 2)
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, -1
%5 = select i1 %4, i32 -1, i32 1
ret i32 %5
}
void isr_int_syscall(long code) {}


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

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

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

LLVM IR (-O2):
define void @isr_int_syscall(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int n1, n2, n3;
  printf("Enter phone [(xxx) xxx-xxxx]: ");
  scanf("(%d) %d-%d", &n1, &n2, &n3);
  printf("You entered: %d.%d.%d\n", n1, n2, n3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Enter phone [(xxx) xxx-xxxx]: \00"
@.str.1 = [11 x i8] c"(%d) %d-%d\00"
@.str.2 = [23 x i8] c"You entered: %d.%d.%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Enter phone [(xxx) xxx-xxxx]: \00"
@.str.1 = [11 x i8] c"(%d) %d-%d\00"
@.str.2 = [23 x i8] c"You entered: %d.%d.%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}
/* Variables and functions */
double exp(double);
double MAP_GAUSS(double x_n, int iteration) {
  return (exp(-1.0 * 8.0 * x_n * x_n) + -0.6);
}


x86 assembly (clang, -O0):
<MAP_GAUSS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xee0(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xec1(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAP_GAUSS>:
push   %rax
movsd  0xee7(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
addsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @MAP_GAUSS(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = fmul double -8.000000e+00, %5
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = call double @exp(double %8)
%10 = fadd double %9, -6.000000e-01
ret double %10
}

LLVM IR (-O2):
define double @MAP_GAUSS(double %0, i32 %1) {
%3 = fmul double %0, -8.000000e+00
%4 = fmul double %3, %0
%5 = tail call double @exp(double %4)
%6 = fadd double %5, -6.000000e-01
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ msg_print(char *);
scalar_t__ target_set_interactive(int, int, int);
void do_cmd_look(void) {
  if (target_set_interactive(0x02, -1, -1)) {
    msg_print("Target Selected.");
  }
}


x86 assembly (clang, -O0):
<do_cmd_look>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0xffffffff,%edx
mov    %edx,%esi
call   1030 <target_set_interactive@plt>
cmp    $0x0,%rax
je     114b <do_cmd_look+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <msg_print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_look>:
push   %rax
mov    $0x2,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1030 <target_set_interactive@plt>
test   %rax,%rax
je     1147 <do_cmd_look+0x27>
lea    0xebf(%rip),%rdi
pop    %rax
jmp    1040 <msg_print@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Target Selected.\00"
define void @do_cmd_look() {
%1 = call i64 @target_set_interactive(i32 2, i32 -1, i32 -1)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @msg_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Target Selected.\00"
define void @do_cmd_look() {
%1 = tail call i64 @target_set_interactive(i32 2, i32 -1, i32 -1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @msg_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
void hang() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<hang>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <hang+0x9>
jmp    1109 <hang+0x9>

x86 assembly (clang, -O2):
<hang>:
jmp    1100 <hang>

LLVM IR (-O0):
define void @hang() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @hang() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void div() { printf("The number is divisible by 5 and 7"); }


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"The number is divisible by 5 and 7\00"
define void @div() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"The number is divisible by 5 and 7\00"
define void @div() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
int fltCmp(const void *f1, const void *f2) {
  return (*((float *)f1) < *((float *)f2)   ? -1
          : *((float *)f1) > *((float *)f2) ? 1
                                            : 0);
}


x86 assembly (clang, -O0):
<fltCmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1132 <fltCmp+0x32>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <fltCmp+0x52>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fltCmp>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fltCmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fcmp olt float %7, %10
br i1 %11, label %12, label %13
12: ; preds = %2
br label %23
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = bitcast i8* %14 to float*
%16 = load float, float* %15
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to float*
%19 = load float, float* %18
%20 = fcmp ogt float %16, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
br label %23
23: ; preds = %13, %12
%24 = phi i32 [ -1, %12 ], [ %22, %13 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @fltCmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = fcmp ogt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Lcd8_Cmd(int);
void Lcd8_Shift_Left() { Lcd8_Cmd(0x18); }


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

x86 assembly (clang, -O2):
<Lcd8_Shift_Left>:
mov    $0x18,%edi
jmp    1030 <Lcd8_Cmd@plt>

LLVM IR (-O0):
define void @Lcd8_Shift_Left() {
%1 = call i32 @Lcd8_Cmd(i32 24)
ret void
}

LLVM IR (-O2):
define void @Lcd8_Shift_Left() {
%1 = tail call i32 @Lcd8_Cmd(i32 24)
ret void
}