xunge/DecIR huggingface dataset:
void pthread_rwlock_unlock() {}


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

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

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

LLVM IR (-O2):
define void @pthread_rwlock_unlock() {
ret void
}
int test_imm_D8uint8_reg(unsigned char val) {
  return ((val) & (0xD8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D8uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xd8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D8uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -40
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double dnrm2_(int *, double *, int *);
int main(int argc, char **argv) {
  int N = 3;
  double X[] = {1, 2, 3};
  int INCX = 1;
  double res = dnrm2_(&N, X, &INCX);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    0xecc(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec9(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x34(%rbp)
lea    -0x30(%rbp),%rsi
lea    -0x14(%rbp),%rdi
lea    -0x34(%rbp),%rdx
call   1030 <dnrm2_@plt>
movsd  %xmm0,-0x40(%rbp)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movl   $0x3,0xc(%rsp)
mov    0xeed(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x1,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <dnrm2_@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.X = [3 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [3 x double]
%8 = alloca i32
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 3, i32* %6
%10 = bitcast [3 x double]* %7 to i8*
store i32 1, i32* %8
%11 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%12 = call double @dnrm2_(i32* %6, double* %11, i32* %8)
store double %12, double* %9
ret i32 0
}

LLVM IR (-O2):
@__const.main.X = [3 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [3 x double]
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
store i32 3, i32* %3
%7 = bitcast [3 x double]* %4 to i8*
%8 = bitcast i32* %5 to i8*
store i32 1, i32* %5
%9 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%10 = call double @dnrm2_(i32* %3, double* %9, i32* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void usage(int argc, char **argv) {
  printf("Usage: %s v%s [version(x.y.z)] [index-to-increment] [increment-by]\n",
         argv[0], "0.2.2");
  printf("If '-' is passed as the version number, the version will be read "
         "from stdin.\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec3(%rip),%rdi
lea    0xf00(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rsi),%rsi
lea    0xec5(%rip),%rdi
lea    0xf02(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"Usage: %s v%s [version(x.y.z)] [index-to-increment] [increment-by]\0A\00"
@.str.1 = [6 x i8] c"0.2.2\00"
@.str.2 = [78 x i8] c"If '-' is passed as the version number, the version will be read from stdin.\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [68 x i8] c"Usage: %s v%s [version(x.y.z)] [index-to-increment] [increment-by]\0A\00"
@.str.1 = [6 x i8] c"0.2.2\00"
@EXIT_FAILURE = global i32 0
@str = [77 x i8] c"If '-' is passed as the version number, the version will be read from stdin.\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
void ft_striter(char *s, void (*f)(char *)) {
  if (f) {
    while (*s)
      f(s++);
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <ft_striter+0x4c>
jmp    1120 <ft_striter+0x20>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <ft_striter+0x47>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    %rdi,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
call   *%rax
jmp    1120 <ft_striter+0x20>
jmp    114c <ft_striter+0x4c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1133 <ft_striter+0x33>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1133 <ft_striter+0x33>
mov    %rsi,%r14
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
mov    %r15,%rbx
jne    1120 <ft_striter+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp eq void (i8*)* %1, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %9, %7 ], [ %0, %4 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
tail call void %1(i8* %8)
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %4, %2
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int clock_nanosleep(int /*<<< orphan*/, int /*<<< orphan*/,
                    struct timespec const *, struct timespec *);
int nanosleep(const struct timespec *requested, struct timespec *remaining) {
  int result = clock_nanosleep(CLOCK_REALTIME, 0, requested, remaining);
  return result ? -1 : 0;
}


x86 assembly (clang, -O0):
<nanosleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
call   1030 <clock_nanosleep@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanosleep>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <clock_nanosleep@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
%5 = alloca i32
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%6 = load i32, i32* @CLOCK_REALTIME
%7 = load %struct.timespec*, %struct.timespec** %3
%8 = load %struct.timespec*, %struct.timespec** %4
%9 = call i32 @clock_nanosleep(i32 %6, i32 0, %struct.timespec* %7, %struct.timespec* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 0
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = load i32, i32* @CLOCK_REALTIME
%4 = tail call i32 @clock_nanosleep(i32 %3, i32 0, %struct.timespec* %0, %struct.timespec* %1)
%5 = icmp ne i32 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
unsigned int tb_phys_hash_func(unsigned long pc) {
  return pc & ((1 << 15) - 1);
}


x86 assembly (clang, -O0):
<tb_phys_hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tb_phys_hash_func>:
mov    %rdi,%rax
and    $0x7fff,%eax
ret

LLVM IR (-O0):
define i32 @tb_phys_hash_func(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 32767
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @tb_phys_hash_func(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 32767
ret i32 %3
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_RenderingControl_SetBrightness(struct UPnPService *Service,
                                                    int ErrorCode, void *User) {
  printf(
      "RND Invoke Response: RenderingControl/SetBrightness[ErrorCode:%d]()\r\n",
      ErrorCode);
}


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

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [70 x i8] c"RND Invoke Response: RenderingControl/SetBrightness[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetBrightness(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [70 x i8] c"RND Invoke Response: RenderingControl/SetBrightness[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetBrightness(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
scalar_t__ __tolower(int);
wint_t towlower(wint_t wc) {
  int c;
  c = (int)wc;
  return ((wint_t)__tolower(c));
}


x86 assembly (clang, -O0):
<towlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <__tolower@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towlower>:
jmp    1030 <__tolower@plt>

LLVM IR (-O0):
define i64 @towlower(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i64 @__tolower(i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @towlower(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i64 @__tolower(i32 %2)
ret i64 %3
}
/* Variables and functions */
int strcmp(char const *, char const *);
int special_name_cmp(const char *a, const char *collkey_a, const char *b,
                     const char *collkey_b) {
  int cmp = (*a != '<') - (*b != '<');
  if (cmp)
    return cmp;
  return strcmp(collkey_a, collkey_b);
}


x86 assembly (clang, -O0):
<special_name_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    $0x3c,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     1167 <special_name_cmp+0x57>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <special_name_cmp+0x67>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<special_name_cmp>:
xor    %eax,%eax
cmpb   $0x3c,(%rdi)
setne  %al
xor    %edi,%edi
cmpb   $0x3c,(%rdx)
setne  %dil
sub    %edi,%eax
je     1126 <special_name_cmp+0x16>
ret
mov    %rsi,%rdi
mov    %rcx,%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @special_name_cmp(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3) {
%5 = load i8, i8* %0
%6 = icmp ne i8 %5, 60
%7 = zext i1 %6 to i32
%8 = load i8, i8* %2
%9 = icmp ne i8 %8, 60
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %7
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(1) %3)
br label %15
15: ; preds = %4, %13
%16 = phi i32 [ %14, %13 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
long fromMilli(long);
long toMilli(long);
long Add_minutes(long tm, long min) {
  long ms = toMilli(tm);
  long ma = min * 60000L;
  return fromMilli(ms + ma);
}


x86 assembly (clang, -O0):
<Add_minutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <toMilli@plt>
mov    %rax,-0x18(%rbp)
imul   $0xea60,-0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
add    -0x20(%rbp),%rdi
call   1040 <fromMilli@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Add_minutes>:
push   %rbx
mov    %rsi,%rbx
call   1030 <toMilli@plt>
imul   $0xea60,%rbx,%rdi
add    %rax,%rdi
pop    %rbx
jmp    1040 <fromMilli@plt>

LLVM IR (-O0):
define i64 @Add_minutes(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = call i64 @toMilli(i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %4
%10 = mul nsw i64 %9, 60000
store i64 %10, i64* %6
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = add nsw i64 %11, %12
%14 = call i64 @fromMilli(i64 %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @Add_minutes(i64 %0, i64 %1) {
%3 = tail call i64 @toMilli(i64 %0)
%4 = mul nsw i64 %1, 60000
%5 = add nsw i64 %3, %4
%6 = tail call i64 @fromMilli(i64 %5)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ factorialSum(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  printf("%lld\n", factorialSum(20));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = tail call i32 @factorialSum(i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  unsigned char port = 0x5a;
  unsigned char result_8 = (~port) >> 4;
  if (result_8 != 0xfa) {
    printf("UNSAFE\n");
    goto ERROR;
  }
  printf("SAFE\n");
  return (0);
ERROR:
  return (-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x5a,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
xor    $0xffffffff,%eax
sar    $0x4,%eax
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0xfa,%eax
je     1150 <main+0x40>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <main+0x58>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116f <main+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"UNSAFE\0A\00"
@.str.1 = [6 x i8] c"SAFE\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 90, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = xor i32 %5, -1
%7 = ashr i32 %6, 4
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp ne i32 %10, 250
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %17
16: ; preds = %12
store i32 -1, i32* %1
br label %17
17: ; preds = %16, %14
%18 = load i32, i32* %1
ret i32 %18
}

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


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

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

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

LLVM IR (-O2):
define void @ASN1_TYPE_free() {
ret void
}
/* Variables and functions */
int db_edit_playlist(char **, int, char *, char *);
int pi_db_edit_playlist(char **pe, int id, char *name, char *clause) {
  return db_edit_playlist(pe, id, name, clause);
}


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

x86 assembly (clang, -O2):
<pi_db_edit_playlist>:
jmp    1030 <db_edit_playlist@plt>

LLVM IR (-O0):
define i32 @pi_db_edit_playlist(i8** %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8**, i8*** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @db_edit_playlist(i8** %9, i32 %10, i8* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @pi_db_edit_playlist(i8** %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @db_edit_playlist(i8** %0, i32 %1, i8* %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
void *realloc(void *, size_t);
void *miniz_def_realloc_func(void *opaque, void *address, size_t items,
                             size_t size) {
  (void)opaque, (void)address, (void)items, (void)size;
  return realloc(address, items * size);
}


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

x86 assembly (clang, -O2):
<miniz_def_realloc_func>:
mov    %rsi,%rdi
imul   %rcx,%rdx
mov    %rdx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @miniz_def_realloc_func(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = load i64, i64* %8
%16 = mul i64 %14, %15
%17 = call i8* @realloc(i8* %13, i64 %16)
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @miniz_def_realloc_func(i8* nocapture readnone %0, i8* nocapture %1, i64 %2, i64 %3) {
%5 = mul i64 %3, %2
%6 = tail call i8* @realloc(i8* %1, i64 %5)
ret i8* %6
}
/* Variables and functions */
scalar_t__ bin_exists(char *);
int is_dropbear_client_enabled(void) {
  return (bin_exists("dbclient") && bin_exists("dropbearkey"));
}


x86 assembly (clang, -O0):
<is_dropbear_client_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <bin_exists@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     114c <is_dropbear_client_enabled+0x3c>
lea    0xecc(%rip),%rdi
call   1030 <bin_exists@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dropbear_client_enabled>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <bin_exists@plt>
test   %rax,%rax
je     113b <is_dropbear_client_enabled+0x2b>
lea    0xee0(%rip),%rdi
call   1030 <bin_exists@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"dbclient\00"
@.str.1 = [12 x i8] c"dropbearkey\00"
define i32 @is_dropbear_client_enabled() {
%1 = call i64 @bin_exists(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i64 @bin_exists(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"dbclient\00"
@.str.1 = [12 x i8] c"dropbearkey\00"
define i32 @is_dropbear_client_enabled() {
%1 = tail call i64 @bin_exists(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @bin_exists(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
char *strchr(char *, char);
char *ShiftP(char *p, char *q) { return strchr(p, '\n') + 1; }


x86 assembly (clang, -O0):
<ShiftP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShiftP>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ShiftP(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 = call i8* @strchr(i8* %5, i8 signext 10)
%7 = getelementptr inbounds i8, i8* %6, i64 1
ret i8* %7
}

LLVM IR (-O2):
define i8* @ShiftP(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%4 = getelementptr inbounds i8, i8* %3, i64 1
ret i8* %4
}
int foo7() { return 7; }


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

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

LLVM IR (-O0):
define i32 @foo7() {
ret i32 7
}

LLVM IR (-O2):
define i32 @foo7() {
ret i32 7
}
int str_diff(const char *a, const char *b) {
  unsigned int u = 0;
  char ch = 0;
  for (;; u++) {
    ch = a[u] - b[u];
    if (ch)
      break;
    if (a[u] == 0)
      break;
  }
  return ch;
}


x86 assembly (clang, -O0):
<str_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movb   $0x0,-0x15(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
movsbl (%rcx,%rdx,1),%ecx
sub    %ecx,%eax
mov    %al,-0x15(%rbp)
cmpb   $0x0,-0x15(%rbp)
je     1141 <str_diff+0x41>
jmp    116d <str_diff+0x6d>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    115a <str_diff+0x5a>
jmp    116d <str_diff+0x6d>
jmp    115f <str_diff+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <str_diff+0x17>
movsbl -0x15(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_diff>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%r8d
movzbl (%rdi,%r8,1),%edx
mov    %edx,%ecx
sub    (%rsi,%r8,1),%cl
test   %dl,%dl
je     1129 <str_diff+0x29>
add    $0x1,%eax
test   %cl,%cl
je     1110 <str_diff+0x10>
movsbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @str_diff(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %14, %3 ]
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 %5
%9 = load i8, i8* %8
%10 = sub i8 %7, %9
%11 = icmp ne i8 %10, 0
%12 = icmp eq i8 %7, 0
%13 = or i1 %12, %11
%14 = add i32 %4, 1
br i1 %13, label %15, label %3
15: ; preds = %3
%16 = sext i8 %10 to i32
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("Usage:");
  puts("\tnum_count <datafile> [num1] [num2] ...");
  return;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Usage:\00"
@.str.1 = [40 x i8] c"\09num_count <datafile> [num1] [num2] ...\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Usage:\00"
@.str.1 = [40 x i8] c"\09num_count <datafile> [num1] [num2] ...\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ is_space(char const);
char *__skip_space(const char *s) {
  while (is_space(*s))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<__skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_space@plt>
cmp    $0x0,%rax
je     1143 <__skip_space+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <__skip_space+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__skip_space>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <is_space@plt>
test   %rax,%rax
jne    1120 <__skip_space+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @__skip_space(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @is_space(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int max2(int, int);
int max3(int a, int b, int c) { return max2(max2(a, b), c); }


x86 assembly (clang, -O0):
<max3>:
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
call   1030 <max2@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <max2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
push   %rbx
mov    %edx,%ebx
call   1030 <max2@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <max2@plt>

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

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @max2(i32 %0, i32 %1)
%5 = tail call i32 @max2(i32 %4, i32 %2)
ret i32 %5
}
void nop_pre_undefine(char *definition) { (void)definition; }


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

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

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

LLVM IR (-O2):
define void @nop_pre_undefine(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_rx_wait();
void wait(void) { __builtin_rx_wait(); }


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

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

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

LLVM IR (-O2):
define void @wait() {
%1 = tail call i32 (...) @__builtin_rx_wait()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2cWrite(int, int, int);
void bmp085_start_ut(void) { i2cWrite(0x77, 0xF4, 0x2E); }


x86 assembly (clang, -O0):
<bmp085_start_ut>:
push   %rbp
mov    %rsp,%rbp
mov    $0x77,%edi
mov    $0xf4,%esi
mov    $0x2e,%edx
call   1030 <i2cWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmp085_start_ut>:
mov    $0x77,%edi
mov    $0xf4,%esi
mov    $0x2e,%edx
jmp    1030 <i2cWrite@plt>

LLVM IR (-O0):
define void @bmp085_start_ut() {
%1 = call i32 @i2cWrite(i32 119, i32 244, i32 46)
ret void
}

LLVM IR (-O2):
define void @bmp085_start_ut() {
%1 = tail call i32 @i2cWrite(i32 119, i32 244, i32 46)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorExit(char *, char *);
void Check_append_only(int argc, char **argv) {
  if (argc > 4) {
    if (argc == 5)
      return;
    PrintErrorExit(argv[0], "Append Only");
  }
  PrintErrorExit(argv[0], "Append Only : missing Yes / No");
}


x86 assembly (clang, -O0):
<Check_append_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x4(%rbp)
jle    114b <Check_append_only+0x3b>
cmpl   $0x5,-0x4(%rbp)
jne    1138 <Check_append_only+0x28>
jmp    115e <Check_append_only+0x4e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeba(%rip),%rsi
call   1030 <PrintErrorExit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <PrintErrorExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Check_append_only>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x5,%edi
jl     112c <Check_append_only+0x1c>
jne    111d <Check_append_only+0xd>
pop    %rbx
ret
mov    (%rbx),%rdi
lea    0xed9(%rip),%rsi
call   1030 <PrintErrorExit@plt>
mov    (%rbx),%rdi
lea    0xed6(%rip),%rsi
pop    %rbx
jmp    1030 <PrintErrorExit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Append Only\00"
@.str.1 = [31 x i8] c"Append Only : missing Yes / No\00"
define void @Check_append_only(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 4
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 5
br i1 %9, label %10, label %11
10: ; preds = %7
br label %21
11: ; preds = %7
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @PrintErrorExit(i8* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %11, %2
%17 = load i8**, i8*** %4
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @PrintErrorExit(i8* %19, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %16, %10
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Append Only\00"
@.str.1 = [31 x i8] c"Append Only : missing Yes / No\00"
define void @Check_append_only(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 4
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = icmp eq i32 %0, 5
br i1 %5, label %12, label %6
6: ; preds = %4
%7 = load i8*, i8** %1
%8 = tail call i32 @PrintErrorExit(i8* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %2
%10 = load i8*, i8** %1
%11 = tail call i32 @PrintErrorExit(i8* %10, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %4, %9
ret void
}
unsigned bitCount_fun_long(long x) {
  unsigned r = x & 1;
  for (x = x >> 1 & 0x7fffffffffl; x; x >>= 1)
    r += x & 1;
  return r;
}


x86 assembly (clang, -O0):
<bitCount_fun_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
movabs $0x7fffffffff,%rcx
and    %rcx,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <bitCount_fun_long+0x59>
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
mov    -0xc(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <bitCount_fun_long+0x2c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitCount_fun_long>:
mov    %edi,%eax
and    $0x1,%eax
shr    %rdi
movabs $0x7fffffffff,%rcx
and    %rdi,%rcx
je     1133 <bitCount_fun_long+0x33>
mov    %rcx,%rdx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%esi
and    $0x1,%esi
add    %esi,%eax
shr    %rdx
cmp    $0x1,%rcx
mov    %rdx,%rcx
ja     1120 <bitCount_fun_long+0x20>
ret

LLVM IR (-O0):
define i32 @bitCount_fun_long(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 1
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i64, i64* %2
%8 = ashr i64 %7, 1
%9 = and i64 %8, 549755813887
store i64 %9, i64* %2
br label %10
10: ; preds = %20, %1
%11 = load i64, i64* %2
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i64, i64* %2
%15 = and i64 %14, 1
%16 = load i32, i32* %3
%17 = zext i32 %16 to i64
%18 = add nsw i64 %17, %15
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %13
%21 = load i64, i64* %2
%22 = ashr i64 %21, 1
store i64 %22, i64* %2
br label %10
23: ; preds = %10
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @bitCount_fun_long(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 1
%4 = lshr i64 %0, 1
%5 = and i64 %4, 549755813887
%6 = icmp eq i64 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %1, %7
%8 = phi i32 [ %12, %7 ], [ %3, %1 ]
%9 = phi i64 [ %13, %7 ], [ %5, %1 ]
%10 = trunc i64 %9 to i32
%11 = and i32 %10, 1
%12 = add i32 %11, %8
%13 = lshr i64 %9, 1
%14 = icmp ult i64 %9, 2
br i1 %14, label %15, label %7
15: ; preds = %7, %1
%16 = phi i32 [ %3, %1 ], [ %12, %7 ]
ret i32 %16
}
void f(void) {
  int i, j, k;
  int **a;
#pragma hlt interchange permutation(2, 1)
  for (i = 0; i < 100; i++) {
    k = 3;
    for (j = 0; j < 200; j++) {
      a[i][j] = i + j;
    }
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    116a <f+0x6a>
movl   $0x3,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jge    1157 <f+0x57>
mov    -0x4(%rbp),%edx
add    -0x8(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1123 <f+0x23>
jmp    115c <f+0x5c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f+0xb>
pop    %rbp
ret

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

LLVM IR (-O2):
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double getWallTime() {
  struct timeval time;
  if (gettimeofday(&time, NULL)) {
    return 0;
  }
  return (double)time.tv_sec + (double)time.tv_usec * 0.000001;
}


x86 assembly (clang, -O0):
<getWallTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     113c <getWallTime+0x2c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115d <getWallTime+0x4d>
cvtsi2sdq -0x10(%rbp),%xmm1
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getWallTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
je     112d <getWallTime+0x1d>
xorps  %xmm0,%xmm0
add    $0x18,%rsp
ret
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xebd(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @getWallTime() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store double 0.000000e+00, double* %1
br label %14
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double %12, double 0x3EB0C6F7A0B5ED8D, double %9)
store double %13, double* %1
br label %14
14: ; preds = %6, %5
%15 = load double, double* %1
ret double %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @getWallTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %8)
br label %13
13: ; preds = %0, %5
%14 = phi double [ %12, %5 ], [ 0.000000e+00, %0 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ assert_quantifier(char const *, int, int /*<<< orphan*/,
                                     int /*<<< orphan*/, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
void assert_quantifier_error(char const *p) {
  assert_quantifier(p, -1, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<assert_quantifier_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <assert_quantifier@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_quantifier_error>:
mov    $0xffffffff,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <assert_quantifier@plt>

LLVM IR (-O0):
define void @assert_quantifier_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert_quantifier(i8* %3, i32 -1, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @assert_quantifier_error(i8* %0) {
%2 = tail call i32 @assert_quantifier(i8* %0, i32 -1, i32 0, i32 0, i32 0, i32 0)
ret void
}