xunge/DecIR huggingface dataset:
/* Type definitions */
struct tms {
  int dummy;
};
typedef int clock_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
clock_t _times(struct tms *buf) {
  errno = EINVAL;
  return (-1);
}


x86 assembly (clang, -O0):
<_times>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_times>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.tms = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_times(%struct.tms* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
store i32 %2, i32* @errno
ret i32 -1
}
double distance(double a, double b) {
  double ret = a - b;
  if (ret < 0)
    return -ret;
  else
    return ret;
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1151 <distance+0x51>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115b <distance+0x5b>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
subsd  %xmm1,%xmm0
movapd 0xef4(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @distance(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
store double %9, double* %6
%10 = load double, double* %6
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load double, double* %6
%14 = fneg double %13
store double %14, double* %3
br label %17
15: ; preds = %2
%16 = load double, double* %6
store double %16, double* %3
br label %17
17: ; preds = %15, %12
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @distance(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp olt double %3, 0.000000e+00
%5 = fneg double %3
%6 = select i1 %4, double %5, double %3
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ util_viewFile(char *);
int mainMenu_opt_help() {
  util_viewFile("help.txt");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"help.txt\00"
define i32 @mainMenu_opt_help() {
%1 = call i32 @util_viewFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"help.txt\00"
define i32 @mainMenu_opt_help() {
%1 = tail call i32 @util_viewFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
char *strdup(char *);
char *get_sys_string(char *table_name, char *attribute_name,
                     char *database_datatype) {
  char buffer[1024];
  sprintf(buffer, "echo \"alter table %s add %s %s;\" | sql.e 2>&1", table_name,
          attribute_name, database_datatype);
  return strdup(buffer);
}


x86 assembly (clang, -O0):
<get_sys_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xeaf(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x420(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sys_string>:
push   %rbx
sub    $0x400,%rsp
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xec8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"echo \22alter table %s add %s %s;\22 | sql.e 2>&1\00"
define i8* @get_sys_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = call i8* @strdup(i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [46 x i8] c"echo \22alter table %s add %s %s;\22 | sql.e 2>&1\00"
define noalias i8* @get_sys_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%7 = call i8* @strdup(i8* %5)
ret i8* %7
}
int cairo_code_draw_lushShapeLabel_get_height() { return 39; }


x86 assembly (clang, -O0):
<cairo_code_draw_lushShapeLabel_get_height>:
push   %rbp
mov    %rsp,%rbp
mov    $0x27,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cairo_code_draw_lushShapeLabel_get_height() {
ret i32 39
}

LLVM IR (-O2):
define i32 @cairo_code_draw_lushShapeLabel_get_height() {
ret i32 39
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setdetachstate(pthread_attr_t *a, int b) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_setdetachstate(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
int sfe_ipv6_recv(struct net_device *dev, struct sk_buff *skb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
%struct.sk_buff = type opaque
define i32 @sfe_ipv6_recv(%struct.net_device* nocapture readnone %0, %struct.sk_buff* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *sleeper_thread(void *arg) {
  (void)arg;
  sleep(1000000);
  return 0;
}


x86 assembly (clang, -O0):
<sleeper_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf4240,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleeper_thread>:
push   %rax
mov    $0xf4240,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sleeper_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sleep(i32 1000000)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sleeper_thread(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 1000000)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void myprint(unsigned int *buf, unsigned int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%03x ", buf[i]);
  }
}


x86 assembly (clang, -O0):
<myprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1157 <myprint+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <myprint+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myprint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1145 <myprint+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <myprint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%03x \00"
define void @myprint(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int findnextSlot(int *board, int n, int x) {
  while (board[x] != 0 && x < n)
    x++;
  if (x >= n)
    return n - 1;
  return x;
}


x86 assembly (clang, -O0):
<findnextSlot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
xor    %eax,%eax
cmpl   $0x0,(%rcx,%rdx,4)
mov    %al,-0x19(%rbp)
je     1131 <findnextSlot+0x31>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
setl   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1141 <findnextSlot+0x41>
jmp    114f <findnextSlot+0x4f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    110e <findnextSlot+0xe>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1169 <findnextSlot+0x69>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <findnextSlot+0x6f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findnextSlot>:
movslq %edx,%rax
movslq %esi,%rcx
lea    -0x1(%rax),%edx
nopl   0x0(%rax)
mov    %rax,%rsi
add    $0x1,%edx
cmpl   $0x0,(%rdi,%rax,4)
je     1125 <findnextSlot+0x25>
lea    0x1(%rsi),%rax
cmp    %rcx,%rsi
jl     1110 <findnextSlot+0x10>
lea    -0x1(%rcx),%eax
cmp    %rcx,%rsi
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @findnextSlot(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %6, %3
%7 = phi i64 [ %13, %6 ], [ %4, %3 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
%11 = icmp slt i64 %7, %5
%12 = select i1 %10, i1 %11, i1 false
%13 = add nsw i64 %7, 1
br i1 %12, label %6, label %14
14: ; preds = %6
%15 = trunc i64 %7 to i32
%16 = add nsw i32 %1, -1
%17 = select i1 %11, i32 %15, i32 %16
ret i32 %17
}
long extract_spr(insn, invalid)
unsigned long insn;
int *invalid;
{ return ((insn >> 16) & 0x1f) | ((insn >> 6) & 0x3e0); }


x86 assembly (clang, -O0):
<extract_spr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0x1f,%rax
mov    -0x8(%rbp),%rcx
shr    $0x6,%rcx
and    $0x3e0,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_spr>:
mov    %edi,%eax
shr    $0x10,%eax
and    $0x1f,%eax
shr    $0x6,%rdi
and    $0x3e0,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @extract_spr(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = lshr i64 %5, 16
%7 = and i64 %6, 31
%8 = load i64, i64* %3
%9 = lshr i64 %8, 6
%10 = and i64 %9, 992
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @extract_spr(i64 %0, i32* nocapture readnone %1) {
%3 = lshr i64 %0, 16
%4 = and i64 %3, 31
%5 = lshr i64 %0, 6
%6 = and i64 %5, 992
%7 = or i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
usage() { printf("usage : servecho numero_port_serveur\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"usage : servecho numero_port_serveur\0A\00"
define i32 @usage() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [37 x i8] c"usage : servecho numero_port_serveur\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putnbr(int);
void ft_putnbrl(int n) {
  ft_putnbr(n);
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_putnbrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ft_putnbr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbrl>:
push   %rax
call   1040 <ft_putnbr@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putnbrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ft_putnbr(i32 %3)
%5 = call i32 @ft_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ft_putnbrl(i32 %0) {
%2 = tail call i32 @ft_putnbr(i32 %0)
%3 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
char *get_version();
int /*<<< orphan*/ printf(char *, char *);
void print_version() { printf("%s", get_version()); }


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_version@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
push   %rax
xor    %eax,%eax
call   1040 <get_version@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @print_version() {
%1 = call i8* (...) @get_version()
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_version() {
%1 = tail call i8* (...) @get_version()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int IsKoreanHantip(const unsigned char *cp, int *pdxChar) {
  if ((*cp >= 0xb0 && *cp <= 0xc8) &&
      (*(cp + 1) >= 0xa1 && *(cp + 1) <= 0xfe)) {
    *pdxChar = 8;
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<IsKoreanHantip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xb0,%eax
jl     116c <IsKoreanHantip+0x6c>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xc8,%eax
jg     116c <IsKoreanHantip+0x6c>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0xa1,%eax
jl     116c <IsKoreanHantip+0x6c>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0xfe,%eax
jg     116c <IsKoreanHantip+0x6c>
mov    -0x18(%rbp),%rax
movl   $0x8,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    1173 <IsKoreanHantip+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsKoreanHantip>:
mov    (%rdi),%cl
add    $0x50,%cl
xor    %eax,%eax
cmp    $0x18,%cl
ja     1122 <IsKoreanHantip+0x22>
mov    0x1(%rdi),%cl
add    $0x1,%cl
cmp    $0xa2,%cl
jb     1122 <IsKoreanHantip+0x22>
movl   $0x8,(%rsi)
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @IsKoreanHantip(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 80
%5 = icmp ult i8 %4, 25
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = add i8 %8, 1
%10 = icmp ult i8 %9, -94
br i1 %10, label %12, label %11
11: ; preds = %6
store i32 8, i32* %1
br label %12
12: ; preds = %2, %6, %11
%13 = phi i32 [ 2, %11 ], [ 0, %6 ], [ 0, %2 ]
ret i32 %13
}
/* Variables and functions */
int rand();
int fake_call2() { return rand(); }


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

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

LLVM IR (-O0):
define i32 @fake_call2() {
%1 = call i32 (...) @rand()
ret i32 %1
}

LLVM IR (-O2):
define i32 @fake_call2() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ read_data(char *);
int main() {
  read_data("test_f.bin");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"test_f.bin\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @read_data(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"test_f.bin\00"
define i32 @main() {
%1 = tail call i32 @read_data(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ main();
void start_me(void) { main(); }


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

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

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

LLVM IR (-O2):
define void @start_me() {
%1 = tail call i32 (...) @main()
ret void
}
/* Type definitions */
struct listAssoc {
  int dummy;
};

/* Variables and functions */
struct listAssoc *getIndex_listAssoc_Aux(struct listAssoc *, int,
                                         int /*<<< orphan*/);
struct listAssoc *getIndex_listAssoc(struct listAssoc *l, int index) {
  return getIndex_listAssoc_Aux(l, index, 0);
}


x86 assembly (clang, -O0):
<getIndex_listAssoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <getIndex_listAssoc_Aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIndex_listAssoc>:
xor    %edx,%edx
jmp    1030 <getIndex_listAssoc_Aux@plt>

LLVM IR (-O0):
%struct.listAssoc = type { i32 }
define %struct.listAssoc* @getIndex_listAssoc(%struct.listAssoc* %0, i32 %1) {
%3 = alloca %struct.listAssoc*
%4 = alloca i32
store %struct.listAssoc* %0, %struct.listAssoc** %3
store i32 %1, i32* %4
%5 = load %struct.listAssoc*, %struct.listAssoc** %3
%6 = load i32, i32* %4
%7 = call %struct.listAssoc* @getIndex_listAssoc_Aux(%struct.listAssoc* %5, i32 %6, i32 0)
ret %struct.listAssoc* %7
}

LLVM IR (-O2):
%struct.listAssoc = type { i32 }
define %struct.listAssoc* @getIndex_listAssoc(%struct.listAssoc* %0, i32 %1) {
%3 = tail call %struct.listAssoc* @getIndex_listAssoc_Aux(%struct.listAssoc* %0, i32 %1, i32 0)
ret %struct.listAssoc* %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int get_bind_path_client(char *bind_path) {
  strcpy(bind_path, "UDS_CLIENT");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"UDS_CLIENT\00"
define i32 @get_bind_path_client(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"UDS_CLIENT\00"
define i32 @get_bind_path_client(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ md_control_keyboard(int);
void stop_window(void) {
  endwin();
  md_control_keyboard(1);
}


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

x86 assembly (clang, -O2):
<stop_window>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <md_control_keyboard@plt>

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

LLVM IR (-O2):
define void @stop_window() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 @md_control_keyboard(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler() { printf("Just a dummy handler\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Just a dummy handler\0A\00"
define void @handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Just a dummy handler\00"
define void @handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
scalar_t__ pthread_self();
void *thread_func1() {
  printf("Task1 running...by Thread  :%u\n", (unsigned int)pthread_self());
}


x86 assembly (clang, -O0):
<thread_func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func1>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Task1 running...by Thread :%u\0A\00"
define i8* @thread_func1() {
%1 = alloca i8*
%2 = call i64 (...) @pthread_self()
%3 = trunc i64 %2 to i32
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@.str = [32 x i8] c"Task1 running...by Thread :%u\0A\00"
define noalias i8* @thread_func1() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* undef
}
unsigned long crc_start(void) { return 0xFFFFFFFF; }


x86 assembly (clang, -O0):
<crc_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @crc_start() {
ret i64 4294967295
}

LLVM IR (-O2):
define i64 @crc_start() {
ret i64 4294967295
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *to_octal_str(int i) {
  char *buf = malloc(16 * sizeof(*buf));
  assert(buf);
  sprintf(buf, "%o", i);
  return buf;
}


x86 assembly (clang, -O0):
<to_octal_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xea0(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_octal_str>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%o\00"
define i8* @to_octal_str(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 16)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %3
%8 = load i32, i32* %2
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%o\00"
define i8* @to_octal_str(i32 %0) {
%2 = tail call dereferenceable_or_null(16) i8* @malloc(i32 16)
%3 = tail call i32 @assert(i8* %2)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
unsigned xrop3_18_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_18_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_18_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    $0xffffff00,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_18_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -256
%8 = or i32 %7, %4
%9 = xor i32 %8, -1
%10 = or i32 %9, %3
ret i32 %10
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll6(struct __test_metadata *);
void wrapper_epoll6(struct __test_metadata *_metadata,
                    struct __fixture_variant_metadata *variant) {
  epoll6(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll6>:
jmp    1030 <epoll6@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll6(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll6(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll6(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll6(%struct.__test_metadata* %0)
ret void
}
char *next_token(const char *s) {
  while ((((unsigned char)*s) == ' ' || ((unsigned char)*s) == '\t'))
    ++s;
  return (char *)s;
}


x86 assembly (clang, -O0):
<next_token>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <next_token+0x2d>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <next_token+0x3d>
jmp    114e <next_token+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <next_token+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_token>:
mov    %rdi,%rax
jmp    1114 <next_token+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <next_token+0x10>
cmp    $0x9,%cl
je     1110 <next_token+0x10>
ret

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

LLVM IR (-O2):
define i8* @next_token(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int hasSubstr(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf(
      "%u\n",
      hasSubstr("You must read the entire document before you start to answer.",
                "en"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xf05(%rip),%rsi
call   1040 <hasSubstr@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
@.str.1 = [62 x i8] c"You must read the entire document before you start to answer.\00"
@.str.2 = [3 x i8] c"en\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @hasSubstr(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
@.str.1 = [62 x i8] c"You must read the entire document before you start to answer.\00"
@.str.2 = [3 x i8] c"en\00"
define i32 @main() {
%1 = tail call i32 @hasSubstr(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_init(int, unsigned int);
void serial_initcom0user(unsigned baudrate) {
  serial_init(((0x03ff0000) + 0xD000), baudrate);
}


x86 assembly (clang, -O0):
<serial_initcom0user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x3ffd000,%edi
call   1030 <serial_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_initcom0user>:
mov    %edi,%esi
mov    $0x3ffd000,%edi
jmp    1030 <serial_init@plt>

LLVM IR (-O0):
define void @serial_initcom0user(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @serial_init(i32 67096576, i32 %3)
ret void
}

LLVM IR (-O2):
define void @serial_initcom0user(i32 %0) {
%2 = tail call i32 @serial_init(i32 67096576, i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ IFNAMSIZ;
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
int system(char *);
int tun_mtu(char *dev, int mtu) {
  char *cmd = (char *)malloc(100 + IFNAMSIZ);
  sprintf(cmd, "ip link set dev %s mtu %d", dev, mtu);
  int rc = system(cmd);
  free(cmd);
  return rc;
}


x86 assembly (clang, -O0):
<tun_mtu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%rdi
add    $0x64,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xe88(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <system@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tun_mtu>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    0x2e8f(%rip),%rax
mov    (%rax),%rdi
add    $0x64,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbp
lea    0xe99(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1060 <sprintf@plt>
mov    %rbp,%rdi
call   1040 <system@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@IFNAMSIZ = global i64 0
@.str = [26 x i8] c"ip link set dev %s mtu %d\00"
define i32 @tun_mtu(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i64, i64* @IFNAMSIZ
%8 = add nsw i64 100, %7
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
%15 = load i8*, i8** %5
%16 = call i32 @system(i8* %15)
store i32 %16, i32* %6
%17 = load i8*, i8** %5
%18 = call i32 @free(i8* %17)
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
@IFNAMSIZ = global i64 0
@.str = [26 x i8] c"ip link set dev %s mtu %d\00"
define i32 @tun_mtu(i8* %0, i32 %1) {
%3 = load i64, i64* @IFNAMSIZ
%4 = add nsw i64 %3, 100
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %6, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%8 = tail call i32 @system(i8* %6)
%9 = tail call i32 @free(i8* %6)
ret i32 %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ report_params(int /*<<< orphan*/, int, char **, char **);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[], char *env[]) {
  report_params(stderr, argc, argv, env);
  return EXIT_SUCCESS;
}


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)
mov    %rdx,-0x18(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <report_params@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <report_params@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* @stderr
%9 = load i32, i32* %5
%10 = load i8**, i8*** %6
%11 = load i8**, i8*** %7
%12 = call i32 @report_params(i32 %8, i32 %9, i8** %10, i8** %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @report_params(i32 %4, i32 %0, i8** %1, i8** %2)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double __ieee754_lgamma_r(double, int *);
double lgamma_r(double x, int *signgamp) {
  return __ieee754_lgamma_r(x, signgamp);
}


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

x86 assembly (clang, -O2):
<lgamma_r>:
jmp    1030 <__ieee754_lgamma_r@plt>

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

LLVM IR (-O2):
define double @lgamma_r(double %0, i32* %1) {
%3 = tail call double @__ieee754_lgamma_r(double %0, i32* %1)
ret double %3
}
void add(double *r, const double *a, const double *b) {
  r[0] = a[0] + b[0];
  r[1] = a[1] + b[1];
  r[2] = a[2] + b[2];
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
addsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
addsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
movsd  (%rsi),%xmm0
addsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
addsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
addsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @add(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fadd double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fadd double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fadd double %27, %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @add(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fadd double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 2
%16 = load double, double* %15
%17 = fadd double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret void
}
void atomic_store_voidptr(void **var, void *val) {
  __atomic_store_n(var, val, 5);
}


x86 assembly (clang, -O0):
<atomic_store_voidptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xchg   %rax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_store_voidptr>:
xchg   %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @atomic_store_voidptr(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %4
store i8* %7, i8** %5
%8 = bitcast i8** %6 to i64*
%9 = bitcast i8** %5 to i64*
%10 = load i64, i64* %9
store atomic i64 %10, i64* %8 seq_cst
ret void
}

LLVM IR (-O2):
define void @atomic_store_voidptr(i8** nocapture writeonly %0, i8* %1) {
%3 = bitcast i8** %0 to i64*
%4 = ptrtoint i8* %1 to i64
store atomic i64 %4, i64* %3 seq_cst
ret void
}