xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *unicode_is_well_formed_utf8(char *, size_t);
unsigned int unicode_string_length_utf8_imp(char *, size_t);
unsigned int unicode_string_length_utf8(char *string, size_t string_length) {
  assert(string);
  assert(unicode_is_well_formed_utf8(string, string_length));
  return unicode_string_length_utf8_imp(string, string_length);
}


x86 assembly (clang, -O0):
<unicode_string_length_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <unicode_is_well_formed_utf8@plt>
mov    %rax,%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <unicode_string_length_utf8_imp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_string_length_utf8>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <unicode_is_well_formed_utf8@plt>
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <unicode_string_length_utf8_imp@plt>

LLVM IR (-O0):
define i32 @unicode_string_length_utf8(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i8* @unicode_is_well_formed_utf8(i8* %7, i64 %8)
%10 = call i32 @assert(i8* %9)
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @unicode_string_length_utf8_imp(i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @unicode_string_length_utf8(i8* %0, i64 %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i8* @unicode_is_well_formed_utf8(i8* %0, i64 %1)
%5 = tail call i32 @assert(i8* %4)
%6 = tail call i32 @unicode_string_length_utf8_imp(i8* %0, i64 %1)
ret i32 %6
}
/* Variables and functions */
double pow(double, int);
double powerr(char const *, double, char const *, int);
double powGuarded2(double x, const char *sx, int y, const char *sy) {
  return (x == 0.0 && y < 0) ? powerr(sx, x, sy, y) : pow(x, y);
}


x86 assembly (clang, -O0):
<powGuarded2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1179 <powGuarded2+0x59>
jp     1179 <powGuarded2+0x59>
cmpl   $0x0,-0x14(%rbp)
jge    1179 <powGuarded2+0x59>
mov    -0x10(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <powerr@plt>
movsd  %xmm0,-0x28(%rbp)
jmp    118b <powGuarded2+0x6b>
movsd  -0x8(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powGuarded2>:
mov    %esi,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113c <powGuarded2+0x1c>
jp     113c <powGuarded2+0x1c>
test   %eax,%eax
jns    113c <powGuarded2+0x1c>
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <powerr@plt>
mov    %eax,%edi
jmp    1040 <pow@plt>

LLVM IR (-O0):
define double @powGuarded2(double %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca double
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store double %0, double* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load double, double* %5
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %11, label %20
11: ; preds = %4
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i8*, i8** %6
%16 = load double, double* %5
%17 = load i8*, i8** %8
%18 = load i32, i32* %7
%19 = call double @powerr(i8* %15, double %16, i8* %17, i32 %18)
br label %24
20: ; preds = %11, %4
%21 = load double, double* %5
%22 = load i32, i32* %7
%23 = call double @pow(double %21, i32 %22)
br label %24
24: ; preds = %20, %14
%25 = phi double [ %19, %14 ], [ %23, %20 ]
ret double %25
}

LLVM IR (-O2):
define double @powGuarded2(double %0, i8* %1, i32 %2, i8* %3) {
%5 = fcmp oeq double %0, 0.000000e+00
%6 = icmp slt i32 %2, 0
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call double @powerr(i8* %1, double %0, i8* %3, i32 %2)
br label %12
10: ; preds = %4
%11 = tail call double @pow(double %0, i32 %2)
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ e_cmp();
int /*<<< orphan*/ e_zpx();
void e_cmp_zpx() {
  e_zpx();
  e_cmp();
}


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

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

LLVM IR (-O0):
define void @e_cmp_zpx() {
%1 = call i32 (...) @e_zpx()
%2 = call i32 (...) @e_cmp()
ret void
}

LLVM IR (-O2):
define void @e_cmp_zpx() {
%1 = tail call i32 (...) @e_zpx()
%2 = tail call i32 (...) @e_cmp()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ BLKGETSIZE64;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
uint64_t linux_get_block_dev_size(int fd) {
  uint64_t len;
  ioctl(fd, BLKGETSIZE64, &len);
  return len;
}


x86 assembly (clang, -O0):
<linux_get_block_dev_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linux_get_block_dev_size>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@BLKGETSIZE64 = global i32 0
define i32 @linux_get_block_dev_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @BLKGETSIZE64
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@BLKGETSIZE64 = global i32 0
define i32 @linux_get_block_dev_size(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @BLKGETSIZE64
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ orchestrator_initStates();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("[C Code] Running test\n");
  orchestrator_initStates();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"[C Code] Running test\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @orchestrator_initStates()
ret i32 0
}
void isr_systick(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @isr_systick() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
unsigned char ds1337_read_register(int);
int /*<<< orphan*/ ds1337_write_register(int, unsigned char);
void ds1337_clear_alarm1_flag() {
  unsigned char status = ds1337_read_register(0x0F);
  status &= 0xFE;
  ds1337_write_register(0x0F, status);
}


x86 assembly (clang, -O0):
<ds1337_clear_alarm1_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf,%edi
call   1040 <ds1337_read_register@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xfe,%eax
mov    %al,-0x1(%rbp)
mov    $0xf,%edi
movzbl -0x1(%rbp),%esi
call   1030 <ds1337_write_register@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1337_clear_alarm1_flag>:
push   %rax
mov    $0xf,%edi
call   1040 <ds1337_read_register@plt>
and    $0xfe,%al
movzbl %al,%esi
mov    $0xf,%edi
pop    %rax
jmp    1030 <ds1337_write_register@plt>

LLVM IR (-O0):
define void @ds1337_clear_alarm1_flag() {
%1 = alloca i8
%2 = call zeroext i8 @ds1337_read_register(i32 15)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = and i32 %4, 254
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = load i8, i8* %1
%8 = call i32 @ds1337_write_register(i32 15, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @ds1337_clear_alarm1_flag() {
%1 = tail call zeroext i8 @ds1337_read_register(i32 15)
%2 = and i8 %1, -2
%3 = tail call i32 @ds1337_write_register(i32 15, i8 zeroext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void ImprimeMenu(char *menuOpc[], size_t length) {
  for (int i = 0; i < length; i++)
    printf("%i - %s\n", i + 1, menuOpc[i]);
}


x86 assembly (clang, -O0):
<ImprimeMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1161 <ImprimeMenu+0x51>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <ImprimeMenu+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ImprimeMenu>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1147 <ImprimeMenu+0x37>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r12
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdx
add    $0x1,%rbx
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    %rbx,%r15
jne    1130 <ImprimeMenu+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%i - %s\0A\00"
define void @ImprimeMenu(i8** nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %7, %5 ], [ 0, %2 ]
%7 = add nuw nsw i64 %6, 1
%8 = getelementptr inbounds i8*, i8** %0, i64 %6
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = icmp eq i64 %7, %1
br i1 %12, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num;
  num = 5;
  printf("%d", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
char nodeCounter(void *graph, int lineIndex, int fromId, int toId) {
  int *max = (int *)graph;
  *max = fromId > toId ? fromId : toId;
  return 1;
}


x86 assembly (clang, -O0):
<nodeCounter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1130 <nodeCounter+0x30>
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1136 <nodeCounter+0x36>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nodeCounter>:
cmp    %ecx,%edx
cmovg  %edx,%ecx
mov    %ecx,(%rdi)
mov    $0x1,%al
ret

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

LLVM IR (-O2):
define signext i8 @nodeCounter(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = icmp sgt i32 %2, %3
%7 = select i1 %6, i32 %2, i32 %3
store i32 %7, i32* %5
ret i8 1
}
/* Type definitions */
struct servent {
  int dummy;
};

/* Variables and functions */
scalar_t__ getservbyname_r(char const *, char const *, struct servent *, void *,
                           int, struct servent **);
struct servent *getservbyname(const char *name, const char *prots) {
  static struct servent se;
  static long buf[32 / sizeof(long)];
  struct servent *res;
  if (getservbyname_r(name, prots, &se, (void *)buf, sizeof buf, &res))
    return 0;
  return &se;
}


x86 assembly (clang, -O0):
<getservbyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0x2f11(%rip),%rdx
lea    0x2f1a(%rip),%rcx
mov    $0x20,%r8d
lea    -0x20(%rbp),%r9
call   1030 <getservbyname_r@plt>
cmp    $0x0,%rax
je     115c <getservbyname+0x4c>
movq   $0x0,-0x8(%rbp)
jmp    1167 <getservbyname+0x57>
lea    0x2edd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getservbyname>:
push   %rbx
sub    $0x10,%rsp
lea    0x2f24(%rip),%rbx
lea    0x2f2d(%rip),%rcx
lea    0x8(%rsp),%r9
mov    %rbx,%rdx
mov    $0x20,%r8d
call   1030 <getservbyname_r@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.servent = type { i32 }
@getservbyname.se = internal global %struct.servent zeroinitializer
@getservbyname.buf = internal global [4 x i64] zeroinitializer
define %struct.servent* @getservbyname(i8* %0, i8* %1) {
%3 = alloca %struct.servent*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.servent*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i64 @getservbyname_r(i8* %7, i8* %8, %struct.servent* @getservbyname.se, i8* bitcast ([4 x i64]* @getservbyname.buf to i8*), i32 32, %struct.servent** %6)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store %struct.servent* null, %struct.servent** %3
br label %13
12: ; preds = %2
store %struct.servent* @getservbyname.se, %struct.servent** %3
br label %13
13: ; preds = %12, %11
%14 = load %struct.servent*, %struct.servent** %3
ret %struct.servent* %14
}

LLVM IR (-O2):
%struct.servent = type { i32 }
@getservbyname.se = internal global %struct.servent zeroinitializer
@getservbyname.buf = internal global [4 x i64] zeroinitializer
define %struct.servent* @getservbyname(i8* %0, i8* %1) {
%3 = alloca %struct.servent*
%4 = bitcast %struct.servent** %3 to i8*
%5 = call i64 @getservbyname_r(i8* %0, i8* %1, %struct.servent* @getservbyname.se, i8* bitcast ([4 x i64]* @getservbyname.buf to i8*), i32 32, %struct.servent** %3)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, %struct.servent* @getservbyname.se, %struct.servent* null
ret %struct.servent* %7
}
/* Variables and functions */
int /*<<< orphan*/ consultador();
void consultar() { consultador(); }


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

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

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

LLVM IR (-O2):
define void @consultar() {
%1 = tail call i32 (...) @consultador()
ret void
}
unsigned invert(unsigned x, int p, int n) {
  unsigned mask, shift;
  mask = ~(~0 << n);
  shift = p + 1 - n;
  return x ^ (mask << shift);
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%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
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = shl i32 -1, %9
%11 = xor i32 %10, -1
store i32 %11, i32* %7
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
store i32 %15, i32* %8
%16 = load i32, i32* %4
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = shl i32 %17, %18
%20 = xor i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = add nsw i32 %1, 1
%7 = sub i32 %6, %2
%8 = shl i32 %5, %7
%9 = xor i32 %8, %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fib(int);
void call_fib(void) { fib(42); }


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

x86 assembly (clang, -O2):
<call_fib>:
mov    $0x2a,%edi
jmp    1030 <fib@plt>

LLVM IR (-O0):
define void @call_fib() {
%1 = call i32 @fib(i32 42)
ret void
}

LLVM IR (-O2):
define void @call_fib() {
%1 = tail call i32 @fib(i32 42)
ret void
}
/* Variables and functions */
unsigned int get_core_id();
int /*<<< orphan*/ rand_r(unsigned int *);
void init_rng(unsigned *p) {
  for (unsigned i = 0; i < get_core_id(); i++)
    rand_r(p);
}


x86 assembly (clang, -O0):
<init_rng>:
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    $0x0,%al
call   1040 <get_core_id@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jae    1164 <init_rng+0x44>
mov    -0x8(%rbp),%rdi
call   1030 <rand_r@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <init_rng+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_rng>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <get_core_id@plt>
test   %eax,%eax
je     1156 <init_rng+0x36>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <rand_r@plt>
add    $0x1,%ebp
xor    %eax,%eax
call   1040 <get_core_id@plt>
cmp    %eax,%ebp
jb     1140 <init_rng+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @init_rng(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = call i32 (...) @get_core_id()
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32*, i32** %2
%10 = call i32 @rand_r(i32* %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @init_rng(i32* %0) {
%2 = tail call i32 (...) @get_core_id()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 @rand_r(i32* %0)
%8 = add nuw i32 %6, 1
%9 = tail call i32 (...) @get_core_id()
%10 = icmp ult i32 %8, %9
br i1 %10, label %5, label %4
}
/* Variables and functions */
int core2_swap(char *, int);
int U_EMRPOLYPOLYLINE_swap(char *record, int torev) {
  return (core2_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYPOLYLINE_swap>:
jmp    1030 <core2_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRPOLYPOLYLINE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core2_swap(i8* %0, i32 %1)
ret i32 %3
}
WAVE_sine() {}


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

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

LLVM IR (-O0):
define i32 @WAVE_sine() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @WAVE_sine() {
ret i32 undef
}
int _sum(int arg1, int arg2, int arg3) { return arg1 + arg2 + arg3; }


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

x86 assembly (clang, -O2):
<_sum>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @_sum(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
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_sum(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int close_file(int);
int sys_close(int fd) { return close_file(fd); }


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

x86 assembly (clang, -O2):
<sys_close>:
jmp    1030 <close_file@plt>

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

LLVM IR (-O2):
define i32 @sys_close(i32 %0) {
%2 = tail call i32 @close_file(i32 %0)
ret i32 %2
}
int blk_mq_debugfs_register_sched(struct request_queue *q) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.request_queue = type opaque
define i32 @blk_mq_debugfs_register_sched(%struct.request_queue* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ msgErro(char *);
void erroAbrePar() { msgErro("Parenteses esperado!"); }


x86 assembly (clang, -O0):
<erroAbrePar>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <msgErro@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"Parenteses esperado!\00"
define void @erroAbrePar() {
%1 = call i32 @msgErro(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Parenteses esperado!\00"
define void @erroAbrePar() {
%1 = tail call i32 @msgErro(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Detta är en very nice feature");
  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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Detta \C3\A4r en very nice feature\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Detta \C3\A4r en very nice feature\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ const wchar_t;

/* Variables and functions */
int wcsspn(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *);
wchar_t *(wcspcbrknul)(const wchar_t *string, const wchar_t *skipset) {
  return string + wcsspn(string, skipset);
}


x86 assembly (clang, -O0):
<wcspcbrknul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wcsspn@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcspcbrknul>:
push   %rbx
mov    %rdi,%rbx
call   1030 <wcsspn@plt>
cltq
lea    (%rbx,%rax,4),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @wcspcbrknul(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** %3
%7 = load i32*, i32** %4
%8 = call i32 @wcsspn(i32* %6, i32* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %5, i64 %9
ret i32* %10
}

LLVM IR (-O2):
define i32* @wcspcbrknul(i32* %0, i32* %1) {
%3 = tail call i32 @wcsspn(i32* %0, i32* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  int is_unsigned = (int)(char)-1 == 255;
  if (!is_unsigned)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1137 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char *get_line();
int /*<<< orphan*/ printf(char *, char *);
char *trim(char *);
int main(void) {
  char *buff;
  char *buff2;
  buff = get_line();
  printf("%s\n", buff);
  buff2 = trim(buff);
  printf("%s\n", buff2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_line@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <trim@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <get_line@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <trim@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @get_line()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* @trim(i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void version(void) {
  printf(" CMatrix version %s by Chris Allegretta (compiled %s, %s)\n", "1.2a",
         "22:56:09", "Mar 18 2022");
  printf(" Email: cmatrix@asty.org  Web: http://www.asty.org/cmatrix\n");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf19(%rip),%rsi
lea    0xf17(%rip),%rdx
lea    0xf19(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf0c(%rip),%rsi
lea    0xf0a(%rip),%rdx
lea    0xf0c(%rip),%rcx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf0a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [59 x i8] c" CMatrix version %s by Chris Allegretta (compiled %s, %s)\0A\00"
@.str.1 = [5 x i8] c"1.2a\00"
@.str.2 = [9 x i8] c"22:56:09\00"
@.str.3 = [12 x i8] c"Mar 18 2022\00"
@.str.4 = [60 x i8] c" Email: cmatrix@asty.org Web: http://www.asty.org/cmatrix\0A\00"
define void @version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c" CMatrix version %s by Chris Allegretta (compiled %s, %s)\0A\00"
@.str.1 = [5 x i8] c"1.2a\00"
@.str.2 = [9 x i8] c"22:56:09\00"
@.str.3 = [12 x i8] c"Mar 18 2022\00"
@str = [59 x i8] c" Email: cmatrix@asty.org Web: http://www.asty.org/cmatrix\00"
define void @version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}
void XkbAllocGeomRows() {}


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

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

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

LLVM IR (-O2):
define void @XkbAllocGeomRows() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ freeoptions(char *);
int /*<<< orphan*/ timer_end();
void cleanup() {
  timer_end();
  freeoptions("");
  ;
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <timer_end@plt>
lea    0xece(%rip),%rdi
call   1040 <freeoptions@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
xor    %eax,%eax
call   1030 <timer_end@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <freeoptions@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @cleanup() {
%1 = call i32 (...) @timer_end()
%2 = call i32 @freeoptions(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @cleanup() {
%1 = tail call i32 (...) @timer_end()
%2 = tail call i32 @freeoptions(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ wait4(int /*<<< orphan*/, int *, int /*<<< orphan*/,
                         int /*<<< orphan*/ *);
int main() {
  pid_t child;
  int status;
  child = fork();
  if (!child) {
    int i = 0xfffff;
    while (i > 0)
      i--;
    exit(0);
  }
  wait4(child, &status, WNOHANG, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1179 <main+0x49>
movl   $0xfffff,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1172 <main+0x42>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    115a <main+0x2a>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%edi
mov    0x2e65(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <wait4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
je     1157 <main+0x27>
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%edx
lea    0x4(%rsp),%rsi
mov    %eax,%edi
xor    %ecx,%ecx
call   1030 <wait4@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@WNOHANG = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @fork()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %0
store i32 1048575, i32* %4
br label %9
9: ; preds = %12, %8
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, -1
store i32 %14, i32* %4
br label %9
15: ; preds = %9
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %0
%18 = load i32, i32* %2
%19 = load i32, i32* @WNOHANG
%20 = call i32 @wait4(i32 %18, i32* %3, i32 %19, i32* null)
ret i32 0
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @fork()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
%8 = load i32, i32* @WNOHANG
%9 = call i32 @wait4(i32 %3, i32* %1, i32 %8, i32* null)
ret i32 0
}
int baz(void) { return 5; }


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

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

LLVM IR (-O0):
define i32 @baz() {
ret i32 5
}

LLVM IR (-O2):
define i32 @baz() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int main(void) {
  int hi = ((-97) & 0xFF) % 256;
  fprintf(stderr, "%d\n", hi);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0x9f,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 159)
ret i32 0
}
/* Type definitions */
struct memory_type_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _memstat_mtl_empty(struct memory_type_list *);
int /*<<< orphan*/ free(struct memory_type_list *);
void memstat_mtl_free(struct memory_type_list *list) {
  _memstat_mtl_empty(list);
  free(list);
}


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

x86 assembly (clang, -O2):
<memstat_mtl_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <_memstat_mtl_empty@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.memory_type_list = type { i32 }
define void @memstat_mtl_free(%struct.memory_type_list* %0) {
%2 = alloca %struct.memory_type_list*
store %struct.memory_type_list* %0, %struct.memory_type_list** %2
%3 = load %struct.memory_type_list*, %struct.memory_type_list** %2
%4 = call i32 @_memstat_mtl_empty(%struct.memory_type_list* %3)
%5 = load %struct.memory_type_list*, %struct.memory_type_list** %2
%6 = call i32 @free(%struct.memory_type_list* %5)
ret void
}

LLVM IR (-O2):
%struct.memory_type_list = type { i32 }
define void @memstat_mtl_free(%struct.memory_type_list* %0) {
%2 = tail call i32 @_memstat_mtl_empty(%struct.memory_type_list* %0)
%3 = tail call i32 @free(%struct.memory_type_list* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
struct sshbuf {
  int dummy;
};

/* Variables and functions */
int sshbuf_put_string(struct sshbuf *, int /*<<< orphan*/ *,
                      int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int sshbuf_put_cstring(struct sshbuf *buf, const char *v) {
  return sshbuf_put_string(buf, (u_char *)v, v == NULL ? 0 : strlen(v));
}


x86 assembly (clang, -O0):
<sshbuf_put_cstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <sshbuf_put_cstring+0x35>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1161 <sshbuf_put_cstring+0x41>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
call   1030 <sshbuf_put_string@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sshbuf_put_cstring>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     113b <sshbuf_put_cstring+0x1b>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
jmp    113d <sshbuf_put_cstring+0x1d>
xor    %edx,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <sshbuf_put_string@plt>

LLVM IR (-O0):
%struct.sshbuf = type { i32 }
define i32 @sshbuf_put_cstring(%struct.sshbuf* %0, i8* %1) {
%3 = alloca %struct.sshbuf*
%4 = alloca i8*
store %struct.sshbuf* %0, %struct.sshbuf** %3
store i8* %1, i8** %4
%5 = load %struct.sshbuf*, %struct.sshbuf** %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
br label %14
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @strlen(i8* %12)
br label %14
14: ; preds = %11, %10
%15 = phi i32 [ 0, %10 ], [ %13, %11 ]
%16 = call i32 @sshbuf_put_string(%struct.sshbuf* %5, i32* %7, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.sshbuf = type { i32 }
define i32 @sshbuf_put_cstring(%struct.sshbuf* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
%8 = bitcast i8* %1 to i32*
%9 = tail call i32 @sshbuf_put_string(%struct.sshbuf* %0, i32* %8, i32 %7)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void print1(int m, int n, double A[]) {
  for (int i = 0; i < (m * n); i++)
    printf("(%d)=%lf\n", i, A[i]);
}


x86 assembly (clang, -O0):
<print1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    1165 <print1+0x55>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <print1+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print1>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
imul   %esi,%edi
test   %edi,%edi
jle    1149 <print1+0x39>
mov    %rdx,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed2(%rip),%r15
xchg   %ax,%ax
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print1+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"(%d)=%lf\0A\00"
define void @print1(i32 %0, i32 %1, double* nocapture %2) {
%4 = mul i32 %1, %0
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = zext i32 %4 to i64
br label %9
8: ; preds = %9, %3
ret void
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %15, %9 ]
%11 = getelementptr inbounds double, double* %2, i64 %10
%12 = load double, double* %11
%13 = trunc i64 %10 to i32
%14 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %13, double %12)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %7
br i1 %16, label %8, label %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int random_walk();
int main(int argc, const char *argv[]) {
  for (int i = 0; i < 50; i++) {
    printf("%d\n", random_walk());
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x32,-0x14(%rbp)
jge    116a <main+0x4a>
mov    $0x0,%al
call   1030 <random_walk@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x32,%ebp
lea    0xed1(%rip),%rbx
nop
xor    %eax,%eax
call   1030 <random_walk@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 50
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = call i32 (...) @random_walk()
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %7
16: ; preds = %7
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %4
ret i32 0
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %8, %4 ]
%6 = tail call i32 (...) @random_walk()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 50
br i1 %9, label %3, label %4
}