xunge/DecIR huggingface dataset:
void INT_Excep_SCI2_RXI2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI2_RXI2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int semctl(int, int, int /*<<< orphan*/, int);
int semaphore_destroy(int semid) {
  union semun;
  int rc;
  if ((rc = semctl(semid, 2, IPC_RMID, 2)) == -1) {
    perror("error in the function semaphore_destroy()");
    exit(1);
  };
  return rc;
}


x86 assembly (clang, -O0):
<semaphore_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%ecx
mov    %ecx,%esi
call   1040 <semctl@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    1175 <semaphore_destroy+0x45>
lea    0xe9a(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semaphore_destroy>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%esi
mov    $0x2,%ecx
call   1040 <semctl@plt>
cmp    $0xffffffff,%eax
je     1150 <semaphore_destroy+0x20>
pop    %rcx
ret
lea    0xea9(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [42 x i8] c"error in the function semaphore_destroy()\00"
define i32 @semaphore_destroy(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @IPC_RMID
%6 = call i32 @semctl(i32 %4, i32 2, i32 %5, i32 2)
store i32 %6, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [42 x i8] c"error in the function semaphore_destroy()\00"
define i32 @semaphore_destroy(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @semctl(i32 %0, i32 2, i32 %2, i32 2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
scalar_t__ pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void xmutex_init(pthread_mutex_t *m) {
  if (pthread_mutex_init(m, NULL)) {
    fputs("xmutex_init\n", stderr);
    abort();
  }
}


x86 assembly (clang, -O0):
<xmutex_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pthread_mutex_init@plt>
cmp    $0x0,%rax
je     116f <xmutex_init+0x3f>
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
lea    0xe9d(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmutex_init>:
push   %rax
xor    %esi,%esi
call   1050 <pthread_mutex_init@plt>
test   %rax,%rax
jne    113f <xmutex_init+0xf>
pop    %rax
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"xmutex_init\0A\00"
@stderr = global i32 0
define void @xmutex_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pthread_mutex_init(i32* %3, i32* null)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"xmutex_init\0A\00"
@stderr = global i32 0
define void @xmutex_init(i32* %0) {
%2 = tail call i64 @pthread_mutex_init(i32* %0, i32* null)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void PrintHelp(void) {
  printf("usage: %s [-vhsefar] [-l length] [-x suffix] [file ...]\n",
         "setsuffix");
}


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

x86 assembly (clang, -O2):
<PrintHelp>:
lea    0xee9(%rip),%rdi
lea    0xf1b(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"usage: %s [-vhsefar] [-l length] [-x suffix] [file ...]\0A\00"
@.str.1 = [10 x i8] c"setsuffix\00"
define void @PrintHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"usage: %s [-vhsefar] [-l length] [-x suffix] [file ...]\0A\00"
@.str.1 = [10 x i8] c"setsuffix\00"
define void @PrintHelp() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_address(int);
void write_integer(int a) { write_address(a); }


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

x86 assembly (clang, -O2):
<write_integer>:
jmp    1030 <write_address@plt>

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

LLVM IR (-O2):
define void @write_integer(i32 %0) {
%2 = tail call i32 @write_address(i32 %0)
ret void
}
/* Variables and functions */
int mcfioC_NTuple(int, int, char *);
int mcfio_ntuple_(int *stream, int *ntupleid, char *version, int ll) {
  return mcfioC_NTuple(*stream, *ntupleid, version);
}


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

x86 assembly (clang, -O2):
<mcfio_ntuple_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <mcfioC_NTuple@plt>

LLVM IR (-O0):
define i32 @mcfio_ntuple_(i32* %0, i32* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i8*, i8** %7
%14 = call i32 @mcfioC_NTuple(i32 %10, i32 %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @mcfio_ntuple_(i32* nocapture %0, i32* nocapture %1, i8* %2, i32 %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = tail call i32 @mcfioC_NTuple(i32 %5, i32 %6, i8* %2)
ret i32 %7
}
int cur_colnames() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cur_colnames() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x19() {
  Assert_real((isspace(25) == 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_isspace.c",
              130, ("isspace should be 0 for 0x19"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x19>:
push   %rax
mov    $0x19,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x82,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x19\00"
define void @t_isspace_0x19() {
%1 = call i64 @isspace(i32 25)
%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 130, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x19\00"
define void @t_isspace_0x19() {
%1 = tail call i64 @isspace(i32 25)
%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 130, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};

/* Variables and functions */
char *inet_ntoa(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *getClientAddr(struct sockaddr_in *client_addr) {
  static char ip[19];
  sprintf(ip, "%s", inet_ntoa(client_addr->sin_addr));
  return (char *)&ip;
}


x86 assembly (clang, -O0):
<getClientAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rdx
lea    0x2eff(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2eec(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getClientAddr>:
push   %rax
mov    (%rdi),%edi
call   1040 <inet_ntoa@plt>
lea    0x2f11(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@getClientAddr.ip = internal global [19 x i8] zeroinitializer
@.str = [3 x i8] c"%s\00"
define i8* @getClientAddr(%struct.sockaddr_in* %0) {
%2 = alloca %struct.sockaddr_in*
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %2
%3 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i8* @inet_ntoa(i32 %5)
%7 = call i32 @sprintf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @getClientAddr.ip, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @getClientAddr.ip, i32 0, i32 0)
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@getClientAddr.ip = internal global [19 x i8] zeroinitializer
define i8* @getClientAddr(%struct.sockaddr_in* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i8* @inet_ntoa(i32 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @getClientAddr.ip, i64 0, i64 0), i8* dereferenceable(1) %4)
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @getClientAddr.ip, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(int /*<<< orphan*/, int /*<<< orphan*/ *);
void fwriteushort(uint16_t us, FILE *fd) {
  putc((uint8_t)(us & 0xff), fd);
  us = us >> 8;
  putc((uint8_t)(us & 0xff), fd);
  us = us >> 8;
}


x86 assembly (clang, -O0):
<fwriteushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwriteushort>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <putc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @fwriteushort(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 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = call i32 @putc(i32 %6, i32* %7)
%9 = load i32, i32* %3
%10 = ashr i32 %9, 8
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = and i32 %11, 255
%13 = load i32*, i32** %4
%14 = call i32 @putc(i32 %12, i32* %13)
%15 = load i32, i32* %3
%16 = ashr i32 %15, 8
store i32 %16, i32* %3
ret void
}

LLVM IR (-O2):
define void @fwriteushort(i32 %0, i32* nocapture %1) {
%3 = and i32 %0, 255
%4 = tail call i32 @putc(i32 %3, i32* %1)
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = tail call i32 @putc(i32 %6, i32* %1)
ret void
}
float within(float x, float period) {
  while (x < 0) {
    x += period;
  }
  while (x >= period) {
    x -= period;
  }
  return x;
}


x86 assembly (clang, -O0):
<within>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112f <within+0x2f>
movss  -0x8(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    110e <within+0xe>
jmp    1134 <within+0x34>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     115b <within+0x5b>
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1134 <within+0x34>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<within>:
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
jbe    1124 <within+0x24>
nopl   0x0(%rax,%rax,1)
addss  %xmm1,%xmm0
ucomiss %xmm0,%xmm2
ja     1110 <within+0x10>
jmp    1124 <within+0x24>
nopl   0x0(%rax,%rax,1)
subss  %xmm1,%xmm0
ucomiss %xmm1,%xmm0
jae    1120 <within+0x20>
ret

LLVM IR (-O0):
define float @within(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
br label %5
5: ; preds = %8, %2
%6 = load float, float* %3
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load float, float* %4
%10 = load float, float* %3
%11 = fadd float %10, %9
store float %11, float* %3
br label %5
12: ; preds = %5
br label %13
13: ; preds = %17, %12
%14 = load float, float* %3
%15 = load float, float* %4
%16 = fcmp oge float %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load float, float* %4
%19 = load float, float* %3
%20 = fsub float %19, %18
store float %20, float* %3
br label %13
21: ; preds = %13
%22 = load float, float* %3
ret float %22
}

LLVM IR (-O2):
define float @within(float %0, float %1) {
%3 = fcmp olt float %0, 0.000000e+00
br i1 %3, label %7, label %4
4: ; preds = %7, %2
%5 = phi float [ %0, %2 ], [ %9, %7 ]
%6 = fcmp ult float %5, %1
br i1 %6, label %15, label %11
7: ; preds = %2, %7
%8 = phi float [ %9, %7 ], [ %0, %2 ]
%9 = fadd float %8, %1
%10 = fcmp olt float %9, 0.000000e+00
br i1 %10, label %7, label %4
11: ; preds = %4, %11
%12 = phi float [ %13, %11 ], [ %5, %4 ]
%13 = fsub float %12, %1
%14 = fcmp ult float %13, %1
br i1 %14, label %15, label %11
15: ; preds = %11, %4
%16 = phi float [ %5, %4 ], [ %13, %11 ]
ret float %16
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ sys_errmsg(char *);
__attribute__((unused)) void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL && size != 0)
    sys_errmsg("out of memory");
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <xmalloc+0x3b>
cmpq   $0x0,-0x8(%rbp)
je     115b <xmalloc+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <sys_errmsg@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <xmalloc+0x25>
test   %r14,%r14
jne    1145 <xmalloc+0x25>
lea    0xec0(%rip),%rdi
call   1040 <sys_errmsg@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @sys_errmsg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @sys_errmsg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
double log10(int);
double compute_value(double illuminance) {
  if (illuminance > 100000) {
    illuminance = 100000;
  } else if (illuminance < 1) {
    illuminance = 1;
  }
  return log10(illuminance) / log10(100000);
}


x86 assembly (clang, -O0):
<compute_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <compute_value+0x36>
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116b <compute_value+0x5b>
movsd  0xeba(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1166 <compute_value+0x56>
movsd  0xea7(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116b <compute_value+0x5b>
cvttsd2si -0x8(%rbp),%edi
call   1030 <log10@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x186a0,%edi
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_value>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1135 <compute_value+0x25>
movsd  0xee1(%rip),%xmm2
ucomisd %xmm0,%xmm2
movapd %xmm0,%xmm1
jbe    1135 <compute_value+0x25>
movapd %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log10@plt>
movsd  %xmm0,(%rsp)
mov    $0x186a0,%edi
call   1030 <log10@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @compute_value(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 1.000000e+05
br i1 %4, label %5, label %6
5: ; preds = %1
store double 1.000000e+05, double* %2
br label %11
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp olt double %7, 1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
store double 1.000000e+00, double* %2
br label %10
10: ; preds = %9, %6
br label %11
11: ; preds = %10, %5
%12 = load double, double* %2
%13 = fptosi double %12 to i32
%14 = call double @log10(i32 %13)
%15 = call double @log10(i32 100000)
%16 = fdiv double %14, %15
ret double %16
}

LLVM IR (-O2):
define double @compute_value(double %0) {
%2 = fcmp ogt double %0, 1.000000e+05
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fcmp olt double %0, 1.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %3
br label %6
6: ; preds = %1, %3, %5
%7 = phi double [ 1.000000e+00, %5 ], [ %0, %3 ], [ 1.000000e+05, %1 ]
%8 = fptosi double %7 to i32
%9 = tail call double @log10(i32 %8)
%10 = tail call double @log10(i32 100000)
%11 = fdiv double %9, %10
ret double %11
}
/* Variables and functions */
unsigned int atoi(char *);
int /*<<< orphan*/ mallocTest(unsigned int);
int main(int argc, char **argv) {
  unsigned number = 0;
  if (argc > 1) {
    number = atoi(argv[1]);
  }
  mallocTest(number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1157 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <mallocTest@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
xor    %edi,%edi
cmp    $0x2,%eax
jl     1135 <main+0x15>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <mallocTest@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
%10 = tail call i32 @mallocTest(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x44() {
  Assert_real((islower(68) == 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_islower.c",
              345, ("islower should be 0 for D"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x44>:
push   %rax
mov    $0x44,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x159,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for D\00"
define void @t_islower_0x44() {
%1 = call i64 @islower(i32 68)
%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 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for D\00"
define void @t_islower_0x44() {
%1 = tail call i64 @islower(i32 68)
%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 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rusage {
  size_t ru_maxrss;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
size_t c_getMemUsage() {
  struct rusage RU;
  getrusage(RUSAGE_SELF, &RU);
  return RU.ru_maxrss;
}


x86 assembly (clang, -O0):
<c_getMemUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getrusage@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_getMemUsage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrusage@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rusage = type { i64 }
@RUSAGE_SELF = global i32 0
define i64 @c_getMemUsage() {
%1 = alloca %struct.rusage
%2 = load i32, i32* @RUSAGE_SELF
%3 = call i32 @getrusage(i32 %2, %struct.rusage* %1)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
%struct.rusage = type { i64 }
@RUSAGE_SELF = global i32 0
define i64 @c_getMemUsage() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}
int wlen(char const *str, int i, char c) {
  int n;
  n = 0;
  while (str[i] != c && str[i]) {
    i++;
    n++;
  }
  return (n);
}


x86 assembly (clang, -O0):
<wlen>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movsbl -0xd(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
je     1149 <wlen+0x49>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1159 <wlen+0x59>
jmp    1170 <wlen+0x70>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <wlen+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wlen>:
movslq %esi,%rsi
mov    (%rdi,%rsi,1),%cl
xor    %eax,%eax
cmp    %dl,%cl
je     1130 <wlen+0x30>
test   %cl,%cl
je     1130 <wlen+0x30>
add    %rdi,%rsi
add    $0x1,%rsi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
add    $0x1,%rax
cmp    %dl,%cl
je     1130 <wlen+0x30>
test   %cl,%cl
jne    1120 <wlen+0x20>
ret

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

LLVM IR (-O2):
define i32 @wlen(i8* nocapture %0, i32 %1, i8 signext %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %2
%8 = icmp eq i8 %6, 0
%9 = or i1 %7, %8
br i1 %9, label %20, label %10
10: ; preds = %3, %10
%11 = phi i64 [ %13, %10 ], [ %4, %3 ]
%12 = phi i32 [ %14, %10 ], [ 0, %3 ]
%13 = add i64 %11, 1
%14 = add nuw nsw i32 %12, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %13
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, %2
%18 = icmp eq i8 %16, 0
%19 = or i1 %17, %18
br i1 %19, label %20, label %10
20: ; preds = %10, %3
%21 = phi i32 [ 0, %3 ], [ %14, %10 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket_broadcast(int s) {
  int opt = 1;
  return (setsockopt(s, SOL_SOCKET, SO_BROADCAST, &opt, sizeof opt));
}


x86 assembly (clang, -O0):
<socket_broadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_broadcast>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define i32 @socket_broadcast(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_BROADCAST
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define i32 @socket_broadcast(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_BROADCAST
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xb2() {
  Assert_real((ispunct(178) == 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",
              895, ("ispunct should be 0 for 0xb2"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xb2>:
push   %rax
mov    $0xb2,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x37f,%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 0xb2\00"
define void @t_ispunct_0xb2() {
%1 = call i64 @ispunct(i32 178)
%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 895, 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 0xb2\00"
define void @t_ispunct_0xb2() {
%1 = tail call i64 @ispunct(i32 178)
%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 895, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void clear_string(char string[100]) {
  int i = 0;
  for (i = 0; i < 100; i++) {
    string[i] = 0;
  };
}


x86 assembly (clang, -O0):
<clear_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    113a <clear_string+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <clear_string+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_string>:
xorps  %xmm0,%xmm0
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x0,0x60(%rdi)
ret

LLVM IR (-O0):
define void @clear_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @clear_string(i8* nocapture writeonly %0) {
ret void
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int countlib(int);
int offset(int, int /*<<< orphan*/, int, int);
int autohelperowl_attackpat37(struct pattern *patt, int transformation,
                              int move, int color, int action) {
  int a;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(-1, 0, move, transformation);
  return countlib(a) == 2;
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat37>:
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
xor    %esi,%esi
call   1030 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <countlib@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat37(%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 0, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = call i32 @countlib(i32 %18)
%20 = icmp eq i32 %19, 2
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat37(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 -1, i32 0, i32 %2, i32 %1)
%7 = tail call i32 @countlib(i32 %6)
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0, b = 1, c = 0;
  do {
    printf("%d, ", a);
    a = b + c;
    c = b;
    b = a;
  } while (a < 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x64,-0x8(%rbp)
jl     1134 <main+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%eax
xor    %esi,%esi
lea    0xede(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <printf@plt>
add    %ebx,%ebp
mov    %ebp,%esi
mov    %ebp,%eax
cmp    $0x64,%ebp
mov    %ebx,%ebp
jl     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ 1, %0 ], [ %6, %1 ]
%4 = phi i32 [ 0, %0 ], [ %3, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = add nsw i32 %4, %3
%7 = icmp slt i32 %6, 100
br i1 %7, label %1, label %8
8: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int CRYPTO_mem_leaks(BIO *b) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @CRYPTO_mem_leaks(i32* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ day_of_week(int /*<<< orphan*/);
int /*<<< orphan*/ menu();
int main() {
  day_of_week(menu());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <menu@plt>
mov    %eax,%edi
call   1030 <day_of_week@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <menu@plt>
mov    %eax,%edi
call   1030 <day_of_week@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @menu()
%3 = call i32 @day_of_week(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @menu()
%2 = tail call i32 @day_of_week(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hello from jessie-docker-hello\n"); }


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

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

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

LLVM IR (-O2):
@str = [31 x i8] c"hello from jessie-docker-hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int mpg123_encsize(int encoding) { return sizeof(short); }


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

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

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

LLVM IR (-O2):
define i32 @mpg123_encsize(i32 %0) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ interp(char *);
char *load(char *);
int main(int argc, char *argv[]) {
  char *code = NULL;
  if (argc <= 1 || (code = load(argv[1])) == NULL)
    return -1;
  interp(code);
  free(code);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1173 <main+0x43>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <load@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    117f <main+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1198 <main+0x68>
mov    -0x18(%rbp),%rdi
call   1040 <interp@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
cmp    $0x2,%edi
jl     1161 <main+0x31>
mov    0x8(%rsi),%rdi
call   1050 <load@plt>
test   %rax,%rax
je     1161 <main+0x31>
mov    %rax,%r14
mov    %rax,%rdi
call   1040 <interp@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i8* @load(i8* %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = tail call i32 @interp(i8* %7)
%11 = tail call i32 @free(i8* %7)
br label %12
12: ; preds = %2, %4, %9
%13 = phi i32 [ 0, %9 ], [ -1, %4 ], [ -1, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void drawSpace(int n, int height) {
  int spaces = height - n;
  int i;
  for (i = 0; i < spaces; i++) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<drawSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <drawSpace+0x44>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112e <drawSpace+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawSpace>:
push   %rbx
mov    %esi,%ebx
sub    %edi,%ebx
test   %ebx,%ebx
jle    112f <drawSpace+0x1f>
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <drawSpace+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @drawSpace(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
store i32 %9, i32* %5
store i32 0, i32* %6
br label %10
10: ; preds = %16, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %10
19: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @drawSpace(i32 %0, i32 %1) {
%3 = sub i32 %1, %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @putchar(i32 32)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %3
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
/* Variables and functions */
float findmean(float *, int);
float findstd(float *, int);
int /*<<< orphan*/ printf(char *, float);
float calcthreshold(float *signal, int rows) {
  float mean, std, threshold;
  mean = findmean(signal, rows);
  std = findstd(signal, rows);
  threshold = (mean + std);
  printf("The thresholding value is %f!\n", threshold);
  return threshold;
}


x86 assembly (clang, -O0):
<calcthreshold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <findmean@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <findstd@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcthreshold>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <findmean@plt>
movss  %xmm0,0x4(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <findstd@plt>
addss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"The thresholding value is %f!\0A\00"
define float @calcthreshold(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float* %0, float** %3
store i32 %1, i32* %4
%8 = load float*, float** %3
%9 = load i32, i32* %4
%10 = call float @findmean(float* %8, i32 %9)
store float %10, float* %5
%11 = load float*, float** %3
%12 = load i32, i32* %4
%13 = call float @findstd(float* %11, i32 %12)
store float %13, float* %6
%14 = load float, float* %5
%15 = load float, float* %6
%16 = fadd float %14, %15
store float %16, float* %7
%17 = load float, float* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %17)
%19 = load float, float* %7
ret float %19
}

LLVM IR (-O2):
@.str = [31 x i8] c"The thresholding value is %f!\0A\00"
define float @calcthreshold(float* %0, i32 %1) {
%3 = tail call float @findmean(float* %0, i32 %1)
%4 = tail call float @findstd(float* %0, i32 %1)
%5 = fadd float %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %5)
ret float %5
}