xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ PinSetMain(int);
int main(int argc, char **argv) {
  PinSetMain(0);
  PinSetMain(0);
  PinSetMain(1);
  PinSetMain(1);
  PinSetMain(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <PinSetMain@plt>
xor    %edi,%edi
call   1030 <PinSetMain@plt>
mov    $0x1,%edi
call   1030 <PinSetMain@plt>
mov    $0x1,%edi
call   1030 <PinSetMain@plt>
xor    %edi,%edi
call   1030 <PinSetMain@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <PinSetMain@plt>
xor    %edi,%edi
call   1030 <PinSetMain@plt>
mov    $0x1,%edi
call   1030 <PinSetMain@plt>
mov    $0x1,%edi
call   1030 <PinSetMain@plt>
xor    %edi,%edi
call   1030 <PinSetMain@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @PinSetMain(i32 0)
%4 = tail call i32 @PinSetMain(i32 0)
%5 = tail call i32 @PinSetMain(i32 1)
%6 = tail call i32 @PinSetMain(i32 1)
%7 = tail call i32 @PinSetMain(i32 0)
ret i32 0
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
void cat1() {
  for (;;) {
    char c = getchar();
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<cat1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
jmp    1128 <cat1+0x8>

x86 assembly (clang, -O2):
<cat1>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1130 <cat1+0x10>

LLVM IR (-O0):
define void @cat1() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = call i32 @putchar(i8 signext %4)
br label %2
}

LLVM IR (-O2):
define void @cat1() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = tail call i32 @putchar(i8 signext %2)
br label %1
}
/* Type definitions */
typedef scalar_t__ base;

/* Variables and functions */
int /*<<< orphan*/ barrier();
void flush(void) {
  unsigned long base = (0UL);
  if (!base)
    return;
  while ((*(volatile unsigned char *)((base) + 0x18)) & (1 << 3))
    barrier();
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1130 <flush+0x20>
jmp    1157 <flush+0x47>
jmp    1135 <flush+0x25>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%al
movzbl %al,%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1157 <flush+0x47>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    1135 <flush+0x25>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @flush() {
%1 = alloca i64
store i64 0, i64* %1
%2 = load i64, i64* %1
%3 = icmp ne i64 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
br label %16
5: ; preds = %0
br label %6
6: ; preds = %14, %5
%7 = load i64, i64* %1
%8 = add i64 %7, 24
%9 = inttoptr i64 %8 to i8*
%10 = load volatile i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 8
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %6
%15 = call i32 (...) @barrier()
br label %6
16: ; preds = %4, %6
ret void
}

LLVM IR (-O2):
define void @flush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
int /*<<< orphan*/ logMallocError();
char *setlocale(int /*<<< orphan*/, int /*<<< orphan*/ *);
char *strdup(char *);
char *getLocaleName(void) {
  char *name = setlocale(LC_CTYPE, NULL);
  if (name) {
    if (!(name = strdup(name))) {
      logMallocError();
    }
  }
  return name;
}


x86 assembly (clang, -O0):
<getLocaleName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setlocale@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117c <getLocaleName+0x4c>
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1177 <getLocaleName+0x47>
mov    $0x0,%al
call   1040 <logMallocError@plt>
jmp    117c <getLocaleName+0x4c>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLocaleName>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <setlocale@plt>
test   %rax,%rax
je     1161 <getLocaleName+0x31>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1161 <getLocaleName+0x31>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <logMallocError@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@LC_CTYPE = global i32 0
define i8* @getLocaleName() {
%1 = alloca i8*
%2 = load i32, i32* @LC_CTYPE
%3 = call i8* @setlocale(i32 %2, i32* null)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i8*, i8** %1
%8 = call i8* @strdup(i8* %7)
store i8* %8, i8** %1
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = call i32 (...) @logMallocError()
br label %12
12: ; preds = %10, %6
br label %13
13: ; preds = %12, %0
%14 = load i8*, i8** %1
ret i8* %14
}

LLVM IR (-O2):
@LC_CTYPE = global i32 0
define noalias i8* @getLocaleName() {
%1 = load i32, i32* @LC_CTYPE
%2 = tail call i8* @setlocale(i32 %1, i32* null)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = tail call i8* @strdup(i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @logMallocError()
br label %9
9: ; preds = %4, %7, %0
%10 = phi i8* [ %5, %4 ], [ null, %7 ], [ null, %0 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void delete (void *_item) { free(_item); }


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

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

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

LLVM IR (-O2):
define void @delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int main() {
  int z = -1;
  unsigned int z2 = (unsigned int)z;
  z2 = z2 + 1;
  if ((unsigned int)z > z2) {
    int *evil = 0;
    *evil = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    113f <main+0x3f>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ ADC_DelSig_AMux_DisconnectAll();
void ADC_DelSig_AMux_Init(void) { ADC_DelSig_AMux_DisconnectAll(); }


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

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

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

LLVM IR (-O2):
define void @ADC_DelSig_AMux_Init() {
%1 = tail call i32 (...) @ADC_DelSig_AMux_DisconnectAll()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x47() {
  Assert_real((isascii(71)),
              "/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_isascii.c",
              360, ("isascii should be 1 for G"));
}


x86 assembly (clang, -O0):
<t_isascii_0x47>:
push   %rbp
mov    %rsp,%rbp
mov    $0x47,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x168,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x47>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x168,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for G\00"
define void @t_isascii_0x47() {
%1 = call i32 @isascii(i32 71)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 360, 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for G\00"
define void @t_isascii_0x47() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 360, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_clearup();
int log_start();
int log_initilize() {
  log_clearup();
  return log_start();
}


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

x86 assembly (clang, -O2):
<log_initilize>:
push   %rax
xor    %eax,%eax
call   1030 <log_clearup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <log_start@plt>

LLVM IR (-O0):
define i32 @log_initilize() {
%1 = call i32 (...) @log_clearup()
%2 = call i32 (...) @log_start()
ret i32 %2
}

LLVM IR (-O2):
define i32 @log_initilize() {
%1 = tail call i32 (...) @log_clearup()
%2 = tail call i32 (...) @log_start()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *const);
extern void eFree(void *const ptr) {
  ;
  free(ptr);
}


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

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

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

LLVM IR (-O2):
define void @eFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ libewf_fatal_print(char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, size_t);
uint8_t *ewf_sectors_chunk_alloc(size_t size) {
  size_t sectors_chunk_size = sizeof(uint8_t) * size;
  uint8_t *sectors_chunk = (uint8_t *)malloc(sectors_chunk_size);
  if (sectors_chunk == NULL) {
    libewf_fatal_print(
        "ewf_sectors_chunk_alloc: unable to allocate sectors_chunk\n");
  }
  memset(sectors_chunk, 0, size);
  return (sectors_chunk);
}


x86 assembly (clang, -O0):
<ewf_sectors_chunk_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116c <ewf_sectors_chunk_alloc+0x3c>
lea    0xe99(%rip),%rdi
call   1030 <libewf_fatal_print@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ewf_sectors_chunk_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x0(,%rdi,4),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1158 <ewf_sectors_chunk_alloc+0x28>
lea    0xead(%rip),%rdi
call   1030 <libewf_fatal_print@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [59 x i8] c"ewf_sectors_chunk_alloc: unable to allocate sectors_chunk\0A\00"
define i32* @ewf_sectors_chunk_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = mul i64 4, %5
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %4
%10 = load i32*, i32** %4
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @libewf_fatal_print(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
%15 = load i32*, i32** %4
%16 = load i64, i64* %2
%17 = call i32 @memset(i32* %15, i32 0, i64 %16)
%18 = load i32*, i32** %4
ret i32* %18
}

LLVM IR (-O2):
@.str = [59 x i8] c"ewf_sectors_chunk_alloc: unable to allocate sectors_chunk\0A\00"
define i32* @ewf_sectors_chunk_alloc(i64 %0) {
%2 = shl i64 %0, 2
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to i32*
%5 = icmp eq i64 %3, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @libewf_fatal_print(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = tail call i32 @memset(i32* %4, i32 0, i64 %0)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void FanChannelConfigManual(unsigned long ulBase, unsigned long ulChannel,
                            unsigned long ulConfig) {
  DEBUG_ASSERT(ulBase == 0x40084000);
  DEBUG_ASSERT(ulChannel < 6);
  (*((volatile unsigned long *)(ulBase + 0x00000010 + (ulChannel * 0x10)))) =
      0x00000001 | ulConfig;
}


x86 assembly (clang, -O0):
<FanChannelConfigManual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x40084000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x6,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x18(%rbp),%rcx
or     $0x1,%rcx
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    -0x10(%rbp),%rdx
shl    $0x4,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanChannelConfigManual>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %edi,%edi
cmp    $0x40084000,%r15
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x6,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
or     $0x1,%r14
shl    $0x4,%rbx
mov    %r14,0x10(%r15,%rbx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @FanChannelConfigManual(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = icmp eq i64 %7, 1074282496
%9 = zext i1 %8 to i32
%10 = call i32 @DEBUG_ASSERT(i32 %9)
%11 = load i64, i64* %5
%12 = icmp ult i64 %11, 6
%13 = zext i1 %12 to i32
%14 = call i32 @DEBUG_ASSERT(i32 %13)
%15 = load i64, i64* %6
%16 = or i64 1, %15
%17 = load i64, i64* %4
%18 = add i64 %17, 16
%19 = load i64, i64* %5
%20 = mul i64 %19, 16
%21 = add i64 %18, %20
%22 = inttoptr i64 %21 to i64*
store volatile i64 %16, i64* %22
ret void
}

LLVM IR (-O2):
define void @FanChannelConfigManual(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %0, 1074282496
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = icmp ult i64 %1, 6
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = or i64 %2, 1
%11 = add i64 %0, 16
%12 = shl i64 %1, 4
%13 = add i64 %11, %12
%14 = inttoptr i64 %13 to i64*
store volatile i64 %10, i64* %14
ret void
}
extern unsigned int gcd(unsigned int x, unsigned int y) {
  for (;;) {
    if (!x)
      return y;
    if (!y)
      return x;
    if (x > y)
      x %= y;
    else
      y %= x;
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111f <gcd+0x1f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <gcd+0x64>
cmpl   $0x0,-0xc(%rbp)
jne    1134 <gcd+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <gcd+0x64>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1152 <gcd+0x52>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %edx,-0x8(%rbp)
jmp    115f <gcd+0x5f>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %edx,-0xc(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
test   %edi,%edi
jne    111c <gcd+0x1c>
jmp    1130 <gcd+0x30>
cs nopw 0x0(%rax,%rax,1)
mov    %esi,%eax
xor    %edx,%edx
div    %edi
mov    %edx,%esi
test   %edi,%edi
je     1130 <gcd+0x30>
test   %esi,%esi
je     1133 <gcd+0x33>
cmp    %esi,%edi
jbe    1110 <gcd+0x10>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%edi
test   %edi,%edi
jne    111c <gcd+0x1c>
mov    %esi,%eax
ret
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
br label %6
6: ; preds = %28, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = load i32, i32* %5
store i32 %10, i32* %3
br label %29
11: ; preds = %6
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = load i32, i32* %4
store i32 %15, i32* %3
br label %29
16: ; preds = %11
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = icmp ugt i32 %17, %18
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = urem i32 %22, %21
store i32 %23, i32* %4
br label %28
24: ; preds = %16
%25 = load i32, i32* %4
%26 = load i32, i32* %5
%27 = urem i32 %26, %25
store i32 %27, i32* %5
br label %28
28: ; preds = %24, %20
br label %6
29: ; preds = %14, %9
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %18, label %4
4: ; preds = %2, %14
%5 = phi i32 [ %16, %14 ], [ %1, %2 ]
%6 = phi i32 [ %15, %14 ], [ %0, %2 ]
%7 = icmp eq i32 %5, 0
br i1 %7, label %18, label %8
8: ; preds = %4
%9 = icmp ugt i32 %6, %5
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = urem i32 %6, %5
br label %14
12: ; preds = %8
%13 = urem i32 %5, %6
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %6, %12 ]
%16 = phi i32 [ %5, %10 ], [ %13, %12 ]
%17 = icmp eq i32 %15, 0
br i1 %17, label %18, label %4
18: ; preds = %14, %4, %2
%19 = phi i32 [ %1, %2 ], [ %6, %4 ], [ %16, %14 ]
ret i32 %19
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_disconnect(struct wpa_ctrl *ctrl, int argc,
                           const char *argv[]) {
  return wpa_ctrl_command(ctrl, "DISCONNECT");
}


x86 assembly (clang, -O0):
<wpa_cli_cmd_disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <wpa_ctrl_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_cli_cmd_disconnect>:
lea    0xee9(%rip),%rsi
jmp    1030 <wpa_ctrl_command@plt>

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [11 x i8] c"DISCONNECT\00"
define i32 @wpa_cli_cmd_disconnect(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [11 x i8] c"DISCONNECT\00"
define i32 @wpa_cli_cmd_disconnect(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
int rchild(int i) { return i << 1; }


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

x86 assembly (clang, -O2):
<rchild>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @rchild(i32 %0) {
%2 = shl i32 %0, 1
ret i32 %2
}
int test_nested4_2(int TESTfoo) { return TESTfoo; }


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

x86 assembly (clang, -O2):
<test_nested4_2>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_nested4_2(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_string(char str[100]) { printf("%s", str); }


x86 assembly (clang, -O0):
<print_string>:
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):
<print_string>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AddMacroExpansionChar(char);
int /*<<< orphan*/ AddMacroIdent(char *);
void DefineMacro(char *name, char *expansion) {
  AddMacroIdent(name);
  do {
    AddMacroExpansionChar(*expansion);
  } while (*expansion++ != '\0');
}


x86 assembly (clang, -O0):
<DefineMacro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <AddMacroIdent@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <AddMacroExpansionChar@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1139 <DefineMacro+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DefineMacro>:
push   %rbx
mov    %rsi,%rbx
call   1030 <AddMacroIdent@plt>
nopl   0x0(%rax)
movsbl (%rbx),%edi
call   1040 <AddMacroExpansionChar@plt>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1130 <DefineMacro+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @DefineMacro(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @AddMacroIdent(i8* %5)
br label %7
7: ; preds = %11, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = call i32 @AddMacroExpansionChar(i8 signext %9)
br label %11
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %7, label %17
17: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @DefineMacro(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @AddMacroIdent(i8* %0)
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ %1, %2 ], [ %8, %4 ]
%6 = load i8, i8* %5
%7 = tail call i32 @AddMacroExpansionChar(i8 signext %6)
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void my_exit(int *status) {
  int s = *status;
  exit(s);
}


x86 assembly (clang, -O0):
<my_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<my_exit>:
push   %rax
mov    (%rdi),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @my_exit(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
define void @my_exit(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @exit(i32 %2)
unreachable
}
int twosComplement(int val) {
  if ((val & 0x8000) == 0)
    return val;
  else
    return (((val & 0x7fff) - 1) ^ 0x7fff);
}


x86 assembly (clang, -O0):
<twosComplement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
jne    1123 <twosComplement+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <twosComplement+0x36>
mov    -0x8(%rbp),%eax
and    $0x7fff,%eax
sub    $0x1,%eax
xor    $0x7fff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<twosComplement>:
mov    %edi,%eax
and    $0x7fff,%eax
add    $0xffffffff,%eax
xor    $0x7fff,%eax
test   $0x8000,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @twosComplement(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 32768
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %14
9: ; preds = %1
%10 = load i32, i32* %3
%11 = and i32 %10, 32767
%12 = sub nsw i32 %11, 1
%13 = xor i32 %12, 32767
store i32 %13, i32* %2
br label %14
14: ; preds = %9, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @twosComplement(i32 %0) {
%2 = and i32 %0, 32768
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 32767
%5 = add nsw i32 %4, -1
%6 = xor i32 %5, 32767
%7 = select i1 %3, i32 %0, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int inotify_init();
int /*<<< orphan*/ perror(char *);
int monitor_init() {
  int fd;
  fd = inotify_init();
  if (fd == -1) {
    perror("inotify_init");
    exit(EXIT_FAILURE);
  }
  return fd;
}


x86 assembly (clang, -O0):
<monitor_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <inotify_init@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1166 <monitor_init+0x36>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monitor_init>:
push   %rax
xor    %eax,%eax
call   1030 <inotify_init@plt>
cmp    $0xffffffff,%eax
je     113f <monitor_init+0xf>
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"inotify_init\00"
@EXIT_FAILURE = global i32 0
define i32 @monitor_init() {
%1 = tail call i32 (...) @inotify_init()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options] n k\n", name);
  fprintf(stderr, "For more information type: %s -h \n\n", name);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedf(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s [options] n k\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s [options] n k\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int getn(int, int);
int get1() { return getn(1, 1); }


x86 assembly (clang, -O0):
<get1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <getn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get1>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <getn@plt>

LLVM IR (-O0):
define i32 @get1() {
%1 = call i32 @getn(i32 1, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get1() {
%1 = tail call i32 @getn(i32 1, i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ testBatchingTransmit(int);
void testClientBatchingTransmit() { testBatchingTransmit(1); }


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

x86 assembly (clang, -O2):
<testClientBatchingTransmit>:
mov    $0x1,%edi
jmp    1030 <testBatchingTransmit@plt>

LLVM IR (-O0):
define void @testClientBatchingTransmit() {
%1 = call i32 @testBatchingTransmit(i32 1)
ret void
}

LLVM IR (-O2):
define void @testClientBatchingTransmit() {
%1 = tail call i32 @testBatchingTransmit(i32 1)
ret void
}
void instruc_18() {}


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

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

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

LLVM IR (-O2):
define void @instruc_18() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xdf() {
  Assert_real((ispunct(223) == 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",
              1120, ("ispunct should be 0 for 0xdf"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xdf>:
push   %rax
mov    $0xdf,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x460,%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 0xdf\00"
define void @t_ispunct_0xdf() {
%1 = call i64 @ispunct(i32 223)
%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 1120, 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 0xdf\00"
define void @t_ispunct_0xdf() {
%1 = tail call i64 @ispunct(i32 223)
%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 1120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p521_selectznz(uintptr_t, uintptr_t, uintptr_t,
                                                uintptr_t);
void fiat_p521_selectznz(uint64_t out1[9], uint8_t arg1, const uint64_t arg2[9],
                         const uint64_t arg3[9]) {
  internal_fiat_p521_selectznz((uintptr_t)out1, (uintptr_t)arg1,
                               (uintptr_t)arg2, (uintptr_t)arg3);
}


x86 assembly (clang, -O0):
<fiat_p521_selectznz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <internal_fiat_p521_selectznz@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p521_selectznz>:
jmp    1030 <internal_fiat_p521_selectznz@plt>

LLVM IR (-O0):
define void @fiat_p521_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = ptrtoint i32* %12 to i64
%14 = load i32*, i32** %8
%15 = ptrtoint i32* %14 to i64
%16 = call i32 @internal_fiat_p521_selectznz(i64 %10, i64 %11, i64 %13, i64 %15)
ret void
}

LLVM IR (-O2):
define void @fiat_p521_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = ptrtoint i32* %0 to i64
%6 = ptrtoint i32* %2 to i64
%7 = ptrtoint i32* %3 to i64
%8 = tail call i32 @internal_fiat_p521_selectznz(i64 %5, i64 %1, i64 %6, i64 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() { puts("hello world"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@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 = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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

/* Variables and functions */
int EOF;
int /*<<< orphan*/ clearerr(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
void myflush(FILE *in) {
  int ch;
  do
    ch = fgetc(in);
  while (ch != EOF && ch != '\n');
  clearerr(in);
}


x86 assembly (clang, -O0):
<myflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
mov    0x2ea4(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0xd(%rbp)
je     1159 <myflush+0x39>
cmpl   $0xa,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    112c <myflush+0xc>
mov    -0x8(%rbp),%rdi
call   1040 <clearerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myflush>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
je     1142 <myflush+0x22>
cmp    (%r14),%eax
jne    1130 <myflush+0x10>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <clearerr@plt>

LLVM IR (-O0):
@EOF = global i32 0
define void @myflush(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 10
br label %14
14: ; preds = %11, %7
%15 = phi i1 [ false, %7 ], [ %13, %11 ]
br i1 %15, label %4, label %16
16: ; preds = %14
%17 = load i32*, i32** %2
%18 = call i32 @clearerr(i32* %17)
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @myflush(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, 10
%7 = and i1 %6, %5
br i1 %7, label %2, label %8
8: ; preds = %2
%9 = tail call i32 @clearerr(i32* %0)
ret void
}
/* Type definitions */
struct statfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
int fstatfs(int fd, struct statfs *buf) {
  StubBug("STUB:"
          "fstatfs");
  return -1;
}


x86 assembly (clang, -O0):
<fstatfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <StubBug@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstatfs>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <StubBug@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.statfs = type { i32 }
@.str = [13 x i8] c"STUB:fstatfs\00"
define i32 @fstatfs(i32 %0, %struct.statfs* %1) {
%3 = alloca i32
%4 = alloca %struct.statfs*
store i32 %0, i32* %3
store %struct.statfs* %1, %struct.statfs** %4
%5 = call i32 @StubBug(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
@.str = [13 x i8] c"STUB:fstatfs\00"
define i32 @fstatfs(i32 %0, %struct.statfs* nocapture readnone %1) {
%3 = tail call i32 @StubBug(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t strlen(const char *str) {
  uint64_t ret = 0;
  while (*str++)
    ++ret;
  return ret;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1139 <strlen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
int defeat_optimizer(volatile int *foo) { return *foo; }


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

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

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

LLVM IR (-O2):
define i32 @defeat_optimizer(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sys_die(char *, int);
extern void fail_test(int line) { sys_die("line %d: test failed\n", line); }


x86 assembly (clang, -O0):
<fail_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <sys_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail_test>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <sys_die@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"line %d: test failed\0A\00"
define void @fail_test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sys_die(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"line %d: test failed\0A\00"
define void @fail_test(i32 %0) {
%2 = tail call i32 @sys_die(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void create_digital_output(int bits) {}


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

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

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

LLVM IR (-O2):
define void @create_digital_output(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(unsigned char *, char *);
int isSSDPsamsung(unsigned char *payload) {
  return (strstr(payload, "M-SEARCH *") != NULL &&
          strstr(payload, "urn:samsung.com:device:RemoteControlReceiver:1") !=
              NULL);
}


x86 assembly (clang, -O0):
<isSSDPsamsung>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1158 <isSSDPsamsung+0x48>
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSSDPsamsung>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     1141 <isSSDPsamsung+0x31>
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"M-SEARCH *\00"
@.str.1 = [47 x i8] c"urn:samsung.com:device:RemoteControlReceiver:1\00"
define i32 @isSSDPsamsung(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @strstr(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32* @strstr(i8* %7, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i32* %8, null
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"M-SEARCH *\00"
@.str.1 = [47 x i8] c"urn:samsung.com:device:RemoteControlReceiver:1\00"
define i32 @isSSDPsamsung(i8* %0) {
%2 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void nakd_log_close() { closelog(); }


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

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

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

LLVM IR (-O2):
define void @nakd_log_close() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Type definitions */
typedef int ptrdiff_t;

/* Variables and functions */
int ULONG_MAX;
unsigned long lh_ptr_hash(const void *k) {
  return (unsigned long)((((ptrdiff_t)k * 0x9e370001UL) >> 4) & ULONG_MAX);
}


x86 assembly (clang, -O0):
<lh_ptr_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cltq
movabs $0x9e370001,%rcx
imul   %rcx,%rax
shr    $0x4,%rax
mov    0x2eb1(%rip),%rcx
movslq (%rcx),%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lh_ptr_hash>:
movslq %edi,%rax
mov    $0x9e370001,%ecx
imul   %rax,%rcx
shr    $0x4,%rcx
mov    0x2ec1(%rip),%rax
movslq (%rax),%rax
and    %rcx,%rax
ret

LLVM IR (-O0):
@ULONG_MAX = global i32 0
define i64 @lh_ptr_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 2654404609
%7 = lshr i64 %6, 4
%8 = load i32, i32* @ULONG_MAX
%9 = sext i32 %8 to i64
%10 = and i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
@ULONG_MAX = global i32 0
define i64 @lh_ptr_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = shl i64 %2, 32
%4 = ashr exact i64 %3, 32
%5 = mul nsw i64 %4, 2654404609
%6 = lshr i64 %5, 4
%7 = load i32, i32* @ULONG_MAX
%8 = sext i32 %7 to i64
%9 = and i64 %6, %8
ret i64 %9
}