xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("`among' options:\n"
         "--among-dst      [!] list      : matches if ether dst is in list\n"
         "--among-src      [!] list      : matches if ether src is in list\n"
         "--among-dst-file [!] file      : obtain dst list from file\n"
         "--among-src-file [!] file      : obtain src list from file\n"
         "list has form:\n"
         " xx:xx:xx:xx:xx:xx[=ip.ip.ip.ip],yy:yy:yy:yy:yy:yy[=ip.ip.ip.ip]"
         ",...,zz:zz:zz:zz:zz:zz[=ip.ip.ip.ip][,]\n"
         "Things in brackets are optional.\n"
         "If you want to allow two (or more) IP addresses to one MAC address, "
         "you\n"
         "can specify two (or more) pairs with the same MAC, e.g.\n"
         " 00:00:00:fa:eb:fe=153.19.120.250,00:00:00:fa:eb:fe=192.168.0.1\n");
}


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

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

LLVM IR (-O0):
@.str = [610 x i8] c"`among' options:\0A--among-dst [!] list : matches if ether dst is in list\0A--among-src [!] list : matches if ether src is in list\0A--among-dst-file [!] file : obtain dst list from file\0A--among-src-file [!] file : obtain src list from file\0Alist has form:\0A xx:xx:xx:xx:xx:xx[=ip.ip.ip.ip],yy:yy:yy:yy:yy:yy[=ip.ip.ip.ip],...,zz:zz:zz:zz:zz:zz[=ip.ip.ip.ip][,]\0AThings in brackets are optional.\0AIf you want to allow two (or more) IP addresses to one MAC address, you\0Acan specify two (or more) pairs with the same MAC, e.g.\0A 00:00:00:fa:eb:fe=153.19.120.250,00:00:00:fa:eb:fe=192.168.0.1\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([610 x i8], [610 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [609 x i8] c"`among' options:\0A--among-dst [!] list : matches if ether dst is in list\0A--among-src [!] list : matches if ether src is in list\0A--among-dst-file [!] file : obtain dst list from file\0A--among-src-file [!] file : obtain src list from file\0Alist has form:\0A xx:xx:xx:xx:xx:xx[=ip.ip.ip.ip],yy:yy:yy:yy:yy:yy[=ip.ip.ip.ip],...,zz:zz:zz:zz:zz:zz[=ip.ip.ip.ip][,]\0AThings in brackets are optional.\0AIf you want to allow two (or more) IP addresses to one MAC address, you\0Acan specify two (or more) pairs with the same MAC, e.g.\0A 00:00:00:fa:eb:fe=153.19.120.250,00:00:00:fa:eb:fe=192.168.0.1\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([609 x i8], [609 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void print_list_item(int idx, void *data) {
  printf("%d: %d, ", idx, (int)data);
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d: %d, \00"
define void @print_list_item(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ execve(char const *, char *const *, char *const *);
int /*<<< orphan*/ unix_error(char *);
void Execve(const char *filename, char *const argv[], char *const envp[]) {
  if (execve(filename, argv, envp) < 0) {
    unix_error("Execve error");
  }
}


x86 assembly (clang, -O0):
<Execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <execve@plt>
cmp    $0x0,%rax
jge    115b <Execve+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Execve>:
push   %rax
call   1030 <execve@plt>
test   %rax,%rax
js     112d <Execve+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"Execve error\00"
define void @Execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i64 @execve(i8* %0, i8** %1, i8** %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
double gasdev();
double gasdev_ms(double mean, double stddev) {
  return mean + stddev * gasdev();
}


x86 assembly (clang, -O0):
<gasdev_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <gasdev@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gasdev_ms>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <gasdev@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @gasdev_ms(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double (...) @gasdev()
%8 = call double @llvm.fmuladd.f64(double %6, double %7, double %5)
ret double %8
}

LLVM IR (-O2):
define double @gasdev_ms(double %0, double %1) {
%3 = tail call double (...) @gasdev()
%4 = tail call double @llvm.fmuladd.f64(double %1, double %3, double %0)
ret double %4
}
/* Type definitions */
struct arrayQueue {
  int dummy;
};

/* Variables and functions */
struct arrayQueue *createQueue(int);
int deQueue(struct arrayQueue *);
int /*<<< orphan*/ enQueue(struct arrayQueue *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct arrayQueue *Q = createQueue(100);
  enQueue(Q, 100);
  int x = deQueue(Q);
  printf("\n%d\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1030 <createQueue@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x64,%esi
call   1060 <enQueue@plt>
mov    -0x8(%rbp),%rdi
call   1040 <deQueue@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1030 <createQueue@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x64,%esi
call   1060 <enQueue@plt>
mov    %rbx,%rdi
call   1040 <deQueue@plt>
lea    0xe96(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.arrayQueue = type { i32 }
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = alloca %struct.arrayQueue*
%2 = alloca i32
%3 = call %struct.arrayQueue* @createQueue(i32 100)
store %struct.arrayQueue* %3, %struct.arrayQueue** %1
%4 = load %struct.arrayQueue*, %struct.arrayQueue** %1
%5 = call i32 @enQueue(%struct.arrayQueue* %4, i32 100)
%6 = load %struct.arrayQueue*, %struct.arrayQueue** %1
%7 = call i32 @deQueue(%struct.arrayQueue* %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
%struct.arrayQueue = type { i32 }
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = tail call %struct.arrayQueue* @createQueue(i32 100)
%2 = tail call i32 @enQueue(%struct.arrayQueue* %1, i32 100)
%3 = tail call i32 @deQueue(%struct.arrayQueue* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if (p == NULL) {
    ;
  }
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <xrealloc+0x31>
jmp    1141 <xrealloc+0x31>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ IOMEM(int);
int __raw_readb(int /*<<< orphan*/);
int is_ts9420_installed(void) {
  return !!(__raw_readb(IOMEM(0xfebfd000)) & 0x04);
}


x86 assembly (clang, -O0):
<is_ts9420_installed>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfebfd000,%edi
call   1040 <IOMEM@plt>
mov    %eax,%edi
call   1030 <__raw_readb@plt>
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ts9420_installed>:
push   %rax
mov    $0xfebfd000,%edi
call   1040 <IOMEM@plt>
mov    %eax,%edi
call   1030 <__raw_readb@plt>
shr    $0x2,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_ts9420_installed() {
%1 = call i32 @IOMEM(i32 -20983808)
%2 = call i32 @__raw_readb(i32 %1)
%3 = and i32 %2, 4
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_ts9420_installed() {
%1 = tail call i32 @IOMEM(i32 -20983808)
%2 = tail call i32 @__raw_readb(i32 %1)
%3 = lshr i32 %2, 2
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void strout(char *msg) {
  extern FILE *Output_File;
  printf("%s\n", msg);
  if (Output_File != NULL) {
    fprintf(Output_File, "%s\n", msg);
  }
}


x86 assembly (clang, -O0):
<strout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
je     1167 <strout+0x47>
mov    0x2e94(%rip),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strout>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%rdi
test   %rdi,%rdi
je     1152 <strout+0x32>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@Output_File = external global i32*
define void @strout(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32*, i32** @Output_File
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void strcpy_contents_Good() {
  char src[5] = "aaaa";
  char dst[5];
  strcpy(dst, src);
  char c = dst[0];
  if (c >= 'a') {
    int a[5];
    a[c - 'a' + 4] = 0;
  }
}


x86 assembly (clang, -O0):
<strcpy_contents_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0x5(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0xa(%rbp),%al
mov    %al,-0xb(%rbp)
movsbl -0xb(%rbp),%eax
cmp    $0x61,%eax
jl     115e <strcpy_contents_Good+0x4e>
movsbl -0xb(%rbp),%eax
sub    $0x61,%eax
add    $0x4,%eax
cltq
movl   $0x0,-0x20(%rbp,%rax,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_contents_Good>:
sub    $0x18,%rsp
movb   $0x0,0x10(%rsp)
movl   $0x61616161,0xc(%rsp)
61
lea    0x13(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <strcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.strcpy_contents_Good.src = [5 x i8] c"aaaa\00"
define void @strcpy_contents_Good() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i8]
%3 = alloca i8
%4 = alloca [5 x i32]
%5 = bitcast [5 x i8]* %1 to i8*
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%10 = load i8, i8* %9
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %21
14: ; preds = %0
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 97
%18 = add nsw i32 %17, 4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 %19
store i32 0, i32* %20
br label %21
21: ; preds = %14, %0
ret void
}

LLVM IR (-O2):
@__const.strcpy_contents_Good.src = [5 x i8] c"aaaa\00"
define void @strcpy_contents_Good() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %3)
ret void
}
unsigned long parse_u32(const unsigned char *p) {
  return (unsigned long)p[0] << 0 | (unsigned long)p[1] << 8 |
         (unsigned long)p[2] << 16 | (unsigned long)p[3] << 24;
}


x86 assembly (clang, -O0):
<parse_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x0,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @parse_u32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl i64 %6, 0
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl i64 %11, 8
%13 = or i64 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = shl i64 %17, 16
%19 = or i64 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i64
%24 = shl i64 %23, 24
%25 = or i64 %19, %24
ret i64 %25
}

LLVM IR (-O2):
define i64 @parse_u32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %13, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ initButtons();
void LVInit() { initButtons(); }


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

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

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

LLVM IR (-O2):
define void @LVInit() {
%1 = tail call i32 (...) @initButtons()
ret void
}
int RTERMSIG(int status) { return status & 0xff; }


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

x86 assembly (clang, -O2):
<RTERMSIG>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @RTERMSIG(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}

LLVM IR (-O2):
define i32 @RTERMSIG(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double convert_time_to_sec(struct timespec tv) {
  double elapsed_time =
      (double)(tv.tv_sec) + ((double)(tv.tv_nsec) / 1000000000);
  return elapsed_time;
}


x86 assembly (clang, -O0):
<convert_time_to_sec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_time_to_sec>:
cvtsi2sd %rsi,%xmm1
cvtsi2sd %rdi,%xmm0
divsd  0xeee(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @convert_time_to_sec(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = alloca double
%5 = bitcast %struct.timespec* %3 to { i64, i64 }*
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 0
store i64 %0, i64* %6
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 1
store i64 %1, i64* %7
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fdiv double %13, 1.000000e+09
%15 = fadd double %10, %14
store double %15, double* %4
%16 = load double, double* %4
ret double %16
}

LLVM IR (-O2):
define double @convert_time_to_sec(i64 %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = sitofp i64 %0 to double
%5 = fdiv double %4, 1.000000e+09
%6 = fadd double %5, %3
ret double %6
}
void test_one(int x) {
#pragma omp target
#pragma omp teams distribute
  for (int i = 0; i < x; i++)
    ;
}


x86 assembly (clang, -O0):
<test_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <test_one+0x2d>
jmp    111f <test_one+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_one+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_one(i32 %0) {
ret void
}
/* Variables and functions */
bool nrf53_errata_9(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_9() {
ret i32 0
}
/* Variables and functions */
int sh_map_compare(void const *, void const *);
int sh_set_compare(const void *s, const void *s2) {
  return sh_map_compare(s, s2);
}


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

x86 assembly (clang, -O2):
<sh_set_compare>:
jmp    1030 <sh_map_compare@plt>

LLVM IR (-O0):
define i32 @sh_set_compare(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 @sh_map_compare(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sh_set_compare(i8* %0, i8* %1) {
%3 = tail call i32 @sh_map_compare(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int MS_NOATIME;
int MS_SYNCHRONOUS;
int mount(char const *, char const *, char *, int, char *);
int mount_vfat(const char *source, const char *target) {
  return mount(source, target, "vfat", MS_NOATIME | MS_SYNCHRONOUS,
               "posix_attr,shortname=mixed");
}


x86 assembly (clang, -O0):
<mount_vfat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea8(%rip),%rax
or     (%rax),%ecx
lea    0xebf(%rip),%rdx
lea    0xebd(%rip),%r8
call   1030 <mount@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_vfat>:
mov    0x2ed9(%rip),%rax
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
lea    0xed7(%rip),%rdx
lea    0xed5(%rip),%r8
jmp    1030 <mount@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"vfat\00"
@MS_NOATIME = global i32 0
@MS_SYNCHRONOUS = global i32 0
@.str.1 = [27 x i8] c"posix_attr,shortname=mixed\00"
define i32 @mount_vfat(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 = load i32, i32* @MS_NOATIME
%8 = load i32, i32* @MS_SYNCHRONOUS
%9 = or i32 %7, %8
%10 = call i32 @mount(i8* %5, i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"vfat\00"
@MS_NOATIME = global i32 0
@MS_SYNCHRONOUS = global i32 0
@.str.1 = [27 x i8] c"posix_attr,shortname=mixed\00"
define i32 @mount_vfat(i8* %0, i8* %1) {
%3 = load i32, i32* @MS_NOATIME
%4 = load i32, i32* @MS_SYNCHRONOUS
%5 = or i32 %4, %3
%6 = tail call i32 @mount(i8* %0, i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ dump_char(int /*<<< orphan*/);
void dump_str(const char *str) {
  while (*str != '\0') {
    dump_char(*str++);
  }
}


x86 assembly (clang, -O0):
<dump_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <dump_str+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <dump_char@plt>
jmp    111c <dump_str+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <dump_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <dump_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <dump_str+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @dump_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @dump_char(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void events_size(int rows, int cols) {}


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

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

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

LLVM IR (-O2):
define void @events_size(i32 %0, i32 %1) {
ret void
}
void rop3_117_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = S | stk3;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_117_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_117_1_0>:
not    %dl
or     %sil,%dl
mov    (%rdi),%al
and    %al,%dl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_117_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = trunc i32 %43 to i8
%45 = load i8*, i8** %4
store i8 %44, i8* %45
ret void
}

LLVM IR (-O2):
define void @rop3_117_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = or i8 %4, %1
%6 = load i8, i8* %0
%7 = and i8 %6, %5
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %6, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n;
  char *str = "12345.67";
  n = atoi(str);
  printf("n=%d\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"12345.67\00"
@.str.1 = [6 x i8] c"n=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @atoi(i8* %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"12345.67\00"
@.str.1 = [6 x i8] c"n=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @atoi(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_outpkt(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_outpkt>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_outpkt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_outpkt(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
const char *lw_mqtt_lib_version(void) {
  static const char *version = "0.1";
  return version;
}


x86 assembly (clang, -O0):
<lw_mqtt_lib_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw_mqtt_lib_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@lw_mqtt_lib_version.version = internal global i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0)
@.str = [4 x i8] c"0.1\00"
define i8* @lw_mqtt_lib_version() {
%1 = load i8*, i8** @lw_mqtt_lib_version.version
ret i8* %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"0.1\00"
define i8* @lw_mqtt_lib_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
char test_47(void) {
  static const char *my_version = "1.1.3";
  return my_version[0];
}


x86 assembly (clang, -O0):
<test_47>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_47>:
mov    $0x31,%al
ret

LLVM IR (-O0):
@test_47.my_version = internal global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
@.str = [6 x i8] c"1.1.3\00"
define signext i8 @test_47() {
%1 = load i8*, i8** @test_47.my_version
%2 = getelementptr inbounds i8, i8* %1, i64 0
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @test_47() {
ret i8 49
}
/* Variables and functions */
int /*<<< orphan*/ start_standalone_factor(int, char **);
int main(int argc, char **argv) {
  start_standalone_factor(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @start_standalone_factor(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int silly(int);
int main(int argc, char **argv) {
  printf("hello world - %d %d %d %d\n", silly(0), silly(11), silly(5),
         silly(6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <silly@plt>
mov    %eax,-0x1c(%rbp)
mov    $0xb,%edi
call   1040 <silly@plt>
mov    %eax,-0x18(%rbp)
mov    $0x5,%edi
call   1040 <silly@plt>
mov    %eax,-0x14(%rbp)
mov    $0x6,%edi
call   1040 <silly@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    %eax,%r8d
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %edi,%edi
call   1040 <silly@plt>
mov    %eax,%r14d
mov    $0xb,%edi
call   1040 <silly@plt>
mov    %eax,%ebp
mov    $0x5,%edi
call   1040 <silly@plt>
mov    %eax,%ebx
mov    $0x6,%edi
call   1040 <silly@plt>
lea    0xea9(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"hello world - %d %d %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @silly(i32 0)
%7 = call i32 @silly(i32 11)
%8 = call i32 @silly(i32 5)
%9 = call i32 @silly(i32 6)
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"hello world - %d %d %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @silly(i32 0)
%4 = tail call i32 @silly(i32 11)
%5 = tail call i32 @silly(i32 5)
%6 = tail call i32 @silly(i32 6)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __sigset_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __sigaddset(__sigset_t *set, int signo) { __set_errno(ENOSYS); }


x86 assembly (clang, -O0):
<__sigaddset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__sigaddset(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32, i32* @ENOSYS
%7 = call i32 @__set_errno(i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__sigaddset(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 undef
}
int charcomp(const void *a, const void *b) {
  unsigned char aa = *(unsigned char *)a, bb = *(unsigned char *)b;
  if (aa == bb)
    return 0;
  else if (!aa)
    return 1;
  else if (!bb)
    return -1;
  else
    return aa - bb;
}


x86 assembly (clang, -O0):
<charcomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jne    113a <charcomp+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1173 <charcomp+0x73>
cmpb   $0x0,-0x19(%rbp)
jne    1150 <charcomp+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1173 <charcomp+0x73>
cmpb   $0x0,-0x1a(%rbp)
jne    1166 <charcomp+0x66>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <charcomp+0x73>
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charcomp>:
movzbl (%rdi),%ecx
movzbl (%rsi),%edx
xor    %eax,%eax
cmp    %dl,%cl
je     1119 <charcomp+0x19>
test   %ecx,%ecx
je     111a <charcomp+0x1a>
sub    %edx,%ecx
cmp    $0x1,%edx
sbb    %eax,%eax
or     %ecx,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @charcomp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = zext i8 %3 to i32
%6 = zext i8 %4 to i32
%7 = icmp eq i8 %3, %4
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = icmp eq i8 %3, 0
br i1 %9, label %14, label %10
10: ; preds = %8
%11 = icmp eq i8 %4, 0
%12 = sub nsw i32 %5, %6
%13 = select i1 %11, i32 -1, i32 %12
br label %14
14: ; preds = %10, %8, %2
%15 = phi i32 [ 0, %2 ], [ 1, %8 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, unsigned short);
unsigned char RdStatus(int);
void SetTregAf(unsigned short UsTregAf) {
  unsigned char UcStRd = 1;
  RamWrite32A(0xF01A, UsTregAf | 0x00010000);
  while (UcStRd) {
    UcStRd = RdStatus(1);
  }
}


x86 assembly (clang, -O0):
<SetTregAf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0x1,-0x3(%rbp)
movzwl -0x2(%rbp),%eax
or     $0x10000,%eax
mov    $0xf01a,%edi
movzwl %ax,%esi
call   1030 <RamWrite32A@plt>
cmpb   $0x0,-0x3(%rbp)
je     1165 <SetTregAf+0x45>
mov    $0x1,%edi
call   1040 <RdStatus@plt>
mov    %al,-0x3(%rbp)
jmp    1149 <SetTregAf+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetTregAf>:
push   %rax
mov    %edi,%esi
mov    $0xf01a,%edi
call   1030 <RamWrite32A@plt>
nopl   (%rax)
mov    $0x1,%edi
call   1040 <RdStatus@plt>
test   %al,%al
jne    1130 <SetTregAf+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @SetTregAf(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
store i8 1, i8* %3
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = or i32 %5, 65536
%7 = trunc i32 %6 to i16
%8 = call i32 @RamWrite32A(i32 61466, i16 zeroext %7)
br label %9
9: ; preds = %12, %1
%10 = load i8, i8* %3
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call zeroext i8 @RdStatus(i32 1)
store i8 %13, i8* %3
br label %9
14: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @SetTregAf(i16 zeroext %0) {
%2 = tail call i32 @RamWrite32A(i32 61466, i16 zeroext %0)
br label %3
3: ; preds = %1, %3
%4 = tail call zeroext i8 @RdStatus(i32 1)
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
char *langRomTypeNormal() { return "Normal ROM"; }


x86 assembly (clang, -O0):
<langRomTypeNormal>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeNormal>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Normal ROM\00"
define i8* @langRomTypeNormal() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"Normal ROM\00"
define i8* @langRomTypeNormal() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_EBPSAFE(int);
int /*<<< orphan*/ window_clear_scenery_should_close();
void window_clear_scenery_close() {
  if (!window_clear_scenery_should_close())
    RCT2_CALLPROC_EBPSAFE(0x006EE281);
}


x86 assembly (clang, -O0):
<window_clear_scenery_close>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <window_clear_scenery_should_close@plt>
cmp    $0x0,%eax
jne    113e <window_clear_scenery_close+0x1e>
mov    $0x6ee281,%edi
call   1040 <RCT2_CALLPROC_EBPSAFE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<window_clear_scenery_close>:
push   %rax
xor    %eax,%eax
call   1030 <window_clear_scenery_should_close@plt>
test   %eax,%eax
je     112e <window_clear_scenery_close+0xe>
pop    %rax
ret
mov    $0x6ee281,%edi
pop    %rax
jmp    1040 <RCT2_CALLPROC_EBPSAFE@plt>

LLVM IR (-O0):
define void @window_clear_scenery_close() {
%1 = call i32 (...) @window_clear_scenery_should_close()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @RCT2_CALLPROC_EBPSAFE(i32 7266945)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @window_clear_scenery_close() {
%1 = tail call i32 (...) @window_clear_scenery_should_close()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @RCT2_CALLPROC_EBPSAFE(i32 7266945)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
void delete_file(char *path) {
  char *command = (char *)malloc(sizeof(char) * 100);
  strcpy(command, "rm -f ");
  strcat(command, path);
  printf("Command executed: %s\n", command);
  system(command);
}


x86 assembly (clang, -O0):
<delete_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1070 <strcat@plt>
mov    -0x10(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe95(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcat@plt>
lea    0xe82(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"rm -f \00"
@.str.1 = [22 x i8] c"Command executed: %s\0A\00"
define void @delete_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 100)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcat(i8* %8, i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @system(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"rm -f \00"
@.str.1 = [22 x i8] c"Command executed: %s\0A\00"
define void @delete_file(i8* %0) {
%2 = tail call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @strcat(i8* %3, i8* %0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = tail call i32 @system(i8* %3)
ret void
}
/* Type definitions */
struct cras_expr_value {
  int dummy;
};
struct cras_expr_env {
  int dummy;
};

/* Variables and functions */
struct cras_expr_value *find_or_insert_value(struct cras_expr_env *,
                                             char const *);
int /*<<< orphan*/ value_set_integer(struct cras_expr_value *, int);
void cras_expr_env_set_variable_integer(struct cras_expr_env *env,
                                        const char *name, int integer) {
  struct cras_expr_value *value = find_or_insert_value(env, name);
  value_set_integer(value, integer);
}


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

x86 assembly (clang, -O2):
<cras_expr_env_set_variable_integer>:
push   %rbx
mov    %edx,%ebx
call   1040 <find_or_insert_value@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <value_set_integer@plt>

LLVM IR (-O0):
%struct.cras_expr_env = type { i32 }
%struct.cras_expr_value = type { i32 }
define void @cras_expr_env_set_variable_integer(%struct.cras_expr_env* %0, i8* %1, i32 %2) {
%4 = alloca %struct.cras_expr_env*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.cras_expr_value*
store %struct.cras_expr_env* %0, %struct.cras_expr_env** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load %struct.cras_expr_env*, %struct.cras_expr_env** %4
%9 = load i8*, i8** %5
%10 = call %struct.cras_expr_value* @find_or_insert_value(%struct.cras_expr_env* %8, i8* %9)
store %struct.cras_expr_value* %10, %struct.cras_expr_value** %7
%11 = load %struct.cras_expr_value*, %struct.cras_expr_value** %7
%12 = load i32, i32* %6
%13 = call i32 @value_set_integer(%struct.cras_expr_value* %11, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.cras_expr_env = type { i32 }
%struct.cras_expr_value = type { i32 }
define void @cras_expr_env_set_variable_integer(%struct.cras_expr_env* %0, i8* %1, i32 %2) {
%4 = tail call %struct.cras_expr_value* @find_or_insert_value(%struct.cras_expr_env* %0, i8* %1)
%5 = tail call i32 @value_set_integer(%struct.cras_expr_value* %4, i32 %2)
ret void
}