xunge/DecIR huggingface dataset:
char *ft_strcpy(char *dest, char *src) {
  int x;
  x = 0;
  while (src[x]) {
    dest[x] = src[x];
    x++;
  }
  dest[x + 1] = '\0';
  return (dest);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1149 <ft_strcpy+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <ft_strcpy+0x13>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <ft_strcpy+0x27>
mov    $0x1,%edx
xchg   %ax,%ax
mov    %cl,-0x1(%rax,%rdx,1)
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <ft_strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
mov    $0x1,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = add nuw i64 %6, 2
%15 = and i64 %14, 4294967295
br label %16
16: ; preds = %13, %2
%17 = phi i64 [ 1, %2 ], [ %15, %13 ]
%18 = getelementptr inbounds i8, i8* %0, i64 %17
store i8 0, i8* %18
ret i8* %0
}
/* Variables and functions */
int booster_statfs64(char const *, void *);
int statfs64(const char *pathname, void *buf) {
  return booster_statfs64(pathname, buf);
}


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

x86 assembly (clang, -O2):
<statfs64>:
jmp    1030 <booster_statfs64@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ print_empty_board(int /*<<< orphan*/);
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    usage(argv[0]);
    return -1;
  }
  uint16_t size_board = strtoul(argv[1], NULL, 10);
  print_empty_board(size_board);
  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)
cmpl   $0x2,-0x8(%rbp)
je     1168 <main+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <main+0x60>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <print_empty_board@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    1151 <main+0x21>
mov    0x8(%rsi),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %eax,%edi
call   1030 <print_empty_board@plt>
jmp    115e <main+0x2e>
mov    (%rsi),%rdi
call   1040 <usage@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
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
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @usage(i8* %12)
store i32 -1, i32* %3
br label %21
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strtoul(i8* %17, i32* null, i32 10)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = call i32 @print_empty_board(i32 %19)
store i32 0, i32* %3
br label %21
21: ; preds = %14, %9
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %12
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strtoul(i8* nocapture %9, i32* null, i32 10)
%11 = tail call i32 @print_empty_board(i32 %10)
br label %12
12: ; preds = %7, %4
%13 = phi i32 [ -1, %4 ], [ 0, %7 ]
ret i32 %13
}
/* Variables and functions */
double exp(int);
double std_atm_temperatur(double height) {
  return ((213.0) + (75.0) * exp((-1) * (height / (10000.0))));
}


x86 assembly (clang, -O0):
<std_atm_temperatur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xeee(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  0xeb5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb1(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_atm_temperatur>:
push   %rax
divsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
mulsd  0xede(%rip),%xmm0
addsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @std_atm_temperatur(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+04
%5 = fmul double -1.000000e+00, %4
%6 = fptosi double %5 to i32
%7 = call double @exp(i32 %6)
%8 = call double @llvm.fmuladd.f64(double 7.500000e+01, double %7, double 2.130000e+02)
ret double %8
}

LLVM IR (-O2):
define double @std_atm_temperatur(double %0) {
%2 = fdiv double %0, -1.000000e+04
%3 = fptosi double %2 to i32
%4 = tail call double @exp(i32 %3)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 7.500000e+01, double 2.130000e+02)
ret double %5
}
/* Variables and functions */
int strlen(char *);
int verificaUf(char *uf) {
  int tamUf = strlen(uf);
  if (uf == NULL || tamUf == 0 || tamUf >= 3)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verificaUf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1147 <verificaUf+0x37>
cmpl   $0x0,-0x14(%rbp)
je     1147 <verificaUf+0x37>
cmpl   $0x3,-0x14(%rbp)
jl     1153 <verificaUf+0x43>
movl   $0x0,-0x4(%rbp)
jmp    115a <verificaUf+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verificaUf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rbx,%rbx
setne  %cl
test   %eax,%eax
setne  %dl
and    %cl,%dl
cmp    $0x3,%eax
setl   %al
and    %dl,%al
movzbl %al,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @verificaUf(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp ne i8* %0, null
%4 = icmp ne i32 %2, 0
%5 = select i1 %3, i1 %4, i1 false
%6 = icmp slt i32 %2, 3
%7 = select i1 %5, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct utsname {
  char *release;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ uname(struct utsname *);
int printLinuxVersion() {
  struct utsname uname_bf;
  if (uname(&uname_bf) < 0) {
    perror("Could not perform uname. Exiting.");
    return -1;
  }
  printf("\x1b[36mLinux Version: %s\x1b[0m\n", uname_bf.release);
  return 0;
}


x86 assembly (clang, -O0):
<printLinuxVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1040 <uname@plt>
cmp    $0x0,%rax
jge    1163 <printLinuxVersion+0x33>
lea    0xeae(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <printLinuxVersion+0x4a>
mov    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLinuxVersion>:
push   %rax
mov    %rsp,%rdi
call   1040 <uname@plt>
test   %rax,%rax
js     1152 <printLinuxVersion+0x22>
mov    (%rsp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xea7(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.utsname = type { i8* }
@.str = [34 x i8] c"Could not perform uname. Exiting.\00"
@.str.1 = [28 x i8] c"\1B[36mLinux Version: %s\1B[0m\0A\00"
define i32 @printLinuxVersion() {
%1 = alloca i32
%2 = alloca %struct.utsname
%3 = call i64 @uname(%struct.utsname* %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %11
7: ; preds = %0
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %2, i32 0, i32 0
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %9)
store i32 0, i32* %1
br label %11
11: ; preds = %7, %5
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%struct.utsname = type { i8* }
@.str = [34 x i8] c"Could not perform uname. Exiting.\00"
@.str.1 = [28 x i8] c"\1B[36mLinux Version: %s\1B[0m\0A\00"
define i32 @printLinuxVersion() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i64 @uname(%struct.utsname* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %0
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 0
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ -1, %5 ], [ 0, %7 ]
ret i32 %12
}
/* Type definitions */
struct customer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ shmat(int, int /*<<< orphan*/, int /*<<< orphan*/);
int shmget(int, int /*<<< orphan*/, int /*<<< orphan*/);
struct customer *get_first_customer(int front_offset) {
  int shmid;
  shmid = shmget(front_offset, 0, 0);
  if (shmid < 0) {
    perror("Could not get shared memory");
    exit(EXIT_FAILURE);
  }
  return (struct customer *)shmat(shmid, 0, 0);
}


x86 assembly (clang, -O0):
<get_first_customer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <shmget@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    117e <get_first_customer+0x3e>
lea    0xe95(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <shmat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_first_customer>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1050 <shmget@plt>
test   %eax,%eax
js     115a <get_first_customer+0x1a>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <shmat@plt>
lea    0xe9f(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.customer = type { i32 }
@.str = [28 x i8] c"Could not get shared memory\00"
@EXIT_FAILURE = global i32 0
define %struct.customer* @get_first_customer(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @shmget(i32 %4, i32 0, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i32, i32* %3
%14 = call i64 @shmat(i32 %13, i32 0, i32 0)
%15 = inttoptr i64 %14 to %struct.customer*
ret %struct.customer* %15
}

LLVM IR (-O2):
%struct.customer = type { i32 }
@.str = [28 x i8] c"Could not get shared memory\00"
@EXIT_FAILURE = global i32 0
define %struct.customer* @get_first_customer(i32 %0) {
%2 = tail call i32 @shmget(i32 %0, i32 0, i32 0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = tail call i64 @shmat(i32 %2, i32 0, i32 0)
%10 = inttoptr i64 %9 to %struct.customer*
ret %struct.customer* %10
}
void foo594() {}


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

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

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

LLVM IR (-O2):
define void @foo594() {
ret void
}
/* Variables and functions */
void *ft_memset(void *, int /*<<< orphan*/, size_t);
void *malloc(size_t);
void *ft_memalloc(size_t size) {
  void *mem;
  mem = malloc(size);
  if (mem == NULL)
    return (NULL);
  else
    return (ft_memset(mem, 0, size));
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <ft_memalloc+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1164 <ft_memalloc+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <ft_memset@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     113c <ft_memalloc+0x1c>
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <ft_memset@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ft_memalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* null, i8** %2
br label %14
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = load i64, i64* %3
%13 = call i8* @ft_memset(i8* %11, i32 0, i64 %12)
store i8* %13, i8** %2
br label %14
14: ; preds = %10, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @ft_memalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @ft_memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
int isfirst(char ch1, char ch2) {}


x86 assembly (clang, -O0):
<isfirst>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isfirst(i8 signext %0, i8 signext %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ munmap(void *, int);
void munmap_wrapper(void *data, void *user_data) {
  int *size = (int *)user_data;
  munmap(data, *size);
  free(user_data);
}


x86 assembly (clang, -O0):
<munmap_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1040 <munmap@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<munmap_wrapper>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%esi
call   1040 <munmap@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @munmap_wrapper(i8* %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @munmap(i8* %0, i32 %4)
%6 = tail call i32 @free(i8* %1)
ret void
}
void func1(int *ptr1, int *ptr2) {
  if (ptr1 || ptr2) {
    *ptr2 = 400;
  } else {
    *ptr1 = 100;
  }
  *ptr1 = 200;
  *ptr2 = 300;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1122 <func1+0x22>
cmpq   $0x0,-0x10(%rbp)
je     1131 <func1+0x31>
mov    -0x10(%rbp),%rax
movl   $0x190,(%rax)
jmp    113b <func1+0x3b>
mov    -0x8(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xc8,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x12c,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
movl   $0xc8,(%rdi)
movl   $0x12c,(%rsi)
ret

LLVM IR (-O0):
define void @func1(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 = icmp ne i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %7, %2
%11 = load i32*, i32** %4
store i32 400, i32* %11
br label %14
12: ; preds = %7
%13 = load i32*, i32** %3
store i32 100, i32* %13
br label %14
14: ; preds = %12, %10
%15 = load i32*, i32** %3
store i32 200, i32* %15
%16 = load i32*, i32** %4
store i32 300, i32* %16
ret void
}

LLVM IR (-O2):
define void @func1(i32* writeonly %0, i32* writeonly %1) {
%3 = icmp ne i32* %0, null
%4 = icmp ne i32* %1, null
%5 = or i1 %3, %4
tail call void @llvm.assume(i1 %5)
store i32 200, i32* %0
store i32 300, i32* %1
ret void
}
/* Variables and functions */
int __GLIBC__;
int /*<<< orphan*/ printf(char *);
int main() {
  int x = __GLIBC__;
  printf("__GLIBC__"
         "."
         "__GLIBC_MINOR__");
  return 0;
}


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

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

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

LLVM IR (-O2):
@__GLIBC__ = global i32 0
@.str = [26 x i8] c"__GLIBC__.__GLIBC_MINOR__\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ search_replace_string(char *, char *, char *);
void javascript_replace_row(char *post_change_javascript, char *row) {
  search_replace_string(post_change_javascript, "$row", row);
}


x86 assembly (clang, -O0):
<javascript_replace_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <search_replace_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<javascript_replace_row>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <search_replace_string@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"$row\00"
define void @javascript_replace_row(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @search_replace_string(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"$row\00"
define void @javascript_replace_row(i8* %0, i8* %1) {
%3 = tail call i32 @search_replace_string(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This program says Hello to to you:D\n\n");
  printf("Hello World\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"This program says Hello to to you:D\0A\0A\00"
@.str.1 = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [37 x i8] c"This program says Hello to to you:D\0A\00"
@str.2 = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
unsigned xrop3_19_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk1 = S | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_19_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ dyn_free(void *, long, int);
void zfree(void *ptr, long size) { dyn_free(ptr, size, 4); }


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

x86 assembly (clang, -O2):
<zfree>:
mov    $0x4,%edx
jmp    1030 <dyn_free@plt>

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

LLVM IR (-O2):
define void @zfree(i8* %0, i64 %1) {
%3 = tail call i32 @dyn_free(i8* %0, i64 %1, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x05() {
  Assert_real((isxdigit(5) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              30, ("isxdigit should be 0 for 0x05"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x05>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1e,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x05>:
push   %rax
mov    $0x5,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x05\00"
define void @t_isxdigit_0x05() {
%1 = call i64 @isxdigit(i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x05\00"
define void @t_isxdigit_0x05() {
%1 = tail call i64 @isxdigit(i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pow(double, double);
double b_poly(double y, double alpha) {
  double result = pow(y, alpha);
  if (result > 1)
    result = 1;
  if (result < 0)
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<b_poly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115a <b_poly+0x4a>
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1170 <b_poly+0x60>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_poly>:
push   %rax
call   1030 <pow@plt>
movsd  0xee2(%rip),%xmm1
minsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
maxsd  %xmm1,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @b_poly(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
%4 = fcmp ogt double %3, 1.000000e+00
%5 = select i1 %4, double 1.000000e+00, double %3
%6 = fcmp olt double %5, 0.000000e+00
%7 = select i1 %6, double 0.000000e+00, double %5
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int LOG_DAEMON;
int LOG_NOTICE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int, char *);
void exit_handler(int signum) {
  syslog(LOG_DAEMON | LOG_NOTICE, "Exit crelay daemon\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2e9d(%rip),%rax
or     (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <syslog@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_handler>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <syslog@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@LOG_DAEMON = global i32 0
@LOG_NOTICE = global i32 0
@.str = [20 x i8] c"Exit crelay daemon\0A\00"
@EXIT_SUCCESS = global i32 0
define void @exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_DAEMON
%4 = load i32, i32* @LOG_NOTICE
%5 = or i32 %3, %4
%6 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@LOG_DAEMON = global i32 0
@LOG_NOTICE = global i32 0
@.str = [20 x i8] c"Exit crelay daemon\0A\00"
@EXIT_SUCCESS = global i32 0
define void @exit_handler(i32 %0) {
%2 = load i32, i32* @LOG_DAEMON
%3 = load i32, i32* @LOG_NOTICE
%4 = or i32 %3, %2
%5 = tail call i32 @syslog(i32 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
}
void mcsp_guardexphook_free(void *chook) { return; }


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

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

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

LLVM IR (-O2):
define void @mcsp_guardexphook_free(i8* nocapture %0) {
ret void
}
int sum_of_squares_bitey(int N) {
  int sum = 0.0;
  for (int i = 1; i < N + 1; ++i)
    sum += i * i;
  return sum;
}


x86 assembly (clang, -O0):
<sum_of_squares_bitey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1141 <sum_of_squares_bitey+0x41>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <sum_of_squares_bitey+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_of_squares_bitey>:
test   %edi,%edi
jle    112d <sum_of_squares_bitey+0x2d>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
lea    -0x3(%rdi),%eax
imul   %rcx,%rax
shr    %rax
imul   $0x55555556,%eax,%eax
shr    %rcx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
lea    (%rcx,%rdi,4),%eax
add    $0xfffffffd,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum_of_squares_bitey(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %22, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = add nsw i32 %0, -3
%10 = zext i32 %9 to i33
%11 = mul i33 %8, %10
%12 = lshr i33 %11, 1
%13 = trunc i33 %12 to i32
%14 = mul i32 %13, 1431655766
%15 = lshr i33 %8, 1
%16 = trunc i33 %15 to i32
%17 = mul i32 %16, 5
%18 = add i32 %14, %17
%19 = shl i32 %0, 2
%20 = add i32 %18, %19
%21 = add i32 %20, -3
br label %22
22: ; preds = %3, %1
%23 = phi i32 [ 0, %1 ], [ %21, %3 ]
ret i32 %23
}
__attribute__((no, noclone)) signed char t106_5mul(unsigned __int128 x) {
  signed char r;
  if (__builtin_mul_overflow(x, (signed __int128)(-2), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t106_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rsi
add    %rcx,%rcx
adc    %rsi,%rsi
setb   %al
xor    %edx,%edx
mov    $0x80,%edi
sub    %rcx,%rdi
sbb    %rsi,%rdx
setb   %dl
or     %dl,%al
neg    %cl
mov    %cl,-0x21(%rbp)
test   $0x1,%al
jne    1165 <t106_5mul+0x55>
jmp    116c <t106_5mul+0x5c>
mov    $0x0,%al
call   1030 <bar@plt>
movsbl -0x21(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t106_5mul>:
push   %rbx
mov    %rdi,%rbx
add    %rdi,%rbx
adc    %rsi,%rsi
jb     1129 <t106_5mul+0x19>
cmp    $0x81,%rbx
sbb    $0x0,%rsi
jb     1130 <t106_5mul+0x20>
xor    %eax,%eax
call   1030 <bar@plt>
neg    %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @t106_5mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i8
%6 = bitcast i128* %3 to { i64, i64 }*
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %6, i32 0, i32 0
store i64 %0, i64* %7
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %6, i32 0, i32 1
store i64 %1, i64* %8
%9 = load i128, i128* %3
store i128 %9, i128* %4
%10 = load i128, i128* %4
%11 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 2, i128 %10)
%12 = extractvalue { i128, i1 } %11, 1
%13 = extractvalue { i128, i1 } %11, 0
%14 = icmp ugt i128 %13, 128
%15 = or i1 %12, %14
%16 = sub i128 0, %13
%17 = select i1 true, i128 %16, i128 %13
%18 = trunc i128 %17 to i8
store i8 %18, i8* %5
br i1 %15, label %19, label %21
19: ; preds = %2
%20 = call i32 (...) @bar()
br label %21
21: ; preds = %19, %2
%22 = load i8, i8* %5
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @t106_5mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %6, i128 2)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
%10 = icmp ugt i128 %9, 128
%11 = or i1 %8, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = tail call i32 (...) @bar()
br label %14
14: ; preds = %12, %2
%15 = trunc i128 %9 to i8
%16 = sub i8 0, %15
ret i8 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int mem_page_write(int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int mem_page_fill(FILE *f, uint64_t addr, uint8_t byte) {
  uint8_t page[4096];
  memset(page, byte, 4096);
  return mem_page_write(f, addr, page);
}


x86 assembly (clang, -O0):
<mem_page_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4010,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x4010(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    $0x1000,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x4010(%rbp),%rdx
call   1030 <mem_page_write@plt>
add    $0x4010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_page_fill>:
push   %rbp
push   %r14
push   %rbx
sub    $0x4000,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %edx,%esi
mov    $0x1000,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <mem_page_write@plt>
add    $0x4000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mem_page_fill(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [4096 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [4096 x i32], [4096 x i32]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = call i32 @memset(i32* %8, i32 %9, i32 4096)
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = getelementptr inbounds [4096 x i32], [4096 x i32]* %7, i64 0, i64 0
%14 = call i32 @mem_page_write(i32* %11, i32 %12, i32* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @mem_page_fill(i32* %0, i32 %1, i32 %2) {
%4 = alloca [4096 x i32]
%5 = bitcast [4096 x i32]* %4 to i8*
%6 = getelementptr inbounds [4096 x i32], [4096 x i32]* %4, i64 0, i64 0
%7 = call i32 @memset(i32* %6, i32 %2, i32 4096)
%8 = call i32 @mem_page_write(i32* %0, i32 %1, i32* %6)
ret i32 %8
}
int mod(double x, double y) {
  int r;
  double d;
  d = x / y;
  r = (int)d;
  if (r < 0)
    r--;
  d = x - y * r;
  r = (int)d;
  return (r);
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1138 <mod+0x38>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%eax
mov    %eax,%ecx
sar    $0x1f,%ecx
add    %eax,%ecx
xorps  %xmm2,%xmm2
cvtsi2sd %ecx,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @mod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
store double %9, double* %6
%10 = load double, double* %6
%11 = fptosi double %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i32, i32* %5
%16 = add nsw i32 %15, -1
store i32 %16, i32* %5
br label %17
17: ; preds = %14, %2
%18 = load double, double* %3
%19 = load double, double* %4
%20 = load i32, i32* %5
%21 = sitofp i32 %20 to double
%22 = fneg double %19
%23 = call double @llvm.fmuladd.f64(double %22, double %21, double %18)
store double %23, double* %6
%24 = load double, double* %6
%25 = fptosi double %24 to i32
store i32 %25, i32* %5
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @mod(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = fptosi double %3 to i32
%5 = ashr i32 %4, 31
%6 = add nsw i32 %5, %4
%7 = sitofp i32 %6 to double
%8 = fneg double %1
%9 = tail call double @llvm.fmuladd.f64(double %8, double %7, double %0)
%10 = fptosi double %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help(void) {
  printf("fujitsu usb touchscreen utility\n");
  printf("usage:\n");
  printf("	orientation 0|1|2|3: set driver orientation\n");
  printf("	calibrate 0|1: activate calibration mode\n");
  printf("	writecalibrate a b c d: write calibration values\n");
}


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

x86 assembly (clang, -O2):
<show_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xf36(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"fujitsu usb touchscreen utility\0A\00"
@.str.1 = [8 x i8] c"usage:\0A\00"
@.str.2 = [46 x i8] c"\09orientation 0|1|2|3: set driver orientation\0A\00"
@.str.3 = [43 x i8] c"\09calibrate 0|1: activate calibration mode\0A\00"
@.str.4 = [51 x i8] c"\09writecalibrate a b c d: write calibration values\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"fujitsu usb touchscreen utility\00"
@str.5 = [7 x i8] c"usage:\00"
@str.6 = [45 x i8] c"\09orientation 0|1|2|3: set driver orientation\00"
@str.7 = [42 x i8] c"\09calibrate 0|1: activate calibration mode\00"
@str.8 = [50 x i8] c"\09writecalibrate a b c d: write calibration values\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ permuteHelp(int *, int /*<<< orphan*/, int);
void permute(int *arr, int num) { permuteHelp(arr, 0, num); }


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

x86 assembly (clang, -O2):
<permute>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <permuteHelp@plt>

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

LLVM IR (-O2):
define void @permute(i32* %0, i32 %1) {
%3 = tail call i32 @permuteHelp(i32* %0, i32 0, i32 %1)
ret void
}
int test_imm_27int8_mem(signed char *val) {
  return ((*val) & (-0x27 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_27int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffd9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_27int8_mem>:
testb  $0xd9,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_27int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -39
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}