xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
__attribute__((always_)) uint32_t load32(const void *src) {
  uint32_t w;
  memcpy(&w, src, sizeof w);
  return w;
}


x86 assembly (clang, -O0):
<load32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @load32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void key(unsigned char key, int x, int y) {
  switch (key) {
  case '\033':
    exit(0);
  }
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <key+0x2b>
jmp    1134 <key+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
cmp    $0x1b,%dil
je     1117 <key+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
bool nrf51_errata_10(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_10() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
struct tm *localtime(int /*<<< orphan*/ const *);
char *ctime(const time_t *t) {
  struct tm *tm = localtime(t);
  if (!tm)
    return 0;
  return asctime(tm);
}


x86 assembly (clang, -O0):
<ctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <ctime+0x31>
movq   $0x0,-0x8(%rbp)
jmp    115e <ctime+0x3e>
mov    -0x18(%rbp),%rdi
call   1040 <asctime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime>:
push   %rax
call   1030 <localtime@plt>
test   %rax,%rax
je     1134 <ctime+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <asctime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @ctime(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca %struct.tm*
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %6, %struct.tm** %4
%7 = load %struct.tm*, %struct.tm** %4
%8 = icmp ne %struct.tm* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %13
10: ; preds = %1
%11 = load %struct.tm*, %struct.tm** %4
%12 = call i8* @asctime(%struct.tm* %11)
store i8* %12, i8** %2
br label %13
13: ; preds = %10, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @ctime(i32* %0) {
%2 = tail call %struct.tm* @localtime(i32* %0)
%3 = icmp eq %struct.tm* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @asctime(%struct.tm* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void report_error_and_die(const char *message) {
  fprintf(stderr, "%s\n", message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<report_error_and_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<report_error_and_die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @report_error_and_die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @report_error_and_die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void EEFC_IRQHandler(void) {
  while (1)
    ;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @av_codec_set_lowres() {
ret void
}
void motion_set(unsigned char Direction) {}


x86 assembly (clang, -O0):
<motion_set>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @motion_set(i8 zeroext %0) {
ret void
}
void XDisplayOfScreen() {}


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

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

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

LLVM IR (-O2):
define void @XDisplayOfScreen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(int, int);
int main() {
  print(55, 10);
  print(2008, 1999);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x37,%edi
mov    $0xa,%esi
call   1030 <print@plt>
mov    $0x7d8,%edi
mov    $0x7cf,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x37,%edi
mov    $0xa,%esi
call   1030 <print@plt>
mov    $0x7d8,%edi
mov    $0x7cf,%esi
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print(i32 55, i32 10)
%3 = call i32 @print(i32 2008, i32 1999)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print(i32 55, i32 10)
%2 = tail call i32 @print(i32 2008, i32 1999)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sfree(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @sfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
double foo() { return 42; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @foo() {
ret double 4.200000e+01
}

LLVM IR (-O2):
define double @foo() {
ret double 4.200000e+01
}
int g(int x) {
  x = x < 0 ? -x : x;
  return x == 0;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <g+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <g+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int ILibWhichPowerOfTwo(int number) {
  int retVal = 0;
  if (number < 1) {
    return (-1);
  }
  while ((number = number >> 1) != 0) {
    ++retVal;
  }
  return (retVal);
}


x86 assembly (clang, -O0):
<ILibWhichPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1124 <ILibWhichPowerOfTwo+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <ILibWhichPowerOfTwo+0x4f>
jmp    1129 <ILibWhichPowerOfTwo+0x29>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1149 <ILibWhichPowerOfTwo+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <ILibWhichPowerOfTwo+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibWhichPowerOfTwo>:
test   %edi,%edi
jle    111d <ILibWhichPowerOfTwo+0x1d>
xor    %eax,%eax
cmp    $0x1,%edi
je     111c <ILibWhichPowerOfTwo+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nop
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <ILibWhichPowerOfTwo+0x10>
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ILibWhichPowerOfTwo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %18
8: ; preds = %1
br label %9
9: ; preds = %13, %8
%10 = load i32, i32* %3
%11 = ashr i32 %10, 1
store i32 %11, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %9
16: ; preds = %9
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @ILibWhichPowerOfTwo(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 1
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = phi i32 [ %8, %5 ], [ %0, %3 ]
%8 = ashr i32 %7, 1
%9 = add nuw nsw i32 %6, 1
%10 = icmp ult i32 %7, 4
br i1 %10, label %11, label %5
11: ; preds = %5, %3, %1
%12 = phi i32 [ -1, %1 ], [ 0, %3 ], [ %9, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int dice;
  srand(time(NULL));
  dice = rand() % 6 + 1;
  printf("Congrats! You rolled a %d\n", dice);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Congrats! You rolled a %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 6
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Congrats! You rolled a %d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int emac2_etherstatspkts1519toxoctets_set(
    unsigned int dev_id, union emac2_etherstatspkts1519toxoctets_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac2_etherstatspkts1519toxoctets_u = type opaque
define i32 @emac2_etherstatspkts1519toxoctets_set(i32 %0, %union.emac2_etherstatspkts1519toxoctets_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_etherstatspkts1519toxoctets_u*
store i32 %0, i32* %3
store %union.emac2_etherstatspkts1519toxoctets_u* %1, %union.emac2_etherstatspkts1519toxoctets_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_etherstatspkts1519toxoctets_u = type opaque
define i32 @emac2_etherstatspkts1519toxoctets_set(i32 %0, %union.emac2_etherstatspkts1519toxoctets_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_7() {
  Assert_real((isqrt(7) == 2),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              40, ("Integer square root of 7 should be 2"));
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [37 x i8] c"Integer square root of 7 should be 2\00"
define void @t_sqrt_7() {
%1 = call i32 @isqrt(i32 7)
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [37 x i8] c"Integer square root of 7 should be 2\00"
define void @t_sqrt_7() {
%1 = tail call i32 @isqrt(i32 7)
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void h4(char *header) { printf("<h4>%s</h4>\n", header); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"<h4>%s</h4>\0A\00"
define void @h4(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void handle_LOST(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_LOST(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
int isname(char c) { return (!isspace(c)); }


x86 assembly (clang, -O0):
<isname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isname>:
push   %rax
call   1030 <isspace@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isname(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @isspace(i8 signext %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isname(i8 signext %0) {
%2 = tail call i32 @isspace(i8 signext %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int loop(int n) {
  int i, s = 0;
  for (i = 0; i < n; i++) {
    s += i;
  }
  return s;
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <loop+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <loop+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
test   %edi,%edi
jle    1118 <loop+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,1),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @loop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, %10
store i32 %12, i32* %4
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @loop(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %10, %0
%12 = add i32 %11, -1
br label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %14
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t cram_into_u16(int val) {
  if (val > 0xfffe)
    return 0xfffe;
  if (val < 0)
    return 0xffff;
  return val;
}


x86 assembly (clang, -O0):
<cram_into_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xfffe,-0x8(%rbp)
jle    1120 <cram_into_u16+0x20>
movl   $0xfffe,-0x4(%rbp)
jmp    113c <cram_into_u16+0x3c>
cmpl   $0x0,-0x8(%rbp)
jge    1136 <cram_into_u16+0x36>
movl   $0xffff,-0x4(%rbp)
jmp    113c <cram_into_u16+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cram_into_u16>:
test   %edi,%edi
mov    $0xffff,%ecx
cmovns %edi,%ecx
cmp    $0xffff,%edi
mov    $0xfffe,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cram_into_u16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 65534
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 65534, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 65535, i32* %2
br label %13
11: ; preds = %7
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %10, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @cram_into_u16(i32 %0) {
%2 = icmp sgt i32 %0, 65534
%3 = icmp slt i32 %0, 0
%4 = select i1 %3, i32 65535, i32 %0
%5 = select i1 %2, i32 65534, i32 %4
ret i32 %5
}
int string_rune_length(char *s) {
  int i = 0, j = 0;
  while (s[i]) {
    if ((s[i] & 0xC0) != 0x80)
      j++;
    i++;
  }
  return (j);
}


x86 assembly (clang, -O0):
<string_rune_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115b <string_rune_length+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     114d <string_rune_length+0x4d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <string_rune_length+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_rune_length>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <string_rune_length+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
and    $0xc0,%cl
xor    %edx,%edx
cmp    $0x80,%cl
setne  %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_rune_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_rune_length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = and i8 %6, -64
%9 = icmp ne i8 %8, -128
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ md5(char *, int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strlen(char *);
int main() {
  char result[64];
  char *data = "Castelo Ratimbum";
  md5(data, strlen(data), result, sizeof(result));
  fprintf(stdout, "%s\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%esi
lea    -0x50(%rbp),%rdx
mov    $0x40,%ecx
call   1050 <md5@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    -0x50(%rbp),%rdx
lea    0xe8e(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0xec2(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
mov    $0x40,%ecx
call   1050 <md5@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Castelo Ratimbum\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%8 = call i32 @md5(i8* %4, i32 %6, i8* %7, i32 64)
%9 = load i32, i32* @stdout
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Castelo Ratimbum\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @md5(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %2, i32 64)
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int opt_text(char *arg, void *data) {
  assert(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @opt_text(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @opt_text(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ automaticArrayInit();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ staticArrayInit();
int main(void) {
  printf("First call to each function:\n");
  staticArrayInit();
  automaticArrayInit();
  printf("\n\nSecond call to each function:\n");
  staticArrayInit();
  automaticArrayInit();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <staticArrayInit@plt>
mov    $0x0,%al
call   1050 <automaticArrayInit@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <staticArrayInit@plt>
mov    $0x0,%al
call   1050 <automaticArrayInit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"First call to each function:\0A\00"
@.str.1 = [33 x i8] c"\0A\0ASecond call to each function:\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @staticArrayInit()
%4 = call i32 (...) @automaticArrayInit()
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @staticArrayInit()
%7 = call i32 (...) @automaticArrayInit()
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"First call to each function:\00"
@str.2 = [32 x i8] c"\0A\0ASecond call to each function:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @staticArrayInit()
%3 = tail call i32 (...) @automaticArrayInit()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 (...) @staticArrayInit()
%6 = tail call i32 (...) @automaticArrayInit()
ret i32 0
}
void swap(int *a1, int *a2) {
  int temp = *a1;
  *a1 = *a2;
  *a2 = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello C\n");
  return 0;
}


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

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

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

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

/* Variables and functions */
uint32_t render_map_color(uint8_t r, uint8_t g, uint8_t b) { return 0; }


x86 assembly (clang, -O0):
<render_map_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @render_map_color(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
void RTAvlU32Remove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlU32Remove() {
ret void
}
unsigned int _clrr(unsigned int src2, int src1) {
  unsigned int csta = (src1 >> 5) & 0x1f;
  unsigned int cstb = src1 & 0x1f;
  if (csta > cstb)
    return src2;
  else {
    unsigned int mask = (((1 << (cstb - csta)) << 1) - 1) << csta;
    return src2 & (~mask);
  }
}


x86 assembly (clang, -O0):
<_clrr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x5,%eax
and    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jbe    1136 <_clrr+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <_clrr+0x5f>
mov    -0x14(%rbp),%ecx
sub    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x18(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_clrr>:
mov    %edi,%eax
mov    %esi,%edx
shr    $0x5,%edx
and    $0x1f,%edx
and    $0x1f,%esi
sub    %edx,%esi
jb     1125 <_clrr+0x25>
mov    $0x2,%edi
mov    %esi,%ecx
shl    %cl,%edi
add    $0xffffffff,%edi
mov    %edx,%ecx
shl    %cl,%edi
not    %edi
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @_clrr(i32 %0, i32 %1) {
%3 = lshr i32 %1, 5
%4 = and i32 %3, 31
%5 = and i32 %1, 31
%6 = icmp ult i32 %5, %4
br i1 %6, label %14, label %7
7: ; preds = %2
%8 = sub nsw i32 %5, %4
%9 = shl i32 2, %8
%10 = add nsw i32 %9, -1
%11 = shl i32 %10, %4
%12 = xor i32 %11, -1
%13 = and i32 %12, %0
br label %14
14: ; preds = %2, %7
%15 = phi i32 [ %13, %7 ], [ %0, %2 ]
ret i32 %15
}
/* Variables and functions */
int ler_intervalo(int, int);
int /*<<< orphan*/ limpa_tela();
int /*<<< orphan*/ printf(char *);
int questiona_tam() {
  limpa_tela();
  printf("Visto que desejou comecar o processamento, ");
  printf("determine a quantidade de documentos\na serem analisados, "
         "recomendado que seja entre 1 e 999 apenas:\n");
  return ler_intervalo(1, 999);
}


x86 assembly (clang, -O0):
<questiona_tam>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <limpa_tela@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x3e7,%esi
call   1030 <ler_intervalo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<questiona_tam>:
push   %rax
xor    %eax,%eax
call   1060 <limpa_tela@plt>
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
mov    $0x3e7,%esi
pop    %rax
jmp    1040 <ler_intervalo@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Visto que desejou comecar o processamento, \00"
@.str.1 = [101 x i8] c"determine a quantidade de documentos\0Aa serem analisados, recomendado que seja entre 1 e 999 apenas:\0A\00"
define i32 @questiona_tam() {
%1 = call i32 (...) @limpa_tela()
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @ler_intervalo(i32 1, i32 999)
ret i32 %4
}

LLVM IR (-O2):
@.str = [44 x i8] c"Visto que desejou comecar o processamento, \00"
@str = [100 x i8] c"determine a quantidade de documentos\0Aa serem analisados, recomendado que seja entre 1 e 999 apenas:\00"
define i32 @questiona_tam() {
%1 = tail call i32 (...) @limpa_tela()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @ler_intervalo(i32 1, i32 999)
ret i32 %4
}
int return_10(void) { return 10; }


x86 assembly (clang, -O0):
<return_10>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @return_10() {
ret i32 10
}

LLVM IR (-O2):
define i32 @return_10() {
ret i32 10
}
/* Variables and functions */
float calculateMaxReadoutGradientAmplitude(float, float);
float calculateMinFieldOfView(float gradientAmplitude, float samplingInterval) {
  return calculateMaxReadoutGradientAmplitude(gradientAmplitude,
                                              samplingInterval);
}


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

x86 assembly (clang, -O2):
<calculateMinFieldOfView>:
jmp    1030 <calculateMaxReadoutGradientAmplitude@plt>

LLVM IR (-O0):
define float @calculateMinFieldOfView(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @calculateMaxReadoutGradientAmplitude(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @calculateMinFieldOfView(float %0, float %1) {
%3 = tail call float @calculateMaxReadoutGradientAmplitude(float %0, float %1)
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ Time;
typedef int /*<<< orphan*/ KeySym;

/* Variables and functions */
unsigned int ShiftMask;
int /*<<< orphan*/ gotodesk(int);
int /*<<< orphan*/ refocus(int /*<<< orphan*/);
int /*<<< orphan*/ setndesk(int);
void fnkey(KeySym keysym, unsigned state, Time time, int arg) {
  if (state & ShiftMask)
    setndesk(arg);
  gotodesk(arg - 1);
  refocus(time);
}


x86 assembly (clang, -O0):
<fnkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e9a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1161 <fnkey+0x31>
mov    -0x10(%rbp),%edi
call   1030 <setndesk@plt>
mov    -0x10(%rbp),%edi
sub    $0x1,%edi
call   1040 <gotodesk@plt>
mov    -0xc(%rbp),%edi
call   1050 <refocus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnkey>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%ebx
mov    0x2eaa(%rip),%rax
test   %esi,(%rax)
je     1149 <fnkey+0x19>
mov    %ebp,%edi
call   1030 <setndesk@plt>
add    $0xffffffff,%ebp
mov    %ebp,%edi
call   1040 <gotodesk@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <refocus@plt>

LLVM IR (-O0):
@ShiftMask = global i32 0
define void @fnkey(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* @ShiftMask
%11 = and i32 %9, %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %4
%14 = load i32, i32* %8
%15 = call i32 @setndesk(i32 %14)
br label %16
16: ; preds = %13, %4
%17 = load i32, i32* %8
%18 = sub nsw i32 %17, 1
%19 = call i32 @gotodesk(i32 %18)
%20 = load i32, i32* %7
%21 = call i32 @refocus(i32 %20)
ret void
}

LLVM IR (-O2):
@ShiftMask = global i32 0
define void @fnkey(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @ShiftMask
%6 = and i32 %5, %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @setndesk(i32 %3)
br label %10
10: ; preds = %8, %4
%11 = add nsw i32 %3, -1
%12 = tail call i32 @gotodesk(i32 %11)
%13 = tail call i32 @refocus(i32 %2)
ret void
}
int main() {
  int i = 0;
  int sum = 0;
  while (i++ < 100) {
    if (i % 2 == 0) {
      continue;
    }
    sum++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x64,%eax
jge    1154 <main+0x54>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1146 <main+0x46>
jmp    1119 <main+0x19>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %12, %0
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = icmp slt i32 %5, 100
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
br label %4
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 50
}
double dmax1(double a, double b) {
  if (a >= b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<dmax1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     112d <dmax1+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <dmax1+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmax1>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dmax1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp oge double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @dmax1(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
float sqrtf(float);
float hypotf(float x, float y) { return sqrtf(x * x + y * y); }


x86 assembly (clang, -O0):
<hypotf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypotf>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <hypotf+0x19>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @hypotf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = call float @llvm.fmuladd.f32(float %5, float %6, float %9)
%11 = call float @sqrtf(float %10)
ret float %11
}

LLVM IR (-O2):
define float @hypotf(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = tail call float @sqrtf(float %4)
ret float %5
}
void gtk_vscale_new_with_range() {}


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

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

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

LLVM IR (-O2):
define void @gtk_vscale_new_with_range() {
ret void
}
/* Variables and functions */
int cm_mask_interrupts(int);
bool __cm_atomic_set(bool *val) { return cm_mask_interrupts(*val); }


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

x86 assembly (clang, -O2):
<__cm_atomic_set>:
mov    (%rdi),%edi
jmp    1030 <cm_mask_interrupts@plt>

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

LLVM IR (-O2):
define i32 @__cm_atomic_set(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @cm_mask_interrupts(i32 %2)
ret i32 %3
}