xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ execute(char *);
int printf(char *);
int scanf(char *, char *);
void loop(void) {
  char name[64];
  while (printf("> "), scanf("%62s", name) == 1)
    execute(name);
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    116b <loop+0x3b>
lea    -0x40(%rbp),%rdi
call   1040 <execute@plt>
jmp    1138 <loop+0x8>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1190 <loop+0x60>
mov    %rsp,%rbx
lea    0xe9d(%rip),%r14
lea    0xe99(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <execute@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1170 <loop+0x40>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"> \00"
@.str.1 = [5 x i8] c"%62s\00"
define void @loop() {
%1 = alloca [64 x i8]
br label %2
2: ; preds = %7, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%9 = call i32 @execute(i8* %8)
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
@.str.1 = [5 x i8] c"%62s\00"
define void @loop() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = call i32 @execute(i8* %2)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%10 = icmp eq i32 %9, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_proxy {
  int dummy;
};
struct wl_pointer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_get_version(struct wl_proxy *);
uint32_t wl_pointer_get_version(struct wl_pointer *wl_pointer) {
  return wl_proxy_get_version((struct wl_proxy *)wl_pointer);
}


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

x86 assembly (clang, -O2):
<wl_pointer_get_version>:
jmp    1030 <wl_proxy_get_version@plt>

LLVM IR (-O0):
%struct.wl_pointer = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_pointer_get_version(%struct.wl_pointer* %0) {
%2 = alloca %struct.wl_pointer*
store %struct.wl_pointer* %0, %struct.wl_pointer** %2
%3 = load %struct.wl_pointer*, %struct.wl_pointer** %2
%4 = bitcast %struct.wl_pointer* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_get_version(%struct.wl_proxy* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.wl_pointer = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_pointer_get_version(%struct.wl_pointer* %0) {
%2 = bitcast %struct.wl_pointer* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_get_version(%struct.wl_proxy* %2)
ret i32 %3
}
/* Variables and functions */
double tanh(double);
double sigmoid(double x) { return tanh(x); }


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

x86 assembly (clang, -O2):
<sigmoid>:
jmp    1030 <tanh@plt>

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

LLVM IR (-O2):
define double @sigmoid(double %0) {
%2 = tail call double @tanh(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void LPCCOMxIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(ulBase == 0x40080000);
  DEBUG_ASSERT((ulIntFlags & ~(0x00200000 | 0x00100000 | 0x00080000)) == 0);
  (*((volatile unsigned long *)(ulBase + 0x00000120))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<LPCCOMxIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0xffffffffffc7ffff,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x120(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x120(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCCOMxIntEnable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40080000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xffffffffffc7ffff,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
or     %r14,0x120(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @LPCCOMxIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074266112
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = and i64 %9, -3670017
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = add i64 %15, 288
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = or i64 %18, %14
store volatile i64 %19, i64* %17
ret void
}

LLVM IR (-O2):
define void @LPCCOMxIntEnable(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074266112
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = and i64 %1, -3670017
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = add i64 %0, 288
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %1
store volatile i64 %13, i64* %11
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ asctime(struct tm *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ rm_return(char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *curr_time_str(char *s) {
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  strcpy(s, asctime(timeinfo));
  rm_return(s);
  return s;
}


x86 assembly (clang, -O0):
<curr_time_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1070 <time@plt>
lea    -0xc(%rbp),%rdi
call   1040 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <asctime@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1050 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <rm_return@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curr_time_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1070 <time@plt>
mov    %r14,%rdi
call   1040 <localtime@plt>
mov    %rax,%rdi
call   1060 <asctime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
call   1030 <rm_return@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @curr_time_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @asctime(%struct.tm* %8)
%10 = call i32 @strcpy(i8* %7, i32 %9)
%11 = load i8*, i8** %2
%12 = call i32 @rm_return(i8* %11)
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @curr_time_str(i8* returned %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @asctime(%struct.tm* %5)
%7 = call i32 @strcpy(i8* %0, i32 %6)
%8 = call i32 @rm_return(i8* %0)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage:\n");
  fprintf(stderr, "\t-q Quiet mode ( only report interface name ).\n\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed9(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [49 x i8] c"\09-q Quiet mode ( only report interface name ).\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [49 x i8] c"\09-q Quiet mode ( only report interface name ).\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TELOPT_ECHO;
int /*<<< orphan*/ tel_opt_do_send(int /*<<< orphan*/, int);
int charmode_do(int a) {
  (void)a;
  tel_opt_do_send(TELOPT_ECHO, 1);
  return 1;
}


x86 assembly (clang, -O0):
<charmode_do>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <tel_opt_do_send@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charmode_do>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <tel_opt_do_send@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@TELOPT_ECHO = global i32 0
define i32 @charmode_do(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TELOPT_ECHO
%5 = call i32 @tel_opt_do_send(i32 %4, i32 1)
ret i32 1
}

LLVM IR (-O2):
@TELOPT_ECHO = global i32 0
define i32 @charmode_do(i32 %0) {
%2 = load i32, i32* @TELOPT_ECHO
%3 = tail call i32 @tel_opt_do_send(i32 %2, i32 1)
ret i32 1
}
int cairo_code_draw_casFrame_get_width() { return 164; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casFrame_get_width() {
ret i32 164
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casFrame_get_width() {
ret i32 164
}
/* Variables and functions */
int /*<<< orphan*/ Makenull(int);
int /*<<< orphan*/ Push(int, int);
void Init(int s, int n) {
  int discctr;
  Makenull(s);
  for (discctr = n; discctr >= 1; discctr--)
    Push(discctr, s);
}


x86 assembly (clang, -O0):
<Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Makenull@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     115f <Init+0x3f>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <Push@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <Init+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <Makenull@plt>
test   %ebx,%ebx
jle    1143 <Init+0x23>
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <Push@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <Init+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @Init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @Makenull(i32 %6)
%8 = load i32, i32* %4
store i32 %8, i32* %5
br label %9
9: ; preds = %16, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 1
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %5
%14 = load i32, i32* %3
%15 = call i32 @Push(i32 %13, i32 %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %5
%18 = add nsw i32 %17, -1
store i32 %18, i32* %5
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @Init(i32 %0, i32 %1) {
%3 = tail call i32 @Makenull(i32 %0)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %1, %2 ]
%7 = tail call i32 @Push(i32 %6, i32 %0)
%8 = add nsw i32 %6, -1
%9 = icmp ugt i32 %6, 1
br i1 %9, label %5, label %10
10: ; preds = %5, %2
ret void
}
/* Type definitions */
struct cp_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cp_info **);
int /*<<< orphan*/ free_cp_info(struct cp_info *);
void free_cp_infos(unsigned int count, struct cp_info **cp) {
  unsigned int i;
  for (i = 0; i < count; i++) {
    free_cp_info(cp[i]);
  }
  free(cp);
}


x86 assembly (clang, -O0):
<free_cp_infos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1160 <free_cp_infos+0x40>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1040 <free_cp_info@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <free_cp_infos+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_cp_infos>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
je     1152 <free_cp_infos+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1040 <free_cp_info@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <free_cp_infos+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.cp_info = type { i32 }
define void @free_cp_infos(i32 %0, %struct.cp_info** %1) {
%3 = alloca i32
%4 = alloca %struct.cp_info**
%5 = alloca i32
store i32 %0, i32* %3
store %struct.cp_info** %1, %struct.cp_info*** %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load %struct.cp_info**, %struct.cp_info*** %4
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds %struct.cp_info*, %struct.cp_info** %11, i64 %13
%15 = load %struct.cp_info*, %struct.cp_info** %14
%16 = call i32 @free_cp_info(%struct.cp_info* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load %struct.cp_info**, %struct.cp_info*** %4
%22 = call i32 @free(%struct.cp_info** %21)
ret void
}

LLVM IR (-O2):
%struct.cp_info = type { i32 }
define void @free_cp_infos(i32 %0, %struct.cp_info** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds %struct.cp_info*, %struct.cp_info** %1, i64 %7
%9 = load %struct.cp_info*, %struct.cp_info** %8
%10 = tail call i32 @free_cp_info(%struct.cp_info* %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
%14 = tail call i32 @free(%struct.cp_info** %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xfocus;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xfocus_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xfocus.window = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xfocus_window>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xfocus_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xfocus_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int crawlcanconnect(struct collectionFormat *collection,
                    int (*documentError)(struct collectionFormat *, int,
                                         const char *, ...)) {
  return 1;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.collectionFormat = type opaque
define i32 @crawlcanconnect(%struct.collectionFormat* nocapture readnone %0, i32 (%struct.collectionFormat*, i32, i8*, ...)* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sendMspTelemetry();
void handleMSPTelemetry(void) { sendMspTelemetry(); }


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

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

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

LLVM IR (-O2):
define void @handleMSPTelemetry() {
%1 = tail call i32 (...) @sendMspTelemetry()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ETHERNET_DriverIRQHandler();
__attribute__((weak)) void ETHERNET_IRQHandler(void) {
  ETHERNET_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @ETHERNET_IRQHandler() {
%1 = tail call i32 (...) @ETHERNET_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *flash_get_OPTKEYR() {
  return mem_get_reg32(0x40023C00 + 0x14);
}


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

x86 assembly (clang, -O2):
<flash_get_OPTKEYR>:
mov    $0x40023c14,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @flash_get_OPTKEYR() {
%1 = call i32* @mem_get_reg32(i32 1073888276)
ret i32* %1
}

LLVM IR (-O2):
define i32* @flash_get_OPTKEYR() {
%1 = tail call i32* @mem_get_reg32(i32 1073888276)
ret i32* %1
}
/* Variables and functions */
float timer_get_ticks();
float f_elapsed_time() { return 0.001f * timer_get_ticks(); }


x86 assembly (clang, -O0):
<f_elapsed_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <timer_get_ticks@plt>
movaps %xmm0,%xmm1
movss  0xeda(%rip),%xmm0
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_elapsed_time>:
push   %rax
xor    %eax,%eax
call   1030 <timer_get_ticks@plt>
mulss  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f_elapsed_time() {
%1 = call float (...) @timer_get_ticks()
%2 = fmul float 0x3F50624DE0000000, %1
ret float %2
}

LLVM IR (-O2):
define float @f_elapsed_time() {
%1 = tail call float (...) @timer_get_ticks()
%2 = fmul float %1, 0x3F50624DE0000000
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *syscfg_get_EXTICR2() {
  return mem_get_reg32(0x40010000 + 0x0C);
}


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

x86 assembly (clang, -O2):
<syscfg_get_EXTICR2>:
mov    $0x4001000c,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @syscfg_get_EXTICR2() {
%1 = call i32* @mem_get_reg32(i32 1073807372)
ret i32* %1
}

LLVM IR (-O2):
define i32* @syscfg_get_EXTICR2() {
%1 = tail call i32* @mem_get_reg32(i32 1073807372)
ret i32* %1
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int stob(char *s) {
  if (strncmp(s, "yes", 3))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<stob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1147 <stob+0x37>
movl   $0x0,-0x4(%rbp)
jmp    114e <stob+0x3e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stob>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"yes\00"
define i32 @stob(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
define i32 @stob(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t i = 0;
  while (str[i])
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
long long max(long long in1, long long in2) {
  if (in1 > in2)
    return in1;
  else
    return in2;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <max+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <max+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int putc(unsigned long, int /*<<< orphan*/ *);
int fputc4LowHigh(unsigned long d, FILE *s) {
  putc(d & 0xFF, s);
  putc((d >> 8) & 0xFF, s);
  putc((d >> 8 * 2) & 0xFF, s);
  return putc((d >> 8 * 3) & 0xFF, s);
}


x86 assembly (clang, -O0):
<fputc4LowHigh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rdi
shr    $0x8,%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rdi
shr    $0x10,%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rdi
shr    $0x18,%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc4LowHigh>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movzbl %bl,%edi
call   1030 <putc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
shr    $0x18,%ebx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define i32 @fputc4LowHigh(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 = and i64 %5, 255
%7 = load i32*, i32** %4
%8 = call i32 @putc(i64 %6, i32* %7)
%9 = load i64, i64* %3
%10 = lshr i64 %9, 8
%11 = and i64 %10, 255
%12 = load i32*, i32** %4
%13 = call i32 @putc(i64 %11, i32* %12)
%14 = load i64, i64* %3
%15 = lshr i64 %14, 16
%16 = and i64 %15, 255
%17 = load i32*, i32** %4
%18 = call i32 @putc(i64 %16, i32* %17)
%19 = load i64, i64* %3
%20 = lshr i64 %19, 24
%21 = and i64 %20, 255
%22 = load i32*, i32** %4
%23 = call i32 @putc(i64 %21, i32* %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @fputc4LowHigh(i64 %0, i32* nocapture %1) {
%3 = and i64 %0, 255
%4 = tail call i32 @putc(i64 %3, i32* %1)
%5 = lshr i64 %0, 8
%6 = and i64 %5, 255
%7 = tail call i32 @putc(i64 %6, i32* %1)
%8 = lshr i64 %0, 16
%9 = and i64 %8, 255
%10 = tail call i32 @putc(i64 %9, i32* %1)
%11 = lshr i64 %0, 24
%12 = and i64 %11, 255
%13 = tail call i32 @putc(i64 %12, i32* %1)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int getifaddr(const char *ifname, char *buf, int len) {
  strncpy(buf, "1.2.3.4", len);
  return 0;
}


x86 assembly (clang, -O0):
<getifaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xecf(%rip),%rsi
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getifaddr>:
push   %rax
mov    %rsi,%rdi
lea    0xee5(%rip),%rsi
call   1030 <strncpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"1.2.3.4\00"
define i32 @getifaddr(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @strncpy(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"1.2.3.4\00"
define i32 @getifaddr(i8* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void free_ucvector(unsigned char *v, int nl, int nh) {
  free((unsigned char *)(v + nl));
}


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

x86 assembly (clang, -O2):
<free_ucvector>:
movslq %esi,%rax
add    %rax,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_ucvector(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
define void @free_ucvector(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
scalar_t__ pow(int, int);
int _intlength(int i) {
  int cnt;
  for (cnt = 1; i / (int)pow(10, cnt) >= 1; cnt++)
    ;
  return cnt;
}


x86 assembly (clang, -O0):
<_intlength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
cmp    $0x1,%eax
jl     115a <_intlength+0x4a>
jmp    114c <_intlength+0x3c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <_intlength+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_intlength>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    $0xa,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    %ebp,%eax
cltd
idiv   %ecx
test   %eax,%eax
jg     1120 <_intlength+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_intlength(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i64 @pow(i32 10, i32 %6)
%8 = trunc i64 %7 to i32
%9 = sdiv i32 %5, %8
%10 = icmp sge i32 %9, 1
br i1 %10, label %11, label %15
11: ; preds = %4
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @_intlength(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %8, %2 ]
%4 = tail call i64 @pow(i32 10, i32 %3)
%5 = trunc i64 %4 to i32
%6 = sdiv i32 %0, %5
%7 = icmp sgt i32 %6, 0
%8 = add nuw nsw i32 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t tick2ns(uint32_t ticks) { return ticks * 1; }


x86 assembly (clang, -O0):
<tick2ns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @tick2ns(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a, b;
  a = 2147483647;
  b = a + 1;
  printf("%d,%d\n", a, b);
  return 0;
}


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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d,%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2147483647, i32 -2147483648)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: ethos <tap> <serial> [baudrate]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"usage: ethos <tap> <serial> [baudrate]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"usage: ethos <tap> <serial> [baudrate]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ObjectSize0(char *);
void test17(char *C) {
  ObjectSize0(C + ({
                int a = 65535;
                a;
              }));
}


x86 assembly (clang, -O0):
<test17>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movl   $0xffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movslq -0x10(%rbp),%rax
add    %rax,%rdi
call   1030 <ObjectSize0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test17>:
add    $0xffff,%rdi
jmp    1030 <ObjectSize0@plt>

LLVM IR (-O0):
define void @test17(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i32 65535, i32* %3
%6 = load i32, i32* %3
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = call i32 @ObjectSize0(i8* %9)
ret void
}

LLVM IR (-O2):
define void @test17(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 65535
%3 = tail call i32 @ObjectSize0(i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_sub_epi32(__m128i A, __m128i B) { return _mm_sub_epi32(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_sub_epi32>:
jmp    1030 <_mm_sub_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_sub_epi32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sub_epi32(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *mg_fopen(const char *path, const char *mode) { return fopen(path, mode); }


x86 assembly (clang, -O0):
<mg_fopen>:
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 <fopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_fopen>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @mg_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
/* Type definitions */
union bpf_attr {
  int key_size;
  int value_size;
  int max_entries;
  int /*<<< orphan*/ map_type;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_CREATE;
int /*<<< orphan*/ BPF_MAP_TYPE_ARRAY;
int /*<<< orphan*/ SYS_bpf;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, union bpf_attr *, int);
int create_map(void) {
  union bpf_attr attr = {
      .map_type = BPF_MAP_TYPE_ARRAY,
      .key_size = 4,
      .value_size = 8,
      .max_entries = 0x100,
  };
  return syscall(SYS_bpf, BPF_MAP_CREATE, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<create_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_map>:
push   %rax
movl   $0x100,(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@__const.create_map.attr = %union.bpf_attr { i32 256 }
@SYS_bpf = global i32 0
@BPF_MAP_CREATE = global i32 0
@BPF_MAP_TYPE_ARRAY = global i32 0
define i32 @create_map() {
%1 = alloca %union.bpf_attr
%2 = bitcast %union.bpf_attr* %1 to i8*
%3 = load i32, i32* @SYS_bpf
%4 = load i32, i32* @BPF_MAP_CREATE
%5 = call i32 @syscall(i32 %3, i32 %4, %union.bpf_attr* %1, i32 4)
ret i32 %5
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@SYS_bpf = global i32 0
@BPF_MAP_CREATE = global i32 0
@BPF_MAP_TYPE_ARRAY = global i32 0
define i32 @create_map() {
%1 = alloca %union.bpf_attr
%2 = bitcast %union.bpf_attr* %1 to i8*
%3 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %1, i64 0, i32 0
store i32 256, i32* %3
%4 = load i32, i32* @SYS_bpf
%5 = load i32, i32* @BPF_MAP_CREATE
%6 = call i32 @syscall(i32 %4, i32 %5, %union.bpf_attr* %1, i32 4)
ret i32 %6
}
void fget_light(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<fget_light>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fget_light>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.fget_light = [11 x i8] c"fget_light\00"
define void @fget_light() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.fget_light, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.fget_light = [11 x i8] c"fget_light\00"
define void @fget_light() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.fget_light, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Screen;

/* Variables and functions */
unsigned int HeightOfScreen(int /*<<< orphan*/ *);
int ypos(Screen *s, unsigned int height) {
  return HeightOfScreen(s) - height - 2;
}


x86 assembly (clang, -O0):
<ypos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <HeightOfScreen@plt>
sub    -0xc(%rbp),%eax
sub    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ypos>:
push   %rbx
mov    %esi,%ebx
call   1030 <HeightOfScreen@plt>
sub    %ebx,%eax
add    $0xfffffffe,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ypos(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @HeightOfScreen(i32* %5)
%7 = load i32, i32* %4
%8 = sub i32 %6, %7
%9 = sub i32 %8, 2
ret i32 %9
}

LLVM IR (-O2):
define i32 @ypos(i32* %0, i32 %1) {
%3 = tail call i32 @HeightOfScreen(i32* %0)
%4 = sub i32 -2, %1
%5 = add i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
int sbpGethostname32(char *, size_t *);
void sbphostn32n(int *ierr, char *name, uint32_t namelen) {
  uint32_t i, newLen = namelen;
  *ierr = sbpGethostname32(name, &newLen);
  for (i = newLen; i < namelen; ++i) {
    name[i] = ' ';
  }
}


x86 assembly (clang, -O0):
<sbphostn32n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <sbpGethostname32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1174 <sbphostn32n+0x64>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1149 <sbphostn32n+0x39>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbphostn32n>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1040 <sbpGethostname32@plt>
mov    %eax,(%r15)
mov    0x8(%rsp),%rax
cmp    %rbx,%rax
jae    1167 <sbphostn32n+0x47>
add    %rax,%r14
sub    %rax,%rbx
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @sbphostn32n(i32* nocapture writeonly %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
store i64 %2, i64* %4
%6 = call i32 @sbpGethostname32(i8* %1, i64* %4)
store i32 %6, i32* %0
%7 = load i64, i64* %4
%8 = icmp ult i64 %7, %2
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = getelementptr i8, i8* %1, i64 %7
%11 = sub i64 %2, %7
br label %12
12: ; preds = %9, %3
ret void
}
void test_no_clause() {
  int i;
#pragma omp for
  for (i = 0; i < 16; ++i)
    ;
#pragma omp for
  ++i;
}


x86 assembly (clang, -O0):
<test_no_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_no_clause+0x28>
jmp    111a <test_no_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_no_clause+0xb>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_no_clause() {
ret void
}
void bar_double(double *x) { *x = __real foo_double(5); }


x86 assembly (clang, -O0):
<bar_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
mov    $0x0,%al
call   1030 <foo_double@plt>
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_double>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <foo_double@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @bar_double(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @foo_double to i32 (i32, ...)*)(i32 5)
%4 = sitofp i32 %3 to double
%5 = load double*, double** %2
store double %4, double* %5
ret void
}

LLVM IR (-O2):
define void @bar_double(double* nocapture writeonly %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo_double to i32 (i32, ...)*)(i32 5)
%3 = sitofp i32 %2 to double
store double %3, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ redecl5();
void useRedecl5() { redecl5(); }


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

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

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

LLVM IR (-O2):
define void @useRedecl5() {
%1 = tail call i32 (...) @redecl5()
ret void
}
void foo078(int p) {}


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

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

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

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