xunge/DecIR huggingface dataset:
/* Variables and functions */
int StaticTestFunction(int);
int /*<<< orphan*/ printf(char *, ...);
int TestFunction() {
  int a = 5;
  int b = StaticTestFunction(a);
  printf("From a DLL\n");
  printf("From the static library %d & %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<TestFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <StaticTestFunction@plt>
mov    %eax,-0x8(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestFunction>:
push   %rbx
mov    $0x5,%edi
call   1050 <StaticTestFunction@plt>
mov    %eax,%ebx
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
mov    $0x5,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"From a DLL\0A\00"
@.str.1 = [33 x i8] c"From the static library %d & %d\0A\00"
define i32 @TestFunction() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @StaticTestFunction(i32 %3)
store i32 %4, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"From the static library %d & %d\0A\00"
@str = [11 x i8] c"From a DLL\00"
define i32 @TestFunction() {
%1 = tail call i32 @StaticTestFunction(i32 5)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 %1)
ret i32 0
}
int pinconf_map_to_setting(const struct pinctrl_map *map,
                           struct pinctrl_setting *setting) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.pinctrl_map = type opaque
%struct.pinctrl_setting = type opaque
define i32 @pinconf_map_to_setting(%struct.pinctrl_map* %0, %struct.pinctrl_setting* %1) {
%3 = alloca %struct.pinctrl_map*
%4 = alloca %struct.pinctrl_setting*
store %struct.pinctrl_map* %0, %struct.pinctrl_map** %3
store %struct.pinctrl_setting* %1, %struct.pinctrl_setting** %4
ret i32 0
}

LLVM IR (-O2):
%struct.pinctrl_map = type opaque
%struct.pinctrl_setting = type opaque
define i32 @pinconf_map_to_setting(%struct.pinctrl_map* nocapture readnone %0, %struct.pinctrl_setting* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int _write_crc(int, int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
int _write_crc_byte(int fd, uint8_t byte, uint8_t *crc) {
  return _write_crc(fd, &byte, 1, crc);
}


x86 assembly (clang, -O0):
<_write_crc_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <_write_crc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_crc_byte>:
push   %rax
mov    %rdx,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <_write_crc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_write_crc_byte(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** %6
%9 = call i32 @_write_crc(i32 %7, i32* %5, i32 1, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_write_crc_byte(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
store i32 %1, i32* %4
%5 = call i32 @_write_crc(i32 %0, i32* %4, i32 1, i32* %2)
ret i32 %5
}
int nodepath_length(short *p) {
  int j = 0;
  while (1) {
    if (p[j] == -1) {
      break;
    }
    j++;
  }
  return j;
}


x86 assembly (clang, -O0):
<nodepath_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
cmp    $0xffffffff,%eax
jne    1129 <nodepath_length+0x29>
jmp    1137 <nodepath_length+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <nodepath_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nodepath_length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpw   $0xffff,(%rdi)
lea    0x2(%rdi),%rdi
jne    1110 <nodepath_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @nodepath_length(i16* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i16, i16* %0, i64 %3
%5 = load i16, i16* %4
%6 = icmp eq i16 %5, -1
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int foo(int a) { return (!a & 1) != ((a == 0) & 1); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
and    $0x1,%eax
cmpl   $0x0,-0x4(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    $0x1,%ecx
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = and i32 %6, 1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = and i32 %10, 1
%12 = icmp ne i32 %7, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SwiClearFlag1();
void SwiInterruptTimeout(void) {
  SwiClearFlag1();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<SwiInterruptTimeout>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SwiClearFlag1@plt>
jmp    111b <SwiInterruptTimeout+0xb>

x86 assembly (clang, -O2):
<SwiInterruptTimeout>:
push   %rax
xor    %eax,%eax
call   1030 <SwiClearFlag1@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <SwiInterruptTimeout+0x10>

LLVM IR (-O0):
define void @SwiInterruptTimeout() {
%1 = call i32 (...) @SwiClearFlag1()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @SwiInterruptTimeout() {
%1 = tail call i32 (...) @SwiClearFlag1()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
ssize_t writev(int fd, const struct iovec *iov, int iovcnt) {
  assert(!"NYI");
  return -1;
}


x86 assembly (clang, -O0):
<writev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.iovec = type { i32 }
@.str = [4 x i8] c"NYI\00"
define i32 @writev(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.iovec*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.iovec* %1, %struct.iovec** %5
store i32 %2, i32* %6
%7 = call i32 @assert(i32 0)
ret i32 -1
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @writev(i32 %0, %struct.iovec* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 -1
}
int TestFunctionDecl(int x, enum {e} y) { return x; }


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

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

LLVM IR (-O0):
define i32 @TestFunctionDecl(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @TestFunctionDecl(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int tfd_qarmaPresent(void) {
  static int lQarmaPresent = -1;
  if (lQarmaPresent < 0) {
    lQarmaPresent = detectPresence("qarma");
  }
  return lQarmaPresent && graphicMode();
}


x86 assembly (clang, -O0):
<tfd_qarmaPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <tfd_qarmaPresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <tfd_qarmaPresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfd_qarmaPresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <tfd_qarmaPresent+0x23>
test   %eax,%eax
je     1159 <tfd_qarmaPresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <tfd_qarmaPresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@tfd_qarmaPresent.lQarmaPresent = internal global i32 -1
@.str = [6 x i8] c"qarma\00"
define i32 @tfd_qarmaPresent() {
%1 = load i32, i32* @tfd_qarmaPresent.lQarmaPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @tfd_qarmaPresent.lQarmaPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @tfd_qarmaPresent.lQarmaPresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@tfd_qarmaPresent.lQarmaPresent = internal unnamed_addr global i32 -1
@.str = [6 x i8] c"qarma\00"
define i32 @tfd_qarmaPresent() {
%1 = load i32, i32* @tfd_qarmaPresent.lQarmaPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @tfd_qarmaPresent.lQarmaPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int var1;
  int var2;
  printf("enter your numbers\n");
  scanf("%d", &var1);
  scanf("%d", &var2);
  printf("\nYou entered %d and %d", var1, var2);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"enter your numbers\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"\0AYou entered %d and %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"\0AYou entered %d and %d\00"
@str = [19 x i8] c"enter your numbers\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i32 (...) @getchar()
ret i32 0
}
int getCharacterTime(int c_rate) { return 1188 / c_rate; }


x86 assembly (clang, -O0):
<getCharacterTime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x4a4,%eax
cltd
idivl  -0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCharacterTime>:
mov    $0x4a4,%eax
xor    %edx,%edx
idiv   %edi
ret

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

LLVM IR (-O2):
define i32 @getCharacterTime(i32 %0) {
%2 = sdiv i32 1188, %0
ret i32 %2
}
char *ft_strchr(const char *s, int c) {
  char *str;
  char value;
  str = (char *)s;
  value = (char)c;
  while (*str != value && *str != 0)
    str++;
  if (*str == value)
    return (str);
  return (0);
}


x86 assembly (clang, -O0):
<ft_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x21(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x22(%rbp)
je     1141 <ft_strchr+0x41>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
test   $0x1,%al
jne    1151 <ft_strchr+0x51>
jmp    1162 <ft_strchr+0x62>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1119 <ft_strchr+0x19>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x21(%rbp),%ecx
cmp    %ecx,%eax
jne    1182 <ft_strchr+0x82>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118a <ft_strchr+0x8a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strchr>:
movsbl %sil,%ecx
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rdi),%edx
add    $0x1,%rdi
test   %edx,%edx
je     1120 <ft_strchr+0x20>
cmp    %edx,%ecx
jne    1110 <ft_strchr+0x10>
xor    %eax,%eax
cmp    %edx,%ecx
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @ft_strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i32, i32* %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %7
br label %11
11: ; preds = %25, %2
%12 = load i8*, i8** %6
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = load i8, i8* %7
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %14, %16
br i1 %17, label %18, label %23
18: ; preds = %11
%19 = load i8*, i8** %6
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br label %23
23: ; preds = %18, %11
%24 = phi i1 [ false, %11 ], [ %22, %18 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i8*, i8** %6
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %6
br label %11
28: ; preds = %23
%29 = load i8*, i8** %6
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = load i8, i8* %7
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %31, %33
br i1 %34, label %35, label %37
35: ; preds = %28
%36 = load i8*, i8** %6
store i8* %36, i8** %3
br label %38
37: ; preds = %28
store i8* null, i8** %3
br label %38
38: ; preds = %37, %35
%39 = load i8*, i8** %3
ret i8* %39
}

LLVM IR (-O2):
define i8* @ft_strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ %0, %2 ], [ %12, %5 ]
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %4, %8
%10 = icmp eq i8 %7, 0
%11 = or i1 %10, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %11, label %13, label %5
13: ; preds = %5
%14 = select i1 %9, i8* %6, i8* null
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
bool isOpen_2(FILE *this) { return this != NULL; }


x86 assembly (clang, -O0):
<isOpen_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOpen_2>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @isOpen_2(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isOpen_2(i32* readnone %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ main(int, char const **);
int /*<<< orphan*/ syscall_process_exit(int /*<<< orphan*/);
void _start(int argc, const char **argv) {
  syscall_process_exit(main(argc, argv));
}


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

x86 assembly (clang, -O2):
<_start>:
push   %rax
call   1040 <main@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <syscall_process_exit@plt>

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

LLVM IR (-O2):
define void @_start(i32 %0, i8** %1) {
%3 = tail call i32 @main(i32 %0, i8** %1)
%4 = tail call i32 @syscall_process_exit(i32 %3)
ret void
}
double e(void) { return 2.71828182845904523536; }


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

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

LLVM IR (-O0):
define double @e() {
ret double 0x4005BF0A8B145769
}

LLVM IR (-O2):
define double @e() {
ret double 0x4005BF0A8B145769
}
/* Variables and functions */
char **readNexusTrees(char const *, int *, int /*<<< orphan*/ *, int);
char **readNexusNFirstTree(const char *infile, int *count, int max) {
  return readNexusTrees(infile, count, NULL, max);
}


x86 assembly (clang, -O0):
<readNexusNFirstTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%edx
call   1030 <readNexusTrees@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readNexusNFirstTree>:
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <readNexusTrees@plt>

LLVM IR (-O0):
define i8** @readNexusNFirstTree(i8* %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 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i8** @readNexusTrees(i8* %7, i32* %8, i32* null, i32 %9)
ret i8** %10
}

LLVM IR (-O2):
define i8** @readNexusNFirstTree(i8* %0, i32* %1, i32 %2) {
%4 = tail call i8** @readNexusTrees(i8* %0, i32* %1, i32* null, i32 %2)
ret i8** %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int divi(uint32_t *env) {
  uint32_t *context = (uint32_t *)*(uint32_t **)(env + 1);
  int a = (int)*(int *)(context);
  int b = (int)*(int *)(context + 1);
  return a / b;
}


x86 assembly (clang, -O0):
<divi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<divi>:
mov    0x4(%rdi),%rcx
mov    (%rcx),%eax
cltd
idivl  0x4(%rcx)
ret

LLVM IR (-O0):
define i32 @divi(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = bitcast i32* %7 to i32**
%9 = load i32*, i32** %8
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
store i32 %11, i32* %4
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
store i32 %14, i32* %5
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = sdiv i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @divi(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = bitcast i32* %2 to i32**
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = sdiv i32 %5, %7
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t return_uint64_1() { return 1073741824; }


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

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

LLVM IR (-O0):
define i32 @return_uint64_1() {
ret i32 1073741824
}

LLVM IR (-O2):
define i32 @return_uint64_1() {
ret i32 1073741824
}
int cvmx_helper_initialize_packet_io_global(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cvmx_helper_initialize_packet_io_global() {
ret i32 0
}
int ConsolePrint(unsigned char c) {}


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

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

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

LLVM IR (-O2):
define i32 @ConsolePrint(i8 zeroext %0) {
ret i32 undef
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void testL(int64_t Arg) {
  printf("%d\n", (int)(Arg / ((int64_t)1 << 4)));
  printf("%d\n", (int)(Arg / ((int64_t)1 << 46)));
}


x86 assembly (clang, -O0):
<testL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testL>:
push   %rbx
lea    0xf(%rdi),%esi
test   %edi,%edi
cmovns %edi,%esi
sar    $0x4,%esi
lea    0xedd(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @testL(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 16
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = sdiv i32 %6, poison
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @testL(i32 %0) {
%2 = sdiv i32 %0, 16
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
ret void
}
int Comparar(const void *a, const void *b) {
  if (*(int *)a == *(int *)b)
    return 0;
  else if (*(int *)a < *(int *)b)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<Comparar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    112a <Comparar+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    114f <Comparar+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <Comparar+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <Comparar+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Comparar>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Comparar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
void phy_rst(int value) { *(unsigned int *)0xf000002c = value; }


x86 assembly (clang, -O0):
<phy_rst>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xf000002c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<phy_rst>:
mov    $0xf000002c,%eax
mov    %edi,(%rax)
ret

LLVM IR (-O0):
define void @phy_rst(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* inttoptr (i64 4026531884 to i32*)
ret void
}

LLVM IR (-O2):
define void @phy_rst(i32 %0) {
store i32 %0, i32* inttoptr (i64 4026531884 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
unsigned int readInt();
int /*<<< orphan*/ writeCommand1parm(char *, unsigned int);
unsigned int proxSensor(unsigned int sensor) {
  unsigned int prox = 0;
  if ((sensor <= 6) && (sensor > 0)) {
    writeCommand1parm("PROX", sensor);
    prox = readInt();
  } else {
    printf("Error sensor number \n");
  }
  return prox;
}


x86 assembly (clang, -O0):
<proxSensor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x4(%rbp)
ja     1174 <proxSensor+0x44>
cmpl   $0x0,-0x4(%rbp)
jbe    1174 <proxSensor+0x44>
mov    -0x4(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <writeCommand1parm@plt>
mov    $0x0,%al
call   1050 <readInt@plt>
mov    %eax,-0x8(%rbp)
jmp    1180 <proxSensor+0x50>
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proxSensor>:
push   %rax
mov    %edi,%esi
lea    -0x1(%rsi),%eax
cmp    $0x5,%eax
ja     114f <proxSensor+0x1f>
lea    0xebe(%rip),%rdi
call   1040 <writeCommand1parm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <readInt@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"PROX\00"
@.str.1 = [22 x i8] c"Error sensor number \0A\00"
define i32 @proxSensor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp ule i32 %4, 6
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ugt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %2
%11 = call i32 @writeCommand1parm(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (...) @readInt()
store i32 %12, i32* %3
br label %15
13: ; preds = %6, %1
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"PROX\00"
@str = [21 x i8] c"Error sensor number \00"
define i32 @proxSensor(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @writeCommand1parm(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 (...) @readInt()
br label %9
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ 0, %7 ]
ret i32 %10
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *xcalloc(size_t nmemb, size_t size) {
  void *buf;
  buf = calloc(nmemb, size);
  if (!buf) {
    fprintf(stderr, "Error: Out of memory. Exiting\n");
    exit(1);
  }
  return buf;
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Error: Out of memory. Exiting\0A\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int n;
  for (n = 0; n <= 100; n++) {
    if (n % 5 != 0)
      continue;
    printf("%d  ", n);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1166 <main+0x56>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1149 <main+0x39>
jmp    1158 <main+0x48>
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
jmp    1128 <main+0x18>
nop
add    $0x1,%ebx
cmp    $0x65,%ebx
je     1149 <main+0x39>
movzbl %bl,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %cl,%al
jne    1120 <main+0x10>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \00"
define i32 @main() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 0, %0 ], [ %9, %8 ]
%3 = trunc i32 %2 to i8
%4 = urem i8 %3, 5
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %8
8: ; preds = %1, %6
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 101
br i1 %10, label %11, label %1
11: ; preds = %8
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ *gets(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
char *reverser(char *);
int main(void) {
  char *s = malloc(500);
  while (gets(s) != NULL)
    printf("%s\n", reverser(s));
  free(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1f4,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <gets@plt>
cmp    $0x0,%rax
je     119d <main+0x4d>
mov    -0x10(%rbp),%rdi
call   1070 <reverser@plt>
mov    %rax,%rsi
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
jmp    116d <main+0x1d>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1f4,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     11a0 <main+0x50>
lea    0xe8b(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1070 <reverser@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
test   %rax,%rax
jne    1180 <main+0x30>
mov    %rbx,%rdi
call   1030 <free@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*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 500)
store i8* %3, i8** %2
br label %4
4: ; preds = %8, %0
%5 = load i8*, i8** %2
%6 = call i32* @gets(i8* %5)
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = call i8* @reverser(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %4
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = call i32 @free(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(500) i8* @malloc(i32 500)
%2 = tail call i32* @gets(i8* %1)
%3 = icmp eq i32* %2, null
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i8* @reverser(i8* %1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32* @gets(i8* %1)
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %0
%10 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void realCreate(int x, int y) { printf("(%d, %d)\n", x, y); }


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

x86 assembly (clang, -O2):
<realCreate>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"(%d, %d)\0A\00"
define void @realCreate(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
int cmpdarray(const void *s1, const void *s2) {
  int cmp = 0;
  const double *x = s1;
  const double *y = s2;
  if (*x < *y)
    cmp = -1;
  else if (*x > *y)
    cmp = 1;
  return (cmp);
}


x86 assembly (clang, -O0):
<cmpdarray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1149 <cmpdarray+0x49>
movl   $0xffffffff,-0x14(%rbp)
jmp    116b <cmpdarray+0x6b>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1166 <cmpdarray+0x66>
movl   $0x1,-0x14(%rbp)
jmp    116b <cmpdarray+0x6b>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpdarray>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    $0xffffffff,%eax
ucomisd %xmm0,%xmm1
ja     1120 <cmpdarray+0x20>
xor    %eax,%eax
ucomisd %xmm1,%xmm0
jbe    1120 <cmpdarray+0x20>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @cmpdarray(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %5
br label %26
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp ogt double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %5
br label %25
25: ; preds = %24, %18
br label %26
26: ; preds = %25, %17
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @cmpdarray(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = fcmp ogt double %5, %6
br i1 %9, label %10, label %11
10: ; preds = %8
br label %11
11: ; preds = %2, %8, %10
%12 = phi i32 [ 1, %10 ], [ 0, %8 ], [ -1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ trace_printk(char *, char *);
int bar(void) {
  static char *fmt = "%s\n";
  trace_printk(fmt, "hello world");
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0d(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <trace_printk@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@bar.fmt = internal global i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0)
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"hello world\00"
define i32 @bar() {
%1 = load i8*, i8** @bar.fmt
%2 = call i32 @trace_printk(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"hello world\00"
define i32 @bar() {
%1 = tail call i32 @trace_printk(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void BREAK(void) { raise(SIGINT); }


x86 assembly (clang, -O0):
<BREAK>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BREAK>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @BREAK() {
%1 = load i32, i32* @SIGINT
%2 = call i32 @raise(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @BREAK() {
%1 = load i32, i32* @SIGINT
%2 = tail call i32 @raise(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};
struct wl_pointer {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int /*<<< orphan*/,
                                    int /*<<< orphan*/, struct wl_surface *,
                                    int /*<<< orphan*/, int /*<<< orphan*/);
void wl_pointer_set_cursor(struct wl_pointer *wl_pointer, uint32_t serial,
                           struct wl_surface *surface, int32_t hotspot_x,
                           int32_t hotspot_y) {
  wl_proxy_marshal((struct wl_proxy *)wl_pointer, 0, serial, surface, hotspot_x,
                   hotspot_y);
}


x86 assembly (clang, -O0):
<wl_pointer_set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
xor    %esi,%esi
call   1030 <wl_proxy_marshal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_pointer_set_cursor>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_pointer = type { i32 }
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_pointer_set_cursor(%struct.wl_pointer* %0, i32 %1, %struct.wl_surface* %2, i32 %3, i32 %4) {
%6 = alloca %struct.wl_pointer*
%7 = alloca i32
%8 = alloca %struct.wl_surface*
%9 = alloca i32
%10 = alloca i32
store %struct.wl_pointer* %0, %struct.wl_pointer** %6
store i32 %1, i32* %7
store %struct.wl_surface* %2, %struct.wl_surface** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.wl_pointer*, %struct.wl_pointer** %6
%12 = bitcast %struct.wl_pointer* %11 to %struct.wl_proxy*
%13 = load i32, i32* %7
%14 = load %struct.wl_surface*, %struct.wl_surface** %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %12, i32 0, i32 %13, %struct.wl_surface* %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
%struct.wl_pointer = type { i32 }
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_pointer_set_cursor(%struct.wl_pointer* %0, i32 %1, %struct.wl_surface* %2, i32 %3, i32 %4) {
%6 = bitcast %struct.wl_pointer* %0 to %struct.wl_proxy*
%7 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %6, i32 0, i32 %1, %struct.wl_surface* %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ scalbln(double, long);
float scalblnf(float x, long _exp) { return (float)scalbln((double)x, _exp); }


x86 assembly (clang, -O0):
<scalblnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <scalbln@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalblnf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <scalbln@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @scalblnf(float %0, i64 %1) {
%3 = alloca float
%4 = alloca i64
store float %0, float* %3
store i64 %1, i64* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load i64, i64* %4
%8 = call i64 @scalbln(double %6, i64 %7)
%9 = sitofp i64 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @scalblnf(float %0, i64 %1) {
%3 = fpext float %0 to double
%4 = tail call i64 @scalbln(double %3, i64 %1)
%5 = sitofp i64 %4 to float
ret float %5
}