xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "%s <oldfile> <newfile>\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [24 x i8] c"%s <oldfile> <newfile>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [24 x i8] c"%s <oldfile> <newfile>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
struct passwd {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int ENOENT;
int NSS_STATUS_NOTFOUND;
enum nss_status _nss_noenum_getpwnam_r(const char *name, struct passwd *result,
                                       char *buf, size_t buflen, int *errnop) {
  *errnop = ENOENT;
  return NSS_STATUS_NOTFOUND;
}


x86 assembly (clang, -O0):
<_nss_noenum_getpwnam_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_noenum_getpwnam_r>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%r8)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
@ENOENT = global i32 0
@NSS_STATUS_NOTFOUND = global i32 0
define i32 @_nss_noenum_getpwnam_r(i8* %0, %struct.passwd* %1, i8* %2, i64 %3, i32* %4) {
%6 = alloca i8*
%7 = alloca %struct.passwd*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32*
store i8* %0, i8** %6
store %struct.passwd* %1, %struct.passwd** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32* %4, i32** %10
%11 = load i32, i32* @ENOENT
%12 = load i32*, i32** %10
store i32 %11, i32* %12
%13 = load i32, i32* @NSS_STATUS_NOTFOUND
ret i32 %13
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@ENOENT = global i32 0
@NSS_STATUS_NOTFOUND = global i32 0
define i32 @_nss_noenum_getpwnam_r(i8* nocapture readnone %0, %struct.passwd* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, i32* nocapture writeonly %4) {
%6 = load i32, i32* @ENOENT
store i32 %6, i32* %4
%7 = load i32, i32* @NSS_STATUS_NOTFOUND
ret i32 %7
}
/* Type definitions */
struct reb_simulation {
  int dummy;
};

/* Variables and functions */
scalar_t__ reb_output_check(struct reb_simulation *, int);
int /*<<< orphan*/ reb_output_orbits(struct reb_simulation *, char *);
int /*<<< orphan*/ reb_output_timing(struct reb_simulation *,
                                     int /*<<< orphan*/);
void heartbeat(struct reb_simulation *r) {
  if (reb_output_check(r, 20. * 3.14159265358979323846)) {
    reb_output_timing(r, 0);
    reb_output_orbits(r, "orbit.txt");
  }
}


x86 assembly (clang, -O0):
<heartbeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3e,%esi
call   1050 <reb_output_check@plt>
cmp    $0x0,%rax
je     116f <heartbeat+0x3f>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <reb_output_timing@plt>
mov    -0x8(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1040 <reb_output_orbits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heartbeat>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3e,%esi
call   1050 <reb_output_check@plt>
test   %rax,%rax
je     115d <heartbeat+0x2d>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <reb_output_timing@plt>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <reb_output_orbits@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.reb_simulation = type { i32 }
@.str = [10 x i8] c"orbit.txt\00"
define void @heartbeat(%struct.reb_simulation* %0) {
%2 = alloca %struct.reb_simulation*
store %struct.reb_simulation* %0, %struct.reb_simulation** %2
%3 = load %struct.reb_simulation*, %struct.reb_simulation** %2
%4 = call i64 @reb_output_check(%struct.reb_simulation* %3, i32 62)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load %struct.reb_simulation*, %struct.reb_simulation** %2
%8 = call i32 @reb_output_timing(%struct.reb_simulation* %7, i32 0)
%9 = load %struct.reb_simulation*, %struct.reb_simulation** %2
%10 = call i32 @reb_output_orbits(%struct.reb_simulation* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.reb_simulation = type { i32 }
@.str = [10 x i8] c"orbit.txt\00"
define void @heartbeat(%struct.reb_simulation* %0) {
%2 = tail call i64 @reb_output_check(%struct.reb_simulation* %0, i32 62)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @reb_output_timing(%struct.reb_simulation* %0, i32 0)
%6 = tail call i32 @reb_output_orbits(%struct.reb_simulation* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(short *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int nBit(char *filename) {
  FILE *fp;
  short short_var;
  int n, nBit;
  fp = fopen(filename, "r");
  fseek(fp, 28, 0);
  n = fread(&short_var, sizeof(short), 1, fp);
  nBit = short_var;
  fclose(fp);
  return nBit;
}


x86 assembly (clang, -O0):
<nBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1c,%esi
xor    %edx,%edx
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rcx
lea    -0x12(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x18(%rbp)
movswl -0x12(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nBit>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1c,%esi
xor    %edx,%edx
call   1050 <fseek@plt>
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
movswl 0x6(%rsp),%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @nBit(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i16
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = call i32 @fseek(i32* %9, i32 28, i32 0)
%11 = load i32*, i32** %3
%12 = call i32 @fread(i16* %4, i32 2, i32 1, i32* %11)
store i32 %12, i32* %5
%13 = load i16, i16* %4
%14 = sext i16 %13 to i32
store i32 %14, i32* %6
%15 = load i32*, i32** %3
%16 = call i32 @fclose(i32* %15)
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @nBit(i8* nocapture %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fseek(i32* %4, i32 28, i32 0)
%6 = call i32 @fread(i16* %2, i32 2, i32 1, i32* %4)
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = tail call i32 @fclose(i32* %4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ uart_tx_char(char);
void uart_tx_string(char string[15]) {
  int a = 0;
  while (string[a] != '\0') {
    uart_tx_char(string[a]);
    a += 1;
  }
}


x86 assembly (clang, -O0):
<uart_tx_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <uart_tx_string+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_tx_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <uart_tx_string+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_tx_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_tx_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_tx_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_tx_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_tx_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @uart_tx_char(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void yyDeWinfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<yyDeWinfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @yyDeWinfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int nan_eq_jump(double x) {
  volatile double y = x;
  volatile double z = y;
  if (y == z) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<nan_eq_jump>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    1143 <nan_eq_jump+0x43>
jp     1143 <nan_eq_jump+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <nan_eq_jump+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nan_eq_jump>:
movsd  %xmm0,-0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
movsd  %xmm0,-0x8(%rsp)
movsd  -0x10(%rsp),%xmm0
cmpeqsd -0x8(%rsp),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nan_eq_jump(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
store volatile double %6, double* %4
%7 = load volatile double, double* %4
store volatile double %7, double* %5
%8 = load volatile double, double* %4
%9 = load volatile double, double* %5
%10 = fcmp oeq double %8, %9
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @nan_eq_jump(double %0) {
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %2 to i8*
store volatile double %0, double* %2
%5 = bitcast double* %3 to i8*
%6 = load volatile double, double* %2
store volatile double %6, double* %3
%7 = load volatile double, double* %2
%8 = load volatile double, double* %3
%9 = fcmp oeq double %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
char *isp_progname_get();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vsnprintf(char *, int, char const *, int /*<<< orphan*/);
void _verr(const char *fmt, va_list ap) {
  char buf[1024];
  (void)vsnprintf(buf, 1024, fmt, ap);
  fprintf(stderr, "%s: %s\n", isp_progname_get(), buf);
}


x86 assembly (clang, -O0):
<_verr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x400,%esi
call   1040 <vsnprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x414(%rbp)
mov    $0x0,%al
call   1030 <isp_progname_get@plt>
mov    -0x414(%rbp),%edi
mov    %rax,%rdx
lea    -0x410(%rbp),%rcx
lea    0xe79(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_verr>:
push   %rbp
push   %rbx
sub    $0x408,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <vsnprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <isp_progname_get@plt>
lea    0xe9b(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1050 <fprintf@plt>
add    $0x408,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @_verr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @vsnprintf(i8* %6, i32 1024, i8* %7, i32 %8)
%10 = load i32, i32* @stderr
%11 = call i8* (...) @isp_progname_get()
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @_verr(i8* nocapture %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @vsnprintf(i8* %4, i32 1024, i8* %0, i32 %1)
%6 = load i32, i32* @stderr
%7 = tail call i8* (...) @isp_progname_get()
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ safe_write(int, char *, int);
void backspace(int fd, int count) {
  while (count-- > 0)
    safe_write(fd, "\b \b", 3);
}


x86 assembly (clang, -O0):
<backspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    114b <backspace+0x3b>
mov    -0x4(%rbp),%edi
lea    0xec4(%rip),%rsi
mov    $0x3,%edx
call   1030 <safe_write@plt>
jmp    111e <backspace+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backspace>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <backspace+0x37>
mov    %esi,%ebx
mov    %edi,%ebp
add    $0x1,%ebx
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <safe_write@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <backspace+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\08 \08\00"
define void @backspace(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 @safe_write(i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\08 \08\00"
define void @backspace(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @safe_write(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, char const *, int);
void warn_error(const char *message, int err) {
  print_error("error", message, err);
}


x86 assembly (clang, -O0):
<warn_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <print_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_error>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <print_error@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"error\00"
define void @warn_error(i8* %0, i32 %1) {
%3 = tail call i32 @print_error(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void data_segment_gdata(void) {
  output_line("\t.area  SMALLC_GENERATED_DATA  (REL,CON,DSEG)");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"\09.area SMALLC_GENERATED_DATA (REL,CON,DSEG)\00"
define void @data_segment_gdata() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"\09.area SMALLC_GENERATED_DATA (REL,CON,DSEG)\00"
define void @data_segment_gdata() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fabs(int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int main() {
  int a, b;
  a = 1234;
  b = -344;
  printf("The absolute value of %d is %lf\n", a, fabs(a));
  printf("The absolute value of %d is %lf\n", b, fabs(b));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4d2,-0x8(%rbp)
movl   $0xfffffea8,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fabs@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <fabs@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4d2,%edi
call   1040 <fabs@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4d2,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xfffffea8,%edi
call   1040 <fabs@plt>
mov    %rbx,%rdi
mov    $0xfffffea8,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"The absolute value of %d is %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1234, i32* %2
store i32 -344, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @fabs(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @fabs(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"The absolute value of %d is %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @fabs(i32 1234)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 1234, i32 %1)
%3 = tail call i32 @fabs(i32 -344)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 -344, i32 %3)
ret i32 0
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned dns_random16(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((unsigned)(tv.tv_usec) ^ ((unsigned)(tv.tv_usec) >> 16)) & 0xffff;
}


x86 assembly (clang, -O0):
<dns_random16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x10,%ecx
xor    %ecx,%eax
and    $0xffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_random16>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%ecx
movzwl %cx,%eax
shr    $0x10,%ecx
xor    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i32 @dns_random16() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = lshr i32 %8, 16
%10 = xor i32 %5, %9
%11 = and i32 %10, 65535
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i32 @dns_random16() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = lshr i32 %6, 16
%8 = and i32 %6, 65535
%9 = xor i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ TaskInfoHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void TaskInfoRequestUpdate() { UAVObjRequestUpdate(TaskInfoHandle()); }


x86 assembly (clang, -O0):
<TaskInfoRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <TaskInfoHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TaskInfoRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <TaskInfoHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @TaskInfoRequestUpdate() {
%1 = call i32 (...) @TaskInfoHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @TaskInfoRequestUpdate() {
%1 = tail call i32 (...) @TaskInfoHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
indreg0indreg1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((*p0) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl (%rax),%eax
mov    -0x20(%rbp),%rcx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     1141 <indreg0indreg1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <indreg0indreg1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0indreg1>:
movzwl (%r8),%ecx
xor    %eax,%eax
cmp    (%r9),%cx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @indreg0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = load i16, i16* %4
%8 = load i16, i16* %5
%9 = icmp ule i16 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ validate_count_traverse_(char const *, size_t *,
                                            int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *);
size_t xo_parser_count_insns(const char *input) {
  size_t n = 0;
  validate_count_traverse_(input, &n, NULL, NULL);
  return n;
}


x86 assembly (clang, -O0):
<xo_parser_count_insns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <validate_count_traverse_@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xo_parser_count_insns>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <validate_count_traverse_@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @xo_parser_count_insns(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
%4 = load i8*, i8** %2
%5 = call i32 @validate_count_traverse_(i8* %4, i64* %3, i32* null, i32* null)
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @xo_parser_count_insns(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = call i32 @validate_count_traverse_(i8* %0, i64* %2, i32* null, i32* null)
%5 = load i64, i64* %2
ret i64 %5
}
int centeredSquare(int num) { return num * num + ((num - 1) * (num - 1)); }


x86 assembly (clang, -O0):
<centeredSquare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<centeredSquare>:
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
imul   %edi,%ecx
imul   %eax,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @centeredSquare(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = mul nsw i32 %7, %9
%11 = add nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @centeredSquare(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = add nsw i32 %0, -1
%4 = mul nsw i32 %3, %3
%5 = add nuw nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pfio_digital_write(int, int /*<<< orphan*/);
int pfio_reset(void) {
  int i;
  for (i = 1; i <= 8; i++)
    pfio_digital_write(i, 0);
  return 0;
}


x86 assembly (clang, -O0):
<pfio_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jg     1141 <pfio_reset+0x31>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <pfio_digital_write@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <pfio_reset+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfio_reset>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <pfio_digital_write@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <pfio_digital_write@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <pfio_digital_write@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <pfio_digital_write@plt>
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <pfio_digital_write@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <pfio_digital_write@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <pfio_digital_write@plt>
mov    $0x8,%edi
xor    %esi,%esi
call   1030 <pfio_digital_write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pfio_reset() {
%1 = tail call i32 @pfio_digital_write(i32 1, i32 0)
%2 = tail call i32 @pfio_digital_write(i32 2, i32 0)
%3 = tail call i32 @pfio_digital_write(i32 3, i32 0)
%4 = tail call i32 @pfio_digital_write(i32 4, i32 0)
%5 = tail call i32 @pfio_digital_write(i32 5, i32 0)
%6 = tail call i32 @pfio_digital_write(i32 6, i32 0)
%7 = tail call i32 @pfio_digital_write(i32 7, i32 0)
%8 = tail call i32 @pfio_digital_write(i32 8, i32 0)
ret i32 0
}
int RPMtofromCompareTime(int RPMorCompareTime) {
  return 7500000 / RPMorCompareTime;
}


x86 assembly (clang, -O0):
<RPMtofromCompareTime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x7270e0,%eax
cltd
idivl  -0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RPMtofromCompareTime>:
mov    $0x7270e0,%eax
xor    %edx,%edx
idiv   %edi
ret

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

LLVM IR (-O2):
define i32 @RPMtofromCompareTime(i32 %0) {
%2 = sdiv i32 7500000, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ h(int, int);
int main(int argc, char *argv[]) {
  h(11, 21);
  h(12, 22);
  h(11, 22);
  h(23, 11);
  h(12, 22);
  h(23, 23);
  h(24, 24);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xb,%edi
mov    $0x15,%esi
call   1030 <h@plt>
mov    $0xc,%edi
mov    $0x16,%esi
call   1030 <h@plt>
mov    $0xb,%edi
mov    $0x16,%esi
call   1030 <h@plt>
mov    $0x17,%edi
mov    $0xb,%esi
call   1030 <h@plt>
mov    $0xc,%edi
mov    $0x16,%esi
call   1030 <h@plt>
mov    $0x17,%esi
mov    %esi,%edi
call   1030 <h@plt>
mov    $0x18,%esi
mov    %esi,%edi
call   1030 <h@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xb,%edi
mov    $0x15,%esi
call   1030 <h@plt>
mov    $0xc,%edi
mov    $0x16,%esi
call   1030 <h@plt>
mov    $0xb,%edi
mov    $0x16,%esi
call   1030 <h@plt>
mov    $0x17,%edi
mov    $0xb,%esi
call   1030 <h@plt>
mov    $0xc,%edi
mov    $0x16,%esi
call   1030 <h@plt>
mov    $0x17,%edi
mov    $0x17,%esi
call   1030 <h@plt>
mov    $0x18,%edi
mov    $0x18,%esi
call   1030 <h@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @h(i32 11, i32 21)
%7 = call i32 @h(i32 12, i32 22)
%8 = call i32 @h(i32 11, i32 22)
%9 = call i32 @h(i32 23, i32 11)
%10 = call i32 @h(i32 12, i32 22)
%11 = call i32 @h(i32 23, i32 23)
%12 = call i32 @h(i32 24, i32 24)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @h(i32 11, i32 21)
%4 = tail call i32 @h(i32 12, i32 22)
%5 = tail call i32 @h(i32 11, i32 22)
%6 = tail call i32 @h(i32 23, i32 11)
%7 = tail call i32 @h(i32 12, i32 22)
%8 = tail call i32 @h(i32 23, i32 23)
%9 = tail call i32 @h(i32 24, i32 24)
ret i32 0
}
/* Variables and functions */
unsigned char gf16_mul_8(unsigned char);
unsigned char gf256_mul_0x80(unsigned char a) {
  unsigned char a0 = a & 0xf;
  unsigned char a1 = (a >> 4);
  unsigned char a0x8 = gf16_mul_8(a0);
  unsigned char a1x8 = gf16_mul_8(a1);
  unsigned char a1x8x8 = gf16_mul_8(a1x8);
  return a1x8x8 ^ ((a0x8 ^ a1x8) << 4);
}


x86 assembly (clang, -O0):
<gf256_mul_0x80>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
mov    %al,-0x3(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <gf16_mul_8@plt>
mov    %al,-0x4(%rbp)
movzbl -0x3(%rbp),%edi
call   1030 <gf16_mul_8@plt>
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <gf16_mul_8@plt>
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
movzbl -0x4(%rbp),%ecx
movzbl -0x5(%rbp),%edx
xor    %edx,%ecx
shl    $0x4,%ecx
xor    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf256_mul_0x80>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
shr    $0x4,%bl
and    $0xf,%edi
call   1030 <gf16_mul_8@plt>
mov    %eax,%r14d
movzbl %bl,%edi
call   1030 <gf16_mul_8@plt>
movzbl %al,%ebp
mov    %ebp,%edi
call   1030 <gf16_mul_8@plt>
xor    %r14b,%bpl
shl    $0x4,%bpl
xor    %bpl,%al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @gf256_mul_0x80(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8 %0, i8* %2
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = trunc i32 %10 to i8
store i8 %11, i8* %3
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = ashr i32 %13, 4
%15 = trunc i32 %14 to i8
store i8 %15, i8* %4
%16 = load i8, i8* %3
%17 = call zeroext i8 @gf16_mul_8(i8 zeroext %16)
store i8 %17, i8* %5
%18 = load i8, i8* %4
%19 = call zeroext i8 @gf16_mul_8(i8 zeroext %18)
store i8 %19, i8* %6
%20 = load i8, i8* %6
%21 = call zeroext i8 @gf16_mul_8(i8 zeroext %20)
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = shl i32 %28, 4
%30 = xor i32 %23, %29
%31 = trunc i32 %30 to i8
ret i8 %31
}

LLVM IR (-O2):
define zeroext i8 @gf256_mul_0x80(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = lshr i8 %0, 4
%4 = tail call zeroext i8 @gf16_mul_8(i8 zeroext %2)
%5 = tail call zeroext i8 @gf16_mul_8(i8 zeroext %3)
%6 = tail call zeroext i8 @gf16_mul_8(i8 zeroext %5)
%7 = xor i8 %5, %4
%8 = shl i8 %7, 4
%9 = xor i8 %8, %6
ret i8 %9
}
/* Variables and functions */
double exp(double);
double dAUX1bp3b(double x) { return 2.0 * (1 - x) * exp(-x); }


x86 assembly (clang, -O0):
<dAUX1bp3b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dAUX1bp3b>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,(%rsp)
xorpd  0xee2(%rip),%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dAUX1bp3b(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.000000e+00, %3
%5 = fmul double 2.000000e+00, %4
%6 = load double, double* %2
%7 = fneg double %6
%8 = call double @exp(double %7)
%9 = fmul double %5, %8
ret double %9
}

LLVM IR (-O2):
define double @dAUX1bp3b(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %2, 2.000000e+00
%4 = fneg double %0
%5 = tail call double @exp(double %4)
%6 = fmul double %3, %5
ret double %6
}
int differences(char S1, char S2, char (*BLOSUM)[6]) {
  int difference;
  difference = BLOSUM[S1][S2];
  return difference;
}


x86 assembly (clang, -O0):
<differences>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbq -0x1(%rbp),%rcx
imul   $0x6,%rcx,%rcx
add    %rcx,%rax
movsbq -0x2(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<differences>:
movslq %edi,%rax
movslq %esi,%rcx
lea    (%rax,%rax,2),%rax
lea    (%rdx,%rax,2),%rax
movsbl (%rcx,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @differences(i8 signext %0, i8 signext %1, [6 x i8]* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca [6 x i8]*
%7 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store [6 x i8]* %2, [6 x i8]** %6
%8 = load [6 x i8]*, [6 x i8]** %6
%9 = load i8, i8* %4
%10 = sext i8 %9 to i64
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 %10
%12 = load i8, i8* %5
%13 = sext i8 %12 to i64
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %11, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @differences(i8 signext %0, i8 signext %1, [6 x i8]* nocapture %2) {
%4 = sext i8 %0 to i64
%5 = sext i8 %1 to i64
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 %4, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_RADIO_VREF_PIN() { clear_io_bit(-1, 1); }


x86 assembly (clang, -O0):
<TOSH_CLR_RADIO_VREF_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_RADIO_VREF_PIN>:
mov    $0xffffffff,%edi
mov    $0x1,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_RADIO_VREF_PIN() {
%1 = call i32 @clear_io_bit(i32 -1, i32 1)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_RADIO_VREF_PIN() {
%1 = tail call i32 @clear_io_bit(i32 -1, i32 1)
ret void
}
int CFun(int x, int y) {
  if (x > y)
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<CFun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1122 <CFun+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <CFun+0x29>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CFun>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @CFun(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 1, i32 -1
ret i32 %4
}
/* Variables and functions */
bool isPowerOfTwo(int n) {
  if (n < 1)
    return false;
  return ((n & (n - 1)) == 0);
}


x86 assembly (clang, -O0):
<isPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <isPowerOfTwo+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1136 <isPowerOfTwo+0x36>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo>:
test   %edi,%edi
jle    110f <isPowerOfTwo+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOfTwo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = and i32 %8, %10
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @isPowerOfTwo(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
int mDB_open(fn) { return mDBi_msg('O', fn, 0, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<mDB_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x4f,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1030 <mDBi_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mDB_open>:
push   %rax
mov    %edi,%esi
mov    $0x4f,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   $0x0
push   $0x0
call   1030 <mDBi_msg@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mDB_open(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 79, i32 %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @mDB_open(i32 %0) {
%2 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 79, i32 %0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %2
}
void *GLUE_realAddress(void *fn, void *fn_e, int *size) {
  *size = (char *)fn_e - (char *)fn;
  return fn;
}


x86 assembly (clang, -O0):
<GLUE_realAddress>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_realAddress>:
mov    %rdi,%rax
sub    %eax,%esi
mov    %esi,(%rdx)
ret

LLVM IR (-O0):
define i8* @GLUE_realAddress(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = load i32*, i32** %6
store i32 %12, i32* %13
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @GLUE_realAddress(i8* returned %0, i8* %1, i32* nocapture writeonly %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
ret i8* %0
}
int test_imm_DCint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xDC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DCint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 944892805120
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int usage(char *me) {
  fprintf(stderr, "%s [-p PID | executable  [arg *]]\n", me);
  fprintf(stderr, "Run program, and print VmPeak, VmSize, VmRSS and VmHWM (in "
                  "KiB) to stderr\n");
  return 0;
}


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
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeef(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"%s [-p PID | executable [arg *]]\0A\00"
@.str.1 = [75 x i8] c"Run program, and print VmPeak, VmSize, VmRSS and VmHWM (in KiB) to stderr\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"%s [-p PID | executable [arg *]]\0A\00"
@.str.1 = [75 x i8] c"Run program, and print VmPeak, VmSize, VmRSS and VmHWM (in KiB) to stderr\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}