xunge/DecIR huggingface dataset:
/* Type definitions */
struct XmlNode {
  int dummy;
};
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ XmlNode_setValue(struct XmlNode *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void XmlNode_setValueInt(struct XmlNode *node, int value) {
  char str[128];
  snprintf(str, sizeof(str), "%d", value);
  XmlNode_setValue(node, str);
}


x86 assembly (clang, -O0):
<XmlNode_setValueInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x80,%esi
lea    0xeb8(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1040 <XmlNode_setValue@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XmlNode_setValueInt>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xeca(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x80,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <XmlNode_setValue@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.XmlNode = type { i32 }
@.str = [3 x i8] c"%d\00"
define void @XmlNode_setValueInt(%struct.XmlNode* %0, i32 %1) {
%3 = alloca %struct.XmlNode*
%4 = alloca i32
%5 = alloca [128 x i8]
store %struct.XmlNode* %0, %struct.XmlNode** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @snprintf(i8* %6, i32 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load %struct.XmlNode*, %struct.XmlNode** %3
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = call i32 @XmlNode_setValue(%struct.XmlNode* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.XmlNode = type { i32 }
@.str = [3 x i8] c"%d\00"
define void @XmlNode_setValueInt(%struct.XmlNode* %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @XmlNode_setValue(%struct.XmlNode* %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ rename(char *, char *);
int main() {
  if (rename("viejo.txt", "nuevo.txt") == 0)
    printf("Fichero renombrado con exito");
  else
    printf("Error: no se puede renombrar el fichero");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1040 <rename@plt>
cmp    $0x0,%rax
jne    115d <main+0x3d>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <main+0x49>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <rename@plt>
test   %rax,%rax
lea    0xed6(%rip),%rax
lea    0xeec(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"viejo.txt\00"
@.str.1 = [10 x i8] c"nuevo.txt\00"
@.str.2 = [29 x i8] c"Fichero renombrado con exito\00"
@.str.3 = [40 x i8] c"Error: no se puede renombrar el fichero\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @rename(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"viejo.txt\00"
@.str.1 = [10 x i8] c"nuevo.txt\00"
@.str.2 = [29 x i8] c"Fichero renombrado con exito\00"
@.str.3 = [40 x i8] c"Error: no se puede renombrar el fichero\00"
define i32 @main() {
%1 = tail call i64 @rename(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
void testMotors() {}


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

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

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

LLVM IR (-O2):
define void @testMotors() {
ret void
}
void gtk_check_menu_item_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_check_menu_item_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hello(char *);
int main(void) {
  hello("Hello,world!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello,world!\0A\00"
define i32 @main() {
%1 = tail call i32 @hello(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t getnum(int sign, int exponent, int mantissa) {
  uint32_t thisnumber;
  thisnumber = sign << 31;
  thisnumber |= exponent << 23;
  thisnumber |= mantissa;
  return thisnumber;
}


x86 assembly (clang, -O0):
<getnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x17,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnum>:
mov    %esi,%eax
shl    $0x1f,%edi
shl    $0x17,%eax
or     %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @getnum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = shl i32 %8, 31
store i32 %9, i32* %7
%10 = load i32, i32* %5
%11 = shl i32 %10, 23
%12 = load i32, i32* %7
%13 = or i32 %12, %11
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = or i32 %15, %14
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @getnum(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 31
%5 = shl i32 %1, 23
%6 = or i32 %5, %4
%7 = or i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void modifyArray(char arr[]) {
  arr[0] = 'Y';
  printf("Inside Function:\t%s\n", arr);
}


x86 assembly (clang, -O0):
<modifyArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x59,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modifyArray>:
mov    %rdi,%rsi
movb   $0x59,(%rdi)
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Inside Function:\09%s\0A\00"
define void @modifyArray(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 89, i8* %4
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Inside Function:\09%s\0A\00"
define void @modifyArray(i8* %0) {
store i8 89, i8* %0
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wfd_cfg_capability_usage(void) {
  printf("Usage : wfd_capability [<DeviceCapability> <GroupCapability>]\n");
  printf("For 'set' both DeviceCapability and GroupCapability should be "
         "provided.\n");
  printf("If no parameter is specified,'get' is performed.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wfd_cfg_capability_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf56(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"Usage : wfd_capability [<DeviceCapability> <GroupCapability>]\0A\00"
@.str.1 = [73 x i8] c"For 'set' both DeviceCapability and GroupCapability should be provided.\0A\00"
@.str.2 = [50 x i8] c"If no parameter is specified,'get' is performed.\0A\00"
define void @print_wfd_cfg_capability_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [62 x i8] c"Usage : wfd_capability [<DeviceCapability> <GroupCapability>]\00"
@str.3 = [72 x i8] c"For 'set' both DeviceCapability and GroupCapability should be provided.\00"
@str.4 = [49 x i8] c"If no parameter is specified,'get' is performed.\00"
define void @print_wfd_cfg_capability_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *plcrash_sysctl_malloc(char const *, int /*<<< orphan*/ *);
char *plcrash_sysctl_string(const char *name) {
  return plcrash_sysctl_malloc(name, NULL);
}


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

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

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

LLVM IR (-O2):
define i8* @plcrash_sysctl_string(i8* %0) {
%2 = tail call i8* @plcrash_sysctl_malloc(i8* %0, i32* null)
ret i8* %2
}
int descending(double *a1, double *a2) {
  double loc = *a2;
  double loc2 = *a1;
  if (loc < loc2) {
    return -1;
  } else if (loc == loc2) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<descending>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <descending+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <descending+0x74>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1168 <descending+0x68>
jp     1168 <descending+0x68>
movl   $0x0,-0x4(%rbp)
jmp    1174 <descending+0x74>
jmp    116d <descending+0x6d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<descending>:
movsd  (%rsi),%xmm0
movsd  (%rdi),%xmm1
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rcx
and    $0x1,%ecx
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @descending(double* %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca double*
%6 = alloca double
%7 = alloca double
store double* %0, double** %4
store double* %1, double** %5
%8 = load double*, double** %5
%9 = load double, double* %8
store double %9, double* %6
%10 = load double*, double** %4
%11 = load double, double* %10
store double %11, double* %7
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %23
16: ; preds = %2
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp oeq double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %3
br label %23
21: ; preds = %16
br label %22
22: ; preds = %21
store i32 1, i32* %3
br label %23
23: ; preds = %22, %20, %15
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @descending(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = fcmp olt double %3, %4
%6 = fcmp une double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led0Toggle();
void EchoP__Leds__led0Toggle(void) { LedsP__Leds__led0Toggle(); }


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

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

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

LLVM IR (-O2):
define void @EchoP__Leds__led0Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led0Toggle()
ret void
}
unsigned int _mpyhu(unsigned int src1, unsigned int src2) {
  return (unsigned short)(src1 >> 16) * (unsigned short)(src2 >> 16);
}


x86 assembly (clang, -O0):
<_mpyhu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
movzwl %ax,%eax
mov    -0x8(%rbp),%ecx
shr    $0x10,%ecx
movzwl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpyhu>:
mov    %esi,%eax
shr    $0x10,%edi
shr    $0x10,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @_mpyhu(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 = lshr i32 %5, 16
%7 = trunc i32 %6 to i16
%8 = zext i16 %7 to i32
%9 = load i32, i32* %4
%10 = lshr i32 %9, 16
%11 = trunc i32 %10 to i16
%12 = zext i16 %11 to i32
%13 = mul nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @_mpyhu(i32 %0, i32 %1) {
%3 = lshr i32 %0, 16
%4 = lshr i32 %1, 16
%5 = mul nuw nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xcb() {
  Assert_real((isodigit(203) == 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",
              1020, ("isodigit should be 0 for 0xcb"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xcb>:
push   %rax
mov    $0xcb,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3fc,%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 0xcb\00"
define void @t_isodigit_0xcb() {
%1 = call i64 @isodigit(i32 203)
%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 1020, 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 0xcb\00"
define void @t_isodigit_0xcb() {
%1 = tail call i64 @isodigit(i32 203)
%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 1020, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_long(intptr_t);
intptr_t strlen(char *);
intptr_t write(int, char *, intptr_t);
int /*<<< orphan*/ x_perror(char *);
void send_string(char *string) {
  intptr_t length = strlen(string);
  send_long(length);
  if (write(1, string, length) != length) {
    x_perror("send_string");
  }
}


x86 assembly (clang, -O0):
<send_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <send_long@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1050 <write@plt>
cmp    -0x10(%rbp),%rax
je     118a <send_string+0x4a>
lea    0xe7b(%rip),%rdi
call   1040 <x_perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1060 <strlen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <send_long@plt>
mov    $0x1,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <write@plt>
cmp    %rbx,%rax
jne    1174 <send_string+0x34>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe85(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <x_perror@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"send_string\00"
define void @send_string(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i32 @send_long(i64 %2)
%4 = tail call i64 @write(i32 1, i8* %0, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @x_perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ph_http_post_destroy(void *handler) {
  free(handler);
  return 0;
}


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

x86 assembly (clang, -O2):
<ph_http_post_destroy>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ph_http_post_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void seashell() {
  printf("Our systems are breached :(\n");
  system("/bin/sh");
}


x86 assembly (clang, -O0):
<seashell>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<seashell>:
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Our systems are breached :(\0A\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define void @seashell() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"/bin/sh\00"
@str = [28 x i8] c"Our systems are breached :(\00"
define void @seashell() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void display_usage(void) {
  puts("doc2html - convert documents to HTML");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<display_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [37 x i8] c"doc2html - convert documents to HTML\00"
@EXIT_FAILURE = global i32 0
define void @display_usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [37 x i8] c"doc2html - convert documents to HTML\00"
@EXIT_FAILURE = global i32 0
define void @display_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void PrintVersion() {
  printf("elfo %i.%i.%i%s by Julio Carlos Sanchez Ortega\n", 0, 6, 0, "");
  printf("(c) Copyright 2007 Tearlach Software. All Rights Reserved.\n\n");
}


x86 assembly (clang, -O0):
<PrintVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %ecx,%ecx
mov    $0x6,%edx
lea    0xf43(%rip),%r8
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintVersion>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf3c(%rip),%r8
xor    %esi,%esi
mov    $0x6,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeea(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"elfo %i.%i.%i%s by Julio Carlos Sanchez Ortega\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [61 x i8] c"(c) Copyright 2007 Tearlach Software. All Rights Reserved.\0A\0A\00"
define void @PrintVersion() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 0, i32 6, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"elfo %i.%i.%i%s by Julio Carlos Sanchez Ortega\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@str = [60 x i8] c"(c) Copyright 2007 Tearlach Software. All Rights Reserved.\0A\00"
define void @PrintVersion() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 0, i32 6, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long gettime(void) {
  struct timespec t;
  clock_gettime(CLOCK_MONOTONIC, &t);
  return (t.tv_nsec / 1000 + (t.tv_sec * 1000000));
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,-0x4(%rbp),%ecx
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
movslq (%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
movslq 0x4(%rsp),%rcx
imul   $0xf4240,%rcx,%rcx
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @gettime() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000000
%10 = add nsw i32 %6, %9
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @gettime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000000
%11 = add nsw i32 %10, %7
%12 = sext i32 %11 to i64
ret i64 %12
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ __wbeu08(int *, int);
int i2c_transact(int, int, int *, int, int /*<<< orphan*/);
int i2c_write_beuint08(int fd, int chip_addr, int reg, uint8_t value) {
  uint8_t data[1 + sizeof(uint8_t)];
  data[0] = reg;
  __wbeu08(&data[1], (uint8_t)value);
  return i2c_transact(fd, chip_addr, data, 1 + sizeof(uint8_t), 0);
}


x86 assembly (clang, -O0):
<i2c_write_beuint08>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%esi
call   1040 <__wbeu08@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x30(%rbp),%rdx
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1030 <i2c_transact@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write_beuint08>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %ecx,%esi
call   1040 <__wbeu08@plt>
mov    %rsp,%rdx
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1030 <i2c_transact@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @i2c_write_beuint08(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [5 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 1
%13 = load i32, i32* %8
%14 = call i32 @__wbeu08(i32* %12, i32 %13)
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%18 = call i32 @i2c_transact(i32 %15, i32 %16, i32* %17, i32 5, i32 0)
ret i32 %18
}

LLVM IR (-O2):
define i32 @i2c_write_beuint08(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [5 x i32]
%6 = bitcast [5 x i32]* %5 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
store i32 %2, i32* %7
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 1
%9 = call i32 @__wbeu08(i32* %8, i32 %3)
%10 = call i32 @i2c_transact(i32 %0, i32 %1, i32* %7, i32 5, i32 0)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strcmp(char *, char *);
void strcmp_constant0() { clang_analyzer_eval(strcmp("123", "123") == 0); }


x86 assembly (clang, -O0):
<strcmp_constant0>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rsi
mov    %rsi,%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_constant0>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @strcmp_constant0() {
%1 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @clang_analyzer_eval(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @strcmp_constant0() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *strmax(char *s1, char *s2) {
  if (strcmp(s1, s2) > 0)
    return s1;
  return s2;
}


x86 assembly (clang, -O0):
<strmax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jle    1144 <strmax+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <strmax+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmax>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strcmp@plt>
test   %rax,%rax
cmovg  %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strmax(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i8*, i8** %4
store i8* %11, i8** %3
br label %14
12: ; preds = %2
%13 = load i8*, i8** %5
store i8* %13, i8** %3
br label %14
14: ; preds = %12, %10
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @strmax(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp sgt i64 %3, 0
%5 = select i1 %4, i8* %0, i8* %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int usage_buy(const char *pname, int exit) {
  printf("Usage: %s FILE buy [15RR [20RI [...]]]\n"
         "\n"
         "Register a 'buy' order of 15RR, 20RI, ...\n",
         pname);
  return exit;
}


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

x86 assembly (clang, -O2):
<usage_buy>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [83 x i8] c"Usage: %s FILE buy [15RR [20RI [...]]]\0A\0ARegister a 'buy' order of 15RR, 20RI, ...\0A\00"
define i32 @usage_buy(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 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
@.str = [83 x i8] c"Usage: %s FILE buy [15RR [20RI [...]]]\0A\0ARegister a 'buy' order of 15RR, 20RI, ...\0A\00"
define i32 @usage_buy(i8* %0, i32 returned %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %1
}
void dog_exit() {}


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

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

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

LLVM IR (-O2):
define void @dog_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char *);
void reassign(char **dst, char *src) {
  if (*dst)
    free(*dst);
  *dst = strdup(src);
}


x86 assembly (clang, -O0):
<reassign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114a <reassign+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reassign>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1137 <reassign+0x17>
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @reassign(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** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %8, %2
%13 = load i8*, i8** %4
%14 = call i8* @strdup(i8* %13)
%15 = load i8**, i8*** %3
store i8* %14, i8** %15
ret void
}

LLVM IR (-O2):
define void @reassign(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = tail call i8* @strdup(i8* %1)
store i8* %8, i8** %0
ret void
}
float __ocl_length_float(float src) { return src < 0 ? -src : src; }


x86 assembly (clang, -O0):
<__ocl_length_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <__ocl_length_float+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <__ocl_length_float+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_length_float>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__ocl_length_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}

LLVM IR (-O2):
define float @__ocl_length_float(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int TruncStrCmp(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ len(char *);
int IsRun(char *str) {
  int retVal;
  retVal = TruncStrCmp(len("run"), str, "run");
  if (retVal < 1)
    return 0;
  return retVal;
}


x86 assembly (clang, -O0):
<IsRun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <len@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
lea    0xebb(%rip),%rdx
call   1040 <TruncStrCmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jge    1163 <IsRun+0x43>
movl   $0x0,-0x4(%rbp)
jmp    1169 <IsRun+0x49>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsRun>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1030 <len@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <TruncStrCmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovs  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"run\00"
define i32 @IsRun(i8* %0) {
%2 = tail call i32 @len(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @TruncStrCmp(i32 %2, i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sqrt(int);
int main(void) {
  int resultado;
  resultado = (-(-9) + sqrt((-9) * (-9) - 4 * 3 * 6)) / (2 * 3);
  printf("O resultado é %d\n", resultado);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x9,%edi
call   1040 <sqrt@plt>
add    $0x9,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1040 <sqrt@plt>
add    $0x9,%eax
cltq
imul   $0x2aaaaaab,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
shr    $0x20,%rsi
add    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"O resultado \C3\A9 %d\0A\00"
define i32 @main() {
%1 = tail call i32 @sqrt(i32 9)
%2 = add nsw i32 %1, 9
%3 = sdiv i32 %2, 6
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t crc32_add_bit(uint32_t crc, int bit) {
  int lbit = crc & 1;
  crc = crc >> 1;
  if (lbit != bit)
    crc ^= 0xEDB88320;
  return crc;
}


x86 assembly (clang, -O0):
<crc32_add_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1133 <crc32_add_bit+0x33>
mov    -0x4(%rbp),%eax
xor    $0xedb88320,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32_add_bit>:
mov    %edi,%ecx
and    $0x1,%ecx
sar    %edi
mov    %edi,%eax
xor    $0xedb88320,%eax
cmp    %esi,%ecx
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @crc32_add_bit(i32 %0, i32 %1) {
%3 = and i32 %0, 1
%4 = ashr i32 %0, 1
%5 = icmp eq i32 %3, %1
%6 = xor i32 %4, -306674912
%7 = select i1 %5, i32 %4, i32 %6
ret i32 %7
}
/* Variables and functions */
long long fabs(long long);
long long gcdi(long long, long long);
long long lcmu(long long a, long long b) { return fabs(a * b) / gcdi(a, b); }


x86 assembly (clang, -O0):
<lcmu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <fabs@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <gcdi@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cqto
idiv   %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcmu>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsi,%rdi
imul   %rbx,%rdi
call   1030 <fabs@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <gcdi@plt>
mov    %rax,%rcx
mov    %r14,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     115e <lcmu+0x3e>
mov    %r14,%rax
cqto
idiv   %rcx
jmp    1165 <lcmu+0x45>
mov    %r14d,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @lcmu(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul nsw i64 %5, %6
%8 = call i64 @fabs(i64 %7)
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = call i64 @gcdi(i64 %9, i64 %10)
%12 = sdiv i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @lcmu(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
%4 = tail call i64 @fabs(i64 %3)
%5 = tail call i64 @gcdi(i64 %0, i64 %1)
%6 = sdiv i64 %4, %5
ret i64 %6
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int countlib(int);
int offset(int, int, int, int);
int autohelperowl_attackpat146(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  int A;
  (void)patt;
  (void)color;
  (void)action;
  A = offset(-1, -2, move, transformation);
  return countlib(A) > 2;
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat146>:
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    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edi
mov    $0xfffffffe,%esi
call   1030 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <countlib@plt>
cmp    $0x2,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat146>:
push   %rax
mov    %esi,%ecx
mov    $0xffffffff,%edi
mov    $0xfffffffe,%esi
call   1030 <offset@plt>
mov    %eax,%edi
call   1040 <countlib@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat146(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 -1, i32 -2, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = call i32 @countlib(i32 %18)
%20 = icmp sgt i32 %19, 2
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat146(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 -1, i32 -2, i32 %2, i32 %1)
%7 = tail call i32 @countlib(i32 %6)
%8 = icmp sgt i32 %7, 2
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void test(int x, int y) {
  int c;
  if (x == 1)
    abort();
  if (y == 1)
    abort();
  c = x / y;
  if (c != 1)
    abort();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    112f <test+0x1f>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1140 <test+0x30>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     115b <test+0x4b>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
cmp    $0x1,%edi
je     1127 <test+0x17>
cmp    $0x1,%esi
je     1127 <test+0x17>
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0x1,%eax
jne    1127 <test+0x17>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %10
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = sdiv i32 %16, %17
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = icmp ne i32 %19, 1
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = call i32 (...) @abort()
unreachable
23: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @test(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
%7 = icmp eq i32 %1, 1
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %6
%11 = sdiv i32 %0, %1
%12 = icmp eq i32 %11, 1
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
ret void
}
__attribute__((format(printf, 1, 2))) void test_check_format(const char *format,
                                                             ...) {
  (void)format;
}


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

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

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

LLVM IR (-O2):
define void @test_check_format(i8* nocapture %0, ...) {
ret void
}