xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  unsigned long tv_sec;
  unsigned long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long gettime() {
  struct timespec ts;
  clock_gettime(CLOCK_REALTIME, &ts);
  return ts.tv_sec * (1000000000ul) + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @gettime() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @gettime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %7, %9
ret i64 %10
}
int fib_rec(int n) {
  int prev_val, val;
  if (n <= 2)
    return 1;
  prev_val = fib_rec(n - 2);
  val = fib_rec(n - 1);
  return prev_val + val;
}


x86 assembly (clang, -O0):
<fib_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     1131 <fib_rec+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1156 <fib_rec+0x46>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib_rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib_rec@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib_rec>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jl     1145 <fib_rec+0x35>
mov    %edi,%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib_rec@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
ja     1130 <fib_rec+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib_rec(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -2
%7 = tail call i32 @fib_rec(i32 %6)
%8 = add nsw i32 %4, -1
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr,
          "usage: %s [-o <output-file>] [-d <delayamt>] [-b <brightnesscap>] "
          "[-t] <file>\n",
          name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [79 x i8] c"usage: %s [-o <output-file>] [-d <delayamt>] [-b <brightnesscap>] [-t] <file>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [79 x i8] c"usage: %s [-o <output-file>] [-d <delayamt>] [-b <brightnesscap>] [-t] <file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_close_file();
int /*<<< orphan*/ log_close_syslog();
void log_close_all(void) {
  log_close_file();
  log_close_syslog();
  return;
}


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

x86 assembly (clang, -O2):
<log_close_all>:
push   %rax
xor    %eax,%eax
call   1030 <log_close_file@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <log_close_syslog@plt>

LLVM IR (-O0):
define void @log_close_all() {
%1 = call i32 (...) @log_close_file()
%2 = call i32 (...) @log_close_syslog()
ret void
}

LLVM IR (-O2):
define void @log_close_all() {
%1 = tail call i32 (...) @log_close_file()
%2 = tail call i32 (...) @log_close_syslog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void *malloc(size_t);
void *umalloc(size_t s) {
  void *p = malloc(s);
  if (!p)
    die("umalloc(%ld)", s);
  return p;
}


x86 assembly (clang, -O0):
<umalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <umalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <umalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"umalloc(%ld)\00"
define noalias i8* @umalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int fun300() { return 300; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x12c,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x12c,%eax
ret

LLVM IR (-O0):
define i32 @fun300() {
ret i32 300
}

LLVM IR (-O2):
define i32 @fun300() {
ret i32 300
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
gen_unsigned_less_than() {
  gen_pop();
  gen_call("ccult");
}


x86 assembly (clang, -O0):
<gen_unsigned_less_than>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xeca(%rip),%rdi
call   1040 <gen_call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_unsigned_less_than>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ccult\00"
define i32 @gen_unsigned_less_than() {
%1 = alloca i32
%2 = call i32 (...) @gen_pop()
%3 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccult\00"
define i32 @gen_unsigned_less_than() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
unsigned int up2power_aux(const unsigned int number) {
  if (number == 0)
    return 0;
  else
    return (1 + up2power_aux(number / 2));
}


x86 assembly (clang, -O0):
<up2power_aux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <up2power_aux+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1142 <up2power_aux+0x32>
mov    -0x8(%rbp),%edi
shr    $0x1,%edi
call   1030 <up2power_aux@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<up2power_aux>:
xor    %eax,%eax
test   %edi,%edi
je     111c <up2power_aux+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <up2power_aux+0x10>
ret

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

LLVM IR (-O2):
define i32 @up2power_aux(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = lshr i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = icmp ult i32 %4, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, double);
scalar_t__ strlen(char *);
int cvtDoubleToExpString(double f_value, char *pstr_value,
                         unsigned short f_precision) {
  sprintf(pstr_value, "%.*e", (int)f_precision, f_value);
  return ((int)strlen(pstr_value));
}


x86 assembly (clang, -O0):
<cvtDoubleToExpString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
movzwl -0x12(%rbp),%edx
movsd  -0x8(%rbp),%xmm0
lea    0xeb4(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvtDoubleToExpString>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xed3(%rip),%rsi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%.*e\00"
define i32 @cvtDoubleToExpString(double %0, i8* %1, i16 zeroext %2) {
%4 = alloca double
%5 = alloca i8*
%6 = alloca i16
store double %0, double* %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%7 = load i8*, i8** %5
%8 = load i16, i16* %6
%9 = zext i16 %8 to i32
%10 = load double, double* %4
%11 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9, double %10)
%12 = load i8*, i8** %5
%13 = call i64 @strlen(i8* %12)
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.*e\00"
define i32 @cvtDoubleToExpString(double %0, i8* nocapture %1, i16 zeroext %2) {
%4 = zext i16 %2 to i32
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4, double %0)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%7 = trunc i64 %6 to i32
ret i32 %7
}
void f126(void) {
a:
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    goto a;
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f126>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    1104 <f126+0x4>

x86 assembly (clang, -O2):
<f126>:
jmp    1100 <f126>

LLVM IR (-O0):
define void @f126() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
br label %6
6: ; preds = %6, %0
store i32 0, i32* %1
%7 = load i32, i32* %1
store i32 0, i32* %2
%8 = load i32, i32* %2
store i32 0, i32* %3
%9 = load i32, i32* %3
store i32 0, i32* %4
%10 = load i32, i32* %4
br label %6
}

LLVM IR (-O2):
define void @f126() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct vioDevice {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int compareDevice(struct device *, struct device *);
int vioCompareDevice(struct vioDevice *dev1, struct vioDevice *dev2) {
  return compareDevice((struct device *)dev1, (struct device *)dev2);
}


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

x86 assembly (clang, -O2):
<vioCompareDevice>:
jmp    1030 <compareDevice@plt>

LLVM IR (-O0):
%struct.vioDevice = type { i32 }
%struct.device = type { i32 }
define i32 @vioCompareDevice(%struct.vioDevice* %0, %struct.vioDevice* %1) {
%3 = alloca %struct.vioDevice*
%4 = alloca %struct.vioDevice*
store %struct.vioDevice* %0, %struct.vioDevice** %3
store %struct.vioDevice* %1, %struct.vioDevice** %4
%5 = load %struct.vioDevice*, %struct.vioDevice** %3
%6 = bitcast %struct.vioDevice* %5 to %struct.device*
%7 = load %struct.vioDevice*, %struct.vioDevice** %4
%8 = bitcast %struct.vioDevice* %7 to %struct.device*
%9 = call i32 @compareDevice(%struct.device* %6, %struct.device* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.vioDevice = type { i32 }
%struct.device = type { i32 }
define i32 @vioCompareDevice(%struct.vioDevice* %0, %struct.vioDevice* %1) {
%3 = bitcast %struct.vioDevice* %0 to %struct.device*
%4 = bitcast %struct.vioDevice* %1 to %struct.device*
%5 = tail call i32 @compareDevice(%struct.device* %3, %struct.device* %4)
ret i32 %5
}
MOD(unsigned i) { return i % 4; }


x86 assembly (clang, -O0):
<MOD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MOD>:
mov    %edi,%eax
and    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @MOD(i32 %0) {
%2 = and i32 %0, 3
ret i32 %2
}
void __clear_cache(void *begin, void *end) {}


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

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

LLVM IR (-O0):
define void @__clear_cache(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__clear_cache(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void lora_cbk(char *response) {}


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

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

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

LLVM IR (-O2):
define void @lora_cbk(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ system(char *);
int anotherfunction(char *argument) {
  printf("ARGUMENTO: %p\n", &argument);
  printf("ARGUMENTO: %s\n", argument);
  system(argument);
}


x86 assembly (clang, -O0):
<anotherfunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anotherfunction>:
push   %rax
mov    %rdi,(%rsp)
lea    0xed4(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%rsi
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%rdi
call   1030 <system@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"ARGUMENTO: %p\0A\00"
@.str.1 = [15 x i8] c"ARGUMENTO: %s\0A\00"
define i32 @anotherfunction(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2)
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @system(i8* %6)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA_CTX;

/* Variables and functions */
int SHA1_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  SHA_CTX sha_ctx;
  int result;
  result = SHA1_Init(&sha_ctx);
  if (result == 1) {
    printf("SHA1_Init success!\n");
  } else {
    printf("SHA1_Init error!\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <SHA1_Init@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1156 <main+0x36>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <main+0x4e>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <main+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1040 <SHA1_Init@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
setne  %bl
lea    0xed3(%rip),%rax
lea    0xebb(%rip),%rdi
cmove  %rax,%rdi
neg    %ebx
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [17 x i8] c"SHA1_Init error!\00"
@str.2 = [19 x i8] c"SHA1_Init success!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @SHA1_Init(i32* %1)
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0)
%6 = xor i1 %4, true
%7 = sext i1 %6 to i32
%8 = call i32 @puts(i8* dereferenceable(1) %5)
ret i32 %7
}
long FlashUserGet(unsigned long *pulUser0, unsigned long *pulUser1) {
  ;
  ;
  if (((((*((volatile unsigned long *)(0x400FE000))) & 0x70000000) ==
        0x00000000) ||
       (((*((volatile unsigned long *)(0x400FE000))) &
         (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00000000)))) {
    return (-1);
  }
  *pulUser0 = (*((volatile unsigned long *)(0x400FE1E0)));
  *pulUser1 = (*((volatile unsigned long *)(0x400FE1E4)));
  return (0);
}


x86 assembly (clang, -O0):
<FlashUserGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70000000,%rax
cmp    $0x0,%rax
je     113e <FlashUserGet+0x3e>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10000000,%rax
jne    114b <FlashUserGet+0x4b>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1171 <FlashUserGet+0x71>
mov    $0x400fe1e0,%eax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x400fe1e4,%eax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashUserGet>:
mov    $0xffffffffffffffff,%rax
testq  $0x70000000,0x400fe000
je     1143 <FlashUserGet+0x43>
mov    0x400fe000,%rcx
40
and    $0x70ff0000,%ecx
cmp    $0x10000000,%ecx
je     1143 <FlashUserGet+0x43>
mov    0x400fe1e0,%rax
40
mov    %rax,(%rdi)
mov    0x400fe1e4,%rax
40
mov    %rax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @FlashUserGet(i64* %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
%6 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%7 = and i64 %6, 1879048192
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%11 = and i64 %10, 1895759872
%12 = icmp eq i64 %11, 268435456
br i1 %12, label %13, label %14
13: ; preds = %9, %2
store i64 -1, i64* %3
br label %19
14: ; preds = %9
%15 = load volatile i64, i64* inttoptr (i64 1074782688 to i64*)
%16 = load i64*, i64** %4
store i64 %15, i64* %16
%17 = load volatile i64, i64* inttoptr (i64 1074782692 to i64*)
%18 = load i64*, i64** %5
store i64 %17, i64* %18
store i64 0, i64* %3
br label %19
19: ; preds = %14, %13
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @FlashUserGet(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
%3 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%4 = and i64 %3, 1879048192
%5 = icmp eq i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%8 = and i64 %7, 1895759872
%9 = icmp eq i64 %8, 268435456
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = load volatile i64, i64* inttoptr (i64 1074782688 to i64*)
store i64 %11, i64* %0
%12 = load volatile i64, i64* inttoptr (i64 1074782692 to i64*)
store i64 %12, i64* %1
br label %13
13: ; preds = %2, %6, %10
%14 = phi i64 [ 0, %10 ], [ -1, %6 ], [ -1, %2 ]
ret i64 %14
}
int stub_ast_check_signature(struct ast_key *key, const char *msg,
                             const char *sig) {
  ast_log(2,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/"
          "master/cryptostub.c",
          37, __PRETTY_FUNCTION__, "Crypto support not loaded!\n");
  return -1;
}


x86 assembly (clang, -O0):
<stub_ast_check_signature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
mov    $0x25,%edx
lea    0xf5b(%rip),%rcx
lea    0xf9f(%rip),%r8
mov    $0x0,%al
call   1030 <ast_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stub_ast_check_signature>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xf78(%rip),%rcx
lea    0xfbc(%rip),%r8
mov    $0x2,%edi
mov    $0x25,%edx
xor    %eax,%eax
call   1030 <ast_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ast_key = type opaque
@.str = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/master/cryptostub.c\00"
@__PRETTY_FUNCTION__.stub_ast_check_signature = [75 x i8] c"int stub_ast_check_signature(struct ast_key *, const char *, const char *)\00"
@.str.1 = [28 x i8] c"Crypto support not loaded!\0A\00"
define i32 @stub_ast_check_signature(%struct.ast_key* %0, i8* %1, i8* %2) {
%4 = alloca %struct.ast_key*
%5 = alloca i8*
%6 = alloca i8*
store %struct.ast_key* %0, %struct.ast_key** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 (i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @ast_log to i32 (i32, i8*, i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i32 37, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @__PRETTY_FUNCTION__.stub_ast_check_signature, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.ast_key = type opaque
@.str = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/master/cryptostub.c\00"
@__PRETTY_FUNCTION__.stub_ast_check_signature = [75 x i8] c"int stub_ast_check_signature(struct ast_key *, const char *, const char *)\00"
@.str.1 = [28 x i8] c"Crypto support not loaded!\0A\00"
define i32 @stub_ast_check_signature(%struct.ast_key* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @ast_log to i32 (i32, i8*, i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i32 37, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @__PRETTY_FUNCTION__.stub_ast_check_signature, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int __close(int);
int close(int fd) { return __close(fd); }


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

x86 assembly (clang, -O2):
<close>:
jmp    1030 <__close@plt>

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @__close(i32 %0)
ret i32 %2
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int off_t;

/* Variables and functions */
scalar_t__ fstat(int, struct stat *);
off_t ffile_size(int fd) {
  struct stat st;
  if (fstat(fd, &st) == 0)
    return st.st_size;
  return -1;
}


x86 assembly (clang, -O0):
<ffile_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <fstat@plt>
cmp    $0x0,%rax
jne    113c <ffile_size+0x2c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <ffile_size+0x33>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffile_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @ffile_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @fstat(i32 %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @ffile_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
/* Variables and functions */
int lengthOfLastWord(char *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  char *s1 = "hello world";
  char *s2 = " hello world    ";
  printf("%d\t%d\n", lengthOfLastWord(s1), lengthOfLastWord(s2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <lengthOfLastWord@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <lengthOfLastWord@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <lengthOfLastWord@plt>
mov    %eax,%ebx
lea    0xed6(%rip),%rdi
call   1030 <lengthOfLastWord@plt>
lea    0xedb(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [17 x i8] c" hello world \00"
@.str.2 = [7 x i8] c"%d\09%d\0A\00"
define i32 @main() {
%1 = tail call i32 @lengthOfLastWord(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @lengthOfLastWord(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
gen_add(lval, lval2) int *lval, *lval2;
{
  gen_pop();
  if (dbltest(lval2, lval)) {
    gen_swap();
    gen_multiply_by_two();
    gen_swap();
  }
  output_line("dad \td");
}


x86 assembly (clang, -O0):
<gen_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1030 <gen_pop@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1070 <dbltest@plt>
cmp    $0x0,%eax
je     1194 <gen_add+0x44>
mov    $0x0,%al
call   1040 <gen_swap@plt>
mov    $0x0,%al
call   1060 <gen_multiply_by_two@plt>
mov    $0x0,%al
call   1040 <gen_swap@plt>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1050 <output_line@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <gen_pop@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <dbltest@plt>
test   %eax,%eax
je     1187 <gen_add+0x37>
xor    %eax,%eax
call   1040 <gen_swap@plt>
xor    %eax,%eax
call   1060 <gen_multiply_by_two@plt>
xor    %eax,%eax
call   1040 <gen_swap@plt>
lea    0xe72(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <output_line@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"dad \09d\00"
define i32 @gen_add(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%6 = call i32 (...) @gen_pop()
%7 = load i32*, i32** %5
%8 = load i32*, i32** %4
%9 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @dbltest to i32 (i32*, i32*, ...)*)(i32* %7, i32* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 (...) @gen_swap()
%13 = call i32 (...) @gen_multiply_by_two()
%14 = call i32 (...) @gen_swap()
br label %15
15: ; preds = %11, %2
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @output_line to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [7 x i8] c"dad \09d\00"
define i32 @gen_add(i32* %0, i32* %1) {
%3 = tail call i32 (...) @gen_pop()
%4 = tail call i32 (i32*, i32*, ...) bitcast (i32 (...)* @dbltest to i32 (i32*, i32*, ...)*)(i32* %1, i32* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 (...) @gen_swap()
%8 = tail call i32 (...) @gen_multiply_by_two()
%9 = tail call i32 (...) @gen_swap()
br label %10
10: ; preds = %6, %2
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @output_line to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double stdlib_strided_dsumkbn(int /*<<< orphan*/ const, double const *,
                              int /*<<< orphan*/ const);
double stdlib_strided_dsum(const int64_t N, const double *X,
                           const int64_t stride) {
  return stdlib_strided_dsumkbn(N, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_dsum>:
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 <stdlib_strided_dsumkbn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dsum>:
jmp    1030 <stdlib_strided_dsumkbn@plt>

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

LLVM IR (-O2):
define double @stdlib_strided_dsum(i32 %0, double* %1, i32 %2) {
%4 = tail call double @stdlib_strided_dsumkbn(i32 %0, double* %1, i32 %2)
ret double %4
}
/* Variables and functions */
int a_fun();
int /*<<< orphan*/ does_it_work();
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int main(void) {
  if (strcmp(does_it_work(), "yes it does") != 0) {
    return -a_fun();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <does_it_work@plt>
mov    %eax,%edi
lea    0xeb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1173 <main+0x43>
mov    $0x0,%al
call   1030 <a_fun@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <main+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <does_it_work@plt>
lea    0xebf(%rip),%rsi
mov    %eax,%edi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1158 <main+0x28>
xor    %eax,%eax
call   1030 <a_fun@plt>
mov    %eax,%ebx
neg    %ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"yes it does\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @does_it_work()
%3 = call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 (...) @a_fun()
%7 = sub nsw i32 0, %6
store i32 %7, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [12 x i8] c"yes it does\00"
define i32 @main() {
%1 = tail call i32 (...) @does_it_work()
%2 = tail call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 (...) @a_fun()
%6 = sub nsw i32 0, %5
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ %6, %4 ], [ 0, %0 ]
ret i32 %8
}
int putchar(const int ic) { return ic; }


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

x86 assembly (clang, -O2):
<putchar>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
char ToUpper(char);
void ToUpperRead(char *r, int readLength) {
  int i;
  for (i = 0; i < readLength; i++) {
    r[i] = ToUpper(r[i]);
  }
}


x86 assembly (clang, -O0):
<ToUpperRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <ToUpperRead+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ToUpper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ToUpperRead+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToUpperRead>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <ToUpperRead+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <ToUpper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <ToUpperRead+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ToUpperRead(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @ToUpper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
int /*<<< orphan*/ u_free(void *, unsigned int);
void *u_malloc(unsigned int);
void *u_realloc(void *addr, unsigned int old_size, unsigned int new_size) {
  void *addr2 = u_malloc(new_size);
  memcpy(addr2, addr, (new_size < old_size ? new_size : old_size));
  u_free(addr, old_size);
  return addr2;
}


x86 assembly (clang, -O0):
<u_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <u_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1175 <u_realloc+0x45>
mov    -0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    117b <u_realloc+0x4b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <u_free@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_realloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %edx,%edi
call   1030 <u_malloc@plt>
mov    %rax,%r15
cmp    %ebp,%ebx
cmovae %ebp,%ebx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1050 <u_free@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @u_realloc(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i8* @u_malloc(i32 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = icmp ult i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load i32, i32* %6
br label %19
17: ; preds = %3
%18 = load i32, i32* %5
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ %18, %17 ]
%21 = call i32 @memcpy(i8* %10, i8* %11, i32 %20)
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = call i32 @u_free(i8* %22, i32 %23)
%25 = load i8*, i8** %7
ret i8* %25
}

LLVM IR (-O2):
define i8* @u_realloc(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @u_malloc(i32 %2)
%5 = icmp ult i32 %2, %1
%6 = select i1 %5, i32 %2, i32 %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %6)
%8 = tail call i32 @u_free(i8* %0, i32 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ cblas_dcopy(int const, double const *, int const, double *,
                               int const);
void c_dcopy(const int N, const double *X, const int strideX, double *Y,
             const int strideY) {
  cblas_dcopy(N, X, strideX, Y, strideY);
}


x86 assembly (clang, -O0):
<c_dcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <cblas_dcopy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_dcopy>:
jmp    1030 <cblas_dcopy@plt>

LLVM IR (-O0):
define void @c_dcopy(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store i32 %2, i32* %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load double*, double** %7
%13 = load i32, i32* %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call i32 @cblas_dcopy(i32 %11, double* %12, i32 %13, double* %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @c_dcopy(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = tail call i32 @cblas_dcopy(i32 %0, double* %1, i32 %2, double* %3, i32 %4)
ret void
}
int test_imm_99uint16_mem(unsigned short *val) {
  return ((*val) & (-0x99 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_99uint16_mem>:
movzwl (%rdi),%eax
test   $0xff67,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_99uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -153
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((__weak__, __always___)) void softboundmpx_abort() { abort(); }


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

x86 assembly (clang, -O2):
<softboundmpx_abort>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define weak void @softboundmpx_abort() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define weak void @softboundmpx_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int isLoopback(uint32_t prefix) {
  return ((((long int)(prefix)) & 0xff000000) == 0x7f000000);
}


x86 assembly (clang, -O0):
<isLoopback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xff000000,%rax
and    -0x8(%rbp),%rax
cmp    $0x7f000000,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLoopback>:
and    $0xff000000,%edi
xor    %eax,%eax
cmp    $0x7f000000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isLoopback(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4278190080
%5 = icmp eq i64 %4, 2130706432
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isLoopback(i64 %0) {
%2 = and i64 %0, 4278190080
%3 = icmp eq i64 %2, 2130706432
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ UTF8_putc(int /*<<< orphan*/ *, int, unsigned long);
int out_utf8(unsigned long value, void *arg) {
  int *outlen;
  outlen = arg;
  *outlen += UTF8_putc(NULL, -1, value);
  return 1;
}


x86 assembly (clang, -O0):
<out_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffffffff,%esi
call   1030 <UTF8_putc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_utf8>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <UTF8_putc@plt>
add    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @out_utf8(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i32*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i64, i64* %3
%9 = call i64 @UTF8_putc(i32* null, i32 -1, i64 %8)
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = add nsw i64 %12, %9
%14 = trunc i64 %13 to i32
store i32 %14, i32* %10
ret i32 1
}

LLVM IR (-O2):
define i32 @out_utf8(i64 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i64 @UTF8_putc(i32* null, i32 -1, i64 %0)
%5 = load i32, i32* %3
%6 = trunc i64 %4 to i32
%7 = add i32 %5, %6
store i32 %7, i32* %3
ret i32 1
}
int init_btnNext() { return 0; }


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

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

LLVM IR (-O0):
define i32 @init_btnNext() {
ret i32 0
}

LLVM IR (-O2):
define i32 @init_btnNext() {
ret i32 0
}