xunge/DecIR huggingface dataset:
int word_length(int repere, char *str) {
  int i;
  i = repere;
  while ((*(str + i) != '\0') && (*(str + i) > 32))
    i++;
  return (i - repere);
}


x86 assembly (clang, -O0):
<word_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1140 <word_length+0x40>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1150 <word_length+0x50>
jmp    115e <word_length+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1111 <word_length+0x11>
mov    -0x14(%rbp),%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<word_length>:
movslq %edi,%rcx
add    %rsi,%rcx
mov    $0xffffffff,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x20,(%rcx)
lea    0x1(%rcx),%rcx
jg     1110 <word_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @word_length(i32 %0, i8* nocapture %1) {
%3 = sext i32 %0 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %9, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = icmp sgt i8 %7, 32
%9 = add i64 %5, 1
br i1 %8, label %4, label %10
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = sub nsw i32 %11, %0
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ geo2pxf(double, double, double *, double *);
int round(double);
void geo2pxi(double lon, double lat, int *x, int *y) {
  double xf, yf;
  geo2pxf(lat, lon, &xf, &yf);
  *x = round(xf);
  *y = round(yf);
}


x86 assembly (clang, -O0):
<geo2pxi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <geo2pxf@plt>
movsd  -0x28(%rbp),%xmm0
call   1040 <round@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x30(%rbp),%xmm0
call   1040 <round@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geo2pxi>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movaps %xmm0,%xmm2
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <geo2pxf@plt>
movsd  0x10(%rsp),%xmm0
call   1040 <round@plt>
mov    %eax,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1040 <round@plt>
mov    %eax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @geo2pxi(double %0, double %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%11 = load double, double* %6
%12 = load double, double* %5
%13 = call i32 @geo2pxf(double %11, double %12, double* %9, double* %10)
%14 = load double, double* %9
%15 = call i32 @round(double %14)
%16 = load i32*, i32** %7
store i32 %15, i32* %16
%17 = load double, double* %10
%18 = call i32 @round(double %17)
%19 = load i32*, i32** %8
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @geo2pxi(double %0, double %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %5 to i8*
%8 = bitcast double* %6 to i8*
%9 = call i32 @geo2pxf(double %1, double %0, double* %5, double* %6)
%10 = load double, double* %5
%11 = call i32 @round(double %10)
store i32 %11, i32* %2
%12 = load double, double* %6
%13 = call i32 @round(double %12)
store i32 %13, i32* %3
ret void
}
int utf8DecodeErrorClass(int err) { return err >> 12; }


x86 assembly (clang, -O0):
<utf8DecodeErrorClass>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8DecodeErrorClass>:
mov    %edi,%eax
sar    $0xc,%eax
ret

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

LLVM IR (-O2):
define i32 @utf8DecodeErrorClass(i32 %0) {
%2 = ashr i32 %0, 12
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ reverse(char *, int /*<<< orphan*/, scalar_t__);
scalar_t__ strlen(char *);
void do_reverse(char str[]) { reverse(str, 0, strlen(str) - 1); }


x86 assembly (clang, -O0):
<do_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1030 <reverse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_reverse>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    -0x1(%rax),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <reverse@plt>

LLVM IR (-O0):
define void @do_reverse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = sub nsw i64 %5, 1
%7 = call i32 @reverse(i8* %3, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @do_reverse(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, -1
%4 = tail call i32 @reverse(i8* %0, i32 0, i64 %3)
ret void
}
void printd(data, cnt) unsigned char *data;
int cnt;
{
  if (cnt > 16)
    cnt = 16;
  while (cnt-- > 0) {
    printf(" %02x", *data);
    ++data;
  }
}


x86 assembly (clang, -O0):
<printd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jle    1130 <printd+0x20>
movl   $0x10,-0xc(%rbp)
jmp    1135 <printd+0x25>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    116f <printd+0x5f>
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1135 <printd+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printd>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1149 <printd+0x39>
mov    %rdi,%rbx
cmp    $0x10,%esi
mov    $0x10,%ebp
cmovb  %esi,%ebp
add    $0x1,%ebp
lea    0xed0(%rip),%r14
movzbl (%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <printd+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c" %02x\00"
define void @printd(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = icmp ult i32 %1, 16
%6 = select i1 %5, i32 %1, i32 16
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ %6, %4 ]
%9 = phi i8* [ %14, %7 ], [ %0, %4 ]
%10 = add nsw i32 %8, -1
%11 = load i8, i8* %9
%12 = zext i8 %11 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = icmp ugt i32 %8, 1
br i1 %15, label %7, label %16
16: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(int *, int *, int /*<<< orphan*/);
void strncpy_good2() {
  int arr1[10];
  int arr2[20];
  strncpy(arr2, arr1, 0);
}


x86 assembly (clang, -O0):
<strncpy_good2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
lea    -0x30(%rbp),%rsi
xor    %edx,%edx
call   1030 <strncpy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_good2>:
sub    $0x88,%rsp
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <strncpy@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @strncpy_good2() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @strncpy(i32* %3, i32* %4, i32 0)
ret void
}

LLVM IR (-O2):
define void @strncpy_good2() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @strncpy(i32* %5, i32* %6, i32 0)
ret void
}
int pathcon_nm2_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @pathcon_nm2_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @pathcon_nm2_n_out() {
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ SIG_SETMASK;
int fork();
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int main() {
  pid_t pid;
  sigset_t mask;
  sigfillset(&mask);
  sigprocmask(SIG_SETMASK, &mask, NULL);
  while (1) {
    kill(-1, SIGFPE);
    while ((pid = fork()) != -1)
      ;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <sigfillset@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%esi
mov    $0xffffffff,%edi
call   1050 <kill@plt>
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
je     1199 <main+0x59>
jmp    1181 <main+0x41>
jmp    116e <main+0x2e>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigfillset@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
mov    0x2e7c(%rip),%rbx
nopl   0x0(%rax)
mov    (%rbx),%esi
mov    $0xffffffff,%edi
call   1050 <kill@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <fork@plt>
cmp    $0xffffffff,%eax
jne    1180 <main+0x40>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
@SIGFPE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @sigfillset(i32* %3)
%5 = load i32, i32* @SIG_SETMASK
%6 = call i32 @sigprocmask(i32 %5, i32* %3, i32* null)
br label %7
7: ; preds = %0, %14
%8 = load i32, i32* @SIGFPE
%9 = call i32 @kill(i32 -1, i32 %8)
br label %10
10: ; preds = %13, %7
%11 = call i32 (...) @fork()
store i32 %11, i32* %2
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %10
br label %10
14: ; preds = %10
br label %7
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
@SIGFPE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIG_SETMASK
%5 = call i32 @sigprocmask(i32 %4, i32* %1, i32* null)
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* @SIGFPE
%8 = call i32 @kill(i32 -1, i32 %7)
br label %9
9: ; preds = %9, %6
%10 = call i32 (...) @fork()
%11 = icmp eq i32 %10, -1
br i1 %11, label %6, label %9
}
int f(int c) { return '3' > c; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x33,%eax
cmp    -0x4(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0x33,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 51, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp slt i32 %0, 51
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ acc_device_host;
int /*<<< orphan*/ acc_device_none;
scalar_t__ acc_get_num_devices(int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (acc_get_num_devices(acc_device_none) != 0)
    abort();
  if (acc_get_num_devices(acc_device_host) == 0)
    abort();
  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    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_get_num_devices@plt>
cmp    $0x0,%rax
je     1155 <main+0x35>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_get_num_devices@plt>
cmp    $0x0,%rax
jne    1174 <main+0x54>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_get_num_devices@plt>
test   %rax,%rax
jne    114b <main+0x2b>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <acc_get_num_devices@plt>
test   %rax,%rax
je     114b <main+0x2b>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@acc_device_none = global i32 0
@acc_device_host = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @acc_device_none
%7 = call i64 @acc_get_num_devices(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
%12 = load i32, i32* @acc_device_host
%13 = call i64 @acc_get_num_devices(i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@acc_device_none = global i32 0
@acc_device_host = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @acc_device_none
%4 = tail call i64 @acc_get_num_devices(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
%9 = load i32, i32* @acc_device_host
%10 = tail call i64 @acc_get_num_devices(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %8
ret i32 0
}
void I422ToARGBRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @I422ToARGBRow_NEON() {
ret void
}
/* Variables and functions */
scalar_t__ INT_MIN;
unsigned int test1u(unsigned int x) { return ~(x ^ (unsigned int)INT_MIN); }


x86 assembly (clang, -O0):
<test1u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
mov    (%rcx),%rcx
xor    %ecx,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1u>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
xor    (%rcx),%eax
not    %eax
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @test1u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i64, i64* @INT_MIN
%5 = trunc i64 %4 to i32
%6 = xor i32 %3, %5
%7 = xor i32 %6, -1
ret i32 %7
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @test1u(i32 %0) {
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = xor i32 %3, %0
%5 = xor i32 %4, -1
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int __ucs_ilog2_u64(int);
unsigned ucs_ffs64(uint64_t n) { return __ucs_ilog2_u64(n & -n); }


x86 assembly (clang, -O0):
<ucs_ffs64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
sub    -0x4(%rbp),%eax
and    %eax,%edi
call   1030 <__ucs_ilog2_u64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucs_ffs64>:
mov    %edi,%eax
neg    %eax
and    %eax,%edi
jmp    1030 <__ucs_ilog2_u64@plt>

LLVM IR (-O0):
define i32 @ucs_ffs64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = and i32 %3, %5
%7 = call i32 @__ucs_ilog2_u64(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ucs_ffs64(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
%4 = tail call i32 @__ucs_ilog2_u64(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int fcntl(int, int /*<<< orphan*/, int);
int fd_set_flags(int fd, int flags) { return fcntl(fd, F_SETFL, flags); }


x86 assembly (clang, -O0):
<fd_set_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_set_flags>:
mov    %esi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
define i32 @fd_set_flags(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* @F_SETFL
%7 = load i32, i32* %4
%8 = call i32 @fcntl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@F_SETFL = global i32 0
define i32 @fd_set_flags(i32 %0, i32 %1) {
%3 = load i32, i32* @F_SETFL
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
float wave_triangle(float i) {
  if (i < 0.25f)
    return i * 4.0f;
  else if (i < 0.75f)
    return 2.0f - (i - 0.25f) * 4.0f;
  return (i - 0.75f) * 4.0f - 1.0f;
}


x86 assembly (clang, -O0):
<wave_triangle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <wave_triangle+0x32>
movss  0xee5(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11b7 <wave_triangle+0xb7>
movss  0xeca(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1184 <wave_triangle+0x84>
movss  -0x8(%rbp),%xmm0
movss  0xeaf(%rip),%xmm1
subss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xe9e(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe9a(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11b7 <wave_triangle+0xb7>
jmp    1189 <wave_triangle+0x89>
movss  -0x8(%rbp),%xmm0
movss  0xe6e(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe66(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe5e(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_triangle>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1116 <wave_triangle+0x16>
mulss  0xef7(%rip),%xmm0
ret
movss  0xee6(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    113c <wave_triangle+0x3c>
addss  0xee9(%rip),%xmm0
mulss  0xee5(%rip),%xmm0
addss  0xee1(%rip),%xmm0
ret
addss  0xec4(%rip),%xmm0
mulss  0xec0(%rip),%xmm0
addss  0xebc(%rip),%xmm0
ret

LLVM IR (-O0):
define float @wave_triangle(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 2.500000e-01
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fmul float %7, 4.000000e+00
store float %8, float* %2
br label %22
9: ; preds = %1
%10 = load float, float* %3
%11 = fcmp olt float %10, 7.500000e-01
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load float, float* %3
%14 = fsub float %13, 2.500000e-01
%15 = fneg float %14
%16 = call float @llvm.fmuladd.f32(float %15, float 4.000000e+00, float 2.000000e+00)
store float %16, float* %2
br label %22
17: ; preds = %9
br label %18
18: ; preds = %17
%19 = load float, float* %3
%20 = fsub float %19, 7.500000e-01
%21 = call float @llvm.fmuladd.f32(float %20, float 4.000000e+00, float -1.000000e+00)
store float %21, float* %2
br label %22
22: ; preds = %18, %12, %6
%23 = load float, float* %2
ret float %23
}

LLVM IR (-O2):
define float @wave_triangle(float %0) {
%2 = fcmp olt float %0, 2.500000e-01
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fmul float %0, 4.000000e+00
br label %14
5: ; preds = %1
%6 = fcmp olt float %0, 7.500000e-01
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = fadd float %0, -2.500000e-01
%9 = fneg float %8
%10 = tail call float @llvm.fmuladd.f32(float %9, float 4.000000e+00, float 2.000000e+00)
br label %14
11: ; preds = %5
%12 = fadd float %0, -7.500000e-01
%13 = tail call float @llvm.fmuladd.f32(float %12, float 4.000000e+00, float -1.000000e+00)
br label %14
14: ; preds = %11, %7, %3
%15 = phi float [ %4, %3 ], [ %10, %7 ], [ %13, %11 ]
ret float %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int main() {
  FILE *fp;
  fp = fopen("/tmp/test.txt", "w+");
  fprintf(fp, "This is testing for fprintf...\n");
  fputs("This is testing for fputs...\n", fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xecf(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xec3(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
lea    0xeca(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/tmp/test.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [32 x i8] c"This is testing for fprintf...\0A\00"
@.str.3 = [30 x i8] c"This is testing for fputs...\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32*, i32** %1
%6 = call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%7 = load i32*, i32** %1
%8 = call i32 @fclose(i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"/tmp/test.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [32 x i8] c"This is testing for fprintf...\0A\00"
@.str.3 = [30 x i8] c"This is testing for fputs...\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i64 31, i64 1, i32* %1)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i64 29, i64 1, i32* %1)
%4 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int sum = 0;
#pragma omp parallel private(sum)
  {
#pragma omp critical
    { sum += omp_get_thread_num(); }
  }
  printf("sum = %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"sum = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @omp_get_thread_num()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
struct termios {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int TCSAFLUSH;
int TCSANOW;
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int tcsetattr(int /*<<< orphan*/, int, struct termios const *);
int restore_tty(FILE *in, struct termios const *prev_tattr) {
  return tcsetattr(fileno(in), TCSAFLUSH | 0 | TCSANOW, prev_tattr);
}


x86 assembly (clang, -O0):
<restore_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
or     $0x0,%esi
mov    0x2e92(%rip),%rax
or     (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_tty>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fileno@plt>
mov    0x2eb8(%rip),%rcx
mov    0x2ea9(%rip),%rdx
mov    (%rdx),%esi
or     (%rcx),%esi
mov    %eax,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <tcsetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCSAFLUSH = global i32 0
@TCSANOW = global i32 0
define i32 @restore_tty(i32* %0, %struct.termios* %1) {
%3 = alloca i32*
%4 = alloca %struct.termios*
store i32* %0, i32** %3
store %struct.termios* %1, %struct.termios** %4
%5 = load i32*, i32** %3
%6 = call i32 @fileno(i32* %5)
%7 = load i32, i32* @TCSAFLUSH
%8 = or i32 %7, 0
%9 = load i32, i32* @TCSANOW
%10 = or i32 %8, %9
%11 = load %struct.termios*, %struct.termios** %4
%12 = call i32 @tcsetattr(i32 %6, i32 %10, %struct.termios* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCSAFLUSH = global i32 0
@TCSANOW = global i32 0
define i32 @restore_tty(i32* nocapture %0, %struct.termios* %1) {
%3 = tail call i32 @fileno(i32* %0)
%4 = load i32, i32* @TCSAFLUSH
%5 = load i32, i32* @TCSANOW
%6 = or i32 %5, %4
%7 = tail call i32 @tcsetattr(i32 %3, i32 %6, %struct.termios* %1)
ret i32 %7
}
/* Variables and functions */
size_t factorial(size_t);
size_t pascal(size_t n, size_t k) {
  return factorial(n) / (factorial(k) * factorial(n - k));
}


x86 assembly (clang, -O0):
<pascal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <factorial@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <factorial@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
sub    -0x10(%rbp),%rdi
call   1030 <factorial@plt>
mov    -0x20(%rbp),%rcx
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
imul   %rdx,%rcx
xor    %edx,%edx
div    %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pascal>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <factorial@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1030 <factorial@plt>
mov    %rax,%r12
sub    %r15,%rbx
mov    %rbx,%rdi
call   1030 <factorial@plt>
mov    %rax,%rcx
imul   %r12,%rcx
mov    %r14,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1159 <pascal+0x49>
mov    %r14,%rax
xor    %edx,%edx
div    %rcx
jmp    1160 <pascal+0x50>
mov    %r14d,%eax
xor    %edx,%edx
div    %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @pascal(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i64 @factorial(i64 %5)
%7 = load i64, i64* %4
%8 = call i64 @factorial(i64 %7)
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = sub i64 %9, %10
%12 = call i64 @factorial(i64 %11)
%13 = mul i64 %8, %12
%14 = udiv i64 %6, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @pascal(i64 %0, i64 %1) {
%3 = tail call i64 @factorial(i64 %0)
%4 = tail call i64 @factorial(i64 %1)
%5 = sub i64 %0, %1
%6 = tail call i64 @factorial(i64 %5)
%7 = mul i64 %6, %4
%8 = udiv i64 %3, %7
ret i64 %8
}
/* Variables and functions */
int scsi_pt_close_device(int);
int sg_cmds_close_device(int device_fd) {
  return scsi_pt_close_device(device_fd);
}


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

x86 assembly (clang, -O2):
<sg_cmds_close_device>:
jmp    1030 <scsi_pt_close_device@plt>

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

LLVM IR (-O2):
define i32 @sg_cmds_close_device(i32 %0) {
%2 = tail call i32 @scsi_pt_close_device(i32 %0)
ret i32 %2
}
int test_imm_3Eint16_reg(short val) {
  return ((val) & (0x3E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x3e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Eint16_reg>:
test   $0x3e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Eint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 62
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_3Eint16_reg(i16 signext %0) {
%2 = and i16 %0, 62
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int real_utime(char *, void *);
scalar_t__ smbw_path(char *);
int smbw_utime(char *, void *);
int utime(char *name, void *tvp) {
  if (smbw_path(name)) {
    return smbw_utime(name, tvp);
  }
  return real_utime(name, tvp);
}


x86 assembly (clang, -O0):
<utime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <smbw_path@plt>
cmp    $0x0,%rax
je     1168 <utime+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <smbw_utime@plt>
mov    %eax,-0x4(%rbp)
jmp    1178 <utime+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <real_utime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <smbw_path@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     1156 <utime+0x26>
pop    %rbx
pop    %r14
jmp    1050 <smbw_utime@plt>
pop    %rbx
pop    %r14
jmp    1030 <real_utime@plt>

LLVM IR (-O0):
define i32 @utime(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @smbw_path(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i32 @smbw_utime(i8* %10, i8* %11)
store i32 %12, i32* %3
br label %17
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = call i32 @real_utime(i8* %14, i8* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @utime(i8* %0, i8* %1) {
%3 = tail call i64 @smbw_path(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @smbw_utime(i8* %0, i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @real_utime(i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
double **doberes_dreieck_zeiger_alloc(double *, long);
double *dvector_alloc(long);
double **doberes_dreieck_all_alloc_1(long n) {
  double **m;
  double *a;
  long ges_laenge;
  ges_laenge = n * (n + 1) / 2;
  a = dvector_alloc(ges_laenge);
  if (a == NULL)
    return NULL;
  m = doberes_dreieck_zeiger_alloc(a, n);
  return m;
}


x86 assembly (clang, -O0):
<doberes_dreieck_all_alloc_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <dvector_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116f <doberes_dreieck_all_alloc_1+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    1188 <doberes_dreieck_all_alloc_1+0x68>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <doberes_dreieck_zeiger_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doberes_dreieck_all_alloc_1>:
push   %rbx
mov    %rdi,%rbx
lea    0x1(%rdi),%rax
imul   %rdi,%rax
mov    %rax,%rdi
shr    $0x3f,%rdi
add    %rax,%rdi
sar    %rdi
call   1030 <dvector_alloc@plt>
test   %rax,%rax
je     114f <doberes_dreieck_all_alloc_1+0x2f>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <doberes_dreieck_zeiger_alloc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define double** @doberes_dreieck_all_alloc_1(i64 %0) {
%2 = alloca double**
%3 = alloca i64
%4 = alloca double**
%5 = alloca double*
%6 = alloca i64
store i64 %0, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 1
%10 = mul nsw i64 %7, %9
%11 = sdiv i64 %10, 2
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = call double* @dvector_alloc(i64 %12)
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp eq double* %14, null
br i1 %15, label %16, label %17
16: ; preds = %1
store double** null, double*** %2
br label %22
17: ; preds = %1
%18 = load double*, double** %5
%19 = load i64, i64* %3
%20 = call double** @doberes_dreieck_zeiger_alloc(double* %18, i64 %19)
store double** %20, double*** %4
%21 = load double**, double*** %4
store double** %21, double*** %2
br label %22
22: ; preds = %17, %16
%23 = load double**, double*** %2
ret double** %23
}

LLVM IR (-O2):
define double** @doberes_dreieck_all_alloc_1(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = mul nsw i64 %2, %0
%4 = sdiv i64 %3, 2
%5 = tail call double* @dvector_alloc(i64 %4)
%6 = icmp eq double* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call double** @doberes_dreieck_zeiger_alloc(double* %5, i64 %0)
br label %9
9: ; preds = %1, %7
%10 = phi double** [ %8, %7 ], [ null, %1 ]
ret double** %10
}
/* Variables and functions */
int /*<<< orphan*/ nextcnt();
void *start_nextcnt(void *val) {
  nextcnt();
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @start_nextcnt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @nextcnt()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @start_nextcnt(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @nextcnt()
ret i8* null
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t result = 0;
  while (*str++) {
    result++;
  }
  return result;
}


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

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
void ttt(void) {
  int i;
  float temp = 0.0;
  for (i = 0; i < 10000; i++)
    temp += 3.0;
}


x86 assembly (clang, -O0):
<ttt>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    114c <ttt+0x4c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1113 <ttt+0x13>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ttt() {
%1 = alloca i32
%2 = alloca float
store float 0.000000e+00, float* %2
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10000
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fadd double %8, 3.000000e+00
%10 = fptrunc double %9 to float
store float %10, float* %2
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 @ttt() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int safe_atou_full(char const *, unsigned int, unsigned int *);
int safe_atou32_full(const char *s, unsigned base, uint32_t *ret_u) {
  struct _assert_struct_1 {
    char x[(sizeof(uint32_t) == sizeof(unsigned)) ? 0 : -1];
  };
  return safe_atou_full(s, base, (unsigned *)ret_u);
}


x86 assembly (clang, -O0):
<safe_atou32_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <safe_atou_full@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_atou32_full>:
jmp    1030 <safe_atou_full@plt>

LLVM IR (-O0):
define i32 @safe_atou32_full(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @safe_atou_full(i8* %7, i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @safe_atou32_full(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @safe_atou_full(i8* %0, i32 %1, i32* %2)
ret i32 %4
}
void skeleton_message(unsigned long type, unsigned long level,
                      int normally_logged, char *skeleton) {}


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

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

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

LLVM IR (-O2):
define void @skeleton_message(i64 %0, i64 %1, i32 %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
int ioperm(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ setval(int, int);
int main() {
  int res, a, b;
  res = ioperm(0x70, 0x04, 1);
  printf("res =%d \n", res);
  setval(4, 0x07);
  setval(2, 0x27);
  setval(0, 0x00);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x70,%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <ioperm@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4,%edi
mov    $0x7,%esi
call   1050 <setval@plt>
mov    $0x2,%edi
mov    $0x27,%esi
call   1050 <setval@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <setval@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x70,%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <ioperm@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x4,%edi
mov    $0x7,%esi
call   1050 <setval@plt>
mov    $0x2,%edi
mov    $0x27,%esi
call   1050 <setval@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <setval@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"res =%d \0A\00"
define i32 @main() {
%1 = tail call i32 @ioperm(i32 112, i32 4, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @setval(i32 4, i32 7)
%4 = tail call i32 @setval(i32 2, i32 39)
%5 = tail call i32 @setval(i32 0, i32 0)
ret i32 0
}
int cmp(const void *pa, const void *pb) {
  static int x;
  return x++ % 2;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2f12(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f07(%rip)
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
@cmp.x = internal global i32 0
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @cmp.x
%6 = add nsw i32 %5, 1
store i32 %6, i32* @cmp.x
%7 = srem i32 %5, 2
ret i32 %7
}

LLVM IR (-O2):
@cmp.x = internal unnamed_addr global i32 0
define i32 @cmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @cmp.x
%4 = add nsw i32 %3, 1
store i32 %4, i32* @cmp.x
%5 = srem i32 %3, 2
ret i32 %5
}
double interpolate(const double val, const double min, const double max) {
  return val < min ? 0 : val > max ? 1 : (val - min) / (max - min);
}


x86 assembly (clang, -O0):
<interpolate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1134 <interpolate+0x34>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    117d <interpolate+0x7d>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1156 <interpolate+0x56>
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1173 <interpolate+0x73>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate>:
xorpd  %xmm3,%xmm3
ucomisd %xmm0,%xmm1
ja     1129 <interpolate+0x29>
ucomisd %xmm2,%xmm0
jbe    1119 <interpolate+0x19>
movsd  0xee8(%rip),%xmm0
ret
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
movapd %xmm0,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @interpolate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %11
10: ; preds = %3
br label %26
11: ; preds = %3
%12 = load double, double* %4
%13 = load double, double* %6
%14 = fcmp ogt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
br label %24
16: ; preds = %11
%17 = load double, double* %4
%18 = load double, double* %5
%19 = fsub double %17, %18
%20 = load double, double* %6
%21 = load double, double* %5
%22 = fsub double %20, %21
%23 = fdiv double %19, %22
br label %24
24: ; preds = %16, %15
%25 = phi double [ 1.000000e+00, %15 ], [ %23, %16 ]
br label %26
26: ; preds = %24, %10
%27 = phi double [ 0.000000e+00, %10 ], [ %25, %24 ]
ret double %27
}

LLVM IR (-O2):
define double @interpolate(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = fcmp ogt double %0, %2
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = fsub double %0, %1
%9 = fsub double %2, %1
%10 = fdiv double %8, %9
br label %11
11: ; preds = %7, %5, %3
%12 = phi double [ 0.000000e+00, %3 ], [ %10, %7 ], [ 1.000000e+00, %5 ]
ret double %12
}