xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ str_to_uint32(char const *, char **, int /*<<< orphan*/);
bool str_to_bool(const char *nptr, char **endptr) {
  uint32_t v = str_to_uint32(nptr, endptr, 0);
  return v != 0;
}


x86 assembly (clang, -O0):
<str_to_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <str_to_uint32@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_bool>:
push   %rax
xor    %edx,%edx
call   1030 <str_to_uint32@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @str_to_bool(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i64
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
%7 = load i8**, i8*** %4
%8 = call i64 @str_to_uint32(i8* %6, i8** %7, i32 0)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @str_to_bool(i8* %0, i8** %1) {
%3 = tail call i64 @str_to_uint32(i8* %0, i8** %1, i32 0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int null_undistort_func(const void *data, const double x, const double y,
                        double ray[3]) {
  ray[0] = x;
  ray[1] = y;
  ray[2] = 1;
  return 0;
}


x86 assembly (clang, -O0):
<null_undistort_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_undistort_func>:
movsd  %xmm0,(%rsi)
movsd  %xmm1,0x8(%rsi)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x10(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @null_undistort_func(i8* %0, double %1, double %2, double* %3) {
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
%8 = alloca double*
store i8* %0, i8** %5
store double %1, double* %6
store double %2, double* %7
store double* %3, double** %8
%9 = load double, double* %6
%10 = load double*, double** %8
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load double, double* %7
%13 = load double*, double** %8
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %8
%16 = getelementptr inbounds double, double* %15, i64 2
store double 1.000000e+00, double* %16
ret i32 0
}

LLVM IR (-O2):
define i32 @null_undistort_func(i8* nocapture readnone %0, double %1, double %2, double* nocapture writeonly %3) {
store double %1, double* %3
%5 = getelementptr inbounds double, double* %3, i64 1
store double %2, double* %5
%6 = getelementptr inbounds double, double* %3, i64 2
store double 1.000000e+00, double* %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *_mktemp(char *, int /*<<< orphan*/, int /*<<< orphan*/ *,
                            int /*<<< orphan*/);
char *mktemp(char *template) {
  if (_mktemp(template, 0, NULL, 0) == NULL)
    template[0] = '\0';
  return template;
}


x86 assembly (clang, -O0):
<mktemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%edx
mov    %ecx,%esi
call   1030 <_mktemp@plt>
cmp    $0x0,%rax
jne    113e <mktemp+0x2e>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mktemp>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <_mktemp@plt>
test   %rax,%rax
jne    1127 <mktemp+0x17>
movb   $0x0,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @mktemp(i8* returned %0) {
%2 = tail call i32* @_mktemp(i8* %0, i32 0, i32* null, i32 0)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %5
4: ; preds = %1
store i8 0, i8* %0
br label %5
5: ; preds = %4, %1
ret i8* %0
}
int test_imm_B2int16_mem(short *val) {
  return ((*val) & (0xB2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B2int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 178
%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_B2int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 178
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char *string = "hello world!";
  printf("%c\n", string[0]);
  char *otherString = string;
  printf("%c\n", otherString[0]);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 104)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 104)
ret i32 0
}
char *helloSubFunc() { return "Hello From helloSubFunc"; }


x86 assembly (clang, -O0):
<helloSubFunc>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<helloSubFunc>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Hello From helloSubFunc\00"
define i8* @helloSubFunc() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [24 x i8] c"Hello From helloSubFunc\00"
define i8* @helloSubFunc() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ thread_pexit(int, char *);
int main() {
  int s;
  if ((s = pthread_join(pthread_self(), NULL)) != 0) {
    thread_pexit(s, "pthread_join");
  }
  printf("Successfully joined with itself.\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <pthread_join@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     118c <main+0x3c>
mov    -0x8(%rbp),%edi
lea    0xe79(%rip),%rsi
call   1040 <thread_pexit@plt>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1070 <pthread_join@plt>
test   %eax,%eax
je     1173 <main+0x23>
lea    0xe94(%rip),%rsi
mov    %eax,%edi
call   1040 <thread_pexit@plt>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"pthread_join\00"
@.str.1 = [34 x i8] c"Successfully joined with itself.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @pthread_self()
%4 = call i32 @pthread_join(i32 %3, i32* null)
store i32 %4, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @thread_pexit(i32 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %0
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @EXIT_SUCCESS
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"pthread_join\00"
@EXIT_SUCCESS = global i32 0
@str = [33 x i8] c"Successfully joined with itself.\00"
define i32 @main() {
%1 = tail call i32 (...) @pthread_self()
%2 = tail call i32 @pthread_join(i32 %1, i32* null)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @thread_pexit(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_SUCCESS
%9 = tail call i32 @exit(i32 %8)
unreachable
}
void DBG_ERR(const char *const msg) {}


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

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

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

LLVM IR (-O2):
define void @DBG_ERR(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AUDIO_PAUSE;
int ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int audioPause(int fd, char *arg) {
  if (arg)
    return -1;
  if (ioctl(fd, AUDIO_PAUSE) == -1)
    perror("AUDIO_PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<audioPause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <audioPause+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <audioPause+0x53>
mov    -0x8(%rbp),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    116c <audioPause+0x4c>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audioPause>:
push   %rbx
mov    $0xffffffff,%ebx
test   %rsi,%rsi
jne    1140 <audioPause+0x20>
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
je     1144 <audioPause+0x24>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
jmp    1140 <audioPause+0x20>

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

LLVM IR (-O2):
@AUDIO_PAUSE = global i32 0
@.str = [12 x i8] c"AUDIO_PAUSE\00"
define i32 @audioPause(i32 %0, i8* readnone %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @AUDIO_PAUSE
%6 = tail call i32 @ioctl(i32 %0, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %4, %8, %2
%11 = phi i32 [ -1, %2 ], [ 0, %8 ], [ 0, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double);
int main(void) {
  double a = 6.0;
  double b = 3.0;
  double c = a / b;
  printf("a = %f, b = %f, c = %f\n", a, b, c);
  printf("a = %x %x, b = %x %x, c = %x %x\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf00(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
movsd  0xee0(%rip),%xmm2
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
movsd  0xebc(%rip),%xmm0
movsd  0xebc(%rip),%xmm1
movsd  0xebc(%rip),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"a = %f, b = %f, c = %f\0A\00"
@.str.1 = [33 x i8] c"a = %x %x, b = %x %x, c = %x %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 6.000000e+00, double* %2
store double 3.000000e+00, double* %3
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fdiv double %5, %6
store double %7, double* %4
%8 = load double, double* %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %8, double %9, double %10)
%12 = load double, double* %2
%13 = load double, double* %3
%14 = load double, double* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), double %12, double %13, double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"a = %f, b = %f, c = %f\0A\00"
@.str.1 = [33 x i8] c"a = %x %x, b = %x %x, c = %x %x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double 6.000000e+00, double 3.000000e+00, double 2.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), double 6.000000e+00, double 3.000000e+00, double 2.000000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *s = "AAA";
  printf("%s\n", s);
  s[1] = 'B';
  printf("%s\n", s);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee9(%rip),%rbx
lea    0xede(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"AAA\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned int tv_nsec;
};

/* Variables and functions */
int nanosleep(struct timespec *, struct timespec *);
int usleep(unsigned useconds) {
  struct timespec tv = {.tv_sec = useconds / 1000000,
                        .tv_nsec = (useconds % 1000000) * 1000};
  return nanosleep(&tv, &tv);
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x3e8,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
push   %rax
mov    %edi,%eax
imul   $0x431bde83,%rax,%rax
shr    $0x32,%rax
mov    %eax,(%rsp)
imul   $0xf4240,%eax,%eax
sub    %eax,%edi
imul   $0x3e8,%edi,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
mov    %rdi,%rsi
call   1030 <nanosleep@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @usleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %2
%6 = udiv i32 %5, 1000000
store i32 %6, i32* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%8 = load i32, i32* %2
%9 = urem i32 %8, 1000000
%10 = mul i32 %9, 1000
store i32 %10, i32* %7
%11 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %3)
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @usleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%5 = udiv i32 %0, 1000000
store i32 %5, i32* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%7 = urem i32 %0, 1000000
%8 = mul nuw nsw i32 %7, 1000
store i32 %8, i32* %6
%9 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %2)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ nrerror(char *);
void free_usvector(unsigned short *v, long nl, long nh) {
  if (nh < 0)
    nrerror("free_usvector: nh must be >=0");
  free((char *)(v + nl - 1));
}


x86 assembly (clang, -O0):
<free_usvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    114b <free_usvector+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <nrerror@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
add    $0xfffffffffffffffe,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_usvector>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdx,%rdx
jns    113b <free_usvector+0x1b>
lea    0xeca(%rip),%rdi
call   1040 <nrerror@plt>
lea    (%rbx,%r14,2),%rdi
add    $0xfffffffffffffffe,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"free_usvector: nh must be >=0\00"
define void @free_usvector(i16* %0, i64 %1, i64 %2) {
%4 = alloca i16*
%5 = alloca i64
%6 = alloca i64
store i16* %0, i16** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @nrerror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %3
%12 = load i16*, i16** %4
%13 = load i64, i64* %5
%14 = getelementptr inbounds i16, i16* %12, i64 %13
%15 = getelementptr inbounds i16, i16* %14, i64 -1
%16 = bitcast i16* %15 to i8*
%17 = call i32 @free(i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"free_usvector: nh must be >=0\00"
define void @free_usvector(i16* nocapture %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @nrerror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = getelementptr inbounds i16, i16* %0, i64 %1
%9 = getelementptr inbounds i16, i16* %8, i64 -1
%10 = bitcast i16* %9 to i8*
%11 = tail call i32 @free(i8* %10)
ret void
}
/* Variables and functions */
int ERR;
int OK;
int change_channel(int channel) {
  if ((channel < 1) || (channel > 14)) {
    return (ERR);
  }
  return (OK);
}


x86 assembly (clang, -O0):
<change_channel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     111b <change_channel+0x1b>
cmpl   $0xe,-0x8(%rbp)
jle    112c <change_channel+0x2c>
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <change_channel+0x38>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_channel>:
add    $0xfffffff1,%edi
cmp    $0xfffffff2,%edi
jae    1112 <change_channel+0x12>
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@ERR = global i32 0
@OK = global i32 0
define i32 @change_channel(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 %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 14
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = load i32, i32* @ERR
store i32 %10, i32* %2
br label %13
11: ; preds = %6
%12 = load i32, i32* @OK
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@ERR = global i32 0
@OK = global i32 0
define i32 @change_channel(i32 %0) {
%2 = add i32 %0, -15
%3 = icmp ult i32 %2, -14
%4 = load i32, i32* @ERR
%5 = load i32, i32* @OK
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num1, num2;
  int soma;
  num1 = 10;
  num2 = 2;
  soma = num1 + num2;
  printf("\nSoma = %d\n", soma);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"\0ASoma = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_screen_refresh();
int /*<<< orphan*/ roadmap_screen_repaint();
void roadmap_screen_redraw(void) {
  if (!roadmap_screen_refresh()) {
    roadmap_screen_repaint();
  }
}


x86 assembly (clang, -O0):
<roadmap_screen_redraw>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <roadmap_screen_refresh@plt>
cmp    $0x0,%eax
jne    113b <roadmap_screen_redraw+0x1b>
mov    $0x0,%al
call   1030 <roadmap_screen_repaint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_screen_redraw>:
push   %rax
xor    %eax,%eax
call   1040 <roadmap_screen_refresh@plt>
test   %eax,%eax
je     112e <roadmap_screen_redraw+0xe>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <roadmap_screen_repaint@plt>

LLVM IR (-O0):
define void @roadmap_screen_redraw() {
%1 = call i32 (...) @roadmap_screen_refresh()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 (...) @roadmap_screen_repaint()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @roadmap_screen_redraw() {
%1 = tail call i32 (...) @roadmap_screen_refresh()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @roadmap_screen_repaint()
br label %5
5: ; preds = %3, %0
ret void
}
void f3(int a[1]) { *a = 333333; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x51615,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
movl   $0x51615,(%rdi)
ret

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

LLVM IR (-O2):
define void @f3(i32* nocapture writeonly %0) {
store i32 333333, i32* %0
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float exp2f(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<exp2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @exp2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @exp2f(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version() { printf("ac_xattr 1.0\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"ac_xattr 1.0\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"ac_xattr 1.0\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void version(void) {
  printf(" CMatrix version %s by Chris Allegretta (compiled %s, %s)\n", "1.2a",
         "12:19:12", "Mar 15 2022");
  printf(" Email: cmatrix@asty.org  Web: http://www.asty.org/cmatrix\n");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf19(%rip),%rsi
lea    0xf17(%rip),%rdx
lea    0xf19(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf0c(%rip),%rsi
lea    0xf0a(%rip),%rdx
lea    0xf0c(%rip),%rcx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf0a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [59 x i8] c" CMatrix version %s by Chris Allegretta (compiled %s, %s)\0A\00"
@.str.1 = [5 x i8] c"1.2a\00"
@.str.2 = [9 x i8] c"12:19:12\00"
@.str.3 = [12 x i8] c"Mar 15 2022\00"
@.str.4 = [60 x i8] c" Email: cmatrix@asty.org Web: http://www.asty.org/cmatrix\0A\00"
define void @version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c" CMatrix version %s by Chris Allegretta (compiled %s, %s)\0A\00"
@.str.1 = [5 x i8] c"1.2a\00"
@.str.2 = [9 x i8] c"12:19:12\00"
@.str.3 = [12 x i8] c"Mar 15 2022\00"
@str = [59 x i8] c" Email: cmatrix@asty.org Web: http://www.asty.org/cmatrix\00"
define void @version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}
int of_gpiochip_add(struct gpio_chip *gc) { return 0; }


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

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

LLVM IR (-O0):
%struct.gpio_chip = type opaque
define i32 @of_gpiochip_add(%struct.gpio_chip* %0) {
%2 = alloca %struct.gpio_chip*
store %struct.gpio_chip* %0, %struct.gpio_chip** %2
ret i32 0
}

LLVM IR (-O2):
%struct.gpio_chip = type opaque
define i32 @of_gpiochip_add(%struct.gpio_chip* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *getlogin();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("login name = %s\n", getlogin());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"login name = %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @getlogin()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int dblcmp(double, double);
int dblcmp_asc(double v1, double v2) { return dblcmp(v1, v2); }


x86 assembly (clang, -O0):
<dblcmp_asc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <dblcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblcmp_asc>:
jmp    1030 <dblcmp@plt>

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

LLVM IR (-O2):
define i32 @dblcmp_asc(double %0, double %1) {
%3 = tail call i32 @dblcmp(double %0, double %1)
ret i32 %3
}
/* Type definitions */
struct dnaSeq {
  int dummy;
};

/* Variables and functions */
struct dnaSeq *faReadAllSeqMixable(char *, int /*<<< orphan*/, int);
struct dnaSeq *faReadAllMixed(char *fileName) {
  return faReadAllSeqMixable(fileName, 0, 1);
}


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

x86 assembly (clang, -O2):
<faReadAllMixed>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <faReadAllSeqMixable@plt>

LLVM IR (-O0):
%struct.dnaSeq = type { i32 }
define %struct.dnaSeq* @faReadAllMixed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.dnaSeq* @faReadAllSeqMixable(i8* %3, i32 0, i32 1)
ret %struct.dnaSeq* %4
}

LLVM IR (-O2):
%struct.dnaSeq = type { i32 }
define %struct.dnaSeq* @faReadAllMixed(i8* %0) {
%2 = tail call %struct.dnaSeq* @faReadAllSeqMixable(i8* %0, i32 0, i32 1)
ret %struct.dnaSeq* %2
}
void fan_init(void) {}


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

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

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

LLVM IR (-O2):
define void @fan_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printstring(char sz[]) {
  for (int i = 0; sz[i]; ++i)
    printf("%c", sz[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <printstring+0x4d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printstring+0x13>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printstring(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %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 = icmp ne i8 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printstring(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %1, %6
%7 = phi i64 [ %11, %6 ], [ 0, %1 ]
%8 = phi i8 [ %13, %6 ], [ %2, %1 ]
%9 = sext i8 %8 to i32
%10 = tail call i32 @putchar(i32 %9)
%11 = add nuw i64 %7, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ test_create();
int /*<<< orphan*/ test_get();
int /*<<< orphan*/ test_map();
int /*<<< orphan*/ test_new();
int /*<<< orphan*/ test_pop();
int main(void) {
  test_create();
  test_new();
  test_pop();
  test_get();
  test_map();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_create@plt>
mov    $0x0,%al
call   1060 <test_new@plt>
mov    $0x0,%al
call   1040 <test_pop@plt>
mov    $0x0,%al
call   1030 <test_get@plt>
mov    $0x0,%al
call   1050 <test_map@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_create@plt>
xor    %eax,%eax
call   1060 <test_new@plt>
xor    %eax,%eax
call   1040 <test_pop@plt>
xor    %eax,%eax
call   1030 <test_get@plt>
xor    %eax,%eax
call   1050 <test_map@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_create()
%3 = call i32 (...) @test_new()
%4 = call i32 (...) @test_pop()
%5 = call i32 (...) @test_get()
%6 = call i32 (...) @test_map()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_create()
%2 = tail call i32 (...) @test_new()
%3 = tail call i32 (...) @test_pop()
%4 = tail call i32 (...) @test_get()
%5 = tail call i32 (...) @test_map()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar(void) { printf("MAIN bar\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"MAIN bar\0A\00"
define void @bar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"MAIN bar\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x29() {
  Assert_real((isalnum(41) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              210, ("isalnum should be 0 for )"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x29>:
push   %rax
mov    $0x29,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xd2,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for )\00"
define void @t_isalnum_0x29() {
%1 = tail call i64 @isalnum(i32 41)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 210, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int fun1239() { return 1239; }


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

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

LLVM IR (-O0):
define i32 @fun1239() {
ret i32 1239
}

LLVM IR (-O2):
define i32 @fun1239() {
ret i32 1239
}
int gv(char c) {
  if (c == '0')
    return 0;
  else if (c == '1')
    return 1;
}


x86 assembly (clang, -O0):
<gv>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jne    1123 <gv+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1141 <gv+0x41>
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
jne    113c <gv+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1141 <gv+0x41>
jmp    1141 <gv+0x41>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gv>:
xor    %eax,%eax
cmp    $0x31,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @gv(i8 signext %0) {
%2 = icmp eq i8 %0, 49
%3 = zext i1 %2 to i32
ret i32 %3
}
int TransformBug(int a) {
  return sizeof(*(int(*)[({
    goto v;
  v:
    a;
  })])0);
}


x86 assembly (clang, -O0):
<TransformBug>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TransformBug>:
lea    0x0(,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @TransformBug(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %1
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = mul nuw i64 4, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @TransformBug(i32 %0) {
%2 = shl i32 %0, 2
ret i32 %2
}
int intel_msic_get_vsys_min(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @intel_msic_get_vsys_min() {
ret i32 0
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_divide(float *, float *, float *);
__attribute__((always_)) struct vec3 *
psvec3_divide(struct vec3 *result, struct vec3 *a, struct vec3 *b) {
  vec3_divide((float *)result, (float *)a, (float *)b);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec3_divide>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_divide@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_divide(%struct.vec3* %0, %struct.vec3* %1, %struct.vec3* %2) {
%4 = alloca %struct.vec3*
%5 = alloca %struct.vec3*
%6 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %4
store %struct.vec3* %1, %struct.vec3** %5
store %struct.vec3* %2, %struct.vec3** %6
%7 = load %struct.vec3*, %struct.vec3** %4
%8 = bitcast %struct.vec3* %7 to float*
%9 = load %struct.vec3*, %struct.vec3** %5
%10 = bitcast %struct.vec3* %9 to float*
%11 = load %struct.vec3*, %struct.vec3** %6
%12 = bitcast %struct.vec3* %11 to float*
%13 = call i32 @vec3_divide(float* %8, float* %10, float* %12)
%14 = load %struct.vec3*, %struct.vec3** %4
ret %struct.vec3* %14
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_divide(%struct.vec3* returned %0, %struct.vec3* %1, %struct.vec3* %2) {
%4 = bitcast %struct.vec3* %0 to float*
%5 = bitcast %struct.vec3* %1 to float*
%6 = bitcast %struct.vec3* %2 to float*
%7 = tail call i32 @vec3_divide(float* %4, float* %5, float* %6)
ret %struct.vec3* %0
}
int findElem(char a[], int size, char elem) {
  for (int i = 0; i < size; i++)
    if (a[i] == elem)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<findElem>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1159 <findElem+0x59>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    1146 <findElem+0x46>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <findElem+0x60>
jmp    114b <findElem+0x4b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <findElem+0x17>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findElem>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <findElem+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dl,(%rdi,%rcx,1)
je     111f <findElem+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <findElem+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @findElem(i8* nocapture %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}