xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int write(int, char const *, int);
int safe_write(int fd, const char *buffer, int size) {
  int ret = write(fd, buffer, size);
  if (ret < 0) {
    perror("write");
    exit(EXIT_FAILURE);
  }
  return ret;
}


x86 assembly (clang, -O0):
<safe_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1178 <safe_write+0x48>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_write>:
push   %rax
call   1030 <write@plt>
test   %eax,%eax
js     113c <safe_write+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"write\00"
@EXIT_FAILURE = global i32 0
define i32 @safe_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %3
ret i32 %4
}
double div_or_zero(double a, double b) {
  double r = a / b;
  if (r != r)
    return 0;
  return r;
}


x86 assembly (clang, -O0):
<div_or_zero>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    1138 <div_or_zero+0x38>
jp     1138 <div_or_zero+0x38>
jmp    1145 <div_or_zero+0x45>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114f <div_or_zero+0x4f>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_or_zero>:
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
cmpordsd %xmm0,%xmm1
andpd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @div_or_zero(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = fcmp ord double %3, 0.000000e+00
%5 = select i1 %4, double %3, double 0.000000e+00
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ print_config_registers();
int /*<<< orphan*/ print_session_registers();
int /*<<< orphan*/ tag_enable(int);
int /*<<< orphan*/ tag_power(int /*<<< orphan*/);
scalar_t__ tag_read_sessionreg(int, char *);
void tag_check_link(void) {
  char regdata = 0;
  tag_enable(1);
  if (tag_read_sessionreg(3, &regdata)) {
    if (!regdata) {
      ;
      print_config_registers();
      print_session_registers();
      tag_power(0);
    }
  }
  tag_enable(0);
}


x86 assembly (clang, -O0):
<tag_check_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <tag_enable@plt>
mov    $0x3,%edi
lea    -0x1(%rbp),%rsi
call   1060 <tag_read_sessionreg@plt>
cmp    $0x0,%rax
je     11a2 <tag_check_link+0x52>
cmpb   $0x0,-0x1(%rbp)
jne    119d <tag_check_link+0x4d>
mov    $0x0,%al
call   1050 <print_config_registers@plt>
mov    $0x0,%al
call   1070 <print_session_registers@plt>
xor    %edi,%edi
call   1040 <tag_power@plt>
jmp    11a2 <tag_check_link+0x52>
xor    %edi,%edi
call   1030 <tag_enable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag_check_link>:
push   %rax
movb   $0x0,0x7(%rsp)
mov    $0x1,%edi
call   1030 <tag_enable@plt>
lea    0x7(%rsp),%rsi
mov    $0x3,%edi
call   1060 <tag_read_sessionreg@plt>
test   %rax,%rax
je     1190 <tag_check_link+0x40>
cmpb   $0x0,0x7(%rsp)
jne    1190 <tag_check_link+0x40>
xor    %eax,%eax
call   1050 <print_config_registers@plt>
xor    %eax,%eax
call   1070 <print_session_registers@plt>
xor    %edi,%edi
call   1040 <tag_power@plt>
xor    %edi,%edi
call   1030 <tag_enable@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @tag_check_link() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @tag_enable(i32 1)
%3 = call i64 @tag_read_sessionreg(i32 3, i8* %1)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = load i8, i8* %1
%7 = icmp ne i8 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = call i32 (...) @print_config_registers()
%10 = call i32 (...) @print_session_registers()
%11 = call i32 @tag_power(i32 0)
br label %12
12: ; preds = %8, %5
br label %13
13: ; preds = %12, %0
%14 = call i32 @tag_enable(i32 0)
ret void
}

LLVM IR (-O2):
define void @tag_check_link() {
%1 = alloca i8
store i8 0, i8* %1
%2 = tail call i32 @tag_enable(i32 1)
%3 = call i64 @tag_read_sessionreg(i32 3, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = load i8, i8* %1
%6 = icmp ne i8 %5, 0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %12, label %8
8: ; preds = %0
%9 = call i32 (...) @print_config_registers()
%10 = call i32 (...) @print_session_registers()
%11 = call i32 @tag_power(i32 0)
br label %12
12: ; preds = %8, %0
%13 = call i32 @tag_enable(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void general_protection_fault(void) {
  panic("exception(fault): general protection fault");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"exception(fault): general protection fault\00"
define void @general_protection_fault() {
%1 = call i32 @panic(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"exception(fault): general protection fault\00"
define void @general_protection_fault() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max32(long, long);
long min32(long, int /*<<< orphan*/);
long clamp32(long x, long min, long max) { return min32(max, max32(min, x)); }


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

x86 assembly (clang, -O2):
<clamp32>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <max32@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <min32@plt>

LLVM IR (-O0):
define i64 @clamp32(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = call i32 @max32(i64 %8, i64 %9)
%11 = call i64 @min32(i64 %7, i32 %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @clamp32(i64 %0, i64 %1, i64 %2) {
%4 = tail call i32 @max32(i64 %1, i64 %0)
%5 = tail call i64 @min32(i64 %2, i32 %4)
ret i64 %5
}
void copy(char *to, char *from) {
  while ((*to++ = *from++) != '\0')
    ;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <copy+0x3f>
jmp    110c <copy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy+0x10>
ret

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

LLVM IR (-O2):
define void @copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
int valid_size(int size) {
  switch (size) {
  case 1:
  case 2:
  case 4:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<valid_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     112f <valid_size+0x2f>
jmp    111e <valid_size+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
jne    113b <valid_size+0x3b>
jmp    112f <valid_size+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1142 <valid_size+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_size>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x3,%edi
ja     1117 <valid_size+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @valid_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 1, label %5
i32 2, label %5
i32 4, label %5
]
5: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.valid_size = [4 x i32] [i32 1, i32 1, i32 0, i32 1]
define i32 @valid_size(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.valid_size, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int cu2ho(double *, double *, int);
int ho2eu(double *, double *, int);
int cu2eu(double *cu, double *eu, int p) {
  double ho[3];
  int trash;
  trash = cu2ho(cu, ho, p);
  trash = ho2eu(ho, eu, p);
  return 1;
}


x86 assembly (clang, -O0):
<cu2eu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <cu2ho@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ho2eu@plt>
mov    %eax,-0x34(%rbp)
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cu2eu>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1040 <cu2ho@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <ho2eu@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @cu2eu(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [3 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @cu2ho(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @ho2eu(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @cu2eu(double* %0, double* %1, i32 %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%7 = call i32 @cu2ho(double* %0, double* %6, i32 %2)
%8 = call i32 @ho2eu(double* %6, double* %1, i32 %2)
ret i32 1
}
/* Variables and functions */
scalar_t__ isprint(int);
int /*<<< orphan*/ isspace(int);
int /*<<< orphan*/ printf(char *, unsigned long, int);
void report(unsigned long count, int c) {
  if (isprint(c) && !isspace(c)) {
    printf("%lu %c\n", count, c);
  } else {
    printf("%lu 0x%02X\n", count, c);
  }
}


x86 assembly (clang, -O0):
<report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <isprint@plt>
cmp    $0x0,%rax
je     117a <report+0x4a>
mov    -0xc(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
jne    117a <report+0x4a>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
jmp    118d <report+0x5d>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1050 <isprint@plt>
test   %rax,%rax
je     1150 <report+0x20>
mov    %ebx,%edi
call   1040 <isspace@plt>
test   %eax,%eax
je     1159 <report+0x29>
lea    0xeb1(%rip),%rdi
jmp    1160 <report+0x30>
lea    0xea0(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%lu %c\0A\00"
@.str.1 = [12 x i8] c"%lu 0x%02X\0A\00"
define void @report(i64 %0, i32 %1) {
%3 = tail call i64 @isprint(i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @isspace(i32 %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %5, %2
br label %9
9: ; preds = %5, %8
%10 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %8 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %5 ]
%11 = tail call i32 @printf(i8* %10, i64 %0, i32 %1)
ret void
}
int commonmutiple(int *p) {}


x86 assembly (clang, -O0):
<commonmutiple>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @commonmutiple(i32* nocapture readnone %0) {
ret i32 undef
}
BOOST_AUTO_TEST_CASE(arccsch) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_selection_convert() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ api1(int, int);
void exit(int status) { api1(1, status); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <api1@plt>

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

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @api1(i32 1, i32 %3)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @api1(i32 1, i32 %0)
unreachable
}
long int bad_long_tmin() { return 1L << sizeof(long) << 3 - 1; }


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

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

LLVM IR (-O0):
define i64 @bad_long_tmin() {
ret i64 1024
}

LLVM IR (-O2):
define i64 @bad_long_tmin() {
ret i64 1024
}
void perf_events_lapic_init(void) {}


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

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

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

LLVM IR (-O2):
define void @perf_events_lapic_init() {
ret void
}
/* Variables and functions */
char *strncpy(char *restrict dest, const char *restrict src, size_t count) {
  for (; count != 0; count--) {
    *dest++ = *src;
    if (*src++ != '\0')
      break;
  }
  return dest;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1168 <strncpy+0x68>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1152 <strncpy+0x52>
jmp    1168 <strncpy+0x68>
jmp    1157 <strncpy+0x57>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <strncpy+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
test   %rdx,%rdx
je     112d <strncpy+0x2d>
add    $0xffffffffffffffff,%rdx
xor    %ecx,%ecx
xchg   %ax,%ax
movzbl (%rsi,%rcx,1),%r8d
mov    %r8b,(%rax,%rcx,1)
lea    0x1(%rcx),%rdi
test   %r8b,%r8b
jne    112a <strncpy+0x2a>
cmp    %rcx,%rdx
mov    %rdi,%rcx
jne    1110 <strncpy+0x10>
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* noalias writeonly %0, i8* noalias nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %13, %5 ], [ %2, %3 ]
%7 = phi i8* [ %12, %5 ], [ %1, %3 ]
%8 = phi i8* [ %10, %5 ], [ %0, %3 ]
%9 = load i8, i8* %7
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %9, i8* %8
%11 = icmp ne i8 %9, 0
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = add i64 %6, -1
%14 = icmp eq i64 %13, 0
%15 = select i1 %11, i1 true, i1 %14
br i1 %15, label %16, label %5
16: ; preds = %5, %3
%17 = phi i8* [ %0, %3 ], [ %10, %5 ]
ret i8* %17
}
int ck_cc_ffs(unsigned int x) {
  unsigned int i;
  if (x == 0)
    return 0;
  for (i = 1; (x & 1) == 0; i++, x >>= 1)
    ;
  return i;
}


x86 assembly (clang, -O0):
<ck_cc_ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ck_cc_ffs+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1155 <ck_cc_ffs+0x55>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    114f <ck_cc_ffs+0x4f>
jmp    1138 <ck_cc_ffs+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <ck_cc_ffs+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ck_cc_ffs>:
test   %edi,%edi
je     112e <ck_cc_ffs+0x2e>
mov    $0x1,%eax
test   $0x1,%dil
jne    112d <ck_cc_ffs+0x2d>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
test   $0x2,%dil
mov    %ecx,%edi
je     1120 <ck_cc_ffs+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ck_cc_ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 1, %3 ]
%8 = phi i32 [ %10, %6 ], [ %0, %3 ]
%9 = add i32 %7, 1
%10 = lshr i32 %8, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %14
}
/* Type definitions */
struct rlimit {
  int rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_NOFILE;
scalar_t__ getrlimit(int /*<<< orphan*/, struct rlimit *);
int file_limit() {
  struct rlimit rlim;
  if (getrlimit(RLIMIT_NOFILE, &rlim) != 0) {
    return -1;
  }
  return rlim.rlim_cur;
}


x86 assembly (clang, -O0):
<file_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getrlimit@plt>
cmp    $0x0,%rax
je     1140 <file_limit+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <file_limit+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_limit>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrlimit@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_NOFILE = global i32 0
define i32 @file_limit() {
%1 = alloca i32
%2 = alloca %struct.rlimit
%3 = load i32, i32* @RLIMIT_NOFILE
%4 = call i64 @getrlimit(i32 %3, %struct.rlimit* %2)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %10
7: ; preds = %0
%8 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_NOFILE = global i32 0
define i32 @file_limit() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_NOFILE
%4 = call i64 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 0, b = 3;
  a++;
  printf("a: %d\n", a);
  printf("a: %d\n", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"a: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
void swap(char *x, char *y) {
  char tmp = *x;
  *x = *y;
  *y = tmp;
}


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

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

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int my_getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int len;
  char line[1000];
  while ((len = my_getline(line, 1000)) > 0)
    if (len > 1) {
      printf("%s", line);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <my_getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x1,-0x8(%rbp)
jle    116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <my_getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
mov    %rsp,%rbx
lea    0xebb(%rip),%r14
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <my_getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x1,%eax
je     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @my_getline(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
char *duplica_string(char *);
int /*<<< orphan*/ free(char *);
char *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main(void) {
  char *s = "Campos verdes";
  char *s_duplicado = malloc(strlen(s));
  s_duplicado = duplica_string(s);
  printf("%s\n", s_duplicado);
  free(s_duplicado);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <duplica_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
call   1060 <duplica_string@plt>
mov    %rax,%rbx
lea    0xeac(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @duplica_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i32 0
}
int test_imm_B4int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xB4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B4int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xb4,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_B4int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 180
%7 = icmp ne i64 %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_B4int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11796480
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, size_t, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void utils_mkresponsetime(char *string, size_t len) {
  time_t ttime = time(NULL);
  struct tm *ltime;
  ltime = localtime(&ttime);
  strftime(string, len, "%a, %b %Y %H:%M:%S %Z", ltime);
}


x86 assembly (clang, -O0):
<utils_mkresponsetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    0xe94(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_mkresponsetime>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeaa(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [22 x i8] c"%a, %b %Y %H:%M:%S %Z\00"
define void @utils_mkresponsetime(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca %struct.tm*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %5
%8 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %8, %struct.tm** %6
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = load %struct.tm*, %struct.tm** %6
%12 = call i32 @strftime(i8* %9, i64 %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %struct.tm* %11)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [22 x i8] c"%a, %b %Y %H:%M:%S %Z\00"
define void @utils_mkresponsetime(i8* %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i64 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dir_spi_slave_init();
void rpi_spi_slave_init() { dir_spi_slave_init(); }


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

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

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

LLVM IR (-O2):
define void @rpi_spi_slave_init() {
%1 = tail call i32 (...) @dir_spi_slave_init()
ret void
}
double f4_sum_pre_int_int_int_int_short(int v0, int v1, int v2, int v3,
                                        short v) {
  return (double)v0 + (double)v1 + (double)v2 + (double)v3 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_int_int_int_int_short>:
push   %rbp
mov    %rsp,%rbp
mov    %r8w,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movswl -0x12(%rbp),%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_int_int_int_short>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
cvtsi2sd %edx,%xmm2
addsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
addsd  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %r8d,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_int_int_int_short(i32 %0, i32 %1, i32 %2, i32 %3, i16 signext %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i16
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i16 %4, i16* %10
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to double
%13 = load i32, i32* %7
%14 = sitofp i32 %13 to double
%15 = fadd double %12, %14
%16 = load i32, i32* %8
%17 = sitofp i32 %16 to double
%18 = fadd double %15, %17
%19 = load i32, i32* %9
%20 = sitofp i32 %19 to double
%21 = fadd double %18, %20
%22 = load i16, i16* %10
%23 = sitofp i16 %22 to double
%24 = fadd double %21, %23
ret double %24
}

LLVM IR (-O2):
define double @f4_sum_pre_int_int_int_int_short(i32 %0, i32 %1, i32 %2, i32 %3, i16 signext %4) {
%6 = sitofp i32 %0 to double
%7 = sitofp i32 %1 to double
%8 = fadd double %6, %7
%9 = sitofp i32 %2 to double
%10 = fadd double %8, %9
%11 = sitofp i32 %3 to double
%12 = fadd double %10, %11
%13 = sitofp i16 %4 to double
%14 = fadd double %12, %13
ret double %14
}
int is_uppercase_or_lowercase(char ch) {
  if (ch >= 'a' && ch <= 'z')
    return 1;
  if (ch >= 'A' && ch <= 'Z')
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<is_uppercase_or_lowercase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <is_uppercase_or_lowercase+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <is_uppercase_or_lowercase+0x30>
movl   $0x1,-0x4(%rbp)
jmp    115d <is_uppercase_or_lowercase+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <is_uppercase_or_lowercase+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1156 <is_uppercase_or_lowercase+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <is_uppercase_or_lowercase+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_uppercase_or_lowercase>:
lea    -0x61(%rdi),%eax
add    $0xbf,%dil
cmp    $0x1a,%dil
sbb    %ecx,%ecx
cmp    $0x1a,%al
mov    $0x1,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_uppercase_or_lowercase(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 26
%6 = sext i1 %5 to i32
%7 = select i1 %3, i32 1, i32 %6
ret i32 %7
}
/* Variables and functions */
int fd_socket(int, int, int);
int real_socket(int, int, int);
int socket(int domain, int type, int protocol) {
  int ret;
  ret = fd_socket(domain, type, protocol);
  if (ret == -5555)
    ret = real_socket(domain, type, protocol);
  do {
  } while (0);
  return ret;
}


x86 assembly (clang, -O0):
<socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <fd_socket@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffea4d,-0x10(%rbp)
jne    1160 <socket+0x40>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <real_socket@plt>
mov    %eax,-0x10(%rbp)
jmp    1165 <socket+0x45>
jmp    116a <socket+0x4a>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <fd_socket@plt>
cmp    $0xffffea4d,%eax
jne    1147 <socket+0x27>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <real_socket@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @fd_socket(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -5555
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = call i32 @real_socket(i32 %15, i32 %16, i32 %17)
store i32 %18, i32* %7
br label %19
19: ; preds = %14, %3
br label %20
20: ; preds = %19
br label %21
21: ; preds = %20
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @fd_socket(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -5555
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @real_socket(i32 %0, i32 %1, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ %4, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ IntUnregister(int);
void SysTickIntUnregister(void) {
  (*((volatile unsigned long *)(0xE000E010))) &= ~(0x00000002);
  IntUnregister(15);
}


x86 assembly (clang, -O0):
<SysTickIntUnregister>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e010,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    $0xe000e010,%eax
mov    %rcx,(%rax)
mov    $0xf,%edi
call   1030 <IntUnregister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTickIntUnregister>:
mov    $0xe000e010,%eax
andq   $0xfffffffffffffffd,(%rax)
mov    $0xf,%edi
jmp    1030 <IntUnregister@plt>

LLVM IR (-O0):
define void @SysTickIntUnregister() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
%3 = call i32 @IntUnregister(i32 15)
ret void
}

LLVM IR (-O2):
define void @SysTickIntUnregister() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
%3 = tail call i32 @IntUnregister(i32 15)
ret void
}
int main(void) {
  __asm__ __volatile__("");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int _FPU_DEFAULT;
int _FPU_MASK_IM;
int _FPU_MASK_OM;
int _FPU_MASK_UM;
int _FPU_MASK_ZM;
int /*<<< orphan*/ __setfpucw(int);
void __attribute__((constructor)) trapfpe() {
  __setfpucw(_FPU_DEFAULT &
             ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM));
}


x86 assembly (clang, -O0):
<trapfpe>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
mov    0x2eab(%rip),%rcx
or     (%rcx),%eax
mov    0x2e8a(%rip),%rcx
or     (%rcx),%eax
mov    0x2e91(%rip),%rcx
or     (%rcx),%eax
xor    $0xffffffff,%eax
and    %eax,%edi
call   1030 <__setfpucw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trapfpe>:
mov    0x2ec9(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
mov    0x2e97(%rip),%rax
or     (%rax),%edi
mov    0x2e9e(%rip),%rax
or     (%rax),%edi
mov    0x2ead(%rip),%rax
not    %edi
and    (%rax),%edi
jmp    1030 <__setfpucw@plt>

LLVM IR (-O0):
@_FPU_DEFAULT = global i32 0
@_FPU_MASK_IM = global i32 0
@_FPU_MASK_ZM = global i32 0
@_FPU_MASK_OM = global i32 0
@_FPU_MASK_UM = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @trapfpe, i8* null }]
define void @trapfpe() {
%1 = load i32, i32* @_FPU_DEFAULT
%2 = load i32, i32* @_FPU_MASK_IM
%3 = load i32, i32* @_FPU_MASK_ZM
%4 = or i32 %2, %3
%5 = load i32, i32* @_FPU_MASK_OM
%6 = or i32 %4, %5
%7 = load i32, i32* @_FPU_MASK_UM
%8 = or i32 %6, %7
%9 = xor i32 %8, -1
%10 = and i32 %1, %9
%11 = call i32 @__setfpucw(i32 %10)
ret void
}

LLVM IR (-O2):
@_FPU_DEFAULT = global i32 0
@_FPU_MASK_IM = global i32 0
@_FPU_MASK_ZM = global i32 0
@_FPU_MASK_OM = global i32 0
@_FPU_MASK_UM = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @trapfpe, i8* null }]
define void @trapfpe() {
%1 = load i32, i32* @_FPU_DEFAULT
%2 = load i32, i32* @_FPU_MASK_IM
%3 = load i32, i32* @_FPU_MASK_ZM
%4 = or i32 %3, %2
%5 = load i32, i32* @_FPU_MASK_OM
%6 = or i32 %4, %5
%7 = load i32, i32* @_FPU_MASK_UM
%8 = or i32 %6, %7
%9 = xor i32 %8, -1
%10 = and i32 %1, %9
%11 = tail call i32 @__setfpucw(i32 %10)
ret void
}