xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isalnum(char);
int url_startwithprotocol(char *s) {
  unsigned int i = 0;
  while (isalnum(s[i])) {
    i++;
  }
  return s[i] == ':';
}


x86 assembly (clang, -O0):
<url_startwithprotocol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     114b <url_startwithprotocol+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <url_startwithprotocol+0x13>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<url_startwithprotocol>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffff,%ebx
nopl   0x0(%rax)
add    $0x1,%ebx
movsbl (%r14,%rbx,1),%edi
call   1030 <isalnum@plt>
test   %rax,%rax
jne    1120 <url_startwithprotocol+0x10>
mov    %ebx,%ecx
xor    %eax,%eax
cmpb   $0x3a,(%r14,%rcx,1)
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @url_startwithprotocol(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i64 @isalnum(i8 signext %6)
%8 = icmp eq i64 %7, 0
%9 = add i32 %3, 1
br i1 %8, label %10, label %2
10: ; preds = %2
%11 = zext i32 %3 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 58
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *ecalloc(size_t n, size_t s) {
  void *o = calloc(n, s);
  if (!o) {
    fprintf(stderr, "Memory allocation failed!\n");
    exit(EXIT_FAILURE);
  }
  return o;
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <ecalloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <ecalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Memory allocation failed!\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @ecalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Memory allocation failed!\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @ecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
void XtRegisterGrabAction() {}


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

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

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

LLVM IR (-O2):
define void @XtRegisterGrabAction() {
ret void
}
/* Variables and functions */
scalar_t__ CRYPTO_secure_malloc_init(int, int);
int /*<<< orphan*/ perror(char *);
int main(int argc, char **argv) {
  if (CRYPTO_secure_malloc_init(4096, 32)) {
    perror("failed");
    return 1;
  }
  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    $0x1000,%edi
mov    $0x20,%esi
call   1040 <CRYPTO_secure_malloc_init@plt>
cmp    $0x0,%rax
je     1167 <main+0x47>
lea    0xeaa(%rip),%rdi
call   1030 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    116e <main+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1000,%edi
mov    $0x20,%esi
call   1040 <CRYPTO_secure_malloc_init@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    113c <main+0x1c>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"failed\00"
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 = call i64 @CRYPTO_secure_malloc_init(i32 4096, i32 32)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %11
10: ; preds = %2
store i32 0, i32* %3
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"failed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @CRYPTO_secure_malloc_init(i32 4096, i32 32)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
short test_short_4(short a, short b, short c, short d) { return 2097; }


x86 assembly (clang, -O0):
<test_short_4>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    $0x831,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_short_4>:
mov    $0x831,%ax
ret

LLVM IR (-O0):
define signext i16 @test_short_4(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
ret i16 2097
}

LLVM IR (-O2):
define signext i16 @test_short_4(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
ret i16 2097
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_write_dobldobl_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(551, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_write_dobldobl_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x227,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_write_dobldobl_Laurent_system>:
mov    $0x227,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_write_dobldobl_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 551, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_write_dobldobl_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 551, i32* undef, i32* undef, double* undef)
ret i32 %1
}
void alphabet(char ELSE) {
  char ch;
  ch = ELSE;
  while (ch <= ELSE + 25) {
    printf(ch);
    ch = ch + 1;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<alphabet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
movsbl -0x1(%rbp),%ecx
add    $0x19,%ecx
cmp    %ecx,%eax
jg     1152 <alphabet+0x42>
movsbq -0x2(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x2(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x2(%rbp)
jmp    1124 <alphabet+0x14>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphabet>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%ebp
add    $0x19,%ebp
nopw   0x0(%rax,%rax,1)
movsbq %bl,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%bl
movsbl %bl,%eax
cmp    %eax,%ebp
jge    1130 <alphabet+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @alphabet(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, 25
br label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %0, %1 ]
%6 = sext i8 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7)
%9 = add i8 %5, 1
%10 = sext i8 %9 to i32
%11 = icmp slt i32 %3, %10
br i1 %11, label %12, label %4
12: ; preds = %4
%13 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int commonFunction() { printf("first men\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"first men\00"
define i32 @commonFunction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
void Default_TIMER1_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Default_TIMER1_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_TIMER1_IRQHandler+0x9>
jmp    1109 <Default_TIMER1_IRQHandler+0x9>

x86 assembly (clang, -O2):
<Default_TIMER1_IRQHandler>:
jmp    1100 <Default_TIMER1_IRQHandler>

LLVM IR (-O0):
define void @Default_TIMER1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_TIMER1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ init_fe(int /*<<< orphan*/, int, int /*<<< orphan*/, int,
                           int, int);
int /*<<< orphan*/ parse_part();
int /*<<< orphan*/ visualize_part();
void m_reload(void) {
  parse_part();
  visualize_part();
  init_fe(0, 300, 0, 300, 200, 200);
}


x86 assembly (clang, -O0):
<m_reload>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <parse_part@plt>
mov    $0x0,%al
call   1050 <visualize_part@plt>
xor    %edx,%edx
mov    $0x12c,%ecx
mov    $0xc8,%r9d
mov    %edx,%edi
mov    %ecx,%esi
mov    %r9d,%r8d
call   1030 <init_fe@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_reload>:
push   %rax
xor    %eax,%eax
call   1040 <parse_part@plt>
xor    %eax,%eax
call   1050 <visualize_part@plt>
xor    %edi,%edi
mov    $0x12c,%esi
xor    %edx,%edx
mov    $0x12c,%ecx
mov    $0xc8,%r8d
mov    $0xc8,%r9d
pop    %rax
jmp    1030 <init_fe@plt>

LLVM IR (-O0):
define void @m_reload() {
%1 = call i32 (...) @parse_part()
%2 = call i32 (...) @visualize_part()
%3 = call i32 @init_fe(i32 0, i32 300, i32 0, i32 300, i32 200, i32 200)
ret void
}

LLVM IR (-O2):
define void @m_reload() {
%1 = tail call i32 (...) @parse_part()
%2 = tail call i32 (...) @visualize_part()
%3 = tail call i32 @init_fe(i32 0, i32 300, i32 0, i32 300, i32 200, i32 200)
ret void
}
unsigned long hash(char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void underline(char *array) {
  puts(array);
  while (*array++) {
    putchar('=');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<underline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     115c <underline+0x3c>
mov    $0x3d,%edi
call   1030 <putchar@plt>
jmp    1135 <underline+0x15>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<underline>:
push   %rbx
mov    %rdi,%rbx
call   1040 <puts@plt>
cmpb   $0x0,(%rbx)
je     1153 <underline+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x3d,%edi
call   1030 <putchar@plt>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1140 <underline+0x20>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @underline(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %7, %5 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putchar(i8 signext 61)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("tamanho de um inteiro: %d\n", sizeof(int));
  printf("-1 com cast: %u\n", -1);
  if (sizeof(int) > -1)
    printf("4 é maior que -1");
  else
    printf("-1 é maior que 4");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"tamanho de um inteiro: %d\0A\00"
@.str.1 = [17 x i8] c"-1 com cast: %u\0A\00"
@.str.2 = [18 x i8] c"-1 \C3\A9 maior que 4\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 4)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -1)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"tamanho de um inteiro: %d\0A\00"
@.str.1 = [17 x i8] c"-1 com cast: %u\0A\00"
@.str.2 = [18 x i8] c"-1 \C3\A9 maior que 4\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 4)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct tag {
  int dummy;
};

/* Variables and functions */
struct tag *tag_reverse0(int /*<<< orphan*/ *, struct tag *);
struct tag *tag_reverse(struct tag *h) {
  return tag_reverse0(NULL, h);
}


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

x86 assembly (clang, -O2):
<tag_reverse>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <tag_reverse0@plt>

LLVM IR (-O0):
%struct.tag = type { i32 }
define %struct.tag* @tag_reverse(%struct.tag* %0) {
%2 = alloca %struct.tag*
store %struct.tag* %0, %struct.tag** %2
%3 = load %struct.tag*, %struct.tag** %2
%4 = call %struct.tag* @tag_reverse0(i32* null, %struct.tag* %3)
ret %struct.tag* %4
}

LLVM IR (-O2):
%struct.tag = type { i32 }
define %struct.tag* @tag_reverse(%struct.tag* %0) {
%2 = tail call %struct.tag* @tag_reverse0(i32* null, %struct.tag* %0)
ret %struct.tag* %2
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void err_sys(const char *string) { perror(string); }


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

x86 assembly (clang, -O2):
<err_sys>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @err_sys(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Variables and functions */
float dot_product(int);
int /*<<< orphan*/ end_measurement();
int /*<<< orphan*/ print_float(float);
int /*<<< orphan*/ start_measurement();
int main() {
  start_measurement();
  float res = dot_product(1000);
  end_measurement();
  print_float(res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <start_measurement@plt>
mov    $0x3e8,%edi
call   1040 <dot_product@plt>
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <end_measurement@plt>
movss  -0x8(%rbp),%xmm0
call   1050 <print_float@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <start_measurement@plt>
mov    $0x3e8,%edi
call   1040 <dot_product@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <end_measurement@plt>
movss  0x4(%rsp),%xmm0
call   1050 <print_float@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (...) @start_measurement()
%4 = call float @dot_product(i32 1000)
store float %4, float* %2
%5 = call i32 (...) @end_measurement()
%6 = load float, float* %2
%7 = call i32 @print_float(float %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start_measurement()
%2 = tail call float @dot_product(i32 1000)
%3 = tail call i32 (...) @end_measurement()
%4 = tail call i32 @print_float(float %2)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int check_number(char const *, char const *);
scalar_t__ errno;
scalar_t__ strtoull(char const *, char **, int);
bool parse_uint64(const char **string, uint64_t *result) {
  errno = 0;
  const char *start = *string;
  char *end;
  *result = (uint64_t)strtoull(start, &end, 10);
  *string = end;
  return check_number(start, *string);
}


x86 assembly (clang, -O0):
<parse_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoull@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
call   1040 <check_number@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_uint64>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2eaa(%rip),%rax
movq   $0x0,(%rax)
mov    (%rdi),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
call   1030 <strtoull@plt>
mov    %rax,(%r14)
mov    0x8(%rsp),%rsi
mov    %rsi,(%r15)
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <check_number@plt>

LLVM IR (-O0):
@errno = global i64 0
define i32 @parse_uint64(i8** %0, i64* %1) {
%3 = alloca i8**
%4 = alloca i64*
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %3
store i64* %1, i64** %4
store i64 0, i64* @errno
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i64 @strtoull(i8* %9, i8** %6, i32 10)
%11 = load i64*, i64** %4
store i64 %10, i64* %11
%12 = load i8*, i8** %6
%13 = load i8**, i8*** %3
store i8* %12, i8** %13
%14 = load i8*, i8** %5
%15 = load i8**, i8*** %3
%16 = load i8*, i8** %15
%17 = call i32 @check_number(i8* %14, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @parse_uint64(i8** nocapture %0, i64* nocapture writeonly %1) {
%3 = alloca i8*
store i64 0, i64* @errno
%4 = load i8*, i8** %0
%5 = bitcast i8** %3 to i8*
%6 = call i64 @strtoull(i8* %4, i8** %3, i32 10)
store i64 %6, i64* %1
%7 = load i8*, i8** %3
store i8* %7, i8** %0
%8 = tail call i32 @check_number(i8* %4, i8* %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void stat() {
  int var = 1;
  static int svar = 1;
  printf("var = %d, static = %d\n", var, svar);
  var++;
  svar++;
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    0x2f00(%rip),%edx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    0x2ee5(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2edc(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat>:
push   %rax
mov    0x2f11(%rip),%edx
lea    0xee2(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
addl   $0x1,0x2ef9(%rip)
pop    %rax
ret

LLVM IR (-O0):
@stat.svar = internal global i32 1
@.str = [23 x i8] c"var = %d, static = %d\0A\00"
define void @stat() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* @stat.svar
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = load i32, i32* @stat.svar
%8 = add nsw i32 %7, 1
store i32 %8, i32* @stat.svar
ret void
}

LLVM IR (-O2):
@stat.svar = internal unnamed_addr global i32 1
@.str = [23 x i8] c"var = %d, static = %d\0A\00"
define void @stat() {
%1 = load i32, i32* @stat.svar
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1, i32 %1)
%3 = load i32, i32* @stat.svar
%4 = add nsw i32 %3, 1
store i32 %4, i32* @stat.svar
ret void
}
unsigned char opcode_bbb_set_addr_mode(unsigned char base,
                                       unsigned char addr_mode) {
  addr_mode = addr_mode & 0x7;
  return base | (addr_mode << 2);
}


x86 assembly (clang, -O0):
<opcode_bbb_set_addr_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0x7,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
shl    $0x2,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opcode_bbb_set_addr_mode>:
lea    0x0(,%rsi,4),%eax
and    $0x1c,%al
or     %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @opcode_bbb_set_addr_mode(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 7
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 2
%14 = or i32 %10, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @opcode_bbb_set_addr_mode(i8 zeroext %0, i8 zeroext %1) {
%3 = shl i8 %1, 2
%4 = and i8 %3, 28
%5 = or i8 %4, %0
ret i8 %5
}
/* Variables and functions */
int gdt_compare(void const *, void const *);
int gdt_reverse_compare_void(const void *p1, const void *p2) {
  return gdt_compare(p2, p1);
}


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

x86 assembly (clang, -O2):
<gdt_reverse_compare_void>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <gdt_compare@plt>

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

LLVM IR (-O2):
define i32 @gdt_reverse_compare_void(i8* %0, i8* %1) {
%3 = tail call i32 @gdt_compare(i8* %1, i8* %0)
ret i32 %3
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_cfend(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c | 0x00f0)) ==
         __cpu_to_le16(0x0004 | 0x00E0);
}


x86 assembly (clang, -O0):
<ieee80211_is_cfend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xe4,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_cfend>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0xe4,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_cfend(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 228)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_cfend(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 228)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void sd_zbc_cancel_write_cmnd(struct scsi_cmnd *cmd) {}


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

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

LLVM IR (-O0):
%struct.scsi_cmnd = type opaque
define void @sd_zbc_cancel_write_cmnd(%struct.scsi_cmnd* %0) {
%2 = alloca %struct.scsi_cmnd*
store %struct.scsi_cmnd* %0, %struct.scsi_cmnd** %2
ret void
}

LLVM IR (-O2):
%struct.scsi_cmnd = type opaque
define void @sd_zbc_cancel_write_cmnd(%struct.scsi_cmnd* nocapture %0) {
ret void
}
int opus_select_arch(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @opus_select_arch() {
ret i32 0
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
void UpperCase(char *s) {
  int i;
  for (i = 0; i < strlen(s); i++)
    s[i] = toupper(s[i]);
}


x86 assembly (clang, -O0):
<UpperCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <UpperCase+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <UpperCase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpperCase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <UpperCase+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <UpperCase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @UpperCase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
char *getEnumEdgeKind(int value) {
  switch (value) {
  case 0:
    return "NOLL_EDGE_DIFF";
  case 1:
    return "NOLL_EDGE_PTO";
  case 2:
    return "NOLL_EDGE_PRED";
  default:
    return "NOLL_EDGE_OTHER";
  }
}


x86 assembly (clang, -O0):
<getEnumEdgeKind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <getEnumEdgeKind+0x3c>
jmp    111a <getEnumEdgeKind+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <getEnumEdgeKind+0x4c>
jmp    112b <getEnumEdgeKind+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <getEnumEdgeKind+0x5c>
jmp    116c <getEnumEdgeKind+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <getEnumEdgeKind+0x77>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <getEnumEdgeKind+0x77>
lea    0xeba(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <getEnumEdgeKind+0x77>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEnumEdgeKind>:
cmp    $0x2,%edi
ja     1117 <getEnumEdgeKind+0x17>
movslq %edi,%rax
lea    0xf2d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf0e(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"NOLL_EDGE_DIFF\00"
@.str.1 = [14 x i8] c"NOLL_EDGE_PTO\00"
@.str.2 = [15 x i8] c"NOLL_EDGE_PRED\00"
@.str.3 = [16 x i8] c"NOLL_EDGE_OTHER\00"
define i8* @getEnumEdgeKind(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [15 x i8] c"NOLL_EDGE_DIFF\00"
@.str.1 = [14 x i8] c"NOLL_EDGE_PTO\00"
@.str.2 = [15 x i8] c"NOLL_EDGE_PRED\00"
@.str.3 = [16 x i8] c"NOLL_EDGE_OTHER\00"
@reltable.getEnumEdgeKind = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.getEnumEdgeKind to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.getEnumEdgeKind to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.getEnumEdgeKind to i64)) to i32)]
define i8* @getEnumEdgeKind(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.getEnumEdgeKind to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Type definitions */
typedef int int8_t;
typedef int /*<<< orphan*/ input;

/* Variables and functions */
int /*<<< orphan*/ test_rebase(int, int *, int, int, int *, int /*<<< orphan*/);
void test_both_bases_are_negative(void) {
  int8_t input[] = {1};
  int8_t expected[] = {0};
  test_rebase(-2, input, (sizeof(input) / sizeof(input[0])), -7, expected, 0);
}


x86 assembly (clang, -O0):
<test_both_bases_are_negative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%r8
mov    $0xfffffffe,%edi
mov    $0x1,%edx
mov    $0xfffffff9,%ecx
xor    %r9d,%r9d
call   1040 <test_rebase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_both_bases_are_negative>:
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%r8
mov    $0xfffffffe,%edi
mov    $0x1,%edx
mov    $0xfffffff9,%ecx
xor    %r9d,%r9d
call   1030 <test_rebase@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.test_both_bases_are_negative.input = [1 x i32] [i32 1]
define void @test_both_bases_are_negative() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 -2, i32* %5, i32 1, i32 -7, i32* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @test_both_bases_are_negative() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 1, i32* %4
%5 = bitcast [1 x i32]* %2 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 0, i32* %6
%7 = call i32 @test_rebase(i32 -2, i32* %4, i32 1, i32 -7, i32* %6, i32 0)
ret void
}
int test_imm_11int16_mem(short *val) {
  return ((*val) & (-0x11 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_11int16_mem>:
movzwl (%rdi),%eax
test   $0xffef,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_11int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -17
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void z_param(int ac) {
  char buf;
  if (ac < 2)
    while (read(0, &buf, 1) != 0)
      write(1, &buf, 1);
}


x86 assembly (clang, -O0):
<z_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    116e <z_param+0x4e>
jmp    113a <z_param+0x1a>
xor    %edi,%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
je     1169 <z_param+0x49>
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    113a <z_param+0x1a>
jmp    116e <z_param+0x4e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<z_param>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x1,%edi
jg     1176 <z_param+0x56>
lea    0xf(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
je     1176 <z_param+0x56>
lea    0xf(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
jne    1150 <z_param+0x30>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @z_param(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %13
6: ; preds = %1
br label %7
7: ; preds = %10, %6
%8 = call i64 @read(i32 0, i8* %3, i32 1)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @write(i32 1, i8* %3, i32 1)
br label %7
12: ; preds = %7
br label %13
13: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
define void @z_param(i32 %0) {
%2 = alloca i8
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = call i64 @read(i32 0, i8* %2, i32 1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4, %7
%8 = call i32 @write(i32 1, i8* %2, i32 1)
%9 = call i64 @read(i32 0, i8* %2, i32 1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7, %4, %1
ret void
}
void d2i_BASIC_CONSTRAINTS(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_BASIC_CONSTRAINTS() {
ret void
}
/* Variables and functions */
unsigned int constant_time_is_zero(unsigned int);
unsigned int constant_time_eq(unsigned int a, unsigned int b) {
  return constant_time_is_zero(a ^ b);
}


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

x86 assembly (clang, -O2):
<constant_time_eq>:
xor    %esi,%edi
jmp    1030 <constant_time_is_zero@plt>

LLVM IR (-O0):
define i32 @constant_time_eq(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 = xor i32 %5, %6
%8 = call i32 @constant_time_is_zero(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @constant_time_eq(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = tail call i32 @constant_time_is_zero(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x94() {
  Assert_real((isalnum(148) == 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_isalnum.c",
              745, ("isalnum should be 0 for 0x94"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x94>:
push   %rax
mov    $0x94,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e9,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x94\00"
define void @t_isalnum_0x94() {
%1 = call i64 @isalnum(i32 148)
%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 745, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x94\00"
define void @t_isalnum_0x94() {
%1 = tail call i64 @isalnum(i32 148)
%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 745, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void init_adsl_mib(void) { return; }


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

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

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

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