xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char ds1337_read_register(int);
int /*<<< orphan*/ ds1337_write_register(int, unsigned char);
void ds1337_disable_oscillator() {
  unsigned char data = ds1337_read_register(0x0E);
  data |= 0x80;
  ds1337_write_register(0x0E, data);
}


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

x86 assembly (clang, -O2):
<ds1337_disable_oscillator>:
push   %rax
mov    $0xe,%edi
call   1040 <ds1337_read_register@plt>
or     $0x80,%al
movzbl %al,%esi
mov    $0xe,%edi
pop    %rax
jmp    1030 <ds1337_write_register@plt>

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

LLVM IR (-O2):
define void @ds1337_disable_oscillator() {
%1 = tail call zeroext i8 @ds1337_read_register(i32 14)
%2 = or i8 %1, -128
%3 = tail call i32 @ds1337_write_register(i32 14, i8 zeroext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xlFmtError(char *);
void maplistdummy_restore(void) {
  xlFmtError("shouldn't happen -- maplistdummy_restore");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"shouldn't happen -- maplistdummy_restore\00"
define void @maplistdummy_restore() {
%1 = call i32 @xlFmtError(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"shouldn't happen -- maplistdummy_restore\00"
define void @maplistdummy_restore() {
%1 = tail call i32 @xlFmtError(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
const char *rcsid(const char *p) {
  return rcsid(p = "@(#)$Id: print.c 10 2006-07-10 18:22:27Z hyin $");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"@(#)$Id: print.c 10 2006-07-10 18:22:27Z hyin $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void genjr() {}


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

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

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

LLVM IR (-O2):
define void @genjr() {
ret void
}
int getMax(int x, int y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<getMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <getMax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <getMax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @getMax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void msm_disable_wdog_debug(void) {}


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

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

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

LLVM IR (-O2):
define void @msm_disable_wdog_debug() {
ret void
}
int strcmp(const char *str1, const char *str2) {
  while (*str1 == *str2++) {
    if (!*str1++) {
      return 0;
    }
  }
  return *(char *)str1 - *(char *)(str2 - 1);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1156 <strcmp+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    1151 <strcmp+0x51>
movl   $0x0,-0x4(%rbp)
jmp    116a <strcmp+0x6a>
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <strcmp+0x27>
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = sext i8 %6 to i32
%15 = sext i8 %7 to i32
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}
int test_imm_39int32_mem(int *val) {
  return ((*val) & (0x39 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_39int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 57
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *_(char *);
int /*<<< orphan*/ printf(char *, char const *);
int usage(const char *path) {
  printf(_("Usage: %s [OPTIONS] [SERVER_NAME]\n"
           "Creates a Teredo tunneling interface for encapsulation of IPv6 "
           "over UDP.\n"
           "\n"
           "  -c, --config     specify an configuration file\n"
           "  -f, --foreground run in the foreground\n"
           "  -h, --help       display this help and exit\n"
           "  -p, --pidfile    override the location of the PID file\n"
           "  -u, --user       override the user to set UID to\n"
           "  -V, --version    display program version and exit\n"),
         path);
  return 0;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <_@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <_@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [405 x i8] c"Usage: %s [OPTIONS] [SERVER_NAME]\0ACreates a Teredo tunneling interface for encapsulation of IPv6 over UDP.\0A\0A -c, --config specify an configuration file\0A -f, --foreground run in the foreground\0A -h, --help display this help and exit\0A -p, --pidfile override the location of the PID file\0A -u, --user override the user to set UID to\0A -V, --version display program version and exit\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* @_(i8* getelementptr inbounds ([405 x i8], [405 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* %3, i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [405 x i8] c"Usage: %s [OPTIONS] [SERVER_NAME]\0ACreates a Teredo tunneling interface for encapsulation of IPv6 over UDP.\0A\0A -c, --config specify an configuration file\0A -f, --foreground run in the foreground\0A -h, --help display this help and exit\0A -p, --pidfile override the location of the PID file\0A -u, --user override the user to set UID to\0A -V, --version display program version and exit\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i8* @_(i8* getelementptr inbounds ([405 x i8], [405 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* %2, i8* %0)
ret i32 0
}
int strlen2(const char text[]) {
  int i = 0;
  while (text[i] != '\0')
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<strlen2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen2+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlen2(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%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
}
long _round(float x) { return (long)(x + 0.5); }


x86 assembly (clang, -O0):
<_round>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_round>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @_round(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @_round(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 5.000000e-01
%4 = fptosi double %3 to i64
ret i64 %4
}
int magic_shop(element)
int element;
{
  switch (element) {
  case 40:
  case 45:
  case 55:
  case 65:
  case 70:
  case 71:
  case 75:
  case 76:
  case 90:
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<magic_shop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x28,%eax
je     1187 <magic_shop+0x87>
jmp    111b <magic_shop+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1187 <magic_shop+0x87>
jmp    112c <magic_shop+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x37,%eax
je     1187 <magic_shop+0x87>
jmp    113d <magic_shop+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x41,%eax
je     1187 <magic_shop+0x87>
jmp    114e <magic_shop+0x4e>
mov    -0xc(%rbp),%eax
add    $0xffffffba,%eax
sub    $0x2,%eax
jb     1187 <magic_shop+0x87>
jmp    1162 <magic_shop+0x62>
mov    -0xc(%rbp),%eax
add    $0xffffffb5,%eax
sub    $0x2,%eax
jb     1187 <magic_shop+0x87>
jmp    1176 <magic_shop+0x76>
mov    -0xc(%rbp),%eax
sub    $0x5a,%eax
jne    1193 <magic_shop+0x93>
jmp    1187 <magic_shop+0x87>
movl   $0x1,-0x4(%rbp)
jmp    119a <magic_shop+0x9a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<magic_shop>:
add    $0xffffffd8,%edi
cmp    $0x32,%edi
ja     111e <magic_shop+0x1e>
mov    $0x1,%eax
movabs $0x40018c2008021,%rcx
bt     %rdi,%rcx
jae    111e <magic_shop+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @magic_shop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 40, label %5
i32 45, label %5
i32 55, label %5
i32 65, label %5
i32 70, label %5
i32 71, label %5
i32 75, label %5
i32 76, label %5
i32 90, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @magic_shop(i32 %0) {
switch i32 %0, label %2 [
i32 40, label %3
i32 45, label %3
i32 55, label %3
i32 65, label %3
i32 70, label %3
i32 71, label %3
i32 75, label %3
i32 76, label %3
i32 90, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
double miabs(double a, double b) {
  double c;
  c = a - b;
  if (c >= 0)
    return c;
  else
    return -1.0 * c;
}


x86 assembly (clang, -O0):
<miabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113e <miabs+0x3e>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1150 <miabs+0x50>
movsd  0xeba(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<miabs>:
subsd  %xmm1,%xmm0
movapd 0xef4(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
cmpnlesd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @miabs(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
store double %9, double* %6
%10 = load double, double* %6
%11 = fcmp oge double %10, 0.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load double, double* %6
store double %13, double* %3
br label %17
14: ; preds = %2
%15 = load double, double* %6
%16 = fmul double -1.000000e+00, %15
store double %16, double* %3
br label %17
17: ; preds = %14, %12
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @miabs(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp ult double %3, 0.000000e+00
%5 = fneg double %3
%6 = select i1 %4, double %5, double %3
ret double %6
}
void XrmCombineFileDatabase() {}


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

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

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

LLVM IR (-O2):
define void @XrmCombineFileDatabase() {
ret void
}
int test32(int *a, int b, int c, volatile char *d) {
  d[1] = a[0] != 0;
  return b;
}


x86 assembly (clang, -O0):
<test32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test32>:
cmpl   $0x0,(%rdi)
mov    %esi,%eax
setne  0x1(%rcx)
ret

LLVM IR (-O0):
define i32 @test32(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %8
%16 = getelementptr inbounds i8, i8* %15, i64 1
store volatile i8 %14, i8* %16
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
define i32 @test32(i32* nocapture %0, i32 returned %1, i32 %2, i8* %3) {
%5 = load i32, i32* %0
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 1
store volatile i8 %7, i8* %8
ret i32 %1
}
void yyerror(int source_id, const char *msg) {}


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

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

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

LLVM IR (-O2):
define void @yyerror(i32 %0, i8* nocapture %1) {
ret void
}
int countSame(char *a, char *b) {
  char c;
  int i;
  int count = 0;
  for (i = 0;; ++i) {
    c = a[i];
    if (b[i] != c)
      break;
    if (c == 0)
      break;
    ++count;
  }
  return count;
}


x86 assembly (clang, -O0):
<countSame>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     1145 <countSame+0x45>
jmp    116e <countSame+0x6e>
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    1157 <countSame+0x57>
jmp    116e <countSame+0x6e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111a <countSame+0x1a>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countSame>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1126 <countSame+0x26>
cmp    %cl,(%rsi)
jne    1126 <countSame+0x26>
xor    %ecx,%ecx
xchg   %ax,%ax
lea    0x1(%rcx),%rax
movzbl 0x1(%rdi,%rcx,1),%edx
test   %dl,%dl
je     1126 <countSame+0x26>
cmp    %dl,0x1(%rsi,%rcx,1)
mov    %rax,%rcx
je     1110 <countSame+0x10>
ret

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

LLVM IR (-O2):
define i32 @countSame(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %4, %3
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %20, label %8
8: ; preds = %2, %8
%9 = phi i64 [ %10, %8 ], [ 0, %2 ]
%10 = add nuw nsw i64 %9, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, %12
%16 = icmp eq i8 %12, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8
%19 = trunc i64 %10 to i32
br label %20
20: ; preds = %18, %2
%21 = phi i32 [ 0, %2 ], [ %19, %18 ]
ret i32 %21
}
/* Variables and functions */
int listen(int, int);
int s_socket_bsd_listen(int s, int backlog) { return listen(s, backlog); }


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

x86 assembly (clang, -O2):
<s_socket_bsd_listen>:
jmp    1030 <listen@plt>

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

LLVM IR (-O2):
define i32 @s_socket_bsd_listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ count_to_ten(int /*<<< orphan*/);
int /*<<< orphan*/ recurse(int);
int main() {
  count_to_ten(0);
  recurse(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <count_to_ten@plt>
mov    $0x1,%edi
call   1030 <recurse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @count_to_ten(i32 0)
%3 = call i32 @recurse(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @count_to_ten(i32 0)
%2 = tail call i32 @recurse(i32 1)
ret i32 0
}
/* Type definitions */
typedef double uint16_t;

/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
uint16_t rand_to_max(uint16_t max) {
  double random;
  while ((random = rand()) == (double)RAND_MAX)
    ;
  return random / (double)RAND_MAX * (double)max;
}


x86 assembly (clang, -O0):
<rand_to_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  %xmm0,-0x10(%rbp)
mov    0x2eb8(%rip),%rax
cvtsi2sdq (%rax),%xmm1
ucomisd %xmm1,%xmm0
jne    114a <rand_to_max+0x3a>
jp     114a <rand_to_max+0x3a>
jmp    111d <rand_to_max+0xd>
movsd  -0x10(%rbp),%xmm0
mov    0x2e92(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_to_max>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    0x2ec6(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq (%rbx),%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <rand_to_max+0x37>
jnp    1130 <rand_to_max+0x20>
divsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rand_to_max(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
br label %4
4: ; preds = %9, %1
%5 = call double (...) @rand()
store double %5, double* %3
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fcmp oeq double %5, %7
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load double, double* %3
%12 = load i64, i64* @RAND_MAX
%13 = sitofp i64 %12 to double
%14 = fdiv double %11, %13
%15 = load double, double* %2
%16 = fmul double %14, %15
ret double %16
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rand_to_max(double %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call double (...) @rand()
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fcmp oeq double %3, %5
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = fdiv double %3, %5
%9 = fmul double %8, %0
ret double %9
}
/* Variables and functions */
int je_mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp,
               size_t newlen) {
  return -1;
}


x86 assembly (clang, -O0):
<je_mallctl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @je_mallctl(i8* %0, i8* %1, i64* %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64* %2, i64** %8
store i8* %3, i8** %9
store i64 %4, i64* %10
ret i32 -1
}

LLVM IR (-O2):
define i32 @je_mallctl(i8* nocapture readnone %0, i8* nocapture readnone %1, i64* nocapture readnone %2, i8* nocapture readnone %3, i64 %4) {
ret i32 -1
}
int ass_isdigit(int c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<ass_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ass_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ass_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ass_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ass_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void Heap_check(char *string, void *ptr) { return; }


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

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

LLVM IR (-O0):
define void @Heap_check(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @Heap_check(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __you_should_not_divide_ll_in_debugger_sw();
long long __divdi3(long long A, long long B) {
  __you_should_not_divide_ll_in_debugger_sw();
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @__divdi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 (...) @__you_should_not_divide_ll_in_debugger_sw()
ret i64 0
}

LLVM IR (-O2):
define i64 @__divdi3(i64 %0, i64 %1) {
%3 = tail call i32 (...) @__you_should_not_divide_ll_in_debugger_sw()
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printInt(void *i) {
  if (i == NULL) {
    printf("null\t");
  } else
    printf("%d\t", *((int *)i));
}


x86 assembly (clang, -O0):
<printInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113a <printInt+0x2a>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114e <printInt+0x3e>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printInt>:
test   %rdi,%rdi
je     1125 <printInt+0x15>
mov    (%rdi),%esi
lea    0xee8(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"null\09\00"
@.str.1 = [4 x i8] c"%d\09\00"
define void @printInt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"null\09\00"
@.str.1 = [4 x i8] c"%d\09\00"
define void @printInt(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __invpcid(int /*<<< orphan*/, int /*<<< orphan*/, int);
void invpcid_flush_all(void) { __invpcid(0, 0, 2); }


x86 assembly (clang, -O0):
<invpcid_flush_all>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    $0x2,%edx
mov    %esi,%edi
call   1030 <__invpcid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<invpcid_flush_all>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2,%edx
jmp    1030 <__invpcid@plt>

LLVM IR (-O0):
define void @invpcid_flush_all() {
%1 = call i32 @__invpcid(i32 0, i32 0, i32 2)
ret void
}

LLVM IR (-O2):
define void @invpcid_flush_all() {
%1 = tail call i32 @__invpcid(i32 0, i32 0, i32 2)
ret void
}
/* Variables and functions */
int a_ctz_l(size_t);
int pntz(size_t p[2]) {
  int r = a_ctz_l((p[0] - 1));
  if (r != 0 ||
      (r = 8 * sizeof(size_t) + a_ctz_l((p[1]))) != 8 * sizeof(size_t)) {
    return r;
  }
  return 0;
}


x86 assembly (clang, -O0):
<pntz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
call   1030 <a_ctz_l@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    115b <pntz+0x4b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <a_ctz_l@plt>
cltq
add    $0x40,%rax
mov    %eax,-0x14(%rbp)
cltq
cmp    $0x40,%rax
je     1166 <pntz+0x56>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <pntz+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pntz>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
add    $0xffffffffffffffff,%rdi
call   1030 <a_ctz_l@plt>
test   %eax,%eax
je     1126 <pntz+0x16>
pop    %rbx
ret
mov    0x8(%rbx),%rdi
call   1030 <a_ctz_l@plt>
mov    %eax,%ecx
lea    0x40(%rcx),%eax
test   %ecx,%ecx
cmove  %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @pntz(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = add i64 %2, -1
%4 = tail call i32 @a_ctz_l(i64 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = getelementptr inbounds i64, i64* %0, i64 1
%8 = load i64, i64* %7
%9 = tail call i32 @a_ctz_l(i64 %8)
%10 = add i32 %9, 64
%11 = icmp eq i32 %9, 0
%12 = select i1 %11, i32 0, i32 %10
br label %13
13: ; preds = %6, %1
%14 = phi i32 [ %4, %1 ], [ %12, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ str_calc(char *);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    return 0;
  } else {
    printf("\033[1;34mresult is \033[1;32m %Lf\033[0m\n", str_calc(argv[1]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    116e <main+0x4e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <str_calc@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
je     1141 <main+0x21>
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <str_calc@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [34 x i8] c"\1B[1;34mresult is \1B[1;32m %Lf\1B[0m\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @str_calc(i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %2, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help() {
  printf("cfg_mgmt tools - clist\n Lists all variables, current values, limits "
         "and descriptions\n Options:\n  -d <path>   Specify path to cfg_mgmt "
         "folder exported by the kernel module\n              Default "
         "location: %s\n",
         "/debug/cfg_mgmt");
}


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

x86 assembly (clang, -O2):
<help>:
lea    0xee9(%rip),%rdi
lea    0xfb1(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [207 x i8] c"cfg_mgmt tools - clist\0A Lists all variables, current values, limits and descriptions\0A Options:\0A -d <path> Specify path to cfg_mgmt folder exported by the kernel module\0A Default location: %s\0A\00"
@.str.1 = [16 x i8] c"/debug/cfg_mgmt\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [207 x i8] c"cfg_mgmt tools - clist\0A Lists all variables, current values, limits and descriptions\0A Options:\0A -d <path> Specify path to cfg_mgmt folder exported by the kernel module\0A Default location: %s\0A\00"
@.str.1 = [16 x i8] c"/debug/cfg_mgmt\00"
define void @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
drawcirc(n) int n;
{}


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

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

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

LLVM IR (-O2):
define i32 @drawcirc(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ writePositionEffect(int **);
void writePosition(int row, int col, int **chessboard) {
  chessboard[row][col] = 1;
  writePositionEffect(chessboard);
}


x86 assembly (clang, -O0):
<writePosition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x10(%rbp),%rdi
call   1030 <writePositionEffect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writePosition>:
movslq %edi,%rax
mov    (%rdx,%rax,8),%rax
movslq %esi,%rcx
movl   $0x1,(%rax,%rcx,4)
mov    %rdx,%rdi
jmp    1030 <writePositionEffect@plt>

LLVM IR (-O0):
define void @writePosition(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*** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32*, i32** %7, i64 %9
%11 = load i32*, i32** %10
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 1, i32* %14
%15 = load i32**, i32*** %6
%16 = call i32 @writePositionEffect(i32** %15)
ret void
}

LLVM IR (-O2):
define void @writePosition(i32 %0, i32 %1, i32** %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32*, i32** %2, i64 %4
%6 = load i32*, i32** %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
store i32 1, i32* %8
%9 = tail call i32 @writePositionEffect(i32** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x7a() {
  Assert_real((isupper(122) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              615, ("isupper should be 0 for z"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x7a>:
push   %rax
mov    $0x7a,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x267,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for z\00"
define void @t_isupper_0x7a() {
%1 = call i64 @isupper(i32 122)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 615, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for z\00"
define void @t_isupper_0x7a() {
%1 = tail call i64 @isupper(i32 122)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 615, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *japi_filedialog(int, char *, char *, char *);
char *j_filedialog(int arg0, char *arg1, char *arg2, char *arg3) {
  return (japi_filedialog(arg0, arg1, arg2, arg3));
}


x86 assembly (clang, -O0):
<j_filedialog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <japi_filedialog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_filedialog>:
jmp    1030 <japi_filedialog@plt>

LLVM IR (-O0):
define i8* @j_filedialog(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i8* @japi_filedialog(i32 %9, i8* %10, i8* %11, i8* %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @j_filedialog(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i8* @japi_filedialog(i32 %0, i8* %1, i8* %2, i8* %3)
ret i8* %5
}
int get_rand(x, y)
register int x, y;
{
  register int r, t;
  long lr;
  if (x > y) {
    t = y;
    y = x;
    x = t;
  }
  lr = rrandom();
  lr &= (long)0x00003fff;
  r = (int)lr;
  r = (r % ((y - x) + 1)) + x;
  return (r);
}


x86 assembly (clang, -O0):
<get_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113c <get_rand+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rrandom@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x3fff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    %esi,%edi
mov    %esi,%ebp
cmovg  %edi,%ebp
cmovg  %esi,%ebx
xor    %eax,%eax
call   1030 <rrandom@plt>
and    $0x3fff,%eax
sub    %ebx,%ebp
add    $0x1,%ebp
xor    %edx,%edx
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_rand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %6
%13 = load i32, i32* %3
store i32 %13, i32* %4
%14 = load i32, i32* %6
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %2
%16 = call i32 (...) @rrandom()
%17 = sext i32 %16 to i64
store i64 %17, i64* %7
%18 = load i64, i64* %7
%19 = and i64 %18, 16383
store i64 %19, i64* %7
%20 = load i64, i64* %7
%21 = trunc i64 %20 to i32
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = load i32, i32* %3
%25 = sub nsw i32 %23, %24
%26 = add nsw i32 %25, 1
%27 = srem i32 %22, %26
%28 = load i32, i32* %3
%29 = add nsw i32 %27, %28
store i32 %29, i32* %5
%30 = load i32, i32* %5
ret i32 %30
}

LLVM IR (-O2):
define i32 @get_rand(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = tail call i32 (...) @rrandom()
%7 = and i32 %6, 16383
%8 = sub i32 1, %5
%9 = add i32 %8, %4
%10 = srem i32 %7, %9
%11 = add nsw i32 %10, %5
ret i32 %11
}
int xchg(int *ptr, int x) {
  asm volatile("lock xchgl %k0,%1" : "=r"(x) : "m"(*ptr), "0"(x) : "memory");
  return x;
}


x86 assembly (clang, -O0):
<xchg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
lock xchg %eax,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xchg>:
mov    %esi,%eax
lock xchg %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @xchg(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 asm sideeffect "lock xchgl ${0:k},$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @xchg(i32* %0, i32 %1) {
%3 = tail call i32 asm sideeffect "lock xchgl ${0:k},$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ pthread_self();
int rtl_pseudothreadid() {
  return (unsigned int)((unsigned long)pthread_self() % 9973);
}


x86 assembly (clang, -O0):
<rtl_pseudothreadid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pthread_self@plt>
mov    $0x26f5,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl_pseudothreadid>:
push   %rax
xor    %eax,%eax
call   1030 <pthread_self@plt>
mov    %rax,%rcx
movabs $0xa490e0a86401f36d,%rdx
e0 90 a4
mul    %rdx
mov    %rcx,%rax
sub    %rdx,%rax
shr    %rax
add    %rdx,%rax
shr    $0xd,%rax
imul   $0x26f5,%eax,%eax
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rtl_pseudothreadid() {
%1 = call i64 (...) @pthread_self()
%2 = urem i64 %1, 9973
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @rtl_pseudothreadid() {
%1 = tail call i64 (...) @pthread_self()
%2 = urem i64 %1, 9973
%3 = trunc i64 %2 to i32
ret i32 %3
}