xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fn_call(int);
void t() {
  int i;
  int x;
  for (i = 0; i < 100000000; i++) {
    fn_call(i < 100000000);
  }
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5f5e100,-0x4(%rbp)
jge    114e <t+0x3e>
cmpl   $0x5f5e100,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <fn_call@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <t+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
push   %rbx
mov    $0x5f5e100,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <fn_call@plt>
add    $0xffffffff,%ebx
jne    1120 <t+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @t() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @fn_call(i32 1)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100000000
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_attr_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_attr_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_attr_setstacksize(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  void *(*)(void *), void *);
void thread(void func(void *), void *args) {
  pthread_t thread_temp;
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  pthread_attr_setstacksize(&attr, 1 << 20);
  pthread_create(&thread_temp, &attr, (void *(*)(void *))func, args);
  pthread_attr_destroy(&attr);
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <pthread_attr_init@plt>
lea    -0x18(%rbp),%rdi
mov    $0x100000,%esi
call   1060 <pthread_attr_setstacksize@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <pthread_create@plt>
lea    -0x18(%rbp),%rdi
call   1050 <pthread_attr_destroy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <pthread_attr_init@plt>
mov    %rbx,%rdi
mov    $0x100000,%esi
call   1060 <pthread_attr_setstacksize@plt>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <pthread_create@plt>
mov    %rbx,%rdi
call   1050 <pthread_attr_destroy@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @thread(void (i8*)* %0, i8* %1) {
%3 = alloca void (i8*)*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store void (i8*)* %0, void (i8*)** %3
store i8* %1, i8** %4
%7 = call i32 @pthread_attr_init(i32* %6)
%8 = call i32 @pthread_attr_setstacksize(i32* %6, i32 1048576)
%9 = load void (i8*)*, void (i8*)** %3
%10 = bitcast void (i8*)* %9 to i8* (i8*)*
%11 = load i8*, i8** %4
%12 = call i32 @pthread_create(i32* %5, i32* %6, i8* (i8*)* %10, i8* %11)
%13 = call i32 @pthread_attr_destroy(i32* %6)
ret void
}

LLVM IR (-O2):
define void @thread(void (i8*)* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @pthread_attr_init(i32* %4)
%8 = call i32 @pthread_attr_setstacksize(i32* %4, i32 1048576)
%9 = bitcast void (i8*)* %0 to i8* (i8*)*
%10 = call i32 @pthread_create(i32* %3, i32* %4, i8* (i8*)* %9, i8* %1)
%11 = call i32 @pthread_attr_destroy(i32* %4)
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
scalar_t__ strlen(char *);
scalar_t__ strncmp(char *, int /*<<< orphan*/, scalar_t__);
int is_framebuffer_device(const struct dirent *dir) {
  return strncmp("fb", dir->d_name, strlen("fb") - 1) == 0;
}


x86 assembly (clang, -O0):
<is_framebuffer_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xec4(%rip),%rdi
call   1040 <strlen@plt>
mov    -0xc(%rbp),%esi
mov    %rax,%rdx
sub    $0x1,%rdx
lea    0xeae(%rip),%rdi
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_framebuffer_device>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [3 x i8] c"fb\00"
define i32 @is_framebuffer_device(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i64 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = sub nsw i64 %6, 1
%8 = call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [3 x i8] c"fb\00"
define i32 @is_framebuffer_device(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3, i64 1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ singSongFor(int);
int main(int argc, const char *argv[]) {
  singSongFor(4);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @singSongFor(i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_failure();
void t_Exit(void) {
  extern void _Exit(int);
#pragma weak _Exit
  _Exit(1);
  link_failure();
}


x86 assembly (clang, -O0):
<t_Exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <_Exit@plt>

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

LLVM IR (-O0):
define void @t_Exit() {
unreachable
}

LLVM IR (-O2):
define void @t_Exit() {
tail call void @_Exit(i32 1)
unreachable
}
void init_graph_v1(int nn_id) {}


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

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

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

LLVM IR (-O2):
define void @init_graph_v1(i32 %0) {
ret void
}
int is_valid_string(char *p_str) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @is_valid_string(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, unsigned long long *, unsigned long long *);
int /*<<< orphan*/ sum(unsigned long long, unsigned long long);
int main() {
  unsigned long long int a, b;
  scanf("%llu%llu", &a, &b);
  printf("%llu", sum(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1040 <sum@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%llu%llu\00"
@.str.1 = [5 x i8] c"%llu\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = call i32 @sum(i64 %6, i64 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GBS_SendMessage(int, int, int /*<<< orphan*/, unsigned int,
                                   unsigned short);
scalar_t__ RamMPlayer_CtrlCode();
void Send_MPlayer_Command(unsigned short cmd, short substract) {
  GBS_SendMessage(0x4209, 0x8053, 0,
                  *((unsigned int *)RamMPlayer_CtrlCode()) - substract, cmd);
}


x86 assembly (clang, -O0):
<Send_MPlayer_Command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <RamMPlayer_CtrlCode@plt>
mov    (%rax),%ecx
movswl -0x4(%rbp),%eax
sub    %eax,%ecx
mov    $0x4209,%edi
mov    $0x8053,%esi
xor    %edx,%edx
movzwl -0x2(%rbp),%r8d
call   1040 <GBS_SendMessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Send_MPlayer_Command>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <RamMPlayer_CtrlCode@plt>
mov    (%rax),%ecx
sub    %ebx,%ecx
mov    $0x4209,%edi
mov    $0x8053,%esi
xor    %edx,%edx
mov    %ebp,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <GBS_SendMessage@plt>

LLVM IR (-O0):
define void @Send_MPlayer_Command(i16 zeroext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call i64 (...) @RamMPlayer_CtrlCode()
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* %6
%8 = load i16, i16* %4
%9 = sext i16 %8 to i32
%10 = sub i32 %7, %9
%11 = load i16, i16* %3
%12 = call i32 @GBS_SendMessage(i32 16905, i32 32851, i32 0, i32 %10, i16 zeroext %11)
ret void
}

LLVM IR (-O2):
define void @Send_MPlayer_Command(i16 zeroext %0, i16 signext %1) {
%3 = tail call i64 (...) @RamMPlayer_CtrlCode()
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* %4
%6 = sext i16 %1 to i32
%7 = sub i32 %5, %6
%8 = tail call i32 @GBS_SendMessage(i32 16905, i32 32851, i32 0, i32 %7, i16 zeroext %0)
ret void
}
int solve(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<solve>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @solve(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @solve(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int ft_isalpha(int c) {
  return (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'));
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x61,%eax
cmp    -0x4(%rbp),%eax
jg     1124 <ft_isalpha+0x24>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1147 <ft_isalpha+0x47>
xor    %eax,%eax
mov    $0x41,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jg     1141 <ft_isalpha+0x41>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 97, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sle i32 65, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ set_clear(int);
void f_clear(void) { set_clear(0x60000000); }


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

x86 assembly (clang, -O2):
<f_clear>:
mov    $0x60000000,%edi
jmp    1030 <set_clear@plt>

LLVM IR (-O0):
define void @f_clear() {
%1 = call i32 @set_clear(i32 1610612736)
ret void
}

LLVM IR (-O2):
define void @f_clear() {
%1 = tail call i32 @set_clear(i32 1610612736)
ret void
}
/* Variables and functions */
scalar_t__ seqlen(char *);
int setlen(char *set[], int n) {
  int total = 0;
  for (int i = 0; i < n; i++) {
    total += seqlen(set[i]);
  }
  return total;
}


x86 assembly (clang, -O0):
<setlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1165 <setlen+0x55>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <seqlen@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <setlen+0x1d>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlen>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <setlen+0x36>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <seqlen@plt>
add    %eax,%ebp
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <setlen+0x20>
jmp    1148 <setlen+0x38>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @setlen(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = phi i32 [ 0, %2 ], [ %15, %8 ]
ret i32 %7
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %16, %8 ]
%10 = phi i32 [ 0, %4 ], [ %15, %8 ]
%11 = getelementptr inbounds i8*, i8** %0, i64 %9
%12 = load i8*, i8** %11
%13 = tail call i64 @seqlen(i8* %12)
%14 = trunc i64 %13 to i32
%15 = add i32 %10, %14
%16 = add nuw nsw i64 %9, 1
%17 = icmp eq i64 %16, %5
br i1 %17, label %6, label %8
}
/* Variables and functions */
long long _mm_popcnt_u64(unsigned long long);
__attribute__((target("popcnt"))) long long foo(unsigned long long X) {
  return _mm_popcnt_u64(X);
}


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <_mm_popcnt_u64@plt>

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

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = tail call i64 @_mm_popcnt_u64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ prctl(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void exStbDemo_threadRename(char *name) {
  char newName[16];
  (void)snprintf(newName, 15, "#%s", name);
  (void)prctl(15, newName, 0, 0, 0);
}


x86 assembly (clang, -O0):
<exStbDemo_threadRename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0xf,%esi
lea    0xec0(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x20(%rbp),%rsi
mov    $0xf,%edi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1040 <prctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exStbDemo_threadRename>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rcx
lea    0xed1(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <snprintf@plt>
mov    $0xf,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <prctl@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"#%s\00"
define void @exStbDemo_threadRename(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = call i32 @prctl(i32 15, i8* %7, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"#%s\00"
define void @exStbDemo_threadRename(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @prctl(i32 15, i8* %3, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ send_errno(int /*<<< orphan*/);
int /*<<< orphan*/ send_success();
scalar_t__ unlink(char *);
void do_rm(int argc, char **argv) {
  assert(argc == 1);
  if (unlink(argv[0]) == 0) {
    send_success();
  } else {
    send_errno(errno);
  }
}


x86 assembly (clang, -O0):
<do_rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
jne    1182 <do_rm+0x42>
mov    $0x0,%al
call   1050 <send_success@plt>
jmp    1190 <do_rm+0x50>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1060 <send_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rm>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
mov    (%rbx),%rdi
call   1030 <unlink@plt>
test   %rax,%rax
je     116f <do_rm+0x2f>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1060 <send_errno@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <send_success@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @do_rm(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i64 @unlink(i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 (...) @send_success()
br label %19
16: ; preds = %2
%17 = load i32, i32* @errno
%18 = call i32 @send_errno(i32 %17)
br label %19
19: ; preds = %16, %14
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @do_rm(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i8*, i8** %1
%7 = tail call i64 @unlink(i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (...) @send_success()
br label %14
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = tail call i32 @send_errno(i32 %12)
br label %14
14: ; preds = %11, %9
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, long);
main() {
  long nc;
  nc = 0;
  while (getchar() != EOF)
    ++nc;
  printf("%ld\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     115f <main+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1140 <main+0x20>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
br label %3
3: ; preds = %7, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i64, i64* %2
%9 = add nsw i64 %8, 1
store i64 %9, i64* %2
br label %3
10: ; preds = %3
%11 = load i64, i64* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = add nuw nsw i64 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello Github!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello Github!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("-1<=3<=-5\t\%d\n", -1 <= 3 <= -5);
  printf("-1<=3<=2\t\%d\n", -1 <= 3 <= 2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"-1<=3<=-5\09%d\0A\00"
@.str.1 = [13 x i8] c"-1<=3<=2\09%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
double opr_mp(struct lifo *stack) { return 1.6726231E-17; }


x86 assembly (clang, -O0):
<opr_mp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xef0(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<opr_mp>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
%struct.lifo = type opaque
define double @opr_mp(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
store %struct.lifo* %0, %struct.lifo** %2
ret double 0x3C7348B64854F205
}

LLVM IR (-O2):
%struct.lifo = type opaque
define double @opr_mp(%struct.lifo* nocapture readnone %0) {
ret double 0x3C7348B64854F205
}
/* Variables and functions */
int /*<<< orphan*/ _uarttx(char *, unsigned long);
unsigned long str32_strlen(char *);
unsigned char text_sender(char *target_str) {
  unsigned long int length = str32_strlen(target_str);
  _uarttx(target_str, length);
  return ((unsigned char)1);
}


x86 assembly (clang, -O0):
<text_sender>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <str32_strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_uarttx@plt>
mov    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_sender>:
push   %rbx
mov    %rdi,%rbx
call   1040 <str32_strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <_uarttx@plt>
mov    $0x1,%al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @text_sender(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @str32_strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call i32 @_uarttx(i8* %6, i64 %7)
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @text_sender(i8* %0) {
%2 = tail call i64 @str32_strlen(i8* %0)
%3 = tail call i32 @_uarttx(i8* %0, i64 %2)
ret i8 1
}
char hexchar(int x) {
  static const char table[16] = "0123456789abcdef";
  return table[x & 15];
}


x86 assembly (clang, -O0):
<hexchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xee9(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexchar>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@hexchar.table = internal constant [16 x i8] c"0123456789abcdef"
define signext i8 @hexchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [16 x i8], [16 x i8]* @hexchar.table, i64 0, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}

LLVM IR (-O2):
@hexchar.table = internal unnamed_addr constant [16 x i8] c"0123456789abcdef"
define signext i8 @hexchar(i32 %0) {
%2 = and i32 %0, 15
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [16 x i8], [16 x i8]* @hexchar.table, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int __builtin_clz(unsigned int);
uint32_t chpl_bitops_clz_32(unsigned int x) {
  return x ? __builtin_clz(x) : 32;
}


x86 assembly (clang, -O0):
<chpl_bitops_clz_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1122 <chpl_bitops_clz_32+0x22>
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <chpl_bitops_clz_32+0x2f>
mov    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <chpl_bitops_clz_32+0x2f>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chpl_bitops_clz_32>:
test   %edi,%edi
je     110b <chpl_bitops_clz_32+0xb>
bsr    %edi,%eax
xor    $0x1f,%eax
ret
mov    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @chpl_bitops_clz_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @llvm.ctlz.i32(i32 %6, i1 true)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 32, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @chpl_bitops_clz_32(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 false)
ret i32 %2
}
int dlpi_set_physaddr(int fd, const char *hwaddr, int length) { return -1; }


x86 assembly (clang, -O0):
<dlpi_set_physaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dlpi_set_physaddr(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @dlpi_set_physaddr(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
char *ft_strchr(char *, char);
int ft_findinarray(char *array, char c) {
  char *s;
  if ((s = ft_strchr(array, c)))
    return (s - array);
  return (-1);
}


x86 assembly (clang, -O0):
<ft_findinarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <ft_strchr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1150 <ft_findinarray+0x40>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1157 <ft_findinarray+0x47>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_findinarray>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ft_strchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_findinarray(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
%7 = load i8*, i8** %4
%8 = load i8, i8* %5
%9 = call i8* @ft_strchr(i8* %7, i8 signext %8)
store i8* %9, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %6
%13 = load i8*, i8** %4
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
%17 = trunc i64 %16 to i32
store i32 %17, i32* %3
br label %19
18: ; preds = %2
store i32 -1, i32* %3
br label %19
19: ; preds = %18, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @ft_findinarray(i8* %0, i8 signext %1) {
%3 = tail call i8* @ft_strchr(i8* %0, i8 signext %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ strreverse(char *, char *);
void modp_ulitoa10(uint64_t value, char *str) {
  char *wstr = str;
  do
    *wstr++ = (char)(48 + (value % 10));
  while (value /= 10);
  *wstr = '\0';
  strreverse(str, wstr - 1);
}


x86 assembly (clang, -O0):
<modp_ulitoa10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    1127 <modp_ulitoa10+0x17>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0xffffffffffffffff,%rsi
call   1030 <strreverse@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modp_ulitoa10>:
mov    %rsi,%r8
add    $0xffffffffffffffff,%rsi
nopw   0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%eax
sub    %edx,%eax
add    $0x30,%al
mov    %al,0x1(%rsi)
add    $0x1,%rsi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1120 <modp_ulitoa10+0x10>
movb   $0x0,0x1(%rsi)
mov    %r8,%rdi
jmp    1030 <strreverse@plt>

LLVM IR (-O0):
define void @modp_ulitoa10(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
br label %7
7: ; preds = %14, %2
%8 = load i32, i32* %3
%9 = srem i32 %8, 10
%10 = add nsw i32 48, %9
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
store i8 %11, i8* %12
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = sdiv i32 %15, 10
store i32 %16, i32* %3
%17 = icmp ne i32 %16, 0
br i1 %17, label %7, label %18
18: ; preds = %14
%19 = load i8*, i8** %5
store i8 0, i8* %19
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 -1
%23 = call i32 @strreverse(i8* %20, i8* %22)
ret void
}

LLVM IR (-O2):
define void @modp_ulitoa10(i32 %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %10, %3 ]
%5 = phi i8* [ %1, %2 ], [ %9, %3 ]
%6 = srem i32 %4, 10
%7 = trunc i32 %6 to i8
%8 = add nsw i8 %7, 48
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %5
%10 = sdiv i32 %4, 10
%11 = add i32 %4, 9
%12 = icmp ult i32 %11, 19
br i1 %12, label %13, label %3
13: ; preds = %3
store i8 0, i8* %9
%14 = tail call i32 @strreverse(i8* %1, i8* %5)
ret void
}
/* Type definitions */
struct multiply_customizable_built_in_procedure_write_back {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
free(struct multiply_customizable_built_in_procedure_write_back *);
int multiply_customizable_built_in_procedure_write_back_destroy(
    struct multiply_customizable_built_in_procedure_write_back *write_back) {
  free(write_back);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.multiply_customizable_built_in_procedure_write_back = type { i32 }
define i32 @multiply_customizable_built_in_procedure_write_back_destroy(%struct.multiply_customizable_built_in_procedure_write_back* %0) {
%2 = alloca %struct.multiply_customizable_built_in_procedure_write_back*
store %struct.multiply_customizable_built_in_procedure_write_back* %0, %struct.multiply_customizable_built_in_procedure_write_back** %2
%3 = load %struct.multiply_customizable_built_in_procedure_write_back*, %struct.multiply_customizable_built_in_procedure_write_back** %2
%4 = call i32 @free(%struct.multiply_customizable_built_in_procedure_write_back* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.multiply_customizable_built_in_procedure_write_back = type { i32 }
define i32 @multiply_customizable_built_in_procedure_write_back_destroy(%struct.multiply_customizable_built_in_procedure_write_back* nocapture %0) {
%2 = tail call i32 @free(%struct.multiply_customizable_built_in_procedure_write_back* %0)
ret i32 0
}
void test_no_clause() {
  int i;
#pragma omp target parallel for
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target parallel 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
}
/* Variables and functions */
scalar_t__ lw_sock_send_str(int *, char *);
scalar_t__ recv_ok(int *);
int lw_protocol_force_start(int *sock) {
  int result = 0;
  if (*sock >= 0 && lw_sock_send_str(sock, "START")) {
    if (recv_ok(sock)) {
      result = 1;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<lw_protocol_force_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1179 <lw_protocol_force_start+0x59>
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <lw_sock_send_str@plt>
cmp    $0x0,%rax
je     1179 <lw_protocol_force_start+0x59>
mov    -0x8(%rbp),%rdi
call   1030 <recv_ok@plt>
cmp    $0x0,%rax
je     1174 <lw_protocol_force_start+0x54>
movl   $0x1,-0xc(%rbp)
jmp    1179 <lw_protocol_force_start+0x59>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw_protocol_force_start>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
cmpl   $0x0,(%rdi)
js     114f <lw_protocol_force_start+0x2f>
mov    %rdi,%rbx
lea    0xecc(%rip),%rsi
call   1040 <lw_sock_send_str@plt>
test   %rax,%rax
je     114f <lw_protocol_force_start+0x2f>
mov    %rbx,%rdi
call   1030 <recv_ok@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"START\00"
define i32 @lw_protocol_force_start(i32* %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @lw_sock_send_str(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i64 @recv_ok(i32* %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
int date_days_in_year(int year) {
  if (year % 100 == 0)
    return 365;
  else if (year % 4 == 0)
    return 366;
  else
    return 365;
}


x86 assembly (clang, -O0):
<date_days_in_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <date_days_in_year+0x27>
movl   $0x16d,-0x4(%rbp)
jmp    114e <date_days_in_year+0x4e>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <date_days_in_year+0x47>
movl   $0x16e,-0x4(%rbp)
jmp    114e <date_days_in_year+0x4e>
movl   $0x16d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_days_in_year>:
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
and    $0x3,%edi
cmp    $0x1,%edi
mov    $0x16d,%eax
adc    $0x0,%eax
mov    $0x16d,%edx
cmp    $0x28f5c29,%ecx
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @date_days_in_year(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 365, i32* %2
br label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = srem i32 %9, 4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 366, i32* %2
br label %14
13: ; preds = %8
store i32 365, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @date_days_in_year(i32 %0) {
%2 = srem i32 %0, 100
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 3
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 366, i32 365
%7 = select i1 %3, i32 365, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *lestring(int, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *nome;
  nome = lestring(3, 10);
  printf("%s", nome);
  free(nome);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0xa,%esi
call   1050 <lestring@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
mov    $0xa,%esi
call   1050 <lestring@plt>
mov    %rax,%rbx
lea    0xeb6(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i8* @lestring(i32 3, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strncat(char *destination, const char *source, size_t num) {
  strncpy(destination + strlen(destination), source, num);
  return destination;
}


x86 assembly (clang, -O0):
<strncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @strncpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @strncat(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @strncpy(i8* %6, i8* %1, i64 %2)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int s, n;
  scanf("%d,%d", &s, &n);
  float v = s / n;
  printf("v=%f\n", v);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cltd
idivl  (%rsp)
cvtsi2ss %eax,%xmm0
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d,%d\00"
@.str.1 = [6 x i8] c"v=%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sdiv i32 %6, %7
%9 = sitofp i32 %8 to float
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %9)
ret i32 0
}