xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ displayBits(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int number1;
  number1 = 65535;
  printf("The result of right shifting the following\n");
  displayBits(number1);
  printf("is\n");
  displayBits(number1 >> 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffff,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <displayBits@plt>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
call   1040 <displayBits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffff,%edi
call   1040 <displayBits@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfff,%edi
call   1040 <displayBits@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"The result of right shifting the following\0A\00"
@.str.1 = [4 x i8] c"is\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 65535, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @displayBits(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = ashr i32 %7, 4
%9 = call i32 @displayBits(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@str = [43 x i8] c"The result of right shifting the following\00"
@str.2 = [3 x i8] c"is\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @displayBits(i32 65535)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @displayBits(i32 4095)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ k_clear_screen();
int /*<<< orphan*/ k_printf(char *, int);
void k_main() {
  k_clear_screen();
  k_printf("Whee, booted", 0);
  k_printf("bye bye now.", 1);
}


x86 assembly (clang, -O0):
<k_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <k_clear_screen@plt>
lea    0xece(%rip),%rdi
xor    %esi,%esi
call   1030 <k_printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x1,%esi
call   1030 <k_printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_main>:
push   %rax
xor    %eax,%eax
call   1040 <k_clear_screen@plt>
lea    0xed1(%rip),%rdi
xor    %esi,%esi
call   1030 <k_printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x1,%esi
pop    %rax
jmp    1030 <k_printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Whee, booted\00"
@.str.1 = [13 x i8] c"bye bye now.\00"
define void @k_main() {
%1 = call i32 (...) @k_clear_screen()
%2 = call i32 @k_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = call i32 @k_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Whee, booted\00"
@.str.1 = [13 x i8] c"bye bye now.\00"
define void @k_main() {
%1 = tail call i32 (...) @k_clear_screen()
%2 = tail call i32 @k_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @k_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GCSReceiverHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void GCSReceiverLogging() { UAVObjLogging(GCSReceiverHandle()); }


x86 assembly (clang, -O0):
<GCSReceiverLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GCSReceiverHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCSReceiverLogging>:
push   %rax
xor    %eax,%eax
call   1040 <GCSReceiverHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @GCSReceiverLogging() {
%1 = call i32 (...) @GCSReceiverHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GCSReceiverLogging() {
%1 = tail call i32 (...) @GCSReceiverHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
char *_strdup(char *);
int /*<<< orphan*/ free(char *);
void opt_setstring(char **s, char *t) {
  if (*s)
    free(*s);
  *s = _strdup(t);
}


x86 assembly (clang, -O0):
<opt_setstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114a <opt_setstring+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1040 <_strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_setstring>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1137 <opt_setstring+0x17>
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <_strdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @opt_setstring(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 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %8, %2
%13 = load i8*, i8** %4
%14 = call i8* @_strdup(i8* %13)
%15 = load i8**, i8*** %3
store i8* %14, i8** %15
ret void
}

LLVM IR (-O2):
define void @opt_setstring(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = tail call i8* @_strdup(i8* %1)
store i8* %8, i8** %0
ret void
}
int is_fib(int number) {
  int a = 0;
  int b = 1;
  while (b <= number) {
    b += a;
    a = b - a;
    if (b == number) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_fib>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1150 <is_fib+0x50>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    114b <is_fib+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1157 <is_fib+0x57>
jmp    1115 <is_fib+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_fib>:
mov    $0x1,%ecx
xor    %eax,%eax
xor    %edx,%edx
nopl   0x0(%rax)
cmp    %edi,%ecx
jg     1125 <is_fib+0x25>
mov    %edx,%esi
add    %ecx,%esi
mov    %ecx,%edx
mov    %esi,%ecx
cmp    %edi,%esi
jne    1110 <is_fib+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %4, %6 ]
%4 = phi i32 [ 1, %1 ], [ %7, %6 ]
%5 = icmp sgt i32 %4, %0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = add nsw i32 %4, %3
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %2
9: ; preds = %2, %6
%10 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %10
}
/* Type definitions */
typedef void const regex_t;

/* Variables and functions */
int REG_EXTENDED;
int REG_ICASE;
scalar_t__ calloc(int, int);
int regcomp(void const *, char const *, int);
int /*<<< orphan*/ rx_free(void const *);
const void *rx_compile(const char *pattern) {
  regex_t *rx = (regex_t *)calloc(1, sizeof(regex_t));
  int rc = regcomp(rx, pattern, REG_EXTENDED | REG_ICASE);
  if (rc != 0) {
    rx_free(rx);
  }
  return rx;
}


x86 assembly (clang, -O0):
<rx_compile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
mov    0x2e84(%rip),%rax
or     (%rax),%edx
call   1040 <regcomp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1181 <rx_compile+0x51>
mov    -0x10(%rbp),%rdi
call   1030 <rx_free@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rx_compile>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    0x2e88(%rip),%rax
mov    0x2e91(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <regcomp@plt>
test   %eax,%eax
je     1172 <rx_compile+0x42>
mov    %rbx,%rdi
call   1030 <rx_free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@REG_EXTENDED = global i32 0
@REG_ICASE = global i32 0
define i8* @rx_compile(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i64 @calloc(i32 1, i32 1)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = load i32, i32* @REG_EXTENDED
%10 = load i32, i32* @REG_ICASE
%11 = or i32 %9, %10
%12 = call i32 @regcomp(i8* %7, i8* %8, i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i8*, i8** %3
%17 = call i32 @rx_free(i8* %16)
br label %18
18: ; preds = %15, %1
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@REG_EXTENDED = global i32 0
@REG_ICASE = global i32 0
define i8* @rx_compile(i8* %0) {
%2 = tail call i64 @calloc(i32 1, i32 1)
%3 = inttoptr i64 %2 to i8*
%4 = load i32, i32* @REG_EXTENDED
%5 = load i32, i32* @REG_ICASE
%6 = or i32 %5, %4
%7 = tail call i32 @regcomp(i8* %3, i8* %0, i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 @rx_free(i8* %3)
br label %11
11: ; preds = %9, %1
ret i8* %3
}
/* Variables and functions */
double DProbNormal(int /*<<< orphan*/);
int /*<<< orphan*/ FRanNormalPolar();
double FRanQuanNormal(void) { return DProbNormal(FRanNormalPolar()); }


x86 assembly (clang, -O0):
<FRanQuanNormal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FRanNormalPolar@plt>
mov    %eax,%edi
call   1040 <DProbNormal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FRanQuanNormal>:
push   %rax
xor    %eax,%eax
call   1030 <FRanNormalPolar@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <DProbNormal@plt>

LLVM IR (-O0):
define double @FRanQuanNormal() {
%1 = call i32 (...) @FRanNormalPolar()
%2 = call double @DProbNormal(i32 %1)
ret double %2
}

LLVM IR (-O2):
define double @FRanQuanNormal() {
%1 = tail call i32 (...) @FRanNormalPolar()
%2 = tail call double @DProbNormal(i32 %1)
ret double %2
}
void nrf_drv_radio802154_timer_critical_section_exit(void) {}


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

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

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

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

/* Variables and functions */
intptr_t st_pop(struct forth_instance *);
int /*<<< orphan*/ st_push(struct forth_instance *, int);
void greaterthan(struct forth_instance *fi) {
  intptr_t tp;
  tp = st_pop(fi);
  st_push(fi, st_pop(fi) > tp);
}


x86 assembly (clang, -O0):
<greaterthan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    -0x18(%rbp),%rdi
cmp    -0x10(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%esi
call   1040 <st_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greaterthan>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <st_pop@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <st_pop@plt>
xor    %esi,%esi
cmp    %r14,%rax
setg   %sil
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @greaterthan(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
%3 = alloca i64
store %struct.forth_instance* %0, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i64 @st_pop(%struct.forth_instance* %4)
store i64 %5, i64* %3
%6 = load %struct.forth_instance*, %struct.forth_instance** %2
%7 = load %struct.forth_instance*, %struct.forth_instance** %2
%8 = call i64 @st_pop(%struct.forth_instance* %7)
%9 = load i64, i64* %3
%10 = icmp sgt i64 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @st_push(%struct.forth_instance* %6, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @greaterthan(%struct.forth_instance* %0) {
%2 = tail call i64 @st_pop(%struct.forth_instance* %0)
%3 = tail call i64 @st_pop(%struct.forth_instance* %0)
%4 = icmp sgt i64 %3, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @st_push(%struct.forth_instance* %0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_RST(int);
void do0xE7() { _I8080_RST(4); }


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

x86 assembly (clang, -O2):
<do0xE7>:
mov    $0x4,%edi
jmp    1030 <_I8080_RST@plt>

LLVM IR (-O0):
define void @do0xE7() {
%1 = call i32 @_I8080_RST(i32 4)
ret void
}

LLVM IR (-O2):
define void @do0xE7() {
%1 = tail call i32 @_I8080_RST(i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cache_db_list_entries();
int /*<<< orphan*/ close_cache_database();
int /*<<< orphan*/ open_cache_database(char *);
void operation_cache_ls(char *path) {
  open_cache_database(path);
  cache_db_list_entries();
  close_cache_database();
}


x86 assembly (clang, -O0):
<operation_cache_ls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <open_cache_database@plt>
mov    $0x0,%al
call   1030 <cache_db_list_entries@plt>
mov    $0x0,%al
call   1040 <close_cache_database@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation_cache_ls>:
push   %rax
call   1050 <open_cache_database@plt>
xor    %eax,%eax
call   1030 <cache_db_list_entries@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <close_cache_database@plt>

LLVM IR (-O0):
define void @operation_cache_ls(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @open_cache_database(i8* %3)
%5 = call i32 (...) @cache_db_list_entries()
%6 = call i32 (...) @close_cache_database()
ret void
}

LLVM IR (-O2):
define void @operation_cache_ls(i8* %0) {
%2 = tail call i32 @open_cache_database(i8* %0)
%3 = tail call i32 (...) @cache_db_list_entries()
%4 = tail call i32 (...) @close_cache_database()
ret void
}
void error_assign(int a, int __attribute((unit("m"))) b) { a = b; }


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

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

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

LLVM IR (-O2):
define void @error_assign(i32 %0, i32 %1) {
ret void
}
unsigned hash_callback_key(const void *key) { return *(unsigned int *)key; }


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

x86 assembly (clang, -O2):
<hash_callback_key>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hash_callback_key(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hash_callback_key(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bar(float *);
void foo(void) {
  float b[256] = {0};
  bar(b);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x400(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    -0x400(%rbp),%rdi
call   1030 <bar@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <bar@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca [256 x float]
%2 = bitcast [256 x float]* %1 to i8*
%3 = getelementptr inbounds [256 x float], [256 x float]* %1, i64 0, i64 0
%4 = call i32 @bar(float* %3)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca [256 x float]
%2 = bitcast [256 x float]* %1 to i8*
%3 = getelementptr inbounds [256 x float], [256 x float]* %1, i64 0, i64 0
%4 = call i32 @bar(float* %3)
ret void
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CDE_begin_standard_fileop(struct tcb *, char *);
void CDE_begin_rmdir(struct tcb *tcp) {
  CDE_begin_standard_fileop(tcp, "rmdir");
}


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

x86 assembly (clang, -O2):
<CDE_begin_rmdir>:
lea    0xee9(%rip),%rsi
jmp    1030 <CDE_begin_standard_fileop@plt>

LLVM IR (-O0):
%struct.tcb = type { i32 }
@.str = [6 x i8] c"rmdir\00"
define void @CDE_begin_rmdir(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @CDE_begin_standard_fileop(%struct.tcb* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
@.str = [6 x i8] c"rmdir\00"
define void @CDE_begin_rmdir(%struct.tcb* %0) {
%2 = tail call i32 @CDE_begin_standard_fileop(%struct.tcb* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int allZero(unsigned char *a, int n) {
  while (n && (a++)[0] == 0) {
    n--;
  }
  return n == 0;
}


x86 assembly (clang, -O0):
<allZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1135 <allZero+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1145 <allZero+0x45>
jmp    1153 <allZero+0x53>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <allZero+0xb>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<allZero>:
test   %esi,%esi
je     112e <allZero+0x2e>
add    $0xffffffff,%esi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
jne    1126 <allZero+0x26>
mov    %rax,%rdx
add    $0x1,%rdx
cmp    %eax,%esi
mov    %rdx,%rax
jne    1110 <allZero+0x10>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @allZero(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = xor i1 %8, true
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add nsw i32 %5, -1
%12 = icmp eq i32 %11, 0
%13 = select i1 %9, i1 true, i1 %12
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = zext i1 %8 to i32
br label %16
16: ; preds = %14, %2
%17 = phi i32 [ 1, %2 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
double floor(double);
double round(double val) { return floor(val + 0.5); }


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call double @llvm.floor.f64(double %4)
ret double %5
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
ret double %3
}
/* Variables and functions */
#define SIGINT 129
#define SIGTERM 128
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int /*<<< orphan*/ trigger_exit();
void termination_handler(int signum) {
  switch (signum) {
  case SIGINT:
  case SIGTERM:
    trigger_exit();
    break;
  default:
    break;
  }
  signal(SIGUSR2, termination_handler);
}


x86 assembly (clang, -O0):
<termination_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x1,%eax
ja     114b <termination_handler+0x2b>
jmp    113f <termination_handler+0x1f>
mov    $0x0,%al
call   1030 <trigger_exit@plt>
jmp    1150 <termination_handler+0x30>
jmp    1150 <termination_handler+0x30>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    0x2e78(%rip),%rsi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termination_handler>:
push   %rax
and    $0xfffffffe,%edi
cmp    $0x80,%edi
jne    1133 <termination_handler+0x13>
xor    %eax,%eax
call   1030 <trigger_exit@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2e95(%rip),%rsi
pop    %rax
jmp    1040 <signal@plt>

LLVM IR (-O0):
@SIGUSR2 = global i32 0
define void @termination_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 129, label %4
i32 128, label %4
]
4: ; preds = %1, %1
%5 = call i32 (...) @trigger_exit()
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* @SIGUSR2
%9 = call i32 @signal(i32 %8, void (i32)* @termination_handler)
ret void
}

LLVM IR (-O2):
@SIGUSR2 = global i32 0
define void @termination_handler(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 128
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @trigger_exit()
br label %6
6: ; preds = %1, %4
%7 = load i32, i32* @SIGUSR2
%8 = tail call i32 @signal(i32 %7, void (i32)* @termination_handler)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void spin(char *func_name) {
  printf("\nspinning in %s ...\n", func_name);
  while (1) {
  }
}


x86 assembly (clang, -O0):
<spin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
jmp    112c <spin+0x1c>

x86 assembly (clang, -O2):
<spin>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <spin+0x10>

LLVM IR (-O0):
@.str = [21 x i8] c"\0Aspinning in %s ...\0A\00"
define void @spin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0Aspinning in %s ...\0A\00"
define void @spin(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Type definitions */
struct tl880_dev {
  int dummy;
};

/* Variables and functions */
scalar_t__ CHECK_NULL(struct tl880_dev *);
int tl880_msp_read(struct tl880_dev *tl880dev, unsigned char reg) {
  if (CHECK_NULL(tl880dev)) {
    return -1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<tl880_msp_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <CHECK_NULL@plt>
cmp    $0x0,%rax
je     1141 <tl880_msp_read+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <tl880_msp_read+0x38>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl880_msp_read>:
push   %rax
call   1030 <CHECK_NULL@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tl880_dev = type { i32 }
define i32 @tl880_msp_read(%struct.tl880_dev* %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca %struct.tl880_dev*
%5 = alloca i8
store %struct.tl880_dev* %0, %struct.tl880_dev** %4
store i8 %1, i8* %5
%6 = load %struct.tl880_dev*, %struct.tl880_dev** %4
%7 = call i64 @CHECK_NULL(%struct.tl880_dev* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
%struct.tl880_dev = type { i32 }
define i32 @tl880_msp_read(%struct.tl880_dev* %0, i8 zeroext %1) {
%3 = tail call i64 @CHECK_NULL(%struct.tl880_dev* %0)
ret i32 -1
}
int test_imm_18int32_mem(int *val) {
  return ((*val) & (0x18 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_18int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 24
%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_18int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 24
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void Error(char *message) { exit(1); }


x86 assembly (clang, -O0):
<Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<Error>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @Error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @Error(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ shim_enosys(int /*<<< orphan*/, void *, void *);
void shim_flush_icache(void *begin, void *end) {
  (void)shim_enosys(0, begin, end);
}


x86 assembly (clang, -O0):
<shim_flush_icache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_flush_icache>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define void @shim_flush_icache(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 = load i8*, i8** %4
%7 = call i32 @shim_enosys(i32 0, i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @shim_flush_icache(i8* %0, i8* %1) {
%3 = tail call i32 @shim_enosys(i32 0, i8* %0, i8* %1)
ret void
}
char *cpstring(char *dest, const char *src) {
  int i = 0;
  while (src[i] != '\0') {
    dest[i] = src[i];
    i++;
  }
  dest[i] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<cpstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <cpstring+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <cpstring+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpstring>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <cpstring+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <cpstring+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @cpstring(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
int dhm_self_test(int verbose) { return (verbose++); }


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

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

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

LLVM IR (-O2):
define i32 @dhm_self_test(i32 returned %0) {
ret i32 %0
}
void foo_2_1_2_1_1_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_1_2_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", 3 + 4);
  printf("%d\n", 3 + 2 + 3 + 4);
  printf("%d\n", 3 * 4);
  printf("%d\n", 3 + 2 * 3 + 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0xd,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xac() {
  Assert_real((isgraph(172) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              865, ("isgraph should be 0 for 0xac"));
}


x86 assembly (clang, -O0):
<t_isgraph_0xac>:
push   %rbp
mov    %rsp,%rbp
mov    $0xac,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x361,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0xac>:
push   %rax
mov    $0xac,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x361,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xac\00"
define void @t_isgraph_0xac() {
%1 = call i64 @isgraph(i32 172)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 865, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xac\00"
define void @t_isgraph_0xac() {
%1 = tail call i64 @isgraph(i32 172)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 865, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void f() { int a = 2; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
void jam_strcpy(char *left, char *right) {
  char ch;
  do {
    *left = *right;
    ch = *right;
    ++left;
    ++right;
  } while (ch != '\0');
}


x86 assembly (clang, -O0):
<jam_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    110c <jam_strcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jam_strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
cmpb   $0x0,(%rsi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <jam_strcpy+0x10>
ret

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

LLVM IR (-O2):
define void @jam_strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %9, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = load i8, i8* %4
store i8 %6, i8* %5
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %7, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
void aMethod() {}


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

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

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

LLVM IR (-O2):
define void @aMethod() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void printProcessesID(int p1, int p2) {
  printf("Child process ID: %d, Parent process ID: %d\n", p1, p2);
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"Child process ID: %d, Parent process ID: %d\0A\00"
define void @printProcessesID(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Child process ID: %d, Parent process ID: %d\0A\00"
define void @printProcessesID(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
int test_imm_0Euint16_mem(unsigned short *val) {
  return ((*val) & (-0x0E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Euint16_mem>:
movzwl (%rdi),%eax
test   $0xfff2,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -14
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ closeI2C();
int /*<<< orphan*/ pwmFinalPosition();
int /*<<< orphan*/ pwmSleep();
void endSettings() {
  pwmFinalPosition();
  pwmSleep();
  closeI2C();
}


x86 assembly (clang, -O0):
<endSettings>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pwmFinalPosition@plt>
mov    $0x0,%al
call   1030 <pwmSleep@plt>
mov    $0x0,%al
call   1050 <closeI2C@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<endSettings>:
push   %rax
xor    %eax,%eax
call   1040 <pwmFinalPosition@plt>
xor    %eax,%eax
call   1030 <pwmSleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <closeI2C@plt>

LLVM IR (-O0):
define void @endSettings() {
%1 = call i32 (...) @pwmFinalPosition()
%2 = call i32 (...) @pwmSleep()
%3 = call i32 (...) @closeI2C()
ret void
}

LLVM IR (-O2):
define void @endSettings() {
%1 = tail call i32 (...) @pwmFinalPosition()
%2 = tail call i32 (...) @pwmSleep()
%3 = tail call i32 (...) @closeI2C()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __fail(char *);
void __chk_fail(void) { __fail("buffer overflow detected; terminated"); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"buffer overflow detected; terminated\00"
define void @__chk_fail() {
%1 = call i32 @__fail(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"buffer overflow detected; terminated\00"
define void @__chk_fail() {
%1 = tail call i32 @__fail(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_DBuint8_mem(unsigned char *val) {
  return ((*val) & (0xDB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DBuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -37
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void warn(char *msg) { fprintf(stdout, "WARNING: %s\n", msg); }


x86 assembly (clang, -O0):
<warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [13 x i8] c"WARNING: %s\0A\00"
define void @warn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"WARNING: %s\0A\00"
define void @warn(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ get_num(char *, char *);
int /*<<< orphan*/ get_string(char *);
int /*<<< orphan*/ long2str(char *, int /*<<< orphan*/);
int /*<<< orphan*/ tt_lookupFromStr(int, int /*<<< orphan*/);
char *macttLookup(char *arg) {
  int tbl;
  tbl = (int)get_num("ttLookup", arg);
  long2str(arg, tt_lookupFromStr(tbl, get_string(arg)));
  return arg;
}


x86 assembly (clang, -O0):
<macttLookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <get_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_string@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1060 <tt_lookupFromStr@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1050 <long2str@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttLookup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <get_string@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   1060 <tt_lookupFromStr@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <long2str@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"ttLookup\00"
define i8* @macttLookup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @get_num(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = load i8*, i8** %2
%10 = call i32 @get_string(i8* %9)
%11 = call i32 @tt_lookupFromStr(i32 %8, i32 %10)
%12 = call i32 @long2str(i8* %7, i32 %11)
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"ttLookup\00"
define i8* @macttLookup(i8* returned %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @get_string(i8* %0)
%5 = tail call i32 @tt_lookupFromStr(i32 %3, i32 %4)
%6 = tail call i32 @long2str(i8* %0, i32 %5)
ret i8* %0
}