xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x10() {
  Assert_real((ispunct(16) == 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_ispunct.c",
              85, ("ispunct should be 0 for 0x10"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x10>:
push   %rax
mov    $0x10,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x55,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x10\00"
define void @t_ispunct_0x10() {
%1 = call i64 @ispunct(i32 16)
%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 85, i8* getelementptr inbounds ([29 x i8], [29 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x10\00"
define void @t_ispunct_0x10() {
%1 = tail call i64 @ispunct(i32 16)
%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 85, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushreal4array_(void *x, unsigned int *n) {
  pushNarray((char *)x, (*n * 4));
}


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

x86 assembly (clang, -O2):
<pushreal4array_>:
mov    (%rsi),%esi
shl    $0x2,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushreal4array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 4
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushreal4array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 2
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x = 25;
  int j = 2;
  int count = 0;
  while (j <= x) {
    if ((x % j) == 0) {
      ++count;
      ++j;
    } else {
      ++j;
    }
  }
  printf("%d can be divided by %d number(s)\n", x, count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x19,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1175 <main+0x65>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1167 <main+0x57>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1170 <main+0x60>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe7e(%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    $0x19,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"%d can be divided by %d number(s)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 25, i32* %2
store i32 2, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %22, %0
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %23
9: ; preds = %5
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = srem i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %22
19: ; preds = %9
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %22
22: ; preds = %19, %14
br label %5
23: ; preds = %5
%24 = load i32, i32* %2
%25 = load i32, i32* %4
%26 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"%d can be divided by %d number(s)\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 25, i32 2)
ret i32 0
}
void abort() { __builtin_trap(); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
ud2

x86 assembly (clang, -O2):
<abort>:
ud2

LLVM IR (-O0):
define void @abort() {
unreachable
}

LLVM IR (-O2):
define void @abort() {
tail call void @llvm.trap()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_help();
void processNormalKeys(unsigned char key, int x, int y) {
  switch (key) {
  case 'q':
    exit(0);
  case '?':
    print_help();
    break;
  }
}


x86 assembly (clang, -O0):
<processNormalKeys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x3f,%eax
je     1161 <processNormalKeys+0x41>
jmp    1149 <processNormalKeys+0x29>
mov    -0x10(%rbp),%eax
sub    $0x71,%eax
jne    1168 <processNormalKeys+0x48>
jmp    115a <processNormalKeys+0x3a>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   1030 <print_help@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processNormalKeys>:
cmp    $0x3f,%dil
je     112d <processNormalKeys+0xd>
cmp    $0x71,%dil
je     1134 <processNormalKeys+0x14>
ret
xor    %eax,%eax
jmp    1030 <print_help@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @processNormalKeys(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %13 [
i32 113, label %9
i32 63, label %11
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
%12 = call i32 (...) @print_help()
br label %13
13: ; preds = %3, %11
ret void
}

LLVM IR (-O2):
define void @processNormalKeys(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %8 [
i8 113, label %4
i8 63, label %6
]
4: ; preds = %3
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %3
%7 = tail call i32 (...) @print_help()
br label %8
8: ; preds = %3, %6
ret void
}
/* Type definitions */
struct tfCommand {
  int dummy;
};

/* Variables and functions */
int sesSCSIResponse(struct tfCommand *, int /*<<< orphan*/);
int sesSCSICmdResponse(struct tfCommand *cmd) {
  return sesSCSIResponse(cmd, 0);
}


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

x86 assembly (clang, -O2):
<sesSCSICmdResponse>:
xor    %esi,%esi
jmp    1030 <sesSCSIResponse@plt>

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

LLVM IR (-O2):
%struct.tfCommand = type { i32 }
define i32 @sesSCSICmdResponse(%struct.tfCommand* %0) {
%2 = tail call i32 @sesSCSIResponse(%struct.tfCommand* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int rand();
int randomInt(int nMin, int nMax) { return rand() % (nMax - nMin) + nMin; }


x86 assembly (clang, -O0):
<randomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomInt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @randomInt(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
int pRecAll(int argc) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pRecAll(i32 %0) {
ret i32 1
}
void testClosureDSrV(void (*closure)(double, short), double a1, short a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureDSrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
movswl -0x12(%rbp),%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureDSrV>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureDSrV(void (double, i16)* %0, double %1, i16 signext %2) {
%4 = alloca void (double, i16)*
%5 = alloca double
%6 = alloca i16
store void (double, i16)* %0, void (double, i16)** %4
store double %1, double* %5
store i16 %2, i16* %6
%7 = load void (double, i16)*, void (double, i16)** %4
%8 = load double, double* %5
%9 = load i16, i16* %6
ret void
}

LLVM IR (-O2):
define void @testClosureDSrV(void (double, i16)* nocapture %0, double %1, i16 signext %2) {
tail call void %0(double %1, i16 signext %2)
ret void
}
int is_nan(double x) { return (x != x); }


x86 assembly (clang, -O0):
<is_nan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_nan>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @is_nan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp une double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_nan(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
char *NumText(n)
int n;
{
  static char x[16];
  if (n > 29999)
    sprintf(x, "F%d", n - 30000);
  else
    sprintf(x, "%d", n);
  return (x);
}


x86 assembly (clang, -O0):
<NumText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x752f,-0x4(%rbp)
jle    114b <NumText+0x3b>
mov    -0x4(%rbp),%edx
sub    $0x7530,%edx
lea    0x2f08(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    1163 <NumText+0x53>
mov    -0x4(%rbp),%edx
lea    0x2eeb(%rip),%rdi
lea    0xea5(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2ed6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumText>:
push   %rax
mov    %edi,%edx
cmp    $0x7530,%edi
jl     1131 <NumText+0x21>
add    $0xffff8ad0,%edx
lea    0x2f18(%rip),%rdi
lea    0xed1(%rip),%rsi
jmp    113f <NumText+0x2f>
lea    0x2f08(%rip),%rdi
lea    0xec2(%rip),%rsi
xor    %eax,%eax
call   1030 <sprintf@plt>
lea    0x2ef3(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@NumText.x = internal global [16 x i8] zeroinitializer
@.str = [4 x i8] c"F%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i8* @NumText(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 29999
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 30000
%8 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @NumText.x, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @NumText.x, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %5
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @NumText.x, i64 0, i64 0)
}

LLVM IR (-O2):
@NumText.x = internal global [16 x i8] zeroinitializer
@.str = [4 x i8] c"F%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i8* @NumText(i32 %0) {
%2 = icmp sgt i32 %0, 29999
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = add nsw i32 %0, -30000
%5 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @NumText.x, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %8
6: ; preds = %1
%7 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @NumText.x, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %3
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @NumText.x, i64 0, i64 0)
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
};

/* Variables and functions */
long ftp_i_seconds_between(struct timeval t1, struct timeval t2) {
  if (t1.tv_sec > t2.tv_sec)
    return t1.tv_sec - t2.tv_sec;
  else
    return t2.tv_sec - t1.tv_sec;
}


x86 assembly (clang, -O0):
<ftp_i_seconds_between>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    112b <ftp_i_seconds_between+0x2b>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <ftp_i_seconds_between+0x37>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftp_i_seconds_between>:
mov    %rdi,%rax
sub    %rsi,%rax
neg    %rax
sub    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i64 @ftp_i_seconds_between(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca %struct.timeval
%5 = alloca %struct.timeval
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i64 %0, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i64 %1, i64* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%9 = load i64, i64* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%11 = load i64, i64* %10
%12 = icmp sgt i64 %9, %11
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%15 = load i64, i64* %14
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%17 = load i64, i64* %16
%18 = sub nsw i64 %15, %17
store i64 %18, i64* %3
br label %25
19: ; preds = %2
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%21 = load i64, i64* %20
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%23 = load i64, i64* %22
%24 = sub nsw i64 %21, %23
store i64 %24, i64* %3
br label %25
25: ; preds = %19, %13
%26 = load i64, i64* %3
ret i64 %26
}

LLVM IR (-O2):
define i64 @ftp_i_seconds_between(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = sub nsw i64 %0, %1
%5 = sub nsw i64 %1, %0
%6 = select i1 %3, i64 %4, i64 %5
ret i64 %6
}
int div(int x, int y) { return (x / y); }


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

x86 assembly (clang, -O2):
<div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @div(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 = load i32, i32* %4
%7 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
__attribute__((always_)) const long double xtruncl(long double x) {
  return (long double)(int)x;
}


x86 assembly (clang, -O0):
<xtruncl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x1c(%rbp)
fldcw  -0x1c(%rbp)
fistpl -0x18(%rbp)
fldcw  -0x1a(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
fildl  -0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtruncl>:
fldt   0x8(%rsp)
fnstcw -0xc(%rsp)
movzwl -0xc(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0xa(%rsp)
fldcw  -0xa(%rsp)
fistpl -0x8(%rsp)
fldcw  -0xc(%rsp)
mov    -0x8(%rsp),%eax
mov    %eax,-0x4(%rsp)
fildl  -0x4(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @xtruncl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptosi x86_fp80 %3 to i32
%5 = sitofp i32 %4 to x86_fp80
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @xtruncl(x86_fp80 %0) {
%2 = fptosi x86_fp80 %0 to i32
%3 = sitofp i32 %2 to x86_fp80
ret x86_fp80 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  uint32_t i;
  unsigned char *cp;
  i = 0x04030201;
  cp = (unsigned char *)&i;
  if (*cp == 1)
    printf("little-endian\n");
  else if (*cp == 4)
    printf("big-endian\n");
  else
    printf("who knows?\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4030201,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x1,%eax
jne    115f <main+0x3f>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    1191 <main+0x71>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x4,%eax
jne    1180 <main+0x60>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x6c>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
jmp    1191 <main+0x71>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"little-endian\0A\00"
@.str.1 = [12 x i8] c"big-endian\0A\00"
@.str.2 = [12 x i8] c"who knows?\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 67305985, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %21
11: ; preds = %0
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = icmp eq i32 %14, 4
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %20
18: ; preds = %11
%19 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
br label %21
21: ; preds = %20, %9
%22 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [14 x i8] c"little-endian\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))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int, float, float);
int /*<<< orphan*/ printfail();
void fexpectf(char *file, int line, float a, float b) {
  if (a == b)
    return;
  printfail();
  printf("%s:%d: %f expected, but got %f\n", file, line, a, b);
  exit(1);
}


x86 assembly (clang, -O0):
<fexpectf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
jne    1164 <fexpectf+0x34>
jp     1164 <fexpectf+0x34>
add    $0x20,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1040 <printfail@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fexpectf>:
ucomiss %xmm1,%xmm0
jne    1138 <fexpectf+0x8>
jp     1138 <fexpectf+0x8>
ret
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
call   1040 <printfail@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"%s:%d: %f expected, but got %f\0A\00"
define void @fexpectf(i8* %0, i32 %1, float %2, float %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca float
%8 = alloca float
store i8* %0, i8** %5
store i32 %1, i32* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %8
%11 = fcmp oeq float %9, %10
br i1 %11, label %12, label %13
12: ; preds = %4
ret void
13: ; preds = %4
%14 = call i32 (...) @printfail()
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = load float, float* %7
%18 = load float, float* %8
%19 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16, float %17, float %18)
%20 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"%s:%d: %f expected, but got %f\0A\00"
define void @fexpectf(i8* %0, i32 %1, float %2, float %3) {
%5 = fcmp oeq float %2, %3
br i1 %5, label %6, label %7
6: ; preds = %4
ret void
7: ; preds = %4
%8 = tail call i32 (...) @printfail()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, float %2, float %3)
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xf9() {
  Assert_real((isgraph(249) == 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_isgraph.c",
              1250, ("isgraph should be 0 for 0xf9"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xf9>:
push   %rax
mov    $0xf9,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4e2,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf9\00"
define void @t_isgraph_0xf9() {
%1 = call i64 @isgraph(i32 249)
%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 1250, i8* getelementptr inbounds ([29 x i8], [29 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf9\00"
define void @t_isgraph_0xf9() {
%1 = tail call i64 @isgraph(i32 249)
%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 1250, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_8Fuint8_reg(unsigned char val) {
  return ((val) & (0x8F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Fuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -113
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_unable_to_create_conversion_map() {
  fprintf(stderr, "Unable to create conversion map\n");
}


x86 assembly (clang, -O0):
<print_unable_to_create_conversion_map>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_unable_to_create_conversion_map>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Unable to create conversion map\0A\00"
define void @print_unable_to_create_conversion_map() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Unable to create conversion map\0A\00"
define void @print_unable_to_create_conversion_map() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ littleEndian();
uint32_t byteswap32(uint32_t num32) {
  if (littleEndian()) {
    return ((num32 >> 3 * 8) & 0x000000ff) | ((num32 << 1 * 8) & 0x00ff0000) |
           ((num32 >> 1 * 8) & 0x0000ff00) | ((num32 << 3 * 8) & 0xff000000);
  } else {
    return num32;
  }
}


x86 assembly (clang, -O0):
<byteswap32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <littleEndian@plt>
cmp    $0x0,%rax
je     1169 <byteswap32+0x59>
mov    -0x8(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x18,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <byteswap32+0x5f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteswap32>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <littleEndian@plt>
test   %rax,%rax
mov    %ebx,%eax
bswap  %eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @byteswap32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @littleEndian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %22
6: ; preds = %1
%7 = load i32, i32* %3
%8 = ashr i32 %7, 24
%9 = and i32 %8, 255
%10 = load i32, i32* %3
%11 = shl i32 %10, 8
%12 = and i32 %11, 16711680
%13 = or i32 %9, %12
%14 = load i32, i32* %3
%15 = ashr i32 %14, 8
%16 = and i32 %15, 65280
%17 = or i32 %13, %16
%18 = load i32, i32* %3
%19 = shl i32 %18, 24
%20 = and i32 %19, -16777216
%21 = or i32 %17, %20
store i32 %21, i32* %2
br label %24
22: ; preds = %1
%23 = load i32, i32* %3
store i32 %23, i32* %2
br label %24
24: ; preds = %22, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @byteswap32(i32 %0) {
%2 = tail call i64 (...) @littleEndian()
%3 = icmp eq i64 %2, 0
%4 = tail call i32 @llvm.bswap.i32(i32 %0)
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
bool nrf52_errata_243(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_243() {
ret i32 0
}
/* Variables and functions */
scalar_t__ q_islower(int);
scalar_t__ q_isupper(int);
int q_isalpha(int c) { return (q_islower(c) || q_isupper(c)); }


x86 assembly (clang, -O0):
<q_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <q_islower@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <q_isalpha+0x37>
mov    -0x4(%rbp),%edi
call   1030 <q_isupper@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <q_islower@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <q_isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <q_isupper@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @q_isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @q_islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @q_isupper(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @q_isalpha(i32 %0) {
%2 = tail call i64 @q_islower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @q_isupper(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t getdns_get_api_version_number(void) { return 0x07df0700; }


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

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

LLVM IR (-O0):
define i32 @getdns_get_api_version_number() {
ret i32 132056832
}

LLVM IR (-O2):
define i32 @getdns_get_api_version_number() {
ret i32 132056832
}
unsigned int hkey(unsigned char *sha) { return (*(unsigned int *)sha) % 8192; }


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

x86 assembly (clang, -O2):
<hkey>:
mov    $0x1fff,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hkey(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = urem i32 %5, 8192
ret i32 %6
}

LLVM IR (-O2):
define i32 @hkey(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = and i32 %3, 8191
ret i32 %4
}
OP(fd, fa) { op_fa(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_fa()
ret i32 undef
}
int line_is_comment(char *_buffer) {
  unsigned int i = 0;
  char c;
  do {
    c = _buffer[i];
    i++;
  } while (c == ' ' || c == '\t');
  if (c == '#' || c == '\0')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<line_is_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movsbl -0x15(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x16(%rbp)
je     1144 <line_is_comment+0x44>
movsbl -0x15(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
test   $0x1,%al
jne    110f <line_is_comment+0xf>
movsbl -0x15(%rbp),%eax
cmp    $0x23,%eax
je     1169 <line_is_comment+0x69>
movsbl -0x15(%rbp),%eax
cmp    $0x0,%eax
jne    1175 <line_is_comment+0x75>
movl   $0x1,-0x4(%rbp)
jmp    117c <line_is_comment+0x7c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_is_comment>:
xor    %eax,%eax
lea    0xef7(%rip),%rcx
nopl   0x0(%rax)
mov    %eax,%edx
movzbl (%rdi,%rdx,1),%edx
cmp    $0x23,%rdx
ja     1130 <line_is_comment+0x30>
movslq (%rcx,%rdx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
add    $0x1,%eax
jmp    1110 <line_is_comment+0x10>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @line_is_comment(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i32 [ 0, %1 ], [ %8, %7 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %10 [
i8 32, label %7
i8 9, label %7
i8 35, label %9
i8 0, label %9
]
7: ; preds = %2, %2
%8 = add i32 %3, 1
br label %2
9: ; preds = %2, %2
br label %10
10: ; preds = %2, %9
%11 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void A(void) { putchar('A'); }


x86 assembly (clang, -O0):
<A>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<A>:
mov    $0x41,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @A() {
%1 = call i32 @putchar(i8 signext 65)
ret void
}

LLVM IR (-O2):
define void @A() {
%1 = tail call i32 @putchar(i8 signext 65)
ret void
}
/* Type definitions */
struct connectdata {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t Curl_ssl_recv(struct connectdata *conn, int sockindex, char *mem,
                      size_t len) {
  (void)conn;
  (void)sockindex;
  (void)mem;
  (void)len;
  return 0;
}


x86 assembly (clang, -O0):
<Curl_ssl_recv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.connectdata = type { i32 }
define i32 @Curl_ssl_recv(%struct.connectdata* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca %struct.connectdata*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store %struct.connectdata* %0, %struct.connectdata** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load %struct.connectdata*, %struct.connectdata** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
ret i32 0
}

LLVM IR (-O2):
%struct.connectdata = type { i32 }
define i32 @Curl_ssl_recv(%struct.connectdata* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i64 %3) {
ret i32 0
}
__attribute__((no, noclone)) char *f3(char *p, int i) { return p + i; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @f3(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @f3(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
int safe_inc_int(int *iptr) {
  int ival;
  ival = 0;
  if (iptr) {
    ival = *iptr;
    ival++;
    if (ival == 0) {
      ival = 1;
    }
    *iptr = ival;
  }
  return (ival);
}


x86 assembly (clang, -O0):
<safe_inc_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <safe_inc_int+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113d <safe_inc_int+0x3d>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_inc_int>:
test   %rdi,%rdi
je     1114 <safe_inc_int+0x14>
mov    (%rdi),%ecx
inc    %ecx
mov    $0x1,%eax
cmovne %ecx,%eax
mov    %eax,(%rdi)
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @safe_inc_int(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32, i32* %0
%5 = add nsw i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 1, i32 %5
store i32 %7, i32* %0
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ %7, %3 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Msp430ClockP__Msp430ClockInit__default__setupDcoCalibrate();
void Msp430ClockP__Msp430ClockInit__setupDcoCalibrate(void) {
  Msp430ClockP__Msp430ClockInit__default__setupDcoCalibrate();
}


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

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

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

LLVM IR (-O2):
define void @Msp430ClockP__Msp430ClockInit__setupDcoCalibrate() {
%1 = tail call i32 (...) @Msp430ClockP__Msp430ClockInit__default__setupDcoCalibrate()
ret void
}
void mpu_enter_powersave(void) {}


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

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

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

LLVM IR (-O2):
define void @mpu_enter_powersave() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *execname) {
  printf("Usage: %s <obj or exec>\n"
         "  <obj | exec | lib>: path to the ELF binary to examine\n",
         execname);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [81 x i8] c"Usage: %s <obj or exec>\0A <obj | exec | lib>: path to the ELF binary to examine\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [81 x i8] c"Usage: %s <obj or exec>\0A <obj | exec | lib>: path to the ELF binary to examine\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ pause();
int /*<<< orphan*/ raise(int);
int /*<<< orphan*/ setsig_fatal_gen(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                    char *);
__attribute__((noreturn)) void raisesignal(int sig) {
  setsig_fatal_gen(sig, SIG_DFL, 0, "restoring");
  raise(sig);
  while (1)
    pause();
}


x86 assembly (clang, -O0):
<raisesignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
lea    0xeb0(%rip),%rcx
call   1050 <setsig_fatal_gen@plt>
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
mov    $0x0,%al
call   1040 <pause@plt>
jmp    115d <raisesignal+0x2d>

x86 assembly (clang, -O2):
<raisesignal>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rcx
xor    %edx,%edx
call   1050 <setsig_fatal_gen@plt>
mov    %ebx,%edi
call   1030 <raise@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <pause@plt>
jmp    1160 <raisesignal+0x30>

LLVM IR (-O0):
@SIG_DFL = global i32 0
@.str = [10 x i8] c"restoring\00"
define void @raisesignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_DFL
%5 = call i32 @setsig_fatal_gen(i32 %3, i32 %4, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @raise(i32 %6)
br label %8
8: ; preds = %1, %8
%9 = call i32 (...) @pause()
br label %8
}

LLVM IR (-O2):
@SIG_DFL = global i32 0
@.str = [10 x i8] c"restoring\00"
define void @raisesignal(i32 %0) {
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @setsig_fatal_gen(i32 %0, i32 %2, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @raise(i32 %0)
br label %5
5: ; preds = %1, %5
%6 = tail call i32 (...) @pause()
br label %5
}
void rk_virt_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @rk_virt_cleanup() {
ret void
}
/* Type definitions */
struct dm_ioctl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct dm_ioctl *);
void free_ctl(struct dm_ioctl *ctl) { free(ctl); }


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

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

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

LLVM IR (-O2):
%struct.dm_ioctl = type { i32 }
define void @free_ctl(%struct.dm_ioctl* nocapture %0) {
%2 = tail call i32 @free(%struct.dm_ioctl* %0)
ret void
}
/* Variables and functions */
scalar_t__ strcasestr(char const *, char const *);
char *mbstrcasestr(const char *haystack, const char *needle) {
  return (char *)strcasestr(haystack, needle);
}


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

x86 assembly (clang, -O2):
<mbstrcasestr>:
jmp    1030 <strcasestr@plt>

LLVM IR (-O0):
define i8* @mbstrcasestr(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 i64 @strcasestr(i8* %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @mbstrcasestr(i8* %0, i8* %1) {
%3 = tail call i64 @strcasestr(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}