xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout;
void intro(void) {
  char welcome[] = "	    __  __     ________  ______ 	\n"
                   "	   / / / /__  / ____/ / / / __ \\	\n"
                   "	  / /_/ / _ \\/ /   / /_/ / / / /	\n"
                   "	 / __  /  __/ /___/ __  / /_/ /		\n"
                   "	/_/ /_/\\___/\\____/_/ /_/\\____/	\n\n"
                   "	 Welcome to HeXA Echo Service!		\n";
  puts(welcome);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<intro>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
lea    -0xe0(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0xd1,%edx
call   1040 <memcpy@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <puts@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intro>:
push   %rbx
sub    $0xe0,%rsp
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    $0xd1,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
add    $0xe0,%rsp
pop    %rbx
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@__const.intro.welcome = [209 x i8] c"\09 __ __ ________ ______ \09\0A\09 / / / /__ / ____/ / / / __ \\\09\0A\09 / /_/ / _ \\/ / / /_/ / / / /\09\0A\09 / __ / __/ /___/ __ / /_/ /\09\09\0A\09/_/ /_/\\___/\\____/_/ /_/\\____/\09\0A\0A\09 Welcome to HeXA Echo Service!\09\09\0A\00"
@stdout = global i32 0
define void @intro() {
%1 = alloca [209 x i8]
%2 = bitcast [209 x i8]* %1 to i8*
%3 = getelementptr inbounds [209 x i8], [209 x i8]* %1, i64 0, i64 0
%4 = call i32 @puts(i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@__const.intro.welcome = [209 x i8] c"\09 __ __ ________ ______ \09\0A\09 / / / /__ / ____/ / / / __ \\\09\0A\09 / /_/ / _ \\/ / / /_/ / / / /\09\0A\09 / __ / __/ /___/ __ / /_/ /\09\09\0A\09/_/ /_/\\___/\\____/_/ /_/\\____/\09\0A\0A\09 Welcome to HeXA Echo Service!\09\09\0A\00"
@stdout = global i32 0
define void @intro() {
%1 = alloca [209 x i8]
%2 = getelementptr inbounds [209 x i8], [209 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ aes_ctr_decrypt(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *);
uint8_t AES_CTR_DecryptData(uint8_t *cipherText, uint16_t textLen,
                            uint8_t *aesKey, uint8_t *nonce,
                            uint8_t *initVector) {
  return aes_ctr_decrypt(cipherText, textLen, aesKey, nonce, initVector);
}


x86 assembly (clang, -O0):
<AES_CTR_DecryptData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <aes_ctr_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_CTR_DecryptData>:
jmp    1030 <aes_ctr_decrypt@plt>

LLVM IR (-O0):
define i32 @AES_CTR_DecryptData(i32* %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @aes_ctr_decrypt(i32* %11, i32 %12, i32* %13, i32* %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @AES_CTR_DecryptData(i32* %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @aes_ctr_decrypt(i32* %0, i32 %1, i32* %2, i32* %3, i32* %4)
ret i32 %6
}
int test_ft_memmove() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @test_ft_memmove() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EnvActivateRouter(void *, char *);
int /*<<< orphan*/ EnvDeactivateRouter(void *, char *);
int EnvGetcRouter(void *, char const *);
int /*<<< orphan*/ PutcDribbleBuffer(void *, int);
int GetcDribble(void *theEnv, const char *logicalName) {
  int rv;
  EnvDeactivateRouter(theEnv, "dribble");
  rv = EnvGetcRouter(theEnv, logicalName);
  EnvActivateRouter(theEnv, "dribble");
  PutcDribbleBuffer(theEnv, rv);
  return (rv);
}


x86 assembly (clang, -O0):
<GetcDribble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1060 <EnvDeactivateRouter@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <EnvGetcRouter@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1050 <EnvActivateRouter@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <PutcDribbleBuffer@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetcDribble>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeac(%rip),%r15
mov    %r15,%rsi
call   1060 <EnvDeactivateRouter@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <EnvGetcRouter@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <EnvActivateRouter@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <PutcDribbleBuffer@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"dribble\00"
define i32 @GetcDribble(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @EnvDeactivateRouter(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @EnvGetcRouter(i8* %8, i8* %9)
store i32 %10, i32* %5
%11 = load i8*, i8** %3
%12 = call i32 @EnvActivateRouter(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = call i32 @PutcDribbleBuffer(i8* %13, i32 %14)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [8 x i8] c"dribble\00"
define i32 @GetcDribble(i8* %0, i8* %1) {
%3 = tail call i32 @EnvDeactivateRouter(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @EnvGetcRouter(i8* %0, i8* %1)
%5 = tail call i32 @EnvActivateRouter(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @PutcDribbleBuffer(i8* %0, i32 %4)
ret i32 %4
}
unsigned packCharacters(char a, char b) {
  unsigned result = a;
  result <<= 8;
  return result |= b;
}


x86 assembly (clang, -O0):
<packCharacters>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<packCharacters>:
mov    %edi,%eax
shl    $0x8,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @packCharacters(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = shl i32 %8, 8
store i32 %9, i32* %5
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = load i32, i32* %5
%13 = or i32 %12, %11
store i32 %13, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @packCharacters(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = shl nsw i32 %3, 8
%5 = sext i8 %1 to i32
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_88() {
  Assert_real((isqrt(88) == 9),
              "/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/stdlib/isqrt.c",
              445, ("Integer square root of 88 should be 9"));
}


x86 assembly (clang, -O0):
<t_sqrt_88>:
push   %rbp
mov    %rsp,%rbp
mov    $0x58,%edi
call   1030 <isqrt@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x1bd,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_88>:
push   %rax
mov    $0x58,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x1bd,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 88 should be 9\00"
define void @t_sqrt_88() {
%1 = call i32 @isqrt(i32 88)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 88 should be 9\00"
define void @t_sqrt_88() {
%1 = tail call i32 @isqrt(i32 88)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int foo3(int i) {
  int j = 0;
  switch (i) {
  default:
    j = 42;
    break;
  case 111:
    j = 111;
    break;
  case 0 ... 100:
    j = 1;
    break;
  case 222:
    j = 222;
    break;
  }
  return j;
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x6f,%eax
je     1141 <foo3+0x41>
jmp    1122 <foo3+0x22>
mov    -0xc(%rbp),%eax
sub    $0xde,%eax
je     116d <foo3+0x6d>
jmp    1159 <foo3+0x59>
movl   $0x2a,-0x8(%rbp)
jmp    1174 <foo3+0x74>
movl   $0x6f,-0x8(%rbp)
jmp    1174 <foo3+0x74>
movl   $0x1,-0x8(%rbp)
jmp    1174 <foo3+0x74>
mov    -0xc(%rbp),%eax
sub    $0x0,%eax
cmp    $0x64,%eax
jbe    114d <foo3+0x4d>
jmp    1135 <foo3+0x35>
movl   $0xde,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
mov    %edi,%eax
cmp    $0x6f,%edi
je     1113 <foo3+0x13>
cmp    $0xde,%eax
jne    1114 <foo3+0x14>
mov    $0xde,%eax
ret
cmp    $0x65,%eax
mov    $0x1,%ecx
mov    $0x2a,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %8 [
i32 111, label %6
i32 222, label %11
]
5: ; preds = %8
store i32 42, i32* %3
br label %12
6: ; preds = %1
store i32 111, i32* %3
br label %12
7: ; preds = %8
store i32 1, i32* %3
br label %12
8: ; preds = %1
%9 = sub i32 %4, 0
%10 = icmp ule i32 %9, 100
br i1 %10, label %7, label %5
11: ; preds = %1
store i32 222, i32* %3
br label %12
12: ; preds = %11, %7, %6, %5
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @foo3(i32 %0) {
switch i32 %0, label %2 [
i32 111, label %6
i32 222, label %5
]
2: ; preds = %1
%3 = icmp ult i32 %0, 101
%4 = select i1 %3, i32 1, i32 42
br label %6
5: ; preds = %1
br label %6
6: ; preds = %2, %1, %5
%7 = phi i32 [ 222, %5 ], [ %0, %1 ], [ %4, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_queue_free() {
  printf("NOT IMPLEMENTED:"
         "pa_queue_free"
         "\n");
}


x86 assembly (clang, -O0):
<pa_queue_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_queue_free\0A\00"
define i32 @pa_queue_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_queue_free\00"
define i32 @pa_queue_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ apagaLinha();
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void AbrirArquivoLog(char *NomeArquivoLog) {
  FILE *ArquivoLog;
  if ((ArquivoLog = fopen(NomeArquivoLog, "w")) == NULL) {
    apagaLinha();
    printf("Não foi possivel criar o arquivo %s", NomeArquivoLog);
    return;
  }
}


x86 assembly (clang, -O0):
<AbrirArquivoLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1171 <AbrirArquivoLog+0x41>
mov    $0x0,%al
call   1040 <apagaLinha@plt>
mov    -0x8(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AbrirArquivoLog>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1147 <AbrirArquivoLog+0x17>
pop    %rbx
ret
xor    %eax,%eax
call   1040 <apagaLinha@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [37 x i8] c"N\C3\A3o foi possivel criar o arquivo %s\00"
define void @AbrirArquivoLog(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 (...) @apagaLinha()
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [37 x i8] c"N\C3\A3o foi possivel criar o arquivo %s\00"
define void @AbrirArquivoLog(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (...) @apagaLinha()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ isnan(float);
float Q_rsqrt(float number) {
  long i;
  float x2, y;
  const float threehalfs = 1.5F;
  x2 = number * 0.5F;
  y = number;
  i = *(long *)&y;
  i = 0x5f3759df - (i >> 1);
  y = *(float *)&i;
  y = y * (threehalfs - (x2 * y * y));
  assert(!isnan(y));
  return y;
}


x86 assembly (clang, -O0):
<Q_rsqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xec2(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
sar    $0x1,%rcx
mov    $0x5f3759df,%eax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe57(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_rsqrt>:
push   %rax
call   1040 <isnan@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define float @Q_rsqrt(float %0) {
%2 = alloca float
%3 = alloca i64
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %2
store float 1.500000e+00, float* %6
%7 = load float, float* %2
%8 = fmul float %7, 5.000000e-01
store float %8, float* %4
%9 = load float, float* %2
store float %9, float* %5
%10 = bitcast float* %5 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = ashr i64 %12, 1
%14 = sub nsw i64 1597463007, %13
store i64 %14, i64* %3
%15 = bitcast i64* %3 to float*
%16 = load float, float* %15
store float %16, float* %5
%17 = load float, float* %5
%18 = load float, float* %4
%19 = load float, float* %5
%20 = fmul float %18, %19
%21 = load float, float* %5
%22 = fneg float %20
%23 = call float @llvm.fmuladd.f32(float %22, float %21, float 1.500000e+00)
%24 = fmul float %17, %23
store float %24, float* %5
%25 = load float, float* %5
%26 = call i32 @isnan(float %25)
%27 = icmp ne i32 %26, 0
%28 = xor i1 %27, true
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = load float, float* %5
ret float %31
}

LLVM IR (-O2):
define float @Q_rsqrt(float %0) {
%2 = tail call i32 @isnan(float poison)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret float poison
}
void clean_b(char *buffer) {
  int index = 0;
  while (index < sizeof(buffer)) {
    buffer[index] = '\0';
    index++;
  }
}


x86 assembly (clang, -O0):
<clean_b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x8,%rax
jae    1137 <clean_b+0x37>
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    110f <clean_b+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_b>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @clean_b(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = icmp ult i64 %6, 8
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
%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 @clean_b(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i64*
store i64 0, i64* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_exp_flt(float *, float);
float xil_fpo_exp_flt(float a) {
  float res_flt;
  xip_fpo_exp_flt(&res_flt, a);
  return res_flt;
}


x86 assembly (clang, -O0):
<xil_fpo_exp_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x8(%rbp),%rdi
call   1030 <xip_fpo_exp_flt@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_exp_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_exp_flt@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @xil_fpo_exp_flt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call i32 @xip_fpo_exp_flt(float* %3, float %4)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @xil_fpo_exp_flt(float %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @xip_fpo_exp_flt(float* %2, float %0)
%5 = load float, float* %2
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ print_bits(unsigned char);
int /*<<< orphan*/ printf(char *, char *);
unsigned char set_bitmask();
int main(void) {
  unsigned char result = set_bitmask();
  printf("%s", "The result is ");
  print_bits(result);
  printf("%s", "\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <set_bitmask@plt>
mov    %al,-0x5(%rbp)
lea    0xeb0(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1030 <printf@plt>
movzbl -0x5(%rbp),%edi
call   1040 <print_bits@plt>
lea    0xe94(%rip),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <set_bitmask@plt>
mov    %eax,%ebx
lea    0xebc(%rip),%r14
lea    0xeb8(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl %bl,%edi
call   1040 <print_bits@plt>
lea    0xeb0(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [15 x i8] c"The result is \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call zeroext i8 (...) @set_bitmask()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @print_bits(i8 zeroext %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void *brk(void *addr) {
  int r;
  __asm__ __volatile__("\tint $0x80\n"
                       : "=a"(r)
                       : "a"(45), "b"(addr)
                       : "memory");
  return (void *)set_errno(r);
}


x86 assembly (clang, -O0):
<brk>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
mov    $0x2d,%eax
int    $0x80
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1030 <set_errno@plt>
cltq
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<brk>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2d,%eax
int    $0x80
mov    %eax,%edi
xor    %eax,%eax
call   1030 <set_errno@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
define i8* @brk(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 45, i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @brk(i8* %0) {
%2 = tail call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 45, i8* %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
char *strchr(char *str, char ch) {
  while (*str != ch && *str != 0)
    str++;
  return str;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xa(%rbp)
je     1136 <strchr+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1146 <strchr+0x46>
jmp    1157 <strchr+0x57>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <strchr+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %sil,%cl
je     1121 <strchr+0x21>
test   %cl,%cl
jne    1110 <strchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
%7 = icmp eq i8 %5, 0
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %4
}
/* Variables and functions */
scalar_t__ bcm_2708_power_off();
int bcm_2708_power_on();
int /*<<< orphan*/ usleep(int);
int bcm_2708_power_cycle() {
  if (bcm_2708_power_off() < 0)
    return -1;
  usleep(5000);
  return bcm_2708_power_on();
}


x86 assembly (clang, -O0):
<bcm_2708_power_cycle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <bcm_2708_power_off@plt>
cmp    $0x0,%rax
jge    1155 <bcm_2708_power_cycle+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <bcm_2708_power_cycle+0x39>
mov    $0x1388,%edi
call   1050 <usleep@plt>
mov    $0x0,%al
call   1030 <bcm_2708_power_on@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcm_2708_power_cycle>:
push   %rax
xor    %eax,%eax
call   1040 <bcm_2708_power_off@plt>
test   %rax,%rax
js     114f <bcm_2708_power_cycle+0x1f>
mov    $0x1388,%edi
call   1050 <usleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bcm_2708_power_on@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bcm_2708_power_cycle() {
%1 = alloca i32
%2 = call i64 (...) @bcm_2708_power_off()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %8
5: ; preds = %0
%6 = call i32 @usleep(i32 5000)
%7 = call i32 (...) @bcm_2708_power_on()
store i32 %7, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @bcm_2708_power_cycle() {
%1 = tail call i64 (...) @bcm_2708_power_off()
%2 = icmp slt i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @usleep(i32 5000)
%5 = tail call i32 (...) @bcm_2708_power_on()
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ -1, %0 ]
ret i32 %7
}
void AddNegativesTestCase() {
  TestCheckEqualSignedIntegers(
      -4, 5 - 2, __FUNCTION__,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/ociotec/mini-test/refs/heads/master/samples/"
      "main.c",
      13);
}


x86 assembly (clang, -O0):
<AddNegativesTestCase>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffc,%edi
mov    $0x3,%esi
lea    0xedb(%rip),%rdx
lea    0xee9(%rip),%rcx
mov    $0xd,%r8d
mov    $0x0,%al
call   1030 <TestCheckEqualSignedIntegers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddNegativesTestCase>:
lea    0xee9(%rip),%rdx
lea    0xef7(%rip),%rcx
mov    $0xfffffffc,%edi
mov    $0x3,%esi
mov    $0xd,%r8d
xor    %eax,%eax
jmp    1030 <TestCheckEqualSignedIntegers@plt>

LLVM IR (-O0):
@__FUNCTION__.AddNegativesTestCase = [21 x i8] c"AddNegativesTestCase\00"
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ociotec/mini-test/refs/heads/master/samples/main.c\00"
define void @AddNegativesTestCase() {
%1 = call i32 (i32, i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @TestCheckEqualSignedIntegers to i32 (i32, i32, i8*, i8*, i32, ...)*)(i32 -4, i32 3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.AddNegativesTestCase, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}

LLVM IR (-O2):
@__FUNCTION__.AddNegativesTestCase = [21 x i8] c"AddNegativesTestCase\00"
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ociotec/mini-test/refs/heads/master/samples/main.c\00"
define void @AddNegativesTestCase() {
%1 = tail call i32 (i32, i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @TestCheckEqualSignedIntegers to i32 (i32, i32, i8*, i8*, i32, ...)*)(i32 -4, i32 3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.AddNegativesTestCase, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(int *, int *, int);
void memmove_bad3() {
  int arr1[10];
  int arr2[20];
  memmove(arr1, arr2, -1);
}


x86 assembly (clang, -O0):
<memmove_bad3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x30(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0xffffffff,%edx
call   1030 <memmove@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove_bad3>:
sub    $0x88,%rsp
mov    %rsp,%rdi
lea    0x30(%rsp),%rsi
mov    $0xffffffff,%edx
call   1030 <memmove@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @memmove_bad3() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%5 = call i32 @memmove(i32* %3, i32* %4, i32 -1)
ret void
}

LLVM IR (-O2):
define void @memmove_bad3() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%7 = call i32 @memmove(i32* %5, i32* %6, i32 -1)
ret void
}
/* Variables and functions */
float __ieee754_log10f(float);
float log10f(float x) { return __ieee754_log10f(x); }


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

x86 assembly (clang, -O2):
<log10f>:
jmp    1030 <__ieee754_log10f@plt>

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

LLVM IR (-O2):
define float @log10f(float %0) {
%2 = tail call float @__ieee754_log10f(float %0)
ret float %2
}
/* Variables and functions */
scalar_t__ EOF;
char *getlogin();
scalar_t__ puts(char *);
int main(void) {
  char *lname;
  return (lname = getlogin()) ? (puts(lname) == EOF) : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getlogin@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1167 <main+0x47>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    1174 <main+0x54>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1174 <main+0x54>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getlogin@plt>
test   %rax,%rax
je     1149 <main+0x29>
mov    %rax,%rdi
call   1030 <puts@plt>
mov    %rax,%rcx
mov    0x2ea9(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (...) @getlogin()
store i8* %3, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i8*, i8** %2
%7 = call i64 @puts(i8* %6)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
br label %12
11: ; preds = %0
br label %12
12: ; preds = %11, %5
%13 = phi i32 [ %10, %5 ], [ 1, %11 ]
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @main() {
%1 = tail call i8* (...) @getlogin()
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i64 @puts(i8* %1)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %0, %3
%9 = phi i32 [ %7, %3 ], [ 1, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
void strlcpy(char *dest, const char *src, size_t size) {
  strncpy(dest, src, size);
  dest[size - 1] = 0;
}


x86 assembly (clang, -O0):
<strlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret void
}
int isspace(int c) { return c == ' ' || c == '\t'; }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isspace+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned int _mpyhlu(unsigned int src1, unsigned int src2) {
  return (unsigned short)(src1 >> 16) * (unsigned short)(src2);
}


x86 assembly (clang, -O0):
<_mpyhlu>:
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
movzwl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpyhlu>:
shr    $0x10,%edi
movzwl %si,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @_mpyhlu(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 = trunc i32 %9 to i16
%11 = zext i16 %10 to i32
%12 = mul nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_mpyhlu(i32 %0, i32 %1) {
%3 = lshr i32 %0, 16
%4 = and i32 %1, 65535
%5 = mul nuw nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_movc_DPTR(char *str) {
  sprintf(str, "MOVC  A, @A+DPTR                ");
}


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

x86 assembly (clang, -O2):
<sprint_movc_DPTR>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

LLVM IR (-O0):
@.str = [33 x i8] c"MOVC A, @A+DPTR \00"
define void @sprint_movc_DPTR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"MOVC A, @A+DPTR \00"
define void @sprint_movc_DPTR(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  long long tv_nsec;
};

/* Variables and functions */
struct timespec tst_ms_to_timespec(long long ms) {
  struct timespec ret;
  ret.tv_sec = ms / 1000;
  ret.tv_nsec = (ms % 1000) * 1000000;
  return ret;
}


x86 assembly (clang, -O0):
<tst_ms_to_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x7,%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
imul   %rcx
mov    -0x20(%rbp),%rax
mov    %rdx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x7,%rcx
add    %rdx,%rcx
imul   $0x3e8,%rcx,%rcx
sub    %rcx,%rax
imul   $0xf4240,%rax,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_ms_to_timespec>:
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
imul   $0x3e8,%rax,%rcx
sub    %rcx,%rdi
imul   $0xf4240,%rdi,%rdx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @tst_ms_to_timespec(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = sdiv i64 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %3
%8 = srem i64 %7, 1000
%9 = mul nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 %9, i64* %10
%11 = bitcast %struct.timespec* %2 to { i64, i64 }*
%12 = load { i64, i64 }, { i64, i64 }* %11
ret { i64, i64 } %12
}

LLVM IR (-O2):
define { i64, i64 } @tst_ms_to_timespec(i64 %0) {
%2 = sdiv i64 %0, 1000
%3 = srem i64 %0, 1000
%4 = mul nsw i64 %3, 1000000
%5 = insertvalue { i64, i64 } poison, i64 %2, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void iface1_destructor(void *context) {
  printf("B - version 0 destructor context %p\n", context);
}


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

x86 assembly (clang, -O2):
<iface1_destructor>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"B - version 0 destructor context %p\0A\00"
define void @iface1_destructor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"B - version 0 destructor context %p\0A\00"
define void @iface1_destructor(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
size_t strlen(char *);
void strstrip(char *str) {
  if (strlen(str) == 0) {
    return;
  }
  size_t len = strlen(str);
  if (str[len - 1] == '\n') {
    str[len - 1] = '\0';
  }
}


x86 assembly (clang, -O0):
<strstrip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    1134 <strstrip+0x24>
jmp    116a <strstrip+0x5a>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    116a <strstrip+0x5a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstrip>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     112a <strstrip+0x1a>
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    112a <strstrip+0x1a>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strstrip(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %4
store i8 0, i8* %6
br label %10
10: ; preds = %4, %9, %1
ret void
}
void __dbgui_draw(void) {}


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

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

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

LLVM IR (-O2):
define void @__dbgui_draw() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ term_color(char *);
int /*<<< orphan*/ term_reset();
void logger_info(char *message) {
  term_color("cyan");
  printf("  info: ");
  term_reset();
  puts(message);
}


x86 assembly (clang, -O0):
<logger_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1060 <term_color@plt>
lea    0xea6(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <term_reset@plt>
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_info>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
call   1060 <term_color@plt>
lea    0xeae(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <term_reset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"cyan\00"
@.str.1 = [9 x i8] c" info: \00"
define void @logger_info(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @term_color(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @term_reset()
%6 = load i8*, i8** %2
%7 = call i32 @puts(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"cyan\00"
@.str.1 = [9 x i8] c" info: \00"
define void @logger_info(i8* nocapture %0) {
%2 = tail call i32 @term_color(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @term_reset()
%5 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
int max(int a, int b) { return b - ((b - a) & ((b - a) >> 31)); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
sub    -0x4(%rbp),%edx
sar    $0x1f,%edx
and    %edx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = ashr i32 %11, 31
%13 = and i32 %8, %12
%14 = sub nsw i32 %5, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int test_imm_6Eint8_mem(signed char *val) {
  return ((*val) & (0x6E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 110
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}