xunge/DecIR huggingface dataset:
/* Variables and functions */
int funsetbit(int, int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 0xAA, y = 0xA7, n = 3, p = 6;
  printf("%x \n", funsetbit(x, p, n, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xaa,-0x8(%rbp)
movl   $0xa7,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x6,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <funsetbit@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xaa,%edi
mov    $0x6,%esi
mov    $0x3,%edx
mov    $0xa7,%ecx
call   1030 <funsetbit@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%x \0A\00"
define i32 @main() {
%1 = tail call i32 @funsetbit(i32 170, i32 6, i32 3, i32 167)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ vt_write_hex_4(int);
void vt_write_hex_16(uint16_t value) {
  vt_write_hex_4(value >> 12);
  vt_write_hex_4(value >> 8);
  vt_write_hex_4(value >> 4);
  vt_write_hex_4(value >> 0);
}


x86 assembly (clang, -O0):
<vt_write_hex_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0xc,%edi
call   1030 <vt_write_hex_4@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
call   1030 <vt_write_hex_4@plt>
mov    -0x4(%rbp),%edi
sar    $0x4,%edi
call   1030 <vt_write_hex_4@plt>
mov    -0x4(%rbp),%edi
sar    $0x0,%edi
call   1030 <vt_write_hex_4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt_write_hex_16>:
push   %rbx
mov    %edi,%ebx
sar    $0xc,%edi
call   1030 <vt_write_hex_4@plt>
mov    %ebx,%edi
sar    $0x8,%edi
call   1030 <vt_write_hex_4@plt>
mov    %ebx,%edi
sar    $0x4,%edi
call   1030 <vt_write_hex_4@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <vt_write_hex_4@plt>

LLVM IR (-O0):
define void @vt_write_hex_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 12
%5 = call i32 @vt_write_hex_4(i32 %4)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = call i32 @vt_write_hex_4(i32 %7)
%9 = load i32, i32* %2
%10 = ashr i32 %9, 4
%11 = call i32 @vt_write_hex_4(i32 %10)
%12 = load i32, i32* %2
%13 = ashr i32 %12, 0
%14 = call i32 @vt_write_hex_4(i32 %13)
ret void
}

LLVM IR (-O2):
define void @vt_write_hex_16(i32 %0) {
%2 = ashr i32 %0, 12
%3 = tail call i32 @vt_write_hex_4(i32 %2)
%4 = ashr i32 %0, 8
%5 = tail call i32 @vt_write_hex_4(i32 %4)
%6 = ashr i32 %0, 4
%7 = tail call i32 @vt_write_hex_4(i32 %6)
%8 = tail call i32 @vt_write_hex_4(i32 %0)
ret void
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char *, int);
int util_has_gz_ext(const char *filename) {
  size_t len;
  len = strlen(filename);
  if ((len > 3) && (strncmp(&filename[len - 3], ".gz", 3) == 0)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<util_has_gz_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jbe    117a <util_has_gz_ext+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
sub    $0x3,%rax
add    %rax,%rdi
lea    0xea6(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    117a <util_has_gz_ext+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1181 <util_has_gz_ext+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_has_gz_ext>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x4,%rax
jb     114d <util_has_gz_ext+0x2d>
lea    (%rax,%rbx,1),%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xec2(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1151 <util_has_gz_ext+0x31>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c".gz\00"
define i32 @util_has_gz_ext(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = icmp ugt i64 %7, 3
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = sub i64 %11, 3
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %9
store i32 1, i32* %2
br label %18
17: ; preds = %9, %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [4 x i8] c".gz\00"
define i32 @util_has_gz_ext(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp ugt i64 %2, 3
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = add i64 %2, -3
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i64 @strncmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %4, %1
br label %10
10: ; preds = %4, %9
%11 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort_report(char *, ...);
int write(int, void *, size_t);
void fifo_write(int fd, void *buf, size_t len) {
  if ((write(fd, buf, len)) == -1)
    (1 == 1) ? abort_report("daemon: Could not write to fifo", "")
             : abort_report("daemon: Could not write to fifo");
}


x86 assembly (clang, -O0):
<fifo_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1161 <fifo_write+0x41>
lea    0xead(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1040 <abort_report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_write>:
push   %rax
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     112d <fifo_write+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
lea    0xee4(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1040 <abort_report@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"daemon: Could not write to fifo\00"
@.str.1 = [1 x i8] zeroinitializer
define void @fifo_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @write(i32 %7, i8* %8, i64 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"daemon: Could not write to fifo\00"
@.str.1 = [1 x i8] zeroinitializer
define void @fifo_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
double pair_tailcorr_switch3_eislater1sp1spcorr(void *pair_data,
                                                long center_index,
                                                long other_index, double rcut,
                                                double width) {
  double t1 = 0;
  return t1;
}


x86 assembly (clang, -O0):
<pair_tailcorr_switch3_eislater1sp1spcorr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_tailcorr_switch3_eislater1sp1spcorr>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pair_tailcorr_switch3_eislater1sp1spcorr(i8* %0, i64 %1, i64 %2, double %3, double %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store double %3, double* %9
store double %4, double* %10
store double 0.000000e+00, double* %11
%12 = load double, double* %11
ret double %12
}

LLVM IR (-O2):
define double @pair_tailcorr_switch3_eislater1sp1spcorr(i8* nocapture readnone %0, i64 %1, i64 %2, double %3, double %4) {
ret double 0.000000e+00
}
void ClearExtensionVariables() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void safe_connect(int socket, const struct sockaddr_in *address) {
  if (connect(socket, (struct sockaddr *)address, sizeof(*address)) == -1) {
    perror("safe_connect - Failed to connect");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<safe_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1050 <connect@plt>
cmp    $0xffffffff,%eax
jne    1173 <safe_connect+0x43>
lea    0xea0(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_connect>:
push   %rax
mov    $0x4,%edx
call   1050 <connect@plt>
cmp    $0xffffffff,%eax
je     1142 <safe_connect+0x12>
pop    %rax
ret
lea    0xeb7(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [33 x i8] c"safe_connect - Failed to connect\00"
@EXIT_FAILURE = global i32 0
define void @safe_connect(i32 %0, %struct.sockaddr_in* %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in*
store i32 %0, i32* %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
%5 = load i32, i32* %3
%6 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%7 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%8 = call i32 @connect(i32 %5, %struct.sockaddr* %7, i32 4)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [33 x i8] c"safe_connect - Failed to connect\00"
@EXIT_FAILURE = global i32 0
define void @safe_connect(i32 %0, %struct.sockaddr_in* %1) {
%3 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%4 = tail call i32 @connect(i32 %0, %struct.sockaddr* %3, i32 4)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ Cvar_InfoString(int);
int /*<<< orphan*/ Info_Print(int /*<<< orphan*/);
void SV_Systeminfo_f(void) {
  Com_Printf("System info settings:\n");
  Info_Print(Cvar_InfoString(8));
}


x86 assembly (clang, -O0):
<SV_Systeminfo_f>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <Com_Printf@plt>
mov    $0x8,%edi
call   1030 <Cvar_InfoString@plt>
mov    %eax,%edi
call   1050 <Info_Print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_Systeminfo_f>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <Com_Printf@plt>
mov    $0x8,%edi
call   1030 <Cvar_InfoString@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <Info_Print@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"System info settings:\0A\00"
define void @SV_Systeminfo_f() {
%1 = call i32 @Com_Printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Cvar_InfoString(i32 8)
%3 = call i32 @Info_Print(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"System info settings:\0A\00"
define void @SV_Systeminfo_f() {
%1 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Cvar_InfoString(i32 8)
%3 = tail call i32 @Info_Print(i32 %2)
ret void
}
void gtk_label_set_use_underline() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_set_use_underline() {
ret void
}
int default_eq(void *va, void *vb) { return va == vb; }


x86 assembly (clang, -O0):
<default_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_eq>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @default_eq(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @default_eq(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
extern void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}


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

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

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

LLVM IR (-O2):
%struct.hw_interrupt_type = type opaque
define void @hw_resend_irq(%struct.hw_interrupt_type* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_stream_update_skt_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_stream@%p::update_skt (rtpp_stream_update_skt) is "
          "invoked after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_stream_update_skt_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_stream_update_skt_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [89 x i8] c"Method rtpp_stream@%p::update_skt (rtpp_stream_update_skt) is invoked after destruction\0A\00"
define void @rtpp_stream_update_skt_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [89 x i8] c"Method rtpp_stream@%p::update_skt (rtpp_stream_update_skt) is invoked after destruction\0A\00"
define void @rtpp_stream_update_skt_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void vt100TextColor(int foregroundColor, int backgroundColor) {
  printf("%c[%i;%im", 0x1B, foregroundColor + 30, backgroundColor + 40);
}


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

x86 assembly (clang, -O2):
lea    0x1e(%rdi),%edx
lea    0x28(%rsi),%ecx
lea    0xee3(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%c[%i;%im\00"
define void @vt100TextColor(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 = add nsw i32 %5, 30
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 40
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%c[%i;%im\00"
define void @vt100TextColor(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 30
%4 = add nsw i32 %1, 40
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_client();
int /*<<< orphan*/ clear_consumer();
void clearServer() {
  clear_client();
  clear_consumer();
}


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

x86 assembly (clang, -O2):
<clearServer>:
push   %rax
xor    %eax,%eax
call   1030 <clear_client@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <clear_consumer@plt>

LLVM IR (-O0):
define void @clearServer() {
%1 = call i32 (...) @clear_client()
%2 = call i32 (...) @clear_consumer()
ret void
}

LLVM IR (-O2):
define void @clearServer() {
%1 = tail call i32 (...) @clear_client()
%2 = tail call i32 (...) @clear_consumer()
ret void
}
int func1(int x) {
  int val;
  val = x;
  return val;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @vdriver_opt_register() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ connect;
int get_socket(char *, char *, int /*<<< orphan*/, int /*<<< orphan*/ *);
int csock(char *host, char *port) {
  return get_socket(host, port, AF_UNSPEC, &connect);
}


x86 assembly (clang, -O0):
<csock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    0x2eb0(%rip),%rcx
call   1030 <get_socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csock>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
mov    0x2ec8(%rip),%rcx
jmp    1030 <get_socket@plt>

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

LLVM IR (-O2):
@AF_UNSPEC = global i32 0
@connect = global i32 0
define i32 @csock(i8* %0, i8* %1) {
%3 = load i32, i32* @AF_UNSPEC
%4 = tail call i32 @get_socket(i8* %0, i8* %1, i32 %3, i32* @connect)
ret i32 %4
}
int regulator_bulk_disable(int num_consumers,
                           struct regulator_bulk_data *consumers) {
  return 0;
}


x86 assembly (clang, -O0):
<regulator_bulk_disable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.regulator_bulk_data = type opaque
define i32 @regulator_bulk_disable(i32 %0, %struct.regulator_bulk_data* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
unsigned long errno;
long __syscall_ret(unsigned long r) {
  if ((int)r > -4096UL) {
    errno = -r;
    return -1;
  }
  return r;
}


x86 assembly (clang, -O0):
<__syscall_ret>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cltq
cmp    $0xfffffffffffff000,%rax
jbe    1139 <__syscall_ret+0x39>
xor    %eax,%eax
mov    %eax,%ecx
sub    -0x10(%rbp),%rcx
mov    0x2eb7(%rip),%rax
mov    %rcx,(%rax)
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1141 <__syscall_ret+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_ret>:
mov    %rdi,%rax
cmp    $0xfffff001,%eax
jb     111e <__syscall_ret+0x1e>
neg    %rax
mov    0x2ecc(%rip),%rcx
mov    %rax,(%rcx)
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@errno = global i64 0
define i64 @__syscall_ret(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
%7 = icmp ugt i64 %6, -4096
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %3
%10 = sub i64 0, %9
store i64 %10, i64* @errno
store i64 -1, i64* %2
br label %13
11: ; preds = %1
%12 = load i64, i64* %3
store i64 %12, i64* %2
br label %13
13: ; preds = %11, %8
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
@errno = global i64 0
define i64 @__syscall_ret(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = icmp ugt i32 %2, -4096
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = sub i64 0, %0
store i64 %5, i64* @errno
br label %6
6: ; preds = %1, %4
%7 = phi i64 [ -1, %4 ], [ %0, %1 ]
ret i64 %7
}
char toUpperCase(char c) {
  int nc = c;
  int nc2upper;
  if (nc >= 97 && nc <= 122) {
    nc2upper = nc - 32;
    char c2upper = nc2upper;
    return c2upper;
  }
  return c;
}


x86 assembly (clang, -O0):
<toUpperCase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     113f <toUpperCase+0x3f>
cmpl   $0x7a,-0x8(%rbp)
jg     113f <toUpperCase+0x3f>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1145 <toUpperCase+0x45>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toUpperCase>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @toUpperCase(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i8 %0, i8* %3
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %20
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp sle i32 %12, 122
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 32
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = trunc i32 %17 to i8
store i8 %18, i8* %6
%19 = load i8, i8* %6
store i8 %19, i8* %2
br label %22
20: ; preds = %11, %1
%21 = load i8, i8* %3
store i8 %21, i8* %2
br label %22
22: ; preds = %20, %14
%23 = load i8, i8* %2
ret i8 %23
}

LLVM IR (-O2):
define signext i8 @toUpperCase(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
ssize_t read(int fd, void *buf, size_t count) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @read(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
void RTSocketShutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSocketShutdown() {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ syscall_1(int, int);
int main(int argc, char *argv[], char *envp[]) {
  char a[10];
  strcpy(a, argv[2]);
  int sleep = atoi(a);
  syscall_1(98, sleep);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x22(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x22(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
mov    $0x62,%edi
call   1040 <syscall_1@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x10(%rsi),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <atoi@plt>
mov    $0x62,%edi
mov    %eax,%esi
call   1040 <syscall_1@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca [10 x i8]
%9 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 2
%13 = load i8*, i8** %12
%14 = call i32 @strcpy(i8* %10, i8* %13)
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %9
%17 = load i32, i32* %9
%18 = call i32 @syscall_1(i32 98, i32 %17)
%19 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = call i32 @strcpy(i8* %5, i8* %7)
%9 = call i32 @atoi(i8* %5)
%10 = call i32 @syscall_1(i32 98, i32 %9)
%11 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int uri_length_bytes(char const *, int);
int uri_validate_bytes(const char *bytes, int len) {
  int n = uri_length_bytes(bytes, len);
  return n >= 0 ? n == len : n;
}


x86 assembly (clang, -O0):
<uri_validate_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <uri_length_bytes@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     114e <uri_validate_bytes+0x3e>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <uri_validate_bytes+0x44>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uri_validate_bytes>:
push   %rbx
mov    %esi,%ebx
call   1030 <uri_length_bytes@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
test   %eax,%eax
cmovns %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @uri_validate_bytes(i8* %0, i32 %1) {
%3 = tail call i32 @uri_length_bytes(i8* %0, i32 %1)
%4 = icmp sgt i32 %3, -1
%5 = icmp eq i32 %3, %1
%6 = zext i1 %5 to i32
%7 = select i1 %4, i32 %6, i32 %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430InterruptP__Port27__default__fired();
void HplMsp430InterruptP__Port27__fired(void) {
  HplMsp430InterruptP__Port27__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430InterruptP__Port27__fired() {
%1 = tail call i32 (...) @HplMsp430InterruptP__Port27__default__fired()
ret void
}
/* Variables and functions */
void DebugP_log3(const char *format, uintptr_t p1, uintptr_t p2, uintptr_t p3) {
}


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

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

LLVM IR (-O0):
define void @DebugP_log3(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
define void @DebugP_log3(i8* nocapture %0, i64 %1, i64 %2, i64 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mem_free(void *data, void *ptr) {
  (void)data;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<mem_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mem_free(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 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @mem_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
void Default_NMI_Handler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Default_NMI_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  while (*s != '\0') {
    if (*s == (char)c) {
      return (char *)s;
    }
    s++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <strchr+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    113d <strchr+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <strchr+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %2
%18 = phi i8* [ null, %2 ], [ null, %13 ], [ %10, %8 ]
ret i8* %18
}
int pgn_read_until_end_comment(char *buffer, int index) {
  for (; buffer[index] != '}' && buffer[index] != '\0'; index++)
    ;
  return index;
}


x86 assembly (clang, -O0):
<pgn_read_until_end_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x7d,%ecx
mov    %al,-0xd(%rbp)
je     113a <pgn_read_until_end_comment+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <pgn_read_until_end_comment+0x4a>
jmp    115d <pgn_read_until_end_comment+0x5d>
jmp    114f <pgn_read_until_end_comment+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <pgn_read_until_end_comment+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgn_read_until_end_comment>:
mov    %esi,%eax
movslq %esi,%rcx
add    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
movzbl (%rcx),%edx
test   %dl,%dl
je     1125 <pgn_read_until_end_comment+0x25>
cmp    $0x7d,%dl
je     1125 <pgn_read_until_end_comment+0x25>
add    $0x1,%eax
add    $0x1,%rcx
jmp    1110 <pgn_read_until_end_comment+0x10>
ret

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

LLVM IR (-O2):
define i32 @pgn_read_until_end_comment(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %8, %2
%5 = phi i64 [ %9, %8 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %8 [
i8 125, label %10
i8 0, label %10
]
8: ; preds = %4
%9 = add i64 %5, 1
br label %4
10: ; preds = %4, %4
%11 = trunc i64 %5 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("linux world\n");
  printf("checking success\n");
  printf("test succeed\n");
  printf("ssh\n");
  printf("sdn world\n");
  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>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%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 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"linux world\0A\00"
@.str.1 = [18 x i8] c"checking success\0A\00"
@.str.2 = [14 x i8] c"test succeed\0A\00"
@.str.3 = [5 x i8] c"ssh\0A\00"
@.str.4 = [11 x i8] c"sdn world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"linux world\00"
@str.5 = [17 x i8] c"checking success\00"
@str.6 = [13 x i8] c"test succeed\00"
@str.7 = [4 x i8] c"ssh\00"
@str.8 = [10 x i8] c"sdn world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("helloworldyyyyyxxxx\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"helloworldyyyyyxxxx\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void init_timer_interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @init_timer_interrupt() {
ret void
}
/* Variables and functions */
char *strfchr(char *);
char *_jsonNext(char *pcSrc, int iValue) {
  char *s = strfchr(pcSrc);
  return (*s ? ((*s == iValue) ? strfchr(s + 1) : NULL) : s);
}


x86 assembly (clang, -O0):
<_jsonNext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strfchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117a <_jsonNext+0x6a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1162 <_jsonNext+0x52>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1030 <strfchr@plt>
mov    %rax,-0x20(%rbp)
jmp    116d <_jsonNext+0x5d>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    116d <_jsonNext+0x5d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1182 <_jsonNext+0x72>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jsonNext>:
push   %rbx
mov    %esi,%ebx
call   1030 <strfchr@plt>
movsbl (%rax),%ecx
test   %ecx,%ecx
je     1132 <_jsonNext+0x22>
cmp    %ebx,%ecx
jne    1130 <_jsonNext+0x20>
add    $0x1,%rax
mov    %rax,%rdi
pop    %rbx
jmp    1030 <strfchr@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_jsonNext(i8* %0, i32 %1) {
%3 = tail call i8* @strfchr(i8* %0)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = sext i8 %4 to i32
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %3, i64 1
%11 = tail call i8* @strfchr(i8* %10)
br label %12
12: ; preds = %2, %9, %6
%13 = phi i8* [ %11, %9 ], [ null, %6 ], [ %3, %2 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ rtl_init_one();
int main(void) {
  rtl_init_one();
  return 17;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @rtl_init_one()
ret i32 17
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @rtl_init_one()
ret i32 17
}
/* Variables and functions */
int log2(int num, int temp, int count) {
  if (num < temp) {
    return count - 1;
  }
  if (num == temp) {
    return count;
  }
  count++;
  temp += temp;
  return log2(num, temp, count);
}


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <log2+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <log2+0x65>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1152 <log2+0x42>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <log2+0x65>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <log2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
mov    %edx,%eax
cmp    %esi,%edi
jl     111d <log2+0x1d>
cs nopw 0x0(%rax,%rax,1)
cmp    %edi,%esi
je     1120 <log2+0x20>
add    $0x1,%eax
add    %esi,%esi
cmp    %edi,%esi
jle    1110 <log2+0x10>
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @log2(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
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32, i32* %7
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %4
br label %30
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32, i32* %7
store i32 %19, i32* %4
br label %30
20: ; preds = %14
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %6
%25 = add nsw i32 %24, %23
store i32 %25, i32* %6
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = call i32 @log2(i32 %26, i32 %27, i32 %28)
store i32 %29, i32* %4
br label %30
30: ; preds = %20, %18, %11
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
define i32 @log2(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
br i1 %4, label %5, label %8
5: ; preds = %12, %3
%6 = phi i32 [ %2, %3 ], [ %13, %12 ]
%7 = add nsw i32 %6, -1
br label %16
8: ; preds = %3, %12
%9 = phi i32 [ %13, %12 ], [ %2, %3 ]
%10 = phi i32 [ %14, %12 ], [ %1, %3 ]
%11 = icmp eq i32 %10, %0
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = add nsw i32 %9, 1
%14 = shl nsw i32 %10, 1
%15 = icmp sgt i32 %14, %0
br i1 %15, label %5, label %8
16: ; preds = %8, %5
%17 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %17
}