Repository: carbon-language/carbon-lang
File: toolchain/lower/handle_call.cpp (C++)

Code before:
      auto* ptr_type = llvm::PointerType::get(context.llvm_context(), 0);
      auto* printf_type = llvm::FunctionType::get(i32_type, {ptr_type},
                                                  /*isVarArg=*/true);
      llvm::FunctionCallee printf =
          context.llvm_module().getOrInsertFunction("printf", printf_type);

      llvm::Value* format_string = context.printf_int_format_string();
      llvm::Value* arg_value = context.builder().CreateSExtOrTrunc(
          context.GetValue(arg_ids[0]), i32_type);
      context.SetLocal(inst_id, context.builder().CreateCall(
                                    printf, {format_string, arg_value}));
      return;
    }

    case SemIR::BuiltinFunctionKind::ReadChar: {
      auto* i32_type = llvm::IntegerType::getInt32Ty(context.llvm_context());
      auto getchar =
          context.llvm_module().getOrInsertFunction("getchar", i32_type);
      auto* result = context.builder().CreateCall(getchar, {});
      context.SetLocal(inst_id, context.builder().CreateSExtOrTrunc(
                                    result, context.GetTypeOfInst(inst_id)));
      return;
    }

    case SemIR::BuiltinFunctionKind::StringAt: {
      // Get the string argument  
      auto string_inst_id = arg_ids[0];
      auto* string_arg = context.GetValue(string_inst_id);
      
      // Check if this is a pointer to a String or a String value
      llvm::Value* string_value;
      if (string_arg->getType()->isPointerTy()) {
        auto string_type_id = context.GetTypeIdOfInst(string_inst_id);
        auto* string_type = context.GetType(string_type_id);
        string_value = context.builder().CreateLoad(
            string_type, string_arg, "string.load");
      } else {
        // Already have the struct value
        string_value = string_arg;
      }
      
      // String is a struct with ptr and size fields
      auto* string_ptr_field = context.builder().CreateExtractValue(
          string_value, {0}, "string.ptr");
      
      // Get the index value
      auto* index_value = context.GetValue(arg_ids[1]);
      
      // Compute the address of the character at the given index
      auto* char_ptr = context.builder().CreateInBoundsGEP(
          llvm::Type::getInt8Ty(context.llvm_context()),

Review comment (suggestion):
```suggestion
```
This just says what the code says

Code after:
      llvm::FunctionCallee printf =
          context.llvm_module().getOrInsertFunction("printf", printf_type);

      llvm::Value* format_string = context.printf_int_format_string();
      llvm::Value* arg_value = context.builder().CreateSExtOrTrunc(
          context.GetValue(arg_ids[0]), i32_type);
      context.SetLocal(inst_id, context.builder().CreateCall(
                                    printf, {format_string, arg_value}));
      return;
    }

    case SemIR::BuiltinFunctionKind::ReadChar: {
      auto* i32_type = llvm::IntegerType::getInt32Ty(context.llvm_context());
      auto getchar =
          context.llvm_module().getOrInsertFunction("getchar", i32_type);
      auto* result = context.builder().CreateCall(getchar, {});
      context.SetLocal(inst_id, context.builder().CreateSExtOrTrunc(
                                    result, context.GetTypeOfInst(inst_id)));
      return;
    }

    case SemIR::BuiltinFunctionKind::StringAt: {
      auto string_inst_id = arg_ids[0];
      auto* string_arg = context.GetValue(string_inst_id);

      auto string_type_id = context.GetTypeIdOfInst(string_inst_id);
      auto* string_type = context.GetType(string_type_id);
      auto* string_value =
          context.builder().CreateLoad(string_type, string_arg, "string.load");

      auto* string_ptr_field =
          context.builder().CreateExtractValue(string_value, {0}, "string.ptr");

      auto* index_value = context.GetValue(arg_ids[1]);

      auto* char_ptr = context.builder().CreateInBoundsGEP(
          llvm::Type::getInt8Ty(context.llvm_context()), string_ptr_field,
          index_value, "string.char_ptr");

      auto* char_i8 = context.builder().CreateLoad(
          llvm::Type::getInt8Ty(context.llvm_context()), char_ptr,
          "string.char");

      context.SetLocal(inst_id, context.builder().CreateZExt(
                                    char_i8, context.GetTypeOfInst(inst_id),
                                    "string.char.zext"));
      return;
    }

    case SemIR::BuiltinFunctionKind::TypeAnd: {
      context.SetLocal(inst_id, context.GetTypeAsValue());