xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void help(void) {
  printf("geoip "
         "1.00"
         " compiled at "
         "Mar 16 2022"
         " "
         "06:46:36"
         " by gcc "
         "9.4.0"
         " (%d-bit) after commit "
         ""
         "\n"
         "[-i input_file] file with database in csv-format\n"
         "[-o output_file] file to write result. Default - stdout\n"
         "[-v] increase verbosity\n"
         "[-s] number of lines to skip\n"
         "[-m] increase mode (0 - maxmind data format, 1 - cache-engine "
         "format, 2- maxmind region data format)\n",
         (int)sizeof(void *) * 8);
}


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

x86 assembly (clang, -O2):
<help>:
lea    0xee9(%rip),%rdi
mov    $0x40,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [340 x i8] c"geoip 1.00 compiled at Mar 16 2022 06:46:36 by gcc 9.4.0 (%d-bit) after commit \0A[-i input_file] file with database in csv-format\0A[-o output_file] file to write result. Default - stdout\0A[-v] increase verbosity\0A[-s] number of lines to skip\0A[-m] increase mode (0 - maxmind data format, 1 - cache-engine format, 2- maxmind region data format)\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([340 x i8], [340 x i8]* @.str, i64 0, i64 0), i32 64)
ret void
}

LLVM IR (-O2):
@.str = [340 x i8] c"geoip 1.00 compiled at Mar 16 2022 06:46:36 by gcc 9.4.0 (%d-bit) after commit \0A[-i input_file] file with database in csv-format\0A[-o output_file] file to write result. Default - stdout\0A[-v] increase verbosity\0A[-s] number of lines to skip\0A[-m] increase mode (0 - maxmind data format, 1 - cache-engine format, 2- maxmind region data format)\0A\00"
define void @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([340 x i8], [340 x i8]* @.str, i64 0, i64 0), i32 64)
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
char toupper(int);
void upcase(register char *argument) {
  register int c;
  while ((c = *argument) != 0) {
    if (islower(c)) {
      *argument = toupper(c);
    }
    argument++;
  }
}


x86 assembly (clang, -O0):
<upcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1172 <upcase+0x52>
mov    -0xc(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1161 <upcase+0x41>
mov    -0xc(%rbp),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <upcase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upcase>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1166 <upcase+0x46>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    114b <upcase+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1166 <upcase+0x46>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     1140 <upcase+0x20>
mov    %ebp,%edi
call   1040 <toupper@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <upcase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @upcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @islower(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call signext i8 @toupper(i32 %7)
store i8 %11, i8* %6
br label %12
12: ; preds = %10, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
void check_stacksize() {}


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

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

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

LLVM IR (-O2):
define void @check_stacksize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_Get(int, int, unsigned char *);
int /*<<< orphan*/ I2C_Gets(int, int, int, unsigned char *);
int /*<<< orphan*/ I2C_Put(int, int, unsigned char);
int /*<<< orphan*/ delay_ms(int);
char thermo_hex_to_temp(unsigned int);
char thermo_get_current(void) {
  unsigned int val;
  unsigned char tmp;
  I2C_Get(0x90, 0x1, &tmp);
  tmp |= 0x80;
  I2C_Put(0x90, 0x1, tmp);
  delay_ms(50);
  I2C_Gets(0x90, 0x0, 2, (unsigned char *)&val);
  ;
  return thermo_hex_to_temp(val);
}


x86 assembly (clang, -O0):
<thermo_get_current>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x90,%edi
mov    $0x1,%esi
lea    -0x5(%rbp),%rdx
call   1030 <I2C_Get@plt>
movzbl -0x5(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x5(%rbp)
mov    $0x90,%edi
mov    $0x1,%esi
movzbl -0x5(%rbp),%edx
call   1060 <I2C_Put@plt>
mov    $0x32,%edi
call   1050 <delay_ms@plt>
lea    -0x4(%rbp),%rcx
mov    $0x90,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <I2C_Gets@plt>
mov    -0x4(%rbp),%edi
call   1070 <thermo_hex_to_temp@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thermo_get_current>:
push   %rax
lea    0x3(%rsp),%rdx
mov    $0x90,%edi
mov    $0x1,%esi
call   1030 <I2C_Get@plt>
movzbl 0x3(%rsp),%edx
or     $0x80,%edx
mov    %dl,0x3(%rsp)
mov    $0x90,%edi
mov    $0x1,%esi
call   1060 <I2C_Put@plt>
mov    $0x32,%edi
call   1050 <delay_ms@plt>
lea    0x4(%rsp),%rcx
mov    $0x90,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <I2C_Gets@plt>
mov    0x4(%rsp),%edi
call   1070 <thermo_hex_to_temp@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @thermo_get_current() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @I2C_Get(i32 144, i32 1, i8* %2)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = or i32 %5, 128
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = call i32 @I2C_Put(i32 144, i32 1, i8 zeroext %8)
%10 = call i32 @delay_ms(i32 50)
%11 = bitcast i32* %1 to i8*
%12 = call i32 @I2C_Gets(i32 144, i32 0, i32 2, i8* %11)
%13 = load i32, i32* %1
%14 = call signext i8 @thermo_hex_to_temp(i32 %13)
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @thermo_get_current() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
%4 = call i32 @I2C_Get(i32 144, i32 1, i8* %2)
%5 = load i8, i8* %2
%6 = or i8 %5, -128
store i8 %6, i8* %2
%7 = call i32 @I2C_Put(i32 144, i32 1, i8 zeroext %6)
%8 = call i32 @delay_ms(i32 50)
%9 = call i32 @I2C_Gets(i32 144, i32 0, i32 2, i8* %3)
%10 = load i32, i32* %1
%11 = call signext i8 @thermo_hex_to_temp(i32 %10)
ret i8 %11
}
void __yp_unbind(ypb) struct dom_binding *ypb;
{}


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

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

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

LLVM IR (-O2):
%struct.dom_binding = type opaque
define void @__yp_unbind(%struct.dom_binding* nocapture %0) {
ret void
}
unsigned int assemble_6(x, y)
unsigned int x, y;
{ return (((x & 0x1) << 5) + (32 - (y & 0x1f))); }


x86 assembly (clang, -O0):
<assemble_6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%edx
and    $0x1f,%edx
mov    $0x20,%ecx
sub    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble_6>:
shl    $0x5,%edi
and    $0x20,%edi
and    $0x1f,%esi
sub    %esi,%edi
lea    0x20(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @assemble_6(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 = and i32 %5, 1
%7 = shl i32 %6, 5
%8 = load i32, i32* %4
%9 = and i32 %8, 31
%10 = sub i32 32, %9
%11 = add i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @assemble_6(i32 %0, i32 %1) {
%3 = shl i32 %0, 5
%4 = and i32 %3, 32
%5 = and i32 %1, 31
%6 = sub nuw nsw i32 32, %5
%7 = add nuw nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xcc() {
  Assert_real((isgraph(204) == 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_isgraph.c",
              1025, ("isgraph should be 0 for 0xcc"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xcc>:
push   %rax
mov    $0xcc,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x401,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xcc\00"
define void @t_isgraph_0xcc() {
%1 = call i64 @isgraph(i32 204)
%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 1025, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xcc\00"
define void @t_isgraph_0xcc() {
%1 = tail call i64 @isgraph(i32 204)
%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 1025, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x10() {
  Assert_real((isbdigit(16) == 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_isbdigit.c",
              85, ("isbdigit should be 0 for 0x10"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x10>:
push   %rax
mov    $0x10,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x55,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x10\00"
define void @t_isbdigit_0x10() {
%1 = call i64 @isbdigit(i32 16)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x10\00"
define void @t_isbdigit_0x10() {
%1 = tail call i64 @isbdigit(i32 16)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int ivory_serialize_unpack_prim_4_be(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(float *, int *, int);
void ivory_serialize_unpack_float_be(const uint8_t *src, uint32_t offs,
                                     float *dst) {
  uint32_t tmp = ivory_serialize_unpack_prim_4_be(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_float_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_4_be@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_float_be>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_4_be@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ivory_serialize_unpack_float_be(i32* %0, i32 %1, float* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca float*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store float* %2, float** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i32 @ivory_serialize_unpack_prim_4_be(i32* %11)
store i32 %12, i32* %7
%13 = load float*, float** %6
%14 = call i32 @memcpy(float* %13, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_unpack_float_be(i32* %0, i32 %1, float* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_4_be(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(float* %2, i32* %4, i32 4)
ret void
}
/* Variables and functions */
int Rf_i1mach(int);
double exparg(int l) {
  int m;
  double lnb;
  lnb = .69314718055995;
  if (l == 0) {
    m = Rf_i1mach(16);
    return m * lnb * .99999;
  }
  m = Rf_i1mach(15) - 1;
  return m * lnb * .99999;
}


x86 assembly (clang, -O0):
<exparg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movsd  0xedd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    115f <exparg+0x4f>
mov    $0x10,%edi
call   1030 <Rf_i1mach@plt>
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118a <exparg+0x7a>
mov    $0xf,%edi
call   1030 <Rf_i1mach@plt>
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exparg>:
push   %rax
test   %edi,%edi
je     1124 <exparg+0x14>
mov    $0xf,%edi
call   1030 <Rf_i1mach@plt>
add    $0xffffffff,%eax
jmp    112e <exparg+0x1e>
mov    $0x10,%edi
call   1030 <Rf_i1mach@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xec6(%rip),%xmm0
mulsd  0xec6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @exparg(i32 %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store double 0x3FE62E42FEFA3A19, double* %5
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = call i32 @Rf_i1mach(i32 16)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = load double, double* %5
%13 = fmul double %11, %12
%14 = fmul double %13, 9.999900e-01
store double %14, double* %2
br label %23
15: ; preds = %1
%16 = call i32 @Rf_i1mach(i32 15)
%17 = sub nsw i32 %16, 1
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = sitofp i32 %18 to double
%20 = load double, double* %5
%21 = fmul double %19, %20
%22 = fmul double %21, 9.999900e-01
store double %22, double* %2
br label %23
23: ; preds = %15, %8
%24 = load double, double* %2
ret double %24
}

LLVM IR (-O2):
define double @exparg(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @Rf_i1mach(i32 16)
br label %8
5: ; preds = %1
%6 = tail call i32 @Rf_i1mach(i32 15)
%7 = add nsw i32 %6, -1
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ %4, %3 ], [ %7, %5 ]
%10 = sitofp i32 %9 to double
%11 = fmul double %10, 0x3FE62E42FEFA3A19
%12 = fmul double %11, 9.999900e-01
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ countingSort(int *, int, int);
void radixSort(int A[], int n, int Max) {
  int e;
  for (e = 1; Max / e > 0; e *= 10)
    countingSort(A, n, e);
}


x86 assembly (clang, -O0):
<radixSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%eax
jle    1154 <radixSort+0x44>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <countingSort@plt>
imul   $0xa,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <radixSort+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radixSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    114c <radixSort+0x3c>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%r15
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
call   1030 <countingSort@plt>
add    %ebp,%ebp
lea    0x0(%rbp,%rbp,4),%ebp
mov    %ebx,%eax
cltd
idiv   %ebp
test   %eax,%eax
jg     1130 <radixSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @radixSort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 1, i32* %7
br label %8
8: ; preds = %18, %3
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = sdiv i32 %9, %10
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %8
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = call i32 @countingSort(i32* %14, i32 %15, i32 %16)
br label %18
18: ; preds = %13
%19 = load i32, i32* %7
%20 = mul nsw i32 %19, 10
store i32 %20, i32* %7
br label %8
21: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @radixSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 1, %3 ]
%7 = tail call i32 @countingSort(i32* %0, i32 %1, i32 %6)
%8 = mul nsw i32 %6, 10
%9 = sdiv i32 %2, %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ baz(int);
int /*<<< orphan*/ foo(int *);
void test(void) {
  int s;
  foo(&s);
  baz(4);
  baz(s);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <foo@plt>
mov    $0x4,%edi
call   1030 <baz@plt>
mov    -0x4(%rbp),%edi
call   1030 <baz@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <foo@plt>
mov    $0x4,%edi
call   1030 <baz@plt>
mov    0x4(%rsp),%edi
call   1030 <baz@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = call i32 @foo(i32* %1)
%3 = call i32 @baz(i32 4)
%4 = load i32, i32* %1
%5 = call i32 @baz(i32 %4)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @foo(i32* %1)
%4 = call i32 @baz(i32 4)
%5 = load i32, i32* %1
%6 = call i32 @baz(i32 %5)
ret void
}
/* Variables and functions */
int tst_ht_entry(int, char **);
int main(int argc, char **argv) { return tst_ht_entry(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <tst_ht_entry@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <tst_ht_entry@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @tst_ht_entry(i32 %0, i8** %1)
ret i32 %3
}
struct ibv_cq *ibv_cq_ex_to_cq(struct ibv_cq_ex *cq) {
  return (struct ibv_cq *)cq;
}


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

x86 assembly (clang, -O2):
<ibv_cq_ex_to_cq>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.ibv_cq = type opaque
%struct.ibv_cq_ex = type opaque
define %struct.ibv_cq* @ibv_cq_ex_to_cq(%struct.ibv_cq_ex* %0) {
%2 = alloca %struct.ibv_cq_ex*
store %struct.ibv_cq_ex* %0, %struct.ibv_cq_ex** %2
%3 = load %struct.ibv_cq_ex*, %struct.ibv_cq_ex** %2
%4 = bitcast %struct.ibv_cq_ex* %3 to %struct.ibv_cq*
ret %struct.ibv_cq* %4
}

LLVM IR (-O2):
%struct.ibv_cq = type opaque
%struct.ibv_cq_ex = type opaque
define %struct.ibv_cq* @ibv_cq_ex_to_cq(%struct.ibv_cq_ex* readnone %0) {
%2 = bitcast %struct.ibv_cq_ex* %0 to %struct.ibv_cq*
ret %struct.ibv_cq* %2
}
/* Variables and functions */
int /*<<< orphan*/ TIOCMGET;
int /*<<< orphan*/ TIOCMSET;
int TIOCM_DTR;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
void clearDTR(int fd) {
  int lineData;
  ioctl(fd, TIOCMGET, &lineData);
  lineData &= ~TIOCM_DTR;
  ioctl(fd, TIOCMSET, &lineData);
}


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

x86 assembly (clang, -O2):
<clearDTR>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%r14
mov    %r14,%rdx
call   1030 <ioctl@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
not    %eax
and    %eax,0x4(%rsp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
mov    %r14,%rdx
call   1030 <ioctl@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@TIOCMGET = global i32 0
@TIOCM_DTR = global i32 0
@TIOCMSET = global i32 0
define void @clearDTR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @TIOCMGET
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
%7 = load i32, i32* @TIOCM_DTR
%8 = xor i32 %7, -1
%9 = load i32, i32* %3
%10 = and i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* @TIOCMSET
%13 = call i32 @ioctl(i32 %11, i32 %12, i32* %3)
ret void
}

LLVM IR (-O2):
@TIOCMGET = global i32 0
@TIOCM_DTR = global i32 0
@TIOCMSET = global i32 0
define void @clearDTR(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @TIOCMGET
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = load i32, i32* @TIOCM_DTR
%7 = xor i32 %6, -1
%8 = load i32, i32* %2
%9 = and i32 %8, %7
store i32 %9, i32* %2
%10 = load i32, i32* @TIOCMSET
%11 = call i32 @ioctl(i32 %0, i32 %10, i32* %2)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, long);
main() {
  long int nc;
  nc = 0;
  while (getchar() != EOF)
    ++nc;
  printf("%ld\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     115f <main+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1140 <main+0x20>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = add nuw nsw i64 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int8_t;
typedef int int32_t;

/* Variables and functions */
int32_t mp4ff_atom_compare(const int8_t a1, const int8_t b1, const int8_t c1,
                           const int8_t d1, const int8_t a2, const int8_t b2,
                           const int8_t c2, const int8_t d2) {
  if (a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<mp4ff_atom_compare>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    1168 <mp4ff_atom_compare+0x68>
mov    -0x18(%rbp),%rax
cmp    -0x38(%rbp),%rax
jne    1168 <mp4ff_atom_compare+0x68>
mov    -0x20(%rbp),%rax
cmp    0x10(%rbp),%rax
jne    1168 <mp4ff_atom_compare+0x68>
mov    -0x28(%rbp),%rax
cmp    0x18(%rbp),%rax
jne    1168 <mp4ff_atom_compare+0x68>
movl   $0x1,-0x4(%rbp)
jmp    116f <mp4ff_atom_compare+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp4ff_atom_compare>:
xor    %r8,%rdi
xor    %r9,%rsi
or     %rdi,%rsi
xor    0x8(%rsp),%rdx
xor    0x10(%rsp),%rcx
or     %rsi,%rdx
xor    %eax,%eax
or     %rdx,%rcx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @mp4ff_atom_compare(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7) {
%9 = icmp eq i64 %0, %4
%10 = icmp eq i64 %1, %5
%11 = and i1 %9, %10
%12 = icmp eq i64 %2, %6
%13 = and i1 %11, %12
%14 = icmp eq i64 %3, %7
%15 = and i1 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}
long long bit36() { return 0x0000001000000000LL; }


x86 assembly (clang, -O0):
<bit36>:
push   %rbp
mov    %rsp,%rbp
movabs $0x1000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit36>:
movabs $0x1000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit36() {
ret i64 68719476736
}

LLVM IR (-O2):
define i64 @bit36() {
ret i64 68719476736
}
/* Variables and functions */
int /*<<< orphan*/ testCase(char *, char *, int);
void test1(void) {
  char haystack1[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab";
  char needle1[] = "ab";
  testCase(haystack1, needle1, 42);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x2d,%edx
call   1030 <memcpy@plt>
mov    0xee9(%rip),%ax
mov    %ax,-0x33(%rbp)
mov    0xee1(%rip),%al
mov    %al,-0x31(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x33(%rbp),%rsi
mov    $0x2a,%edx
call   1040 <testCase@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
sub    $0x48,%rsp
movups 0xf02(%rip),%xmm0
movups %xmm0,0x2d(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movb   $0x0,0xe(%rsp)
movw   $0x6261,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x2a,%edx
call   1030 <testCase@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.test1.haystack1 = [45 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\00"
@__const.test1.needle1 = [3 x i8] c"ab\00"
define void @test1() {
%1 = alloca [45 x i8]
%2 = alloca [3 x i8]
%3 = bitcast [45 x i8]* %1 to i8*
%4 = bitcast [3 x i8]* %2 to i8*
%5 = getelementptr inbounds [45 x i8], [45 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%7 = call i32 @testCase(i8* %5, i8* %6, i32 42)
ret void
}

LLVM IR (-O2):
@__const.test1.haystack1 = [45 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab\00"
@__const.test1.needle1 = [3 x i8] c"ab\00"
define void @test1() {
%1 = alloca [45 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [45 x i8], [45 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @testCase(i8* %3, i8* %4, i32 42)
ret void
}
/* Variables and functions */
int strlen(char const *);
int OSC_effectiveStringLength(const char *string) {
  int len = strlen(string) + 1;
  if ((len % 4) != 0) {
    len += 4 - (len % 4);
  }
  return len;
}


x86 assembly (clang, -O0):
<OSC_effectiveStringLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1157 <OSC_effectiveStringLength+0x47>
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    $0x4,%eax
sub    %edx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSC_effectiveStringLength>:
push   %rax
call   1030 <strlen@plt>
lea    0x1(%rax),%ecx
lea    0x4(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffffc,%edx
neg    %edx
add    %eax,%edx
add    $0x1,%edx
sub    %edx,%eax
add    $0x5,%eax
test   %edx,%edx
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @OSC_effectiveStringLength(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
%6 = add i32 %2, 5
%7 = sub i32 %6, %4
%8 = select i1 %5, i32 %3, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ getline(char *, short);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void gnewstr(char *prompt, char *mstring, short length) {
  char temp[40];
  temp[0] = '\0';
  printf("\n\nEnter new %s:  ", prompt);
  getline(temp, length);
  if (temp[0])
    strcpy(mstring, temp);
}


x86 assembly (clang, -O0):
<gnewstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movb   $0x0,-0x40(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
movswl -0x12(%rbp),%esi
call   1050 <getline@plt>
cmpb   $0x0,-0x40(%rbp)
je     117f <gnewstr+0x4f>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnewstr>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
movb   $0x0,(%rsp)
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rdi
mov    %ebp,%esi
call   1050 <getline@plt>
cmpb   $0x0,(%rsp)
je     1169 <gnewstr+0x39>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0A\0AEnter new %s: \00"
define void @gnewstr(i8* %0, i8* %1, i16 signext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16
%7 = alloca [40 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%8 = getelementptr inbounds [40 x i8], [40 x i8]* %7, i64 0, i64 0
store i8 0, i8* %8
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [40 x i8], [40 x i8]* %7, i64 0, i64 0
%12 = load i16, i16* %6
%13 = call i32 @getline(i8* %11, i16 signext %12)
%14 = getelementptr inbounds [40 x i8], [40 x i8]* %7, i64 0, i64 0
%15 = load i8, i8* %14
%16 = icmp ne i8 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %3
%18 = load i8*, i8** %5
%19 = getelementptr inbounds [40 x i8], [40 x i8]* %7, i64 0, i64 0
%20 = call i32 @strcpy(i8* %18, i8* %19)
br label %21
21: ; preds = %17, %3
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0A\0AEnter new %s: \00"
define void @gnewstr(i8* %0, i8* %1, i16 signext %2) {
%4 = alloca [40 x i8]
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
store i8 0, i8* %5
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i32 @getline(i8* %5, i16 signext %2)
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %3
%11 = call i32 @strcpy(i8* %1, i8* %5)
br label %12
12: ; preds = %10, %3
ret void
}
int test_imm_C0uint32_mem(unsigned int *val) {
  return ((*val) & (0xC0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C0uint32_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, 192
%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_C0uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 192
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct htrace_span {
  int dummy;
};

/* Variables and functions */
int span_json_sprintf_impl(struct htrace_span const *, int /*<<< orphan*/,
                           int /*<<< orphan*/ *);
int span_json_size(const struct htrace_span *span) {
  return span_json_sprintf_impl(span, 0, NULL);
}


x86 assembly (clang, -O0):
<span_json_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <span_json_sprintf_impl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<span_json_size>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <span_json_sprintf_impl@plt>

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

LLVM IR (-O2):
%struct.htrace_span = type { i32 }
define i32 @span_json_size(%struct.htrace_span* %0) {
%2 = tail call i32 @span_json_sprintf_impl(%struct.htrace_span* %0, i32 0, i32* null)
ret i32 %2
}
double ls_cost_nm5_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<ls_cost_nm5_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm5_twice>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm5_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_cost_nm5_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
void i2d_X509_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_X509_bio() {
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
main() { printf("the value of EOF is: %d\n", EOF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"the value of EOF is: %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"the value of EOF is: %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void ADCDMADisable(unsigned long ulBase, unsigned long ulChannel) {
  unsigned long ulBitMask;
  ulBitMask = (ulChannel == 0x00000000)   ? 0x01
              : (ulChannel == 0x00000008) ? 0x04
              : (ulChannel == 0x00000010) ? 0x10
                                          : 0x40;
  (*((volatile unsigned long *)(ulBase + 0x00000064))) &= ~ulBitMask;
}


x86 assembly (clang, -O0):
<ADCDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1124 <ADCDMADisable+0x24>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115a <ADCDMADisable+0x5a>
cmpq   $0x8,-0x10(%rbp)
jne    113c <ADCDMADisable+0x3c>
mov    $0x4,%eax
mov    %eax,-0x20(%rbp)
jmp    1154 <ADCDMADisable+0x54>
mov    -0x10(%rbp),%rdx
mov    $0x40,%eax
mov    $0x10,%ecx
cmp    $0x10,%rdx
cmove  %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x64(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x64(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCDMADisable>:
test   %rsi,%rsi
je     1117 <ADCDMADisable+0x17>
cmp    $0x8,%rsi
jne    1123 <ADCDMADisable+0x23>
mov    $0xfffffffffffffffb,%rax
and    %rax,0x64(%rdi)
ret
mov    $0xfffffffffffffffe,%rax
and    %rax,0x64(%rdi)
ret
cmp    $0x10,%rsi
mov    $0xffffffffffffffef,%rcx
mov    $0xffffffffffffffbf,%rax
cmove  %rcx,%rax
and    %rax,0x64(%rdi)
ret

LLVM IR (-O0):
define void @ADCDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %20
9: ; preds = %2
%10 = load i64, i64* %4
%11 = icmp eq i64 %10, 8
br i1 %11, label %12, label %13
12: ; preds = %9
br label %18
13: ; preds = %9
%14 = load i64, i64* %4
%15 = icmp eq i64 %14, 16
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 16, i32 64
br label %18
18: ; preds = %13, %12
%19 = phi i32 [ 4, %12 ], [ %17, %13 ]
br label %20
20: ; preds = %18, %8
%21 = phi i32 [ 1, %8 ], [ %19, %18 ]
%22 = sext i32 %21 to i64
store i64 %22, i64* %5
%23 = load i64, i64* %5
%24 = xor i64 %23, -1
%25 = load i64, i64* %3
%26 = add i64 %25, 100
%27 = inttoptr i64 %26 to i64*
%28 = load volatile i64, i64* %27
%29 = and i64 %28, %24
store volatile i64 %29, i64* %27
ret void
}

LLVM IR (-O2):
define void @ADCDMADisable(i64 %0, i64 %1) {
switch i64 %1, label %3 [
i64 0, label %7
i64 8, label %6
]
3: ; preds = %2
%4 = icmp eq i64 %1, 16
%5 = select i1 %4, i64 -17, i64 -65
br label %7
6: ; preds = %2
br label %7
7: ; preds = %2, %6, %3
%8 = phi i64 [ -2, %2 ], [ %5, %3 ], [ -5, %6 ]
%9 = add i64 %0, 100
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, %8
store volatile i64 %12, i64* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PACE_CTX_clear_free(void *);
void wrap_pace_ctx_clear_free(void *ctx) { PACE_CTX_clear_free(ctx); }


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

x86 assembly (clang, -O2):
<wrap_pace_ctx_clear_free>:
jmp    1030 <PACE_CTX_clear_free@plt>

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

LLVM IR (-O2):
define void @wrap_pace_ctx_clear_free(i8* %0) {
%2 = tail call i32 @PACE_CTX_clear_free(i8* %0)
ret void
}
/* Variables and functions */
void *getpwuid() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @getpwuid() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @getpwuid() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRE5_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRE5_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRE5_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
int getloadavg(double loadavg[], int nelem) {
  int i;
  for (i = 0; i < nelem; i++) {
    loadavg[i] = 0.0;
  }
  return i;
}


x86 assembly (clang, -O0):
<getloadavg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <getloadavg+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <getloadavg+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getloadavg>:
push   %rbx
test   %esi,%esi
jle    1126 <getloadavg+0x16>
mov    %esi,%ebx
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
jmp    1128 <getloadavg+0x18>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getloadavg(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 0, %2 ], [ %1, %4 ]
ret i32 %9
}
void loop3(int sum, int n) {
  while (n != 0) {
    sum += n;
  }
  return;
}


x86 assembly (clang, -O0):
<loop3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <loop3+0x22>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <loop3+0xa>
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop3>:
test   %esi,%esi
je     1112 <loop3+0x12>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1110 <loop3+0x10>
ret

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

LLVM IR (-O2):
define void @loop3(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2, %4
br label %4
5: ; preds = %2
ret void
}