xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ arr_malloc_size(size_t, int);
char *malloc_or_die(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *o_strdup(const char *str) {
  size_t len = strlen(str);
  char *dup = malloc_or_die(arr_malloc_size((len + 1), sizeof(char)));
  strcpy(dup, str);
  return dup;
}


x86 assembly (clang, -O0):
<o_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1030 <arr_malloc_size@plt>
mov    %eax,%edi
call   1060 <malloc_or_die@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<o_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1030 <arr_malloc_size@plt>
mov    %eax,%edi
call   1060 <malloc_or_die@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @o_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i32 @arr_malloc_size(i64 %8, i32 1)
%10 = call i8* @malloc_or_die(i32 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @o_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 @arr_malloc_size(i64 %3, i32 1)
%5 = tail call i8* @malloc_or_die(i32 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destruir_string(void *e) {
  char **d = (char **)e;
  free(*d);
}


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

x86 assembly (clang, -O2):
<destruir_string>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @destruir_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
store i8** %5, i8*** %3
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @destruir_string(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
int GetDeferredType(int action) { return (action >> 4) & 0xF; }


x86 assembly (clang, -O0):
<GetDeferredType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDeferredType>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @GetDeferredType(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = and i32 %4, 15
ret i32 %5
}

LLVM IR (-O2):
define i32 @GetDeferredType(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ talk();
int main(int argc, char **argv) { talk(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <talk@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 (...) @talk()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @talk()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void fclose_function(FILE **ptr) {
  if (*ptr)
    fclose(*ptr);
}


x86 assembly (clang, -O0):
<fclose_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <fclose_function+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclose_function>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <fclose_function+0xd>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
define void @fclose_function(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = call i32 @fclose(i32* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @fclose_function(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
int match_any(char c, char *str) {
  while (*str) {
    if (c == *str)
      return 1;
    ++str;
  }
  return 0;
}


x86 assembly (clang, -O0):
<match_any>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <match_any+0x4b>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113a <match_any+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1152 <match_any+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <match_any+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_any>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <match_any+0x20>
add    $0x1,%rsi
nopl   0x0(%rax)
cmp    %dil,%cl
je     1121 <match_any+0x21>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <match_any+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @match_any(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = load i8, i8* %12
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %12, %5 ], [ %1, %2 ]
%11 = icmp eq i8 %9, %0
%12 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %2
%14 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ AdcHardware_GetSample();
scalar_t__ AdcHardware_GetSampleComplete();
int /*<<< orphan*/ AdcHardware_StartConversion();
scalar_t__ AdcModel_DoGetSample();
int /*<<< orphan*/ AdcModel_ProcessInput(int /*<<< orphan*/);
void AdcConductor_Run(void) {
  if (AdcModel_DoGetSample() && AdcHardware_GetSampleComplete()) {
    AdcModel_ProcessInput(AdcHardware_GetSample());
    AdcHardware_StartConversion();
  }
}


x86 assembly (clang, -O0):
<AdcConductor_Run>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <AdcModel_DoGetSample@plt>
cmp    $0x0,%rax
je     118b <AdcConductor_Run+0x3b>
mov    $0x0,%al
call   1070 <AdcHardware_GetSampleComplete@plt>
cmp    $0x0,%rax
je     118b <AdcConductor_Run+0x3b>
mov    $0x0,%al
call   1050 <AdcHardware_GetSample@plt>
mov    %eax,%edi
call   1030 <AdcModel_ProcessInput@plt>
mov    $0x0,%al
call   1040 <AdcHardware_StartConversion@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AdcConductor_Run>:
push   %rax
xor    %eax,%eax
call   1060 <AdcModel_DoGetSample@plt>
test   %rax,%rax
je     117f <AdcConductor_Run+0x2f>
xor    %eax,%eax
call   1070 <AdcHardware_GetSampleComplete@plt>
test   %rax,%rax
je     117f <AdcConductor_Run+0x2f>
xor    %eax,%eax
call   1050 <AdcHardware_GetSample@plt>
mov    %eax,%edi
call   1030 <AdcModel_ProcessInput@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <AdcHardware_StartConversion@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @AdcConductor_Run() {
%1 = call i64 (...) @AdcModel_DoGetSample()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = call i64 (...) @AdcHardware_GetSampleComplete()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (...) @AdcHardware_GetSample()
%8 = call i32 @AdcModel_ProcessInput(i32 %7)
%9 = call i32 (...) @AdcHardware_StartConversion()
br label %10
10: ; preds = %6, %3, %0
ret void
}

LLVM IR (-O2):
define void @AdcConductor_Run() {
%1 = tail call i64 (...) @AdcModel_DoGetSample()
%2 = icmp eq i64 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i64 (...) @AdcHardware_GetSampleComplete()
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 (...) @AdcHardware_GetSample()
%8 = tail call i32 @AdcModel_ProcessInput(i32 %7)
%9 = tail call i32 (...) @AdcHardware_StartConversion()
br label %10
10: ; preds = %6, %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xbe() {
  Assert_real((isdigit(190) == 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_isdigit.c",
              955, ("isdigit should be 0 for 0xbe"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xbe>:
push   %rax
mov    $0xbe,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3bb,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xbe\00"
define void @t_isdigit_0xbe() {
%1 = call i64 @isdigit(i32 190)
%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 955, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xbe\00"
define void @t_isdigit_0xbe() {
%1 = tail call i64 @isdigit(i32 190)
%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 955, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_72int64_lowword_mem(long long *val) {
  return ((*val) & (0x72 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_72int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 114
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void arch_sigFunc(int sig __attribute__((unused))) { return; }


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

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

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

LLVM IR (-O2):
define void @arch_sigFunc(i32 %0) {
ret void
}
void statusline(void) {}


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

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

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

LLVM IR (-O2):
define void @statusline() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isxdigit(int);
void t_isxdigit_0x34() {
  Assert_real((isxdigit(52)),
              "/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_isxdigit.c",
              265, ("isxdigit should be 1 for 4"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x34>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
call   1030 <isxdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x109,%edx
lea    0xf66(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x34>:
push   %rax
mov    $0x34,%edi
call   1030 <isxdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0x109,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for 4\00"
define void @t_isxdigit_0x34() {
%1 = call i32 @isxdigit(i32 52)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 265, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for 4\00"
define void @t_isxdigit_0x34() {
%1 = tail call i32 @isxdigit(i32 52)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 265, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EmitLn(char *);
int /*<<< orphan*/ Factor();
int /*<<< orphan*/ Match(char);
void Multiply() {
  Match('*');
  Factor();
  EmitLn("imull (%esp), %eax");
  EmitLn("addl $4, %esp");
}


x86 assembly (clang, -O0):
<Multiply>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1040 <Match@plt>
mov    $0x0,%al
call   1030 <Factor@plt>
lea    0xeb4(%rip),%rdi
call   1050 <EmitLn@plt>
lea    0xebb(%rip),%rdi
call   1050 <EmitLn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Multiply>:
push   %rax
mov    $0x2a,%edi
call   1040 <Match@plt>
xor    %eax,%eax
call   1030 <Factor@plt>
lea    0xeb7(%rip),%rdi
call   1050 <EmitLn@plt>
lea    0xebe(%rip),%rdi
pop    %rax
jmp    1050 <EmitLn@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"imull (%esp), %eax\00"
@.str.1 = [14 x i8] c"addl $4, %esp\00"
define void @Multiply() {
%1 = call i32 @Match(i8 signext 42)
%2 = call i32 (...) @Factor()
%3 = call i32 @EmitLn(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @EmitLn(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"imull (%esp), %eax\00"
@.str.1 = [14 x i8] c"addl $4, %esp\00"
define void @Multiply() {
%1 = tail call i32 @Match(i8 signext 42)
%2 = tail call i32 (...) @Factor()
%3 = tail call i32 @EmitLn(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @EmitLn(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x71() {
  Assert_real((ispunct(113) == 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",
              570, ("ispunct should be 0 for q"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x71>:
push   %rax
mov    $0x71,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x23a,%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 = [26 x i8] c"ispunct should be 0 for q\00"
define void @t_ispunct_0x71() {
%1 = call i64 @ispunct(i32 113)
%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 570, 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for q\00"
define void @t_ispunct_0x71() {
%1 = tail call i64 @ispunct(i32 113)
%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 570, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ printfail();
void expect(int a, int b) {
  if (!(a == b)) {
    printfail();
    printf("\n  %d expected, but got %d\n", a, b);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<expect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     116d <expect+0x3d>
mov    $0x0,%al
call   1040 <printfail@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect>:
cmp    %esi,%edi
jne    1135 <expect+0x5>
ret
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <printfail@plt>
lea    0xeb6(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"\0A %d expected, but got %d\0A\00"
define void @expect(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = call i32 (...) @printfail()
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0A %d expected, but got %d\0A\00"
define void @expect(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 (...) @printfail()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_args(int, char **);
int main(int argc, char *argv[]) {
  parse_args(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char c;
  printf("%ld\n", sizeof(char));
  printf("%ld\n", sizeof(c));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int bufcon_lenp(unsigned int);
int bufcon_lenx(unsigned int p) { return (bufcon_lenp(p) + 2); }


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

x86 assembly (clang, -O2):
<bufcon_lenx>:
push   %rax
call   1030 <bufcon_lenp@plt>
add    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bufcon_lenx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bufcon_lenp(i32 %3)
%5 = add nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @bufcon_lenx(i32 %0) {
%2 = tail call i32 @bufcon_lenp(i32 %0)
%3 = add nsw i32 %2, 2
ret i32 %3
}
void outb(unsigned short port, unsigned char val) {
  __asm__ volatile("outb %0, %1" : : "a"(val), "Nd"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $0, $1", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CE_High();
int /*<<< orphan*/ CE_Low();
int /*<<< orphan*/ Send_Byte(unsigned char);
void Byte_Program(unsigned long Dst, unsigned char byte) {
  CE_Low();
  Send_Byte(0x02);
  Send_Byte(((Dst & 0xFFFFFF) >> 16));
  Send_Byte(((Dst & 0xFFFF) >> 8));
  Send_Byte(Dst & 0xFF);
  Send_Byte(byte);
  CE_High();
}


x86 assembly (clang, -O0):
<Byte_Program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x0,%al
call   1050 <CE_Low@plt>
mov    $0x2,%edi
call   1030 <Send_Byte@plt>
mov    -0x8(%rbp),%rax
and    $0xffffff,%rax
shr    $0x10,%rax
movzbl %al,%edi
call   1030 <Send_Byte@plt>
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
shr    $0x8,%rax
movzbl %al,%edi
call   1030 <Send_Byte@plt>
mov    -0x8(%rbp),%rax
and    $0xff,%rax
movzbl %al,%edi
call   1030 <Send_Byte@plt>
movzbl -0x9(%rbp),%edi
call   1030 <Send_Byte@plt>
mov    $0x0,%al
call   1040 <CE_High@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Byte_Program>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <CE_Low@plt>
mov    $0x2,%edi
call   1030 <Send_Byte@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <Send_Byte@plt>
movzbl %bh,%edi
call   1030 <Send_Byte@plt>
movzbl %bl,%edi
call   1030 <Send_Byte@plt>
mov    %ebp,%edi
call   1030 <Send_Byte@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <CE_High@plt>

LLVM IR (-O0):
define void @Byte_Program(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = call i32 (...) @CE_Low()
%6 = call i32 @Send_Byte(i8 zeroext 2)
%7 = load i64, i64* %3
%8 = and i64 %7, 16777215
%9 = lshr i64 %8, 16
%10 = trunc i64 %9 to i8
%11 = call i32 @Send_Byte(i8 zeroext %10)
%12 = load i64, i64* %3
%13 = and i64 %12, 65535
%14 = lshr i64 %13, 8
%15 = trunc i64 %14 to i8
%16 = call i32 @Send_Byte(i8 zeroext %15)
%17 = load i64, i64* %3
%18 = and i64 %17, 255
%19 = trunc i64 %18 to i8
%20 = call i32 @Send_Byte(i8 zeroext %19)
%21 = load i8, i8* %4
%22 = call i32 @Send_Byte(i8 zeroext %21)
%23 = call i32 (...) @CE_High()
ret void
}

LLVM IR (-O2):
define void @Byte_Program(i64 %0, i8 zeroext %1) {
%3 = tail call i32 (...) @CE_Low()
%4 = tail call i32 @Send_Byte(i8 zeroext 2)
%5 = lshr i64 %0, 16
%6 = trunc i64 %5 to i8
%7 = tail call i32 @Send_Byte(i8 zeroext %6)
%8 = lshr i64 %0, 8
%9 = trunc i64 %8 to i8
%10 = tail call i32 @Send_Byte(i8 zeroext %9)
%11 = trunc i64 %0 to i8
%12 = tail call i32 @Send_Byte(i8 zeroext %11)
%13 = tail call i32 @Send_Byte(i8 zeroext %1)
%14 = tail call i32 (...) @CE_High()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "bus_autoconf - devd config file generator\n"
                  "	-i <structure_type,module.ko>\n"
                  "	-F <format_file>\n"
                  "	-h show usage\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [107 x i8] c"bus_autoconf - devd config file generator\0A\09-i <structure_type,module.ko>\0A\09-F <format_file>\0A\09-h show usage\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [107 x i8] c"bus_autoconf - devd config file generator\0A\09-i <structure_type,module.ko>\0A\09-F <format_file>\0A\09-h show usage\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char *, char *, char *, char *);
void diskpartition_header(const char *partition_name) {
  printf("%-10s %10s %10s %10s %10s\n", partition_name, "reads  ",
         "read sectors", "writes   ", "requested writes");
}


x86 assembly (clang, -O0):
<diskpartition_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
lea    0xeed(%rip),%rdx
lea    0xeee(%rip),%rcx
lea    0xef4(%rip),%r8
lea    0xef7(%rip),%r9
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diskpartition_header>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
lea    0xefa(%rip),%rdx
lea    0xefb(%rip),%rcx
lea    0xf01(%rip),%r8
lea    0xf04(%rip),%r9
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%-10s %10s %10s %10s %10s\0A\00"
@.str.1 = [8 x i8] c"reads \00"
@.str.2 = [13 x i8] c"read sectors\00"
@.str.3 = [10 x i8] c"writes \00"
@.str.4 = [17 x i8] c"requested writes\00"
define void @diskpartition_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%-10s %10s %10s %10s %10s\0A\00"
@.str.1 = [8 x i8] c"reads \00"
@.str.2 = [13 x i8] c"read sectors\00"
@.str.3 = [10 x i8] c"writes \00"
@.str.4 = [17 x i8] c"requested writes\00"
define void @diskpartition_header(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
ret void
}
int test_imm_89int16_reg(short val) {
  return ((val) & (-0x89 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_89int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff77,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_89int16_reg>:
test   $0xff77,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_89int16_reg(i16 signext %0) {
%2 = and i16 %0, -137
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned xrop3_44_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D | S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_44_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_44_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
lea    (%rdi,%rax,1),%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
or     $0xff,%eax
and    %edx,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_44_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_44_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = or i32 %4, 255
%9 = and i32 %7, %8
%10 = xor i32 %9, %5
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ SYS_brk;
scalar_t__ syscall_1(int /*<<< orphan*/, int /*<<< orphan*/);
int brk(void *end_data_segment) {
  return (void *)syscall_1(SYS_brk, 0) == end_data_segment;
}


x86 assembly (clang, -O0):
<brk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <syscall_1@plt>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brk>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <syscall_1@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SYS_brk = global i32 0
define i32 @brk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @SYS_brk
%4 = call i64 @syscall_1(i32 %3, i32 0)
%5 = inttoptr i64 %4 to i8*
%6 = load i8*, i8** %2
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@SYS_brk = global i32 0
define i32 @brk(i8* readnone %0) {
%2 = load i32, i32* @SYS_brk
%3 = tail call i64 @syscall_1(i32 %2, i32 0)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i8* %4, %0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct ln_rst_time {
  int dummy;
};
struct ln_par_orbit {
  int dummy;
};
struct ln_lnlat_posn {
  int dummy;
};

/* Variables and functions */
int ln_get_par_body_next_rst_horizon(double, struct ln_lnlat_posn *,
                                     struct ln_par_orbit *, double,
                                     struct ln_rst_time *);
int ln_get_par_body_next_rst(double JD, struct ln_lnlat_posn *observer,
                             struct ln_par_orbit *orbit,
                             struct ln_rst_time *rst) {
  return ln_get_par_body_next_rst_horizon(JD, observer, orbit, -0.5667, rst);
}


x86 assembly (clang, -O0):
<ln_get_par_body_next_rst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
movsd  0xebe(%rip),%xmm1
call   1030 <ln_get_par_body_next_rst_horizon@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_par_body_next_rst>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <ln_get_par_body_next_rst_horizon@plt>

LLVM IR (-O0):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_par_orbit = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_par_body_next_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_par_orbit* %2, %struct.ln_rst_time* %3) {
%5 = alloca double
%6 = alloca %struct.ln_lnlat_posn*
%7 = alloca %struct.ln_par_orbit*
%8 = alloca %struct.ln_rst_time*
store double %0, double* %5
store %struct.ln_lnlat_posn* %1, %struct.ln_lnlat_posn** %6
store %struct.ln_par_orbit* %2, %struct.ln_par_orbit** %7
store %struct.ln_rst_time* %3, %struct.ln_rst_time** %8
%9 = load double, double* %5
%10 = load %struct.ln_lnlat_posn*, %struct.ln_lnlat_posn** %6
%11 = load %struct.ln_par_orbit*, %struct.ln_par_orbit** %7
%12 = load %struct.ln_rst_time*, %struct.ln_rst_time** %8
%13 = call i32 @ln_get_par_body_next_rst_horizon(double %9, %struct.ln_lnlat_posn* %10, %struct.ln_par_orbit* %11, double -5.667000e-01, %struct.ln_rst_time* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.ln_lnlat_posn = type { i32 }
%struct.ln_par_orbit = type { i32 }
%struct.ln_rst_time = type { i32 }
define i32 @ln_get_par_body_next_rst(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_par_orbit* %2, %struct.ln_rst_time* %3) {
%5 = tail call i32 @ln_get_par_body_next_rst_horizon(double %0, %struct.ln_lnlat_posn* %1, %struct.ln_par_orbit* %2, double -5.667000e-01, %struct.ln_rst_time* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Wc(char);
void Wr(void) { Wc('\r'); }


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

x86 assembly (clang, -O2):
<Wr>:
mov    $0xd,%edi
jmp    1030 <Wc@plt>

LLVM IR (-O0):
define void @Wr() {
%1 = call i32 @Wc(i8 signext 13)
ret void
}

LLVM IR (-O2):
define void @Wr() {
%1 = tail call i32 @Wc(i8 signext 13)
ret void
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int vec3_length(struct vec3 *);
int /*<<< orphan*/ vec3_scale_inplace(struct vec3 *, int);
void vec3_normalize_inplace(struct vec3 *dst) {
  vec3_scale_inplace(dst, 1 / vec3_length(dst));
}


x86 assembly (clang, -O0):
<vec3_normalize_inplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vec3_length@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,%esi
call   1040 <vec3_scale_inplace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_normalize_inplace>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_length@plt>
lea    0x1(%rax),%ecx
xor    %esi,%esi
cmp    $0x3,%ecx
cmovb  %eax,%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <vec3_scale_inplace@plt>

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define void @vec3_normalize_inplace(%struct.vec3* %0) {
%2 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %2
%3 = load %struct.vec3*, %struct.vec3** %2
%4 = load %struct.vec3*, %struct.vec3** %2
%5 = call i32 @vec3_length(%struct.vec3* %4)
%6 = sdiv i32 1, %5
%7 = call i32 @vec3_scale_inplace(%struct.vec3* %3, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define void @vec3_normalize_inplace(%struct.vec3* %0) {
%2 = tail call i32 @vec3_length(%struct.vec3* %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = tail call i32 @vec3_scale_inplace(%struct.vec3* %0, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdin;
int vfscanf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vscanf(const char *fmt, va_list arg) { return vfscanf(stdin, fmt, arg); }


x86 assembly (clang, -O0):
<vscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfscanf@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @vscanf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdin
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @vfscanf(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @vscanf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @vfscanf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ assert(char const *);
scalar_t__ stat(char const *, struct stat *);
int is_dir(const char *fname) {
  assert(fname);
  struct stat s;
  if (stat(fname, &s) == 0) {
    if (S_ISDIR(s.st_mode))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <stat@plt>
cmp    $0x0,%rax
jne    117f <is_dir+0x4f>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     117a <is_dir+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1186 <is_dir+0x56>
jmp    117f <is_dir+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <assert@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <stat@plt>
test   %rax,%rax
jne    1165 <is_dir+0x35>
mov    0x8(%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1167 <is_dir+0x37>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %3
%8 = call i64 @stat(i8* %7, %struct.stat* %4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i64 @S_ISDIR(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %2
br label %18
16: ; preds = %10
br label %17
17: ; preds = %16, %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca %struct.stat
%3 = tail call i32 @assert(i8* %0)
%4 = bitcast %struct.stat* %2 to i8*
%5 = call i64 @stat(i8* %0, %struct.stat* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7, %1
br label %13
13: ; preds = %7, %12
%14 = phi i32 [ 0, %12 ], [ 1, %7 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_pxints(unsigned port) {
  return readl((void *)0xb0010000 + (port * 0x100) + (0x14));
}


x86 assembly (clang, -O0):
<read_pxints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%edi
add    %rax,%rdi
add    $0x14,%rdi
call   1030 <readl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pxints>:
shl    $0x8,%edi
mov    $0xb0010014,%eax
add    %rax,%rdi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_pxints(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 256
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %5
%7 = getelementptr i8, i8* %6, i64 20
%8 = call i32 @readl(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_pxints(i32 %0) {
%2 = shl i32 %0, 8
%3 = zext i32 %2 to i64
%4 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %3
%5 = getelementptr i8, i8* %4, i64 20
%6 = tail call i32 @readl(i8* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ driveForwardDead();
int /*<<< orphan*/ intakeDead();
int /*<<< orphan*/ stopAll();
int /*<<< orphan*/ stopDrive();
int /*<<< orphan*/ stopIntake();
void ram() {
  intakeDead();
  driveForwardDead();
  delay(5000);
  stopDrive();
  stopIntake();
  stopAll();
}


x86 assembly (clang, -O0):
<ram>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <intakeDead@plt>
mov    $0x0,%al
call   1060 <driveForwardDead@plt>
mov    $0x1388,%edi
call   1040 <delay@plt>
mov    $0x0,%al
call   1080 <stopDrive@plt>
mov    $0x0,%al
call   1050 <stopIntake@plt>
mov    $0x0,%al
call   1030 <stopAll@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ram>:
push   %rax
xor    %eax,%eax
call   1070 <intakeDead@plt>
xor    %eax,%eax
call   1060 <driveForwardDead@plt>
mov    $0x1388,%edi
call   1040 <delay@plt>
xor    %eax,%eax
call   1080 <stopDrive@plt>
xor    %eax,%eax
call   1050 <stopIntake@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <stopAll@plt>

LLVM IR (-O0):
define void @ram() {
%1 = call i32 (...) @intakeDead()
%2 = call i32 (...) @driveForwardDead()
%3 = call i32 @delay(i32 5000)
%4 = call i32 (...) @stopDrive()
%5 = call i32 (...) @stopIntake()
%6 = call i32 (...) @stopAll()
ret void
}

LLVM IR (-O2):
define void @ram() {
%1 = tail call i32 (...) @intakeDead()
%2 = tail call i32 (...) @driveForwardDead()
%3 = tail call i32 @delay(i32 5000)
%4 = tail call i32 (...) @stopDrive()
%5 = tail call i32 (...) @stopIntake()
%6 = tail call i32 (...) @stopAll()
ret void
}
/* Variables and functions */
char *tolmfile(char *);
char *acceptable_tom(char *dep) { return tolmfile(dep); }


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

x86 assembly (clang, -O2):
<acceptable_tom>:
jmp    1030 <tolmfile@plt>

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

LLVM IR (-O2):
define i8* @acceptable_tom(i8* %0) {
%2 = tail call i8* @tolmfile(i8* %0)
ret i8* %2
}
int main(void) {
  return 0;
this_label_is_not_used:
  __attribute__((unused)) return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %1
br label %3
2: ; No predecessors!
store i32 1, i32* %1
br label %3
3: ; preds = %2, %0
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}