xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
void um() {
  int ano, mes, dia;
  scanf("Diga sua idade em anos, meses e dias: %d %d %d", &ano, &mes, &dia);
  dia = (ano * 360) + (mes * 30) + dia;
  printf("Você tem %d dias de vida", dia);
}


x86 assembly (clang, -O0):
<um>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
imul   $0x168,-0x4(%rbp),%eax
imul   $0x1e,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<um>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
imul   $0x168,0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
mov    %ecx,%esi
shl    $0x5,%esi
sub    %ecx,%esi
sub    %ecx,%esi
add    %eax,%esi
add    0xc(%rsp),%esi
mov    %esi,0xc(%rsp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Diga sua idade em anos, meses e dias: %d %d %d\00"
@.str.1 = [26 x i8] c"Voc\C3\AA tem %d dias de vida\00"
define void @um() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @scanf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, 360
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, 30
%9 = add nsw i32 %6, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Diga sua idade em anos, meses e dias: %d %d %d\00"
@.str.1 = [26 x i8] c"Voc\C3\AA tem %d dias de vida\00"
define void @um() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, 360
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 30
%12 = add nsw i32 %11, %9
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
store i32 %14, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __blast_assert();
int main(void) {
  int *a, *b;
  b = a;
  *a = 2;
  ((*b == 2) ? (0) : __blast_assert());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x2,(%rax)
jne    1143 <main+0x33>
jmp    114a <main+0x3a>
mov    $0x0,%al
call   1030 <__blast_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = load i32*, i32** %2
store i32* %4, i32** %3
%5 = load i32*, i32** %2
store i32 2, i32* %5
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %0
br label %12
10: ; preds = %0
%11 = call i32 (...) @__blast_assert()
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 0, %9 ], [ %11, %10 ]
ret i32 0
}

LLVM IR (-O2):
long get32(char *addr) {
  return ((unsigned char)addr[0]) | (((long)(unsigned char)addr[1]) << 8) |
         (((long)(unsigned char)addr[2]) << 16) |
         (((long)(unsigned char)addr[3]) << 24);
}


x86 assembly (clang, -O0):
<get32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i64 @get32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = shl i64 %10, 8
%12 = or i64 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl i64 %16, 16
%18 = or i64 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i64
%23 = shl i64 %22, 24
%24 = or i64 %18, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @get32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %13, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          "usage: %s [-s] [-i] [script]\n"
          "   -s: force script mode\n"
          "   -i: force interactive mode\n",
          progname);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [85 x i8] c"usage: %s [-s] [-i] [script]\0A -s: force script mode\0A -i: force interactive mode\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [85 x i8] c"usage: %s [-s] [-i] [script]\0A -s: force script mode\0A -i: force interactive mode\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
signed char same_sign(int a, int b) {
  return (a > 0) == (b > 0) && (a < 0) == (b < 0);
}


x86 assembly (clang, -O0):
<same_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%ecx
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jne    1150 <same_sign+0x50>
cmpl   $0x0,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x8(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<same_sign>:
test   %edi,%edi
setle  %al
test   %esi,%esi
setg   %cl
xor    %al,%cl
xor    %edx,%edx
xor    %edi,%esi
setns  %dl
xor    %eax,%eax
test   %cl,%cl
cmovne %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @same_sign(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i32
%11 = icmp eq i32 %7, %10
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 0
%15 = zext i1 %14 to i32
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 0
%18 = zext i1 %17 to i32
%19 = icmp eq i32 %15, %18
br label %20
20: ; preds = %12, %2
%21 = phi i1 [ false, %2 ], [ %19, %12 ]
%22 = zext i1 %21 to i32
%23 = trunc i32 %22 to i8
ret i8 %23
}

LLVM IR (-O2):
define signext i8 @same_sign(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
%4 = icmp sgt i32 %1, 0
%5 = xor i1 %3, %4
%6 = xor i32 %1, %0
%7 = lshr i32 %6, 31
%8 = trunc i32 %7 to i8
%9 = xor i8 %8, 1
%10 = select i1 %5, i8 %9, i8 0
ret i8 %10
}
START_TEST(test_hello_world) { ck_assert_int_eq(0, 0); }


x86 assembly (clang, -O0):
<START_TEST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %esi,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <ck_assert_int_eq@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<START_TEST>:
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <ck_assert_int_eq@plt>

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

LLVM IR (-O2):
define i32 @START_TEST(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @ck_assert_int_eq to i32 (i32, i32, ...)*)(i32 0, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int rmdir(const char *pathname) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<rmdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmdir>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @rmdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @rmdir(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
void *pthread_func(void *useless) {
  useless = useless;
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @pthread_func(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ INADDR_NONE;
int inet_aton(char const *, struct in_addr *);
uint32_t inet_addr(const char *str) {
  struct in_addr a;
  int rv = inet_aton(str, &a);
  return rv ? a.s_addr : INADDR_NONE;
}


x86 assembly (clang, -O0):
<inet_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <inet_aton@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1141 <inet_addr+0x31>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114d <inet_addr+0x3d>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_addr>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <inet_aton@plt>
test   %eax,%eax
jne    112d <inet_addr+0x1d>
mov    0x2ebb(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@INADDR_NONE = global i32 0
define i32 @inet_addr(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.in_addr
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @inet_aton(i8* %5, %struct.in_addr* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%11 = load i32, i32* %10
br label %14
12: ; preds = %1
%13 = load i32, i32* @INADDR_NONE
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ %11, %9 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@INADDR_NONE = global i32 0
define i32 @inet_addr(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = call i32 @inet_aton(i8* %0, %struct.in_addr* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @INADDR_NONE
%9 = select i1 %5, i32 %8, i32 %7
ret i32 %9
}
double level1_linear(double x1, double x2, double c1, double c2) {
  double T1 = x1 - x2 - c1;
  return c2 * T1 * T1;
}


x86 assembly (clang, -O0):
<level1_linear>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<level1_linear>:
subsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm3
mulsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @level1_linear(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fsub double %10, %11
%13 = load double, double* %7
%14 = fsub double %12, %13
store double %14, double* %9
%15 = load double, double* %8
%16 = load double, double* %9
%17 = fmul double %15, %16
%18 = load double, double* %9
%19 = fmul double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @level1_linear(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %1
%6 = fsub double %5, %2
%7 = fmul double %6, %3
%8 = fmul double %6, %7
ret double %8
}
int getint(buffer, min, max, junk)
char *buffer;
int min;
int max;
int junk;
{
  gets(buffer);
  return atoi(buffer);
}


x86 assembly (clang, -O0):
<getint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <gets@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <atoi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getint>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <gets@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <atoi@plt>

LLVM IR (-O0):
define i32 @getint(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @getint(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hello, world!\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @dl_G_SETPRIMDEPTH() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEidiv(int /*<<< orphan*/ *);
void code_idiv() { appendCODE(makeCODEidiv(NULL)); }


x86 assembly (clang, -O0):
<code_idiv>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <makeCODEidiv@plt>
mov    %eax,%edi
call   1040 <appendCODE@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @code_idiv() {
%1 = call i32 @makeCODEidiv(i32* null)
%2 = call i32 @appendCODE(i32 %1)
ret void
}

LLVM IR (-O2):
define void @code_idiv() {
%1 = tail call i32 @makeCODEidiv(i32* null)
%2 = tail call i32 @appendCODE(i32 %1)
ret void
}
void wpas_dbus_signal_network_enabled_changed(struct wpa_supplicant *wpa_s,
                                              struct wpa_ssid *ssid) {}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wpa_ssid = type opaque
define void @wpas_dbus_signal_network_enabled_changed(%struct.wpa_supplicant* %0, %struct.wpa_ssid* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %struct.wpa_ssid*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %struct.wpa_ssid* %1, %struct.wpa_ssid** %4
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpa_ssid = type opaque
define void @wpas_dbus_signal_network_enabled_changed(%struct.wpa_supplicant* nocapture %0, %struct.wpa_ssid* nocapture %1) {
ret void
}
/* Variables and functions */
int gen_conncpy(void *, void *);
int osconncpy(void *o1, void *o2) { return gen_conncpy(o1, o2); }


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

x86 assembly (clang, -O2):
<osconncpy>:
jmp    1030 <gen_conncpy@plt>

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

LLVM IR (-O2):
define i32 @osconncpy(i8* %0, i8* %1) {
%3 = tail call i32 @gen_conncpy(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
char *strcasestr(char const *, char const *);
int strlen(char const *);
char *vh_strrcasestr(const char *buf, const char *str) {
  char *ptr, *res = NULL;
  while ((ptr = strcasestr(buf, str))) {
    res = ptr;
    buf = ptr + strlen(str);
  }
  return res;
}


x86 assembly (clang, -O0):
<vh_strrcasestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcasestr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1181 <vh_strrcasestr+0x61>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1138 <vh_strrcasestr+0x18>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vh_strrcasestr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <strcasestr@plt>
test   %rax,%rax
je     1160 <vh_strrcasestr+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcasestr@plt>
test   %rax,%rax
jne    1140 <vh_strrcasestr+0x20>
jmp    1162 <vh_strrcasestr+0x42>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @vh_strrcasestr(i8* %0, i8* %1) {
%3 = tail call i8* @strcasestr(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = tail call i32 @strlen(i8* %1)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = tail call i8* @strcasestr(i8* %9, i8* %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i8* [ null, %2 ], [ %6, %5 ]
ret i8* %13
}
__attribute__((always_)) unsigned int task_cpu(const struct task_struct *p) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @task_cpu(%struct.task_struct* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *direct_memcpy(void *, void const *, size_t);
void *memmove(void *, void const *, size_t);
void *direct_memmove(void *to, const void *from, size_t len) {
  if (from > to || ((const char *)from + len) < ((char *)to))
    return direct_memcpy(to, from, len);
  return memmove(to, from, len);
}


x86 assembly (clang, -O0):
<direct_memmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1154 <direct_memmove+0x34>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116e <direct_memmove+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <direct_memcpy@plt>
mov    %rax,-0x8(%rbp)
jmp    118b <direct_memmove+0x6b>
mov    -0x10(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memmove@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_memmove>:
cmp    %rdi,%rsi
ja     1133 <direct_memmove+0x13>
lea    (%rsi,%rdx,1),%rax
cmp    %rdi,%rax
jb     1133 <direct_memmove+0x13>
jmp    1040 <memmove@plt>
jmp    1030 <direct_memcpy@plt>

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

LLVM IR (-O2):
define i8* @direct_memmove(i8* %0, i8* %1, i64 %2) {
%4 = icmp ugt i8* %1, %0
%5 = getelementptr inbounds i8, i8* %1, i64 %2
%6 = icmp ult i8* %5, %0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i8* @direct_memcpy(i8* %0, i8* %1, i64 %2)
br label %11
10: ; preds = %3
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
br label %11
11: ; preds = %10, %8
%12 = phi i8* [ %9, %8 ], [ %0, %10 ]
ret i8* %12
}
void PORT1_IRQHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<PORT1_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PORT1_IRQHandler+0x9>
jmp    1109 <PORT1_IRQHandler+0x9>

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

LLVM IR (-O0):
define void @PORT1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @PORT1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ mem_assert(void *);
void *calloc_assert(size_t amount, size_t size) {
  void *mem = calloc(amount, size);
  mem_assert(mem);
  return mem;
}


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

x86 assembly (clang, -O2):
<calloc_assert>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <mem_assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @calloc_assert(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @mem_assert(i8* %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @calloc_assert(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = tail call i32 @mem_assert(i8* %3)
ret i8* %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_container_to_start_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(8, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_container_to_start_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x8,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_container_to_start_solutions>:
mov    $0x8,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @copy_container_to_start_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 8, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int MIN(int, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int form_field_getrpos_default(const char *str, int cpos, void *arg) {
  return MIN(cpos, strlen(str));
}


x86 assembly (clang, -O0):
<form_field_getrpos_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1030 <MIN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<form_field_getrpos_default>:
push   %rbx
mov    %esi,%ebx
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <MIN@plt>

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

LLVM IR (-O2):
define i32 @form_field_getrpos_default(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @MIN(i32 %1, i32 %4)
ret i32 %5
}
void schedule(void) { return; }


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

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

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

LLVM IR (-O2):
define void @schedule() {
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int tsdiff(struct timespec *tv2, struct timespec *tv1) {
  return (tv2->tv_sec - tv1->tv_sec) * 1000 * 1000 * 1000 + tv2->tv_nsec -
         tv1->tv_nsec;
}


x86 assembly (clang, -O0):
<tsdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
imul   $0x3e8,%eax,%eax
imul   $0x3e8,%eax,%eax
imul   $0x3e8,%eax,%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x10(%rbp),%rcx
sub    0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsdiff>:
mov    (%rdi),%eax
sub    (%rsi),%eax
imul   $0x3b9aca00,%eax,%eax
add    0x4(%rdi),%eax
sub    0x4(%rsi),%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @tsdiff(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %4
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000
%13 = mul nsw i32 %12, 1000
%14 = mul nsw i32 %13, 1000
%15 = load %struct.timespec*, %struct.timespec** %3
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = add nsw i32 %14, %17
%19 = load %struct.timespec*, %struct.timespec** %4
%20 = getelementptr inbounds %struct.timespec, %struct.timespec* %19, i32 0, i32 1
%21 = load i32, i32* %20
%22 = sub nsw i32 %18, %21
ret i32 %22
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @tsdiff(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul i32 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%13 = load i32, i32* %12
%14 = sub i32 %11, %13
ret i32 %14
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t rollhash_step(uint32_t arg, uint32_t hash, uint8_t lose,
                       uint8_t gain) {
  return ((hash + 256 * 8355967 - lose * arg) % 8355967 * 256 + gain) % 8355967;
}


x86 assembly (clang, -O0):
<rollhash_step>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x7f807f00,%eax
mov    -0xc(%rbp),%ecx
imul   -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    $0x7f807f,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
shl    $0x8,%eax
add    -0x10(%rbp),%eax
mov    $0x7f807f,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rollhash_step>:
imul   %edx,%edi
sub    %edi,%esi
add    $0x7f807f00,%esi
movslq %esi,%rax
imul   $0x40400041,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x35,%rdx
add    %esi,%edx
imul   $0x7f807f,%edx,%edx
sub    %edx,%eax
shl    $0x8,%eax
add    %ecx,%eax
cltq
imul   $0x40400041,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x35,%rcx
add    %edx,%ecx
imul   $0x7f807f,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @rollhash_step(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 2139127552
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = mul nsw i32 %11, %12
%14 = sub nsw i32 %10, %13
%15 = srem i32 %14, 8355967
%16 = mul nsw i32 %15, 256
%17 = load i32, i32* %8
%18 = add nsw i32 %16, %17
%19 = srem i32 %18, 8355967
ret i32 %19
}

LLVM IR (-O2):
define i32 @rollhash_step(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, 2139127552
%6 = mul nsw i32 %2, %0
%7 = sub i32 %5, %6
%8 = srem i32 %7, 8355967
%9 = shl nsw i32 %8, 8
%10 = add nsw i32 %9, %3
%11 = srem i32 %10, 8355967
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x14() {
  Assert_real((isodigit(20) == 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_isodigit.c",
              105, ("isodigit should be 0 for 0x14"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x14>:
push   %rax
mov    $0x14,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x69,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x14\00"
define void @t_isodigit_0x14() {
%1 = call i64 @isodigit(i32 20)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 105, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x14\00"
define void @t_isodigit_0x14() {
%1 = tail call i64 @isodigit(i32 20)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 105, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int inb(int);
int is_transmit_empty_serial(int port) { return inb(port + 5) & 0x20; }


x86 assembly (clang, -O0):
<is_transmit_empty_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x5,%edi
call   1030 <inb@plt>
and    $0x20,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_transmit_empty_serial>:
push   %rax
add    $0x5,%edi
call   1030 <inb@plt>
and    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_transmit_empty_serial(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 5
%5 = call i32 @inb(i32 %4)
%6 = and i32 %5, 32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_transmit_empty_serial(i32 %0) {
%2 = add nsw i32 %0, 5
%3 = tail call i32 @inb(i32 %2)
%4 = and i32 %3, 32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, double);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ stdout;
void sequence_element_destroy(void *x, void *arg) {
  { arg = arg; }
  if (NULL != x) {
    fprintf(stdout, "\tdestroy element -> {object=>0x%p, value=>%.3f}\n", x,
            *(double *)x);
    free(x);
  }
}


x86 assembly (clang, -O0):
<sequence_element_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     116e <sequence_element_destroy+0x4e>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequence_element_destroy>:
test   %rdi,%rdi
je     114e <sequence_element_destroy+0x2e>
push   %rbx
mov    %rdi,%rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
movsd  (%rbx),%xmm0
lea    0xec3(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [49 x i8] c"\09destroy element -> {object=>0x%p, value=>%.3f}\0A\00"
define void @sequence_element_destroy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
store i8* %5, i8** %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* null, %6
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i32, i32* @stdout
%10 = load i8*, i8** %3
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %10, double %13)
%15 = load i8*, i8** %3
%16 = call i32 @free(i8* %15)
br label %17
17: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [49 x i8] c"\09destroy element -> {object=>0x%p, value=>%.3f}\0A\00"
define void @sequence_element_destroy(i8* %0, i8* nocapture readnone %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = load i32, i32* @stdout
%6 = bitcast i8* %0 to double*
%7 = load double, double* %6
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0, double %7)
%9 = tail call i32 @free(i8* %0)
br label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
float interpolate(float, float, int /*<<< orphan*/);
int /*<<< orphan*/ random2();
float random_range(float min_value, float max_value) {
  return interpolate(min_value, max_value, random2());
}


x86 assembly (clang, -O0):
<random_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <random2@plt>
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mov    %eax,%edi
call   1030 <interpolate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_range>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <random2@plt>
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
mov    %eax,%edi
pop    %rax
jmp    1030 <interpolate@plt>

LLVM IR (-O0):
define float @random_range(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i32 (...) @random2()
%8 = call float @interpolate(float %5, float %6, i32 %7)
ret float %8
}

LLVM IR (-O2):
define float @random_range(float %0, float %1) {
%3 = tail call i32 (...) @random2()
%4 = tail call float @interpolate(float %0, float %1, i32 %3)
ret float %4
}
unsigned char pampd_remote_cksum(void *pampd) {
  unsigned long fake_pampd = (unsigned long)pampd;
  return (fake_pampd >> ((((0 + 1) + 1) + 8) + 13)) & ((1UL << (8)) - 1);
}


x86 assembly (clang, -O0):
<pampd_remote_cksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x17,%rax
and    $0xff,%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pampd_remote_cksum>:
mov    %rdi,%rax
shr    $0x17,%rax
ret

LLVM IR (-O0):
define zeroext i8 @pampd_remote_cksum(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = lshr i64 %6, 23
%8 = and i64 %7, 255
%9 = trunc i64 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @pampd_remote_cksum(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 23
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int isdigit(int /*<<< orphan*/);
int iswdigit(wint_t wc) { return isdigit(wc); }


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

x86 assembly (clang, -O2):
<iswdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @iswdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct qlcnic_dcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct qlcnic_dcb *);
void qlcnic_clear_dcb_ops(struct qlcnic_dcb *dcb) { kfree(dcb); }


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

x86 assembly (clang, -O2):
<qlcnic_clear_dcb_ops>:
jmp    1030 <kfree@plt>

LLVM IR (-O0):
%struct.qlcnic_dcb = type { i32 }
define void @qlcnic_clear_dcb_ops(%struct.qlcnic_dcb* %0) {
%2 = alloca %struct.qlcnic_dcb*
store %struct.qlcnic_dcb* %0, %struct.qlcnic_dcb** %2
%3 = load %struct.qlcnic_dcb*, %struct.qlcnic_dcb** %2
%4 = call i32 @kfree(%struct.qlcnic_dcb* %3)
ret void
}

LLVM IR (-O2):
%struct.qlcnic_dcb = type { i32 }
define void @qlcnic_clear_dcb_ops(%struct.qlcnic_dcb* %0) {
%2 = tail call i32 @kfree(%struct.qlcnic_dcb* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("bd [-c N] [-g N] [-n N] [-o N] [-m|-l] [file]\n"
         "  -c N    number of bits\n"
         "  -g N    group size\n"
         "  -n N    groups per line\n"
         "  -o N    offset from the head\n"
         "  -l      least significant bit first\n"
         "  -m      most significant bit first\n");
}


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

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

LLVM IR (-O0):
@.str = [225 x i8] c"bd [-c N] [-g N] [-n N] [-o N] [-m|-l] [file]\0A -c N number of bits\0A -g N group size\0A -n N groups per line\0A -o N offset from the head\0A -l least significant bit first\0A -m most significant bit first\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [224 x i8] c"bd [-c N] [-g N] [-n N] [-o N] [-m|-l] [file]\0A -c N number of bits\0A -g N group size\0A -n N groups per line\0A -o N offset from the head\0A -l least significant bit first\0A -m most significant bit first\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([224 x i8], [224 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
char *get_last_dirsep(const char *p) { return strrchr(p, '/'); }


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

x86 assembly (clang, -O2):
<get_last_dirsep>:
mov    $0x2f,%esi
jmp    1030 <strrchr@plt>

LLVM IR (-O0):
define i8* @get_last_dirsep(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strrchr(i8* %3, i8 signext 47)
ret i8* %4
}

LLVM IR (-O2):
define i8* @get_last_dirsep(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void smallAdjustmentLE(unsigned a) {
  char *b = ((void *)0);
  if (a + 1 <= 2)
    b = malloc(1);
  if (a == 0 || a == 1 || a == (0x7fffffff * 2U + 1U))
    free(b);
  return;
}


x86 assembly (clang, -O0):
<smallAdjustmentLE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x2,%eax
ja     1150 <smallAdjustmentLE+0x30>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116e <smallAdjustmentLE+0x4e>
cmpl   $0x1,-0x4(%rbp)
je     116e <smallAdjustmentLE+0x4e>
cmpl   $0xffffffff,-0x4(%rbp)
jne    1177 <smallAdjustmentLE+0x57>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smallAdjustmentLE>:
add    $0x1,%edi
cmp    $0x2,%edi
ja     113c <smallAdjustmentLE+0x1c>
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @smallAdjustmentLE(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%6 = tail call i32 @free(i8* %5)
br label %7
7: ; preds = %1, %4
ret void
}